Pandas
CSV
format, both are from weather station 'USC00116760' in Petersburg, IL'Temp_116760.csv'
stores temperture data, the index is day-of-year.'Prcp_116760.csv'
stores precipation data, the index is date-time.Pandas
will always try to align index
docsting
of Pandas.read_csv
Pandas.concat
to join DataFrame
together
In [1]:
# How to read the 'Temp_116760.csv' file?
In [2]:
df_temp.tail()
Out[2]:
In [3]:
# How to read the 'Prcp_116760.csv' file and make its index datetime dtype?
In [4]:
df_prcp.head()
Out[4]:
In [5]:
# and I want the index to be of date-time, rather than just strings
df_prcp.index.dtype
Out[5]:
pandas.concat
In [6]:
# How to use concat to make a combined dataframe?
Out[6]:
pandas.merge
merge
might be the better apporach?
In [7]:
# How to use merge to make a combined dataframe?
Out[7]:
In [8]:
# Assuming your now have the combined dataframe from above, named df
# How to make the following summary table using pivot_table?
Out[8]:
In [ ]:
# How should the correct summary table look like?
# How to make it with just 3 method calls?