Skip to content

Instantly share code, notes, and snippets.

@vrootic
Created September 19, 2014 05:10
Show Gist options
  • Select an option

  • Save vrootic/1f1dab1f6940865d5ad8 to your computer and use it in GitHub Desktop.

Select an option

Save vrootic/1f1dab1f6940865d5ad8 to your computer and use it in GitHub Desktop.
import numpy as np
import matplotlib.pyplot as plt
data = []
with open("output.txt", "r") as f:
for line in f.readlines():
data.append(float(line))
x = []
tmpx = set()
for i in data:
tmpx.add(i)
for i in tmpx:
x.append(i)
x.sort()
y = []
for i in x:
total = 0
for j in data:
if i == j:
total += 1
y.append(float(total)/len(data))
plt.plot(x, np.cumsum(y))
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment