remove white space in colnames before mcsm format output
This commit is contained in:
parent
c0827b56cc
commit
5a2084ba11
3 changed files with 9 additions and 0 deletions
|
@ -308,6 +308,9 @@ def format_mcsm_output(mcsm_outputcsv):
|
||||||
print('Sorting df by position')
|
print('Sorting df by position')
|
||||||
mcsm_data_fs = mcsm_data_f.sort_values(by = ['position'])
|
mcsm_data_fs = mcsm_data_f.sort_values(by = ['position'])
|
||||||
print('sorted df:\n', mcsm_data_fs.head())
|
print('sorted df:\n', mcsm_data_fs.head())
|
||||||
|
|
||||||
|
# Remove white space everywhere before output: bit me when merging!?
|
||||||
|
mcsm_data_fs.columns = mcsm_data_fs.columns.str.replace(' ', '')
|
||||||
#%%===========================================================================
|
#%%===========================================================================
|
||||||
#############
|
#############
|
||||||
# sanity check before writing file
|
# sanity check before writing file
|
||||||
|
|
|
@ -298,6 +298,9 @@ else:
|
||||||
, '\nis', expected_ncols_toadd, 'the no. of expected cols to add?'
|
, '\nis', expected_ncols_toadd, 'the no. of expected cols to add?'
|
||||||
, '\n===============================================================')
|
, '\n===============================================================')
|
||||||
#%%============================================================================
|
#%%============================================================================
|
||||||
|
# Remove white space everywhere before output: bit me when merging!?
|
||||||
|
mcsm_data_fs.columns = mcsm_data_fs.columns.str.replace(' ', '')
|
||||||
|
|
||||||
# writing file
|
# writing file
|
||||||
print('Writing formatted df to csv')
|
print('Writing formatted df to csv')
|
||||||
mcsm_data_fs.to_csv(outfile_mcsm_norm, index = False)
|
mcsm_data_fs.to_csv(outfile_mcsm_norm, index = False)
|
||||||
|
|
|
@ -425,6 +425,9 @@ def format_mcsm_output(mcsm_outputcsv):
|
||||||
print('Sorting df by position')
|
print('Sorting df by position')
|
||||||
mcsm_data_fs = mcsm_data_f.sort_values(by = ['position'])
|
mcsm_data_fs = mcsm_data_f.sort_values(by = ['position'])
|
||||||
print('sorted df:\n', mcsm_data_fs.head())
|
print('sorted df:\n', mcsm_data_fs.head())
|
||||||
|
|
||||||
|
# Remove white space everywhere before output: bit me when merging!?
|
||||||
|
mcsm_data_fs.columns = mcsm_data_fs.columns.str.replace(' ', '')
|
||||||
#%%=====================================================================
|
#%%=====================================================================
|
||||||
#############
|
#############
|
||||||
# sanity check before writing file
|
# sanity check before writing file
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue