def check_known_inconsistencies(bill_data, bond_data):
 inconsistent_dates = bill_data.index.sym_diff(bond_data.index)
 known_inconsistencies = [pd.Timestamp('2006-09-04', tz='UTC'), pd.Timestamp('2010-02-15', tz='UTC'), pd.Timestamp('2013-07-25', tz='UTC')]
 unexpected_inconsistences = inconsistent_dates.drop(known_inconsistencies)
 if len(unexpected_inconsistences):
  in_bills = bill_data.index.difference(bond_data.index).difference(known_inconsistencies)
  in_bonds = bond_data.index.difference(bill_data.index).difference(known_inconsistencies)
  raise ValueError('Inconsistent dates for Canadian treasury bills vs bonds. \nDates with bills but not bonds: {in_bills}.\nDates with bonds but not bills: {in_bonds}.'.format(in_bills=in_bills, in_bonds=in_bonds))

def check_known_inconsistencies ( bill_data , bond_data ) : inconsistent_dates = bill_data . index . sym_diff ( bond_data . index ) known_inconsistencies = [ pd . Timestamp ( '2006-09-04' , tz = 'UTC' ) , pd . Timestamp ( '2010-02-15' , tz = 'UTC' ) , pd . Timestamp ( '2013-07-25' , tz = 'UTC' ) ] unexpected_inconsistences = inconsistent_dates . drop ( known_inconsistencies ) if len ( unexpected_inconsistences ) : in_bills = bill_data . index . difference ( bond_data . index ) . difference ( known_inconsistencies ) in_bonds = bond_data . index . difference ( bill_data . index ) . difference ( known_inconsistencies ) raise ValueError ( 'Inconsistent dates for Canadian treasury bills vs bonds. \nDates with bills but not bonds: {in_bills}.\nDates with bonds but not bills: {in_bonds}.' . format ( in_bills = in_bills , in_bonds = in_bonds ) )
there are a couple quirks in the data provided by bank of canada .