Richard Stanton
unread,May 21, 2013, 5:34:56 PM5/21/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to pyd...@googlegroups.com
When using DataFrame() with a dataframe as input, trying to set the column
names results in very odd behavior. Here's an example:
df = DataFrame({'A' : [1,2,3], 'B' : [1,2,3]})
DataFrame(df, columns=['C','D'])
Result:
C D
0 NaN NaN
1 NaN NaN
2 NaN NaN
Of course I can always reset the column names in a separate statement, but
pandas makes me want to do as much as possible in a single line.