Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No module named 'pandas.stats' #20

Closed
xanderdunn opened this issue Jun 20, 2019 · 3 comments · Fixed by #21
Closed

No module named 'pandas.stats' #20

xanderdunn opened this issue Jun 20, 2019 · 3 comments · Fixed by #21

Comments

@xanderdunn
Copy link
Contributor

pandas 0.24.2
universal-portfolios 0.3.3

When I attempt to from universal import algos, I get this error:

--> 117     from universal import algos

/usr/local/lib/python3.5/dist-packages/universal/algos/__init__.py in <module>
----> 1 from .crp import CRP
      2 from .bah import BAH
      3 from .anticor import Anticor
      4 from .corn import CORN
      5 from .bcrp import BCRP

/usr/local/lib/python3.5/dist-packages/universal/algos/crp.py in <module>
----> 1 from ..algo import Algo
      2 from .. import tools
      3 import numpy as np
      4 import pandas as pd
      5 import matplotlib.pyplot as plt

/usr/local/lib/python3.5/dist-packages/universal/algo.py in <module>
      6 import inspect
      7 import copy
----> 8 from .result import AlgoResult, ListResult
      9 from scipy.misc import comb
     10 from . import tools

/usr/local/lib/python3.5/dist-packages/universal/result.py in <module>
      3 import matplotlib.pyplot as plt
      4 import pickle
----> 5 from universal import tools
      6 import seaborn as sns
      7 from statsmodels.api import OLS

/usr/local/lib/python3.5/dist-packages/universal/tools.py in <module>
      3 import scipy.optimize as optimize
      4 from scipy.special import betaln
----> 5 from pandas.stats.moments import rolling_mean as rolling_m
      6 from pandas.stats.moments import rolling_corr
      7 import matplotlib.pyplot as plt

ImportError: No module named 'pandas.stats'
  In call to configurable 'train' (<function train at 0x7f03e5e6f730>)

It looks like #15 already ran into this issue. The library should be updated to latest pandas. Newer projects will be unable to revert pandas version to 0.22.

It looks like the only two instances that need to be updated are in tools.py:

from pandas.stats.moments import rolling_mean as rolling_m
from pandas.stats.moments import rolling_corr

I believe this is the replacement. Would it be df.rolling.mean() and df.rolling().corr()?

@Abdoulaye-Ba
Copy link

No module named 'pandas.stats'
I have this problem. I need really your help to install that module

@Marigold
Copy link
Owner

Marigold commented Oct 1, 2020

@Abdoulaye-Ba could you post the full stackstrace? This shouldn't be the problem anymore.

@gitcnd
Copy link

gitcnd commented May 27, 2021

Here is the fix:

  1. install anaconda3 - https://docs.continuum.io/anaconda/install/
  2. pip uninstall universal
  3. pip install universal-portfolios

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants