Skip to content

Instantly share code, notes, and snippets.

@RomanSteinberg
Created May 26, 2020 10:04
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 RomanSteinberg/192300c111717d68dd1637d22ba5de06 to your computer and use it in GitHub Desktop.
Save RomanSteinberg/192300c111717d68dd1637d22ba5de06 to your computer and use it in GitHub Desktop.
stream measurement
import json
from pathlib import Path
import pandas as pd
# from matplotlib.pyplot import plt
from matplotlib import pyplot as plt
%matplotlib inline
with Path('/home/roman/dev/vinteo/backend/measurement.json').open() as f:
m = json.load(f)
df = pd.DataFrame(m)
plt.figure(figsize=(12, 8))
for col in df.columns:
ax = df[col].plot(kind='line')
ax.legend(df.columns)
print(f'max={round(df.total.max(), 2)} mean={round(df.total.mean(), 2)}')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment