I'm fairly inexperienced with Python and I need some help - I have a csv file with different columns for day, month, year, hours, minutes, seconds and for my measured parameters. I need to combine the date/time information into one column so I can then plot the date/time against the parameter. Can anyone offer any assistance on doing this?
I have searched and found some similar questions but nothing has worked!
Thank you in advance!
My code is as follows:
from matplotlib import pyplot as plt
import numpy as np
import csv
with open('Weather station data 19.03 to 21.03.csv', 'rb') as f:
reader = csv.reader(f, delimiter=',')
next(reader, None)
D = []
M = []
Y = []
Hrs = []
Mins = []
Secs = []
Pres = []
Temp = []
RH = []
Volts = []
Date_time = []
for col in reader:
Day = col[0]
Month = col[1]
Year = col[2]
Hour = col[3]
Minute = col[4]
Second = col[5]
Pressure = col[6]
Temperature = col[7]
Humidity = col[8]
Voltage = col[9]
D.append(Day)
M.append(Month)
Y.append(Year)
Hrs.append(Hour)
Mins.append(Minute)
Secs.append(Secs)
Pres.append(Pressure)
Temp.append(Temperature)
RH.append(Humidity)
Volts.append(Voltage)
I want to be able to combine the date and the time information together, so I can then plot it against the pressure or temperature or RH