Skip to content

Strange behavior assigning values to elements #3970

Closed
@phobson

Description

@phobson

Basically, if you create a Data

import pandas as pd

df = pd.DataFrame({ "aa":range(5), "bb":[2.2]*5})

df["cc"] = 0.0 # remove this line, it works

ck = [True]*len(df)

df["bb"].iloc[0] = .13
df_tmp = df.iloc[ck] # or remove this line and it'll work
df["bb"].iloc[0] = .15 # doesn't happen

print df

which gives:

   aa    bb  cc
0   0  0.13   0
1   1  2.20   0
2   2  2.20   0
3   3  2.20   0
4   4  2.20   0

Very strange.

Specs:

pd.version.version
Out[5]: '0.11.0'

np.version.version
Out[7]: '1.7.1'

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIndexingRelated to indexing on series/frames, not to indexes themselves

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions