Buggy .ix assignment #2707

Closed
wesm opened this Issue Jan 19, 2013 · 3 comments

Projects

None yet

2 participants

@wesm
Python for Data member

from mailing list

1) With numeric values everywhere:

df['tt1'] = df['tt2'] = 0
df.ix[1, ['tt1', 'tt2']] = [1, 2]
print df.ix[0:2,['tt1', 'tt2']]

Output:

   tt1  tt2
0    0    0
1    1    2
2    0    0

2) With string values everywhere:

df['tt1'] = df['tt2'] = '0'
df.ix[1, ['tt1', 'tt2']] = ['1', '2']
print df.ix[0:2,['tt1', 'tt2']]

Output:

      tt1     tt2
0       0       0
1  [1, 2]  [1, 2]
2       0       0
@changhiskhan changhiskhan was assigned Jan 20, 2013
@changhiskhan
Python for Data member

Looks ok on master:

In [5]: paste
df['tt1'] = df['tt2'] = 0
df.ix[1, ['tt1', 'tt2']] = [1, 2]
print df.ix[0:2,['tt1', 'tt2']]
## -- End pasted text --
   tt1  tt2
0    0    0
1    1    2
2    0    0

In [6]: paste
df['tt1'] = df['tt2'] = '0'
df.ix[1, ['tt1', 'tt2']] = ['1', '2']
print df.ix[0:2,['tt1', 'tt2']]
## -- End pasted text --
  tt1 tt2
0   0   0
1   1   2
2   0   0
@wesm
Python for Data member

Let's add a unit test?

@changhiskhan
Python for Data member

Yeah good point. Added.

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