Reputation: 1590
I have a dataframe and I need to create a new column and assign values. if say there are 100 rows in that column, I want to be able to say that the first 50 are assigned value 1 and the rest are 0. I know that in order to create a new column, I could do df['CLASS'] = 0, but in this case, all values are 0s. How should I modify this statement to be able to assign different values?
Upvotes: 0
Views: 37