I have a large file, df1, that I wish to extract some data from its cells and then create a new file, df2 with a new column name and datetime column:
df
A B C D E
1 2 3 4 5
Desired output:
Date Value
1/1/2020 3
This is what I am doing:
import pandas as pd
import numpy as mp
df1 = pd.read_csv('df1'csv')
for index.row in df.iterrows():
print row.loc[0:3] = df2['value']
df2.to_csv('df2.csv')
I am stuck on how to create the new column and add the date into this new dataframe. Any suggestion is appreciated.