Last active
February 6, 2018 22:47
-
-
Save riceissa/4506fa16d4dbae794387979843e74c22 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
calls = 0 | |
data = [] | |
with open(sys.argv[1], "r") as f: | |
for line in f: | |
if not line.strip(): | |
continue | |
calls += 1 | |
try: | |
time, donee = line.strip().split("\\t") | |
data.append((time, calls, donee)) | |
except ValueError: | |
pass | |
df = pd.DataFrame(data, columns=['time', 'calls', 'donee']) | |
df['time'] = pd.to_datetime(df['time']) | |
df = df.set_index('time') | |
df.calls.plot(linestyle='none', marker='.', rot=45) | |
plt.ylabel("cumulative number of donees") | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment