A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/8387 below:

Pandas ignores index when assigning different dtypes. · Issue #8387 · pandas-dev/pandas · GitHub

Consider the following example:

import pandas

foo = pandas.Series( [ 0, 1, 2, 0 ] )

w   = foo > 0
bar = foo[ w ].map( str )
print bar

foo[w] = bar
print foo

foo[w] = bar
print foo

gives the following output

1    1
2    2
dtype: object

0      0
1    NaN
2      1
3      0
dtype: object

0    0
1    1
2    2
3    0
dtype: object

It looks as if in the first assignemend foo[w] = bar the matching index of both sides is ignored.

Is this a bug or documented behavior?


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4