lundi 11 juillet 2016

Put 2 separate .csv files on one graph using Python

I have created a multi-line graph, of water temperatures throughout the year, with python using pandas:

import pandas as pd
filepath = "C:\Users\technician\Desktop\LowerBD2014.csv" 

data = pd.read_csv(filepath, header = 0, index_col = 0)

data.plot(kind = 'line', use_index = True, title="timeseries", figsize=(20,10))

Now, I would like to add another line for Air Temperature. Unfortunately, the dates and times, when data was collected, don't match. I was thinking that I could work around this my importing 2 separate .csv files into the same graph, but I am unsure how to do that.

Any suggestions would be great. I can also add all of the data to one file, I just worry that the Air Temperature will not plot correctly without a secondary horizontal axis (I don't know how to do this either).

Aucun commentaire:

Enregistrer un commentaire