import pandas as pd
import datetime as dt
from ggplot import *
%pylab --no-import-all
%matplotlib inline
Using matplotlib backend: MacOSX Populating the interactive namespace from numpy and matplotlib
#!grep average *.log | cut -d' ' -f1,2,4 | sed -e "s/\.log:/, /g" > averages
df = pd.read_csv('averages', header=None,
names=['streams', 'datetime', 'ms', 'Mbps'],
parse_dates=['datetime'])
df = df.drop('ms', axis=1)
df.streams = df.streams.apply(lambda x: x.split('_')[1])
df.sort('datetime', inplace=True)
df.head()
streams | datetime | Mbps | |
---|---|---|---|
75 | 5 | 2014-01-16 19:18:22 | 1.654655 |
0 | 10 | 2014-01-16 19:38:22 | 1.646546 |
15 | 12 | 2014-01-16 19:58:23 | 1.642779 |
30 | 13 | 2014-01-16 20:18:23 | 1.641394 |
45 | 14 | 2014-01-16 20:38:23 | 1.559687 |
5 rows × 3 columns
ggplot(aes(x='datetime', y='Mbps', colour='streams'), data=df) +\
geom_line() + geom_point()
<ggplot: (277262001)>