def qn_df(df, axis='row', keep_orig=False):
  '''
  do quantile normalization of a dataframe dictionary, does not write to net
  '''
  df_qn = {}

  for mat_type in df:
    inst_df = df[mat_type]

    # using transpose to do row qn
    if axis == 'row':
      inst_df = inst_df.transpose()

    missing_values = inst_df.isnull().values.any()

    # make mask of missing values
    if missing_values:

      # get nan mask
      missing_mask = pd.isnull(inst_df)

      # tmp fill in na with zero, will not affect qn
      inst_df = inst_df.fillna(value=0)

    # calc common distribution
    common_dist = calc_common_dist(inst_df)

    # swap in common distribution
    inst_df = swap_in_common_dist(inst_df, common_dist)

    # swap back in missing values
    if missing_values:
      inst_df = inst_df.mask(missing_mask, other=np.nan)

    # using transpose to do row qn
    if axis == 'row':
      inst_df = inst_df.transpose()

    df_qn[mat_type] = inst_df

  return df_qn
do quantile normalization of a dataframe dictionary, does not write to net