-1

I have a dataframe that has two columns "0" and "1" there some values and NA in both columns I want to basically combine into one column since the row names are either "edible" and "poisonous". how do i do this in python?

here is the image of the data frame

  • Does this answer your question? [How to merge/combine columns in pandas?](https://stackoverflow.com/questions/46563833/how-to-merge-combine-columns-in-pandas) – Chris Greening Oct 05 '20 at 00:51

1 Answers1

0

Solution 1

df.sum(axis=1)

Solution 2

df['0'].fillna(df['1'])

gioxc88
  • 349
  • 1
  • 9