Nicky Nicolson commited on
Commit
32b8a4e
1 Parent(s): 875aea5

Add year columns

Browse files
Files changed (1) hide show
  1. tab2csv.py +1 -0
tab2csv.py CHANGED
@@ -19,5 +19,6 @@ if __name__ == '__main__':
19
  parse_dates=date_columns)
20
  if args.createcols:
21
  for date_column in date_columns:
 
22
  df[date_column + '_q'] = pd.PeriodIndex(df[date_column], freq='Q')
23
  df.to_csv(args.outputfile, index=False, sep=',')
 
19
  parse_dates=date_columns)
20
  if args.createcols:
21
  for date_column in date_columns:
22
+ df[date_column + '_yr'] = pd.PeriodIndex(df[date_column], freq='Y')
23
  df[date_column + '_q'] = pd.PeriodIndex(df[date_column], freq='Q')
24
  df.to_csv(args.outputfile, index=False, sep=',')