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

np.fix crashes with pandas time series #1721

Closed
tschm opened this issue Aug 2, 2012 · 1 comment
Closed

np.fix crashes with pandas time series #1721

tschm opened this issue Aug 2, 2012 · 1 comment
Labels
Milestone

Comments

@tschm
Copy link

tschm commented Aug 2, 2012

    import numpy as np
    import pandas

    x = pandas.TimeSeries(data = np.array([-0.54548407,  2.81105692, np.nan, -1.61954275, 1.3670269,  -0.73211055, -0.22832786,  0.06384124, -1.7113508,  -2.42429978]), index = np.arange(0,10))

print np.fix(x)

crashes with:

  File "C:\Python27\lib\site-packages\numpy\lib\ufunclike.py", line 48, in fix
    y[...] = nx.where(x >= 0, y1, y2)
  File "C:\Python27\lib\site-packages\pandas\core\series.py", line 540, in __setitem__
    raise KeyError('%s not in this series!' % str(key))
KeyError: 'Ellipsis not in this series!'

I assume this should work?
Thomas

@wesm
Copy link
Member

wesm commented Aug 7, 2012

I wasn't aware of this syntax. I thought y[:] was the standard practice; learn something new every day

@wesm wesm closed this as completed in 8156ab9 Aug 9, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants