edited: didnt see you reply before posting this :)
Ok this is what I've done so far and its working.
I don't really know what happened so that data[0].dtype became datetime64 type because since yesterday it was an object type !!!! and the reason of my post. lol
and then
now I can set the headers
Is there any ideas to improve this. Thks
Ok this is what I've done so far and its working.
import pandas as pd import datetime as dt #from datetime import datetime import matplotlib.pyplot as plt import numpy as np import random, string data = pd.read_csv('dec18_oct19.csv', sep = ';', header = None, low_memory = False) data.head()have this dataframe -> df
I don't really know what happened so that data[0].dtype became datetime64 type because since yesterday it was an object type !!!! and the reason of my post. lol
and then
#Because I just want to work with specific columns dat = data[[0, 5, 6, 7, 8, 9, 10, 14, 15, 16]].copy(deep=False) #dat[0] = pd.to_datetime(data[0], errors = 'coerce') dat[5] = pd.to_numeric(dat[5], errors = 'coerce') dat.head()result -> slicing
now I can set the headers
dat.columns = [ 'Date_Time', 'Netzspannung1', 'Netzspannung2', 'Netzspannung3', 'Phasenstrom (Wirkstrom)1', 'Phasenstrom (Wirkstrom)2', 'Phasenstrom (Wirkstrom)3', 'Netzstrom1', 'Netzstrom2', 'Netzstrom3']result -> final df
Is there any ideas to improve this. Thks