When importing with read_csv, I added the first 2 rows as headers in my dataframe so I have what I think is an Object as all my column names.
For example when I type
df.iloc[:,0]
I get the following to be returned.
Name: (RECORD, Unnamed: 0_level_1), Length: 36000, dtype: int64
I'm unsure how to use
df.LOC["ColName" = "value"]
Usually for ColName I'd put a single string that is usually the column name. I'm unsure for what do I put for ColName ?
Edit:
>>>> df.head(2).to_dict()
{('RECORD', 'Unnamed: 0_level_1'): {0: 1, 1: 2}, ('TIME/DATE', 'Unnamed:
1_level_1'): {0: '19:55:48.52 09/30/22 ', 1: '19:55:48.62 09/30/22
'}, ('ALARM OR MESSAGE', 'Unnamed: 2_level_1'): {0: 'NO ALARMS
', 1: 'NO ALARMS'}
I tried to convert
df['TIME']= pd.to_datetime(df['TIME/DATE'],, format='%m/%d/%Y %H:%M:%S', infer_datetime_format=True)
But I keep getting an error:
ValueError: to assemble mappings requires at least that [year, month, day] be specified: [day,month,year] is missing
I believe it's because the Heading is an object.