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

Setting float_series[bool_index] = None errors #4667

Closed
dalejung opened this Issue Aug 25, 2013 · 3 comments

Comments

Projects
None yet
2 participants
@dalejung
Contributor

dalejung commented Aug 25, 2013

s = pd.Series(range(10)).astype(float)
s[s > 8] = None
s
/Users/datacaliber/Dropbox/Projects/trading/python/externals/pandas/pandas/core/internals.py in create_block(v, m, n, item, reshape)
    596                 # change the dtype
    597                 if nv is None:
--> 598                     dtype, _ = com._maybe_promote(n.dtype)
    599                     nv = v.astype(dtype)
    600                     try:

AttributeError: 'NoneType' object has no attribute 'dtype'

This is on latest master.

@dalejung

This comment has been minimized.

Show comment
Hide comment
@dalejung

dalejung Aug 25, 2013

Contributor
df = pd.DataFrame({'series': pd.Series(range(10))})
df = df.astype(float)
df[df > 3] = None
df

Works for DataFrame's although it upcasts to object.

s = pd.Series(range(10)).astype(float)
s[8] = None
s

Stays as float.

Contributor

dalejung commented Aug 25, 2013

df = pd.DataFrame({'series': pd.Series(range(10))})
df = df.astype(float)
df[df > 3] = None
df

Works for DataFrame's although it upcasts to object.

s = pd.Series(range(10)).astype(float)
s[8] = None
s

Stays as float.

@jreback

This comment has been minimized.

Show comment
Hide comment
@jreback

jreback Aug 25, 2013

Contributor

ok....will get to this soon..thanks for the report

Contributor

jreback commented Aug 25, 2013

ok....will get to this soon..thanks for the report

@jreback

This comment has been minimized.

Show comment
Hide comment
@jreback

jreback Aug 26, 2013

Contributor

thanks for the report! keep em coming!

Contributor

jreback commented Aug 26, 2013

thanks for the report! keep em coming!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment