Skip to content

assignment with ix and mixed dtypes #691

Closed
@jseabold

Description

@jseabold

data = {"title" : ['foobar','bar','foobar'] + ['foobar'] * 17 , "cruft" : np.random.random(20)}

df = pandas.DataFrame(data)

ix = df[df['title'] == 'bar'].index

this doesn't work with a list of variables

df.ix[ix, ['title']] = 'foobar'
df.ix[ix, ['cruft']] = 0

print df

but this does

df.ix[ix, 'title'] = 'foobar'
df.ix[ix, 'cruft'] = 0

print df

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions