My data doesn't contain columns when I am adding the columns in the data using dataFrame.columns = ['XYZ','ABC']
then the 1st row is getting replaced by the column names.
Asked
Active
Viewed 30 times
-1
-
This is just renaming the columns. (What you call the 1st row are column headers.) – IanS Jun 19 '19 at 13:37
1 Answers
1
I think your issue is pretty much explained here - Adding new column to existing DataFrame in Python pandas
.
To keep it short: df['new_column'] = None # or any other value
.

Zigfrid
- 21
- 5