I have seen this before and just can't remember this function.
Let's say I have a “Speed” column, and each row has 1 of these values:
'Slow', 'Normal', 'Fast'
How to create a new data framework with all my rows except the "Speed" column, which now makes 3 columns: "Slow" "Normal" and "Fast", which has all my rows with a label of 1 in any column, the old column "Speed" was. Therefore, if I had:
print df['Speed'].ix[0] > 'Normal'
I would not expect this:
print df['Normal'].ix[0] >1 print df['Slow'].ix[0] >0
python pandas
user1610719
source share