stephbuon / digital-history

Instructional repository for "Text Mining as Historical Method"
GNU General Public License v3.0
7 stars 3 forks source link

add date filter example to week 4 data access hansard #41

Closed stephbuon closed 3 years ago

stephbuon commented 3 years ago

%%time import datetime as dt import pandas as pd

all_hansard = pd.read_parquet("/scratch/group/oit_research_data/hansard/hansard_20191119.parquet")

all_hansard['speechdate'] = pd.to_datetime(all_hansard['speechdate'], errors = 'coerce')

hansard_1870 = all_hansard[(all_hansard['speechdate'] >= dt.datetime(1870,1,1)) & (all_hansard['speechdate'] <= dt.datetime(1879,12,31))]

del all_hansard