Skip to content

Instantly share code, notes, and snippets.

@evilkost
Created December 14, 2013 13:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evilkost/7959046 to your computer and use it in GitHub Desktop.
Save evilkost/7959046 to your computer and use it in GitHub Desktop.
# require pandas 0.13+
import pandas as pd
def read_one(prefix, filename, alg):
return pd.read_csv(prefix + "Mona_Lisa.bmp.LS.csv", sep="\t", index_col=0, header=None, names=['Evals', 'Error'])
##### CSV format:
# separator: \t
# no header
# two columns: first evaluation number, second error
filename = "Mona_Lisa.bmp"
alg = "LS"
raw_list = []
for i in range(10):
prefix = "b%02d" % i
raw_list.append(read_one(prefix, filename, alg))
dfm = pd.concat(raw_list, axis=1)
dfm.columns = map(str, range(10))
df_all_curves = dfm.interpolate()
df_all_curves.plot()
mean_curve = df_all_curves.mean(axis=1)
mean_curve.plot()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment