Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas as pd
- import glob
- # the only thing that you need to do is to change the name of the folder
- path ='/home/nov/PycharmProjects/convert'
- allFiles = glob.glob(path + "/*.csv")
- frame = pd.DataFrame()
- list_ = []
- for file_ in allFiles:
- df = pd.read_csv(file_, index_col=None, header=0)
- row = 0
- for i in df['Date']:
- temp = pd.to_datetime(i)
- temp = temp.strftime("%d/%m/%Y %H:%M")
- df.set_value(row, 'Date', temp)
- print(df['Date'][row])
- row += 1
- df.to_csv(file_, index=False)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement