0

I want to append df1 to data. I used the code combined = data.join(df1). But it returns a NaN values in the column i'm trying to add. The data column was extracted from yahoo finance which has a date column that i am unable to get rid of. It returns this, which isnt what i want. Could anyone assist me in appending the two df's together and getting the Date column into a reasonable column that I can edit on

enter image description here

enter image description here

enter image description here

coder888
  • 33
  • 6
  • 2
    Please have a look at [how to ask pandas questions](https://stackoverflow.com/a/20159305/3620003). – timgeb Feb 21 '22 at 11:02

1 Answers1

0

We can use DataFrame.fillna:

data = data.fillna(df1)
ansev
  • 30,322
  • 5
  • 17
  • 31
  • It still doesnt work for me, still giving me NaN for that column – coder888 Feb 21 '22 at 11:14
  • check `data.columns.intersection(df1.columns)` and `data.index.intersection(df1.index)` , dataframe.fillna search using rows and columns, make sure data.index type is equal df1.index type – ansev Feb 21 '22 at 11:20