def _utc_localize_index_level_0(df):
 idx = df.index
 df.index = pd.MultiIndex.from_product((idx.levels[0].tz_localize('utc'), idx.levels[1]), names=idx.names)
 return df

def _utc_localize_index_level_0 ( df ) : idx = df . index df . index = pd . MultiIndex . from_product ( ( idx . levels [ 0 ] . tz_localize ( 'utc' ) , idx . levels [ 1 ] ) , names = idx . names ) return df
tz_localize the first level of a multiindexed dataframe to utc .