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
Asked
Active
Viewed 437 times
0

coder888
- 33
- 6
-
2Please have a look at [how to ask pandas questions](https://stackoverflow.com/a/20159305/3620003). – timgeb Feb 21 '22 at 11:02
1 Answers
0
We can use DataFrame.fillna
:
data = data.fillna(df1)

ansev
- 30,322
- 5
- 17
- 31
-
-
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