text_html_output_2.png text_html_output_1.png text_plain_output_1.png
import datetime as dt

import pandas as pd

df_source = pd.read_csv('../input/periodic-traffic-data/periodic_traffic.csv')
df_source['rep_date'] = pd.to_datetime(df_source['_time'])
df_source.drop(['_time'], axis=1, inplace=True)
df_source_time = df_source.copy()
df_source_time['rep_time'] = df_source_time['rep_date'].apply(lambda x: dt.datetime.strptime(x.strftime('%H:%M'), '%H:%M'))
df_source_time.drop(['rep_date'], axis=1, inplace=True)
df_source = df_source.set_index('rep_date')
df_source_time = df_source_time.set_index('rep_time')
print('Rows found in the DataFrame:\n{}\n'.format(len(df_source.index)))
display(df_source.tail(3))
display(df_source_time.tail(3))