Skip to content

Instantly share code, notes, and snippets.

@jamiecook
Last active April 9, 2017 12:41
Show Gist options
  • Save jamiecook/3741e62e6635c2a81f9617814de1c4c6 to your computer and use it in GitHub Desktop.
Save jamiecook/3741e62e6635c2a81f9617814de1c4c6 to your computer and use it in GitHub Desktop.
upload the last 3 odd days of speed data to plotly
import pandas as pd
import numpy as np
import plotly.plotly as py
import plotly.graph_objs as go
import scipy
from scipy import signal
N = 1000
df = pd.read_csv('/home/jamie/bin/speedtest-log.txt', header=None)
x=df[0][-N:].map(str) + " " + df[1][-N:].map(str)
download=df[2][-N:]
upload=df[3][-N:]
trace_down = go.Scatter(x=x, y=download, name='download speed', visible='legendonly')
trace_down_ = go.Scatter(x=x, y=signal.savgol_filter(download, 53, 3), name='download speed (smoothed)')
trace_up = go.Scatter(x=x, y=upload, name='upload speed', visible='legendonly')
trace_up_ = go.Scatter(x=x, y=signal.savgol_filter(upload, 53, 3), name='upload speed (smoothed)')
data = [trace_down_, trace_up_, trace_down, trace_up]
py.iplot(data, filename='optus_cable_speed')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment