i have a csv file and want to select one specific colum (date string). then i want to change the format of the date string from yyyymmdd
to dd.mm.yyyy
for every entry.
i read the csv file in a dataframe with pandas and then saved the specific column with the header DATE
to a variable.
import pandas as pd
# read csv file
df = pd.read_csv('csv_file')
# save specific column
df_date_col = df['DATE']
now i want to change the values in df_date_col
. How can i do this?
I know i can do it a step before like this:
df['DATE'] = modify(df['DATE'])
Is this possible just using the variable df_date_col
?
If i try df_date_Col['DATE']=...
it will give a KeyError
.