Skip to content

Instantly share code, notes, and snippets.

@lauromoura
Created April 25, 2019 22:32
Show Gist options
  • Save lauromoura/4075f149955bf6234d95bddcd2395f22 to your computer and use it in GitHub Desktop.
Save lauromoura/4075f149955bf6234d95bddcd2395f22 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# coding: utf-8
# In[2]:
import pandas as pd
import seaborn as sns
get_ipython().run_line_magic('matplotlib', 'inline')
# In[28]:
dfs = []
for i in range(1, 10):
filename = 'normal_run_{:d}.txt'.format(i)
name = 'normal_{:02d}'.format(i)
new = pd.read_csv(filename, names=[name, 'Test'], error_bad_lines=False, index_col=1)
dfs.append(new)
dfs
result = pd.concat(dfs, axis=1)
result.transpose().describe()
# In[30]:
mean = result.transpose().mean().reset_index()
mean = mean.reindex(columns=[0, 'Test'])
mean.to_csv('test.csv', header=False, float_format='%.2f', index=False)
mean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment