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

examples not running, error in documentation #51

Closed
columW opened this issue Jun 21, 2011 · 6 comments
Closed

examples not running, error in documentation #51

columW opened this issue Jun 21, 2011 · 6 comments

Comments

@columW
Copy link

columW commented Jun 21, 2011

Both examples do not run. In finance.py, on line 83:

 filledRatio = ibm / ibmMonthly.reindex(ibm.index, fillMethod='pad')

should be:

 filledRatio = ibm / ibmMonthly.reindex(ibm.index, method='pad')

As reindex is defined in core/series.py as

 def reindex(self, index=None, method=None):

This error is repeated in the documentation at http://pandas.sourceforge.net (reindex uses the argument fillMethod instead of method).

running regressions.py, I get the following error:

Traceback (most recent call last):
File "regressions.py", line 30, in
model = ols(y=Y, x=X)
File "/usr/local/lib/python2.6/dist-packages/pandas/stats/interface.py", line 117, in ols
return klass(**kwargs)
File "/usr/local/lib/python2.6/dist-packages/pandas/stats/ols.py", line 56, in init
self.sm_ols = sm.OLS(self._y_raw, self._x.values).fit()
AttributeError: 'module' object has no attribute 'OLS'

It's possible I'm somehow combining incompatible versions of pandas, but I don't see how, considering I downloaded pandas today, once. The first bug, at least seems like a simple code error.

Hopefully this is of some help,
Colum

@wesm
Copy link
Member

wesm commented Jun 21, 2011

Um, you installed pandas from the git repo or from PyPI (either is fine)? As you can see I haven't touched the examples in quite a while, and for example I removed the deprecated fillMethod argument from reindex very recently. I plan to make a pass through the docs in the next week or two to update them given all the work I've been putting in on the library. Thanks for letting me know about the examples, I'll take a look and fix them up to be in line with the present API.

The second error is rather weird. I would strongly suggest upgrading your scikits.statsmodels and trying again:

http://pypi.python.org/pypi/scikits.statsmodels/

Let me know

@wesm
Copy link
Member

wesm commented Jun 21, 2011

I updated the examples and the online docs per your comments. I need to write significantly more docs in the near future to document new features. Stay tuned.

Let me know if you're still having problems with regressions after you update statsmodels!

@wesm wesm closed this as completed Jun 21, 2011
@columW
Copy link
Author

columW commented Jun 21, 2011

I installed pandas from the git repo, and have updated scikits.statsmodels using easy_install. The error from regressions.py is the same. I'm using version scikits.statsmodels 0.3.0rc1.

@wesm
Copy link
Member

wesm commented Jun 21, 2011

Can you type

import scikits.statsmodels.api as api

into a python shell

then

api.OLS

and let me know what it says

@columW
Copy link
Author

columW commented Jun 21, 2011

typing

import scikits.statsmodels.api as api

gives me

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.6/dist-packages/scikits.statsmodels-0.3.0rc1-py2.6.egg/scikits/statsmodels/api.py", line 1, in <module>
import iolib, datasets, tools
File "/usr/local/lib/python2.6/dist-packages/scikits.statsmodels-0.3.0rc1-py2.6.egg/scikits/statsmodels/iolib/__init__.py", line 1, in <module>
from foreign import StataReader, genfromdta, savetxt
File "/usr/local/lib/python2.6/dist-packages/scikits.statsmodels-0.3.0rc1-py2.6.egg/scikits/statsmodels/iolib/foreign.py", line 16, in <module>
from numpy.lib._iotools import _is_string_like, easy_dtype

easy_dtype does exist in lib._iotools in the current version of numpy, but not in the version I have, installed using apt-get (I think I have 1.3.0).
I'll install the current version of numpy, and see if that works.

Thanks for the help!

@wesm
Copy link
Member

wesm commented Jun 21, 2011

Ah, that is indeed the problem. See about upgrading to NumPy 1.6. The issue was that I caught an ImportError in pandas when the import convention from statsmodels changed. I can probably get rid of that which will make these errors easier to spot

dan-nadler pushed a commit to dan-nadler/pandas that referenced this issue Sep 23, 2019
Expose data info via VersionedItem
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

No branches or pull requests

2 participants