Commit dd187c0f authored by Carlos GO's avatar Carlos GO
Browse files

parse average over runs

parent 57e94a06
......@@ -324,4 +324,4 @@ def start(generations=20, size=10, length=50, fit='energy', gc=0.5,\
if __name__ == "__main__":
start(mutation_rate=-1,verbose=True, generations=1000, size=1000, runs=20,\
dest="maternal_50_a10.csv", procs=10)
......@@ -12,13 +12,16 @@ def structure_info(df, sse='multi'):
df[sse] = df['structure'].apply(lambda x: loop_counter(x)[sse])
return df
def mean_stats(dfs):
return pd.concat(list(dfs)).groupby('mutations').mean()
def struc_plot(df, sse='multi'):
df = structure_info(df, sse=sse)
strucs = df.groupby('mutations').mean()
def struc_plot(dfs, sse='multi'):
dfs = (structure_info(df) for df in dfs)
strucs = pd.concat(dfs).groupby('mutations').mean()
sse_mean = strucs[sse]
plt.savefig("multis_adapt.pdf", format="pdf")
# print(sse_mean)
......@@ -29,7 +32,7 @@ def mut_plot():
if __name__ == "__main__":
path = "maternal_50_adaptive_0.csv"
df = pd.read_csv(path)
struc_plot(df, sse='multi')
dfs = (pd.read_csv(f"maternal_50_a10_{i}.csv") for i in range(20))
struc_plot(dfs, sse='multi')
# mut_plot()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment