pandas-dev / pandas

Flexible and powerful data analysis / manipulation library for Python, providing labeled data structures similar to R data.frame objects, statistical functions, and much more
https://pandas.pydata.org
BSD 3-Clause "New" or "Revised" License
43.88k stars 18.03k forks source link

numpy.dtype size changed runtime warning on XP #22

Closed tgefell closed 13 years ago

tgefell commented 13 years ago

I've installed numpy from numpy-1.5.1-win32-superpack-python2.6.exe and pandas from pandas-0.2.win32-py2.6.exe.

When I import * from pandas I get the following warnings:

Warning (from warnings module): File "C:\Program Files\Python26\lib\site-packages\pandas\core\index.py", line 7 from pandas.lib.tseries import map_indices RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility

Warning (from warnings module): File "C:\Program Files\Python26\lib\site-packages\pandas\core\index.py", line 7 from pandas.lib.tseries import map_indices RuntimeWarning: numpy.flatiter size changed, may indicate binary incompatibility

I've had no issues yet using pandas interactively in the window (idle), but if I have embedded the import in a module then I am not able to execute any of the code from the module.

Thoughts?

wesm commented 13 years ago

That pandas binary was built against NumPy 1.3.0 which is not ABI-compatible with the latest NumPy-- are you equipped to compile from source? I should probably post a 0.3 beta anyway on PyPI.

tgefell commented 13 years ago

I'm rather a nubi at all of this so I'm not sure I should try compiling from source. It took me about 3 days to get registry, env var's etc. set up to use at all. Should I revert to numpy 1.3 or should I try your 0.3? I'm not doing anything that's production sensitive, so I'd be game to try the 0.3.

wesm commented 13 years ago

The github HEAD is well-tested but not yet ready for release until I do a few more things. I'll build and post 0.3 beta binaries later today-- stick with NumPy 1.5.1.

BTW I'd recommend checking out the Enthought Python Distribution as it comes set up to compile things from source with no hassle.

tgefell commented 13 years ago

Very good. Thanks Wes. I'm just trying to get enough traction learning Python/ now pandas and actually get something done at the same time.

wesm commented 13 years ago

I posted binaries for Python 2.5-2.7 built against latest NumPy-- let me know if you have any trouble!!

http://pypi.python.org/pypi?:action=display&name=pandas&version=0.3.0.beta

tgefell commented 13 years ago

Wes, I'm new enough that I've never moved up a version on anything python-related. Do I need to uninstall my earlier version of pandas before running the new installation .exe? Will this new installer automatically fix up any references in my path variable and my registry?

wesm commented 13 years ago

If you run the new installer it will override your prior installation-- you can check that the right version is installed by:

import pandas print pandas.version

tgefell commented 13 years ago

Wes,

I'm not sure what you need me to send you to help you debug. I did install 0.3 and it did load without the warnings. However, it also bombed when I tried to create a DataFrame. I cut and pasted the following, with some notes included:

I create a list: headers in row 1, dates in col 1, values in col's[1:]

t = gf.get_bmrk_asset_weights()

type (t) <type 'list'> len(t) 2037 t[:2] [['Date', 'BA', 'CAT', 'CMI', 'CSX', 'DE', 'DHR', 'EMR', 'FDX', 'GD', 'GE', 'HON', 'ITW', 'LMT', 'MMM', 'NOC', 'NSC', 'PCAR', 'PCP', 'RTN', 'TYC', 'UNP', 'UTX', 'WM', 'XLI'], [datetime.date(1998, 11, 25), 0.062619577947945801, 0.027268106641251115, 0.0022265456759515082, 0.014247168087848643, 0.013195744171185141, 0.0095164984532162631, 0.043821780902251181, 0.014310929221289945, 0.011549577203586944, 0.46356668152426372, 0.038046569176042495, 0.025077286132099617, 0.032061521644136844, 0.051246232439461852, 0.0085445846506965115, 0.018797841874526829, 0.0056623434171960965, 0.0016919000630261892, 0.029560646985546359, 0.031922116996210739, 0.018288231848329117, 0.03828907124638279, 0.03848904369755457, 0.0]]

I split out the dates as my DataFrame index:

i = [x[0] for x in t[1:]] len(i) 2036 i[:2] [datetime.date(1998, 11, 25), datetime.date(1998, 11, 27)]

I split out cols[1:] as a dictionary

d = dict([(t[0][j+1], [x[j+1] for x in t[1:]]) for j in range(len(t[0])-1)]) d.keys() ['RTN', 'BA', 'CMI', 'PCP', 'DE', 'CAT', 'EMR', 'FDX', 'NOC', 'PCAR', 'XLI', 'NSC', 'WM', 'UNP', 'HON', 'GE', 'GD', 'CSX', 'UTX', 'DHR', 'LMT', 'TYC', 'MMM', 'ITW'] len(d) 24 len(d["BA"]) 2036

The following line dies with a Microsoft Window saying "pythonw.exe has encountered a problem and needs to close. We are sorry for the inconvenience.": df = DataFrame(d, index=i)

This worked with the pandas 0.2 that I had had installed.

wesm commented 13 years ago

Can you please try running

pandas.test() and copy-paste the output-- you may need to install nose (!)

I will take a look shortly and let you know

tgefell commented 13 years ago

I did install nose.

This doesn't look very helpful:

from pandas import * pandas.test() Traceback (most recent call last): File "<pyshell#2>", line 1, in pandas.test() NameError: name 'pandas' is not defined

I don't get it. It clearly knows about pandas. It loaded.

wesm commented 13 years ago

sorry:

import pandas pandas.test()

tgefell commented 13 years ago

Same error window/message after this:

import pandas pandas.test() Running unit tests for pandas NumPy version 1.5.1 NumPy is installed in C:\Program Files\Python26\lib\site-packages\numpy Python version 2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 bit (Intel)] nose version 0.11.3

wesm commented 13 years ago

let's discuss offline on gmail, will be easier (i'm wesmckinn at gmail)