Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
select nan value
#1
I have a dataframe which have 2 columns. They have mutually exclusive nan in the cells. I mean the place where col1 is nan, col2 have some numerical value and vice versa. The situation is shown below

df = pd.DataFrame({"A": [1, 'nan'], "B": ['nan', 2]})
I would like to merge them into single columns with values taken from both,

df = pd.DataFrame({"A": [1, 2]})
Reply


Messages In This Thread
select nan value - by fullstop - Dec-23-2019, 04:17 PM
RE: select nan value - by scidam - Dec-25-2019, 08:07 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020