Plotting data 20180201-2223




Pay Notebook Creator: Karsh Patel0
Set Container: Numerical CPU with TINY Memory for 10 Minutes 0
Total0
In [15]:
# Crosscompute
data_table_path = 'data.csv'
a = "apples"
x = 1
target_folder = '/tmp'
In [16]:
print("y = %s " % (x + 10))
y = 11 
In [17]:
%pylab inline
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from os.path import join
Populating the interactive namespace from numpy and matplotlib
In [18]:
t = pd.read_csv(data_table_path)
t.head()
Out[18]:
<style scoped> .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } </style>
Score
0 1304
1 838
2 1636
3 1764
4 725
In [19]:
t.plot()
Out[19]:
<matplotlib.axes._subplots.AxesSubplot at 0x7f2d509d0978>
In [20]:
target_path = join(target_folder, 'graph.png')
fig = plt.figure()
fig.savefig(target_path)
<matplotlib.figure.Figure at 0x7f2d5092b550>
In [21]:
print('x_image_path = %s' % target_path)
x_image_path = /tmp/graph.png
In [22]:
ax = t.plot()
fig = ax.get_figure()
target_path = join(target_folder, 'graph.png')
fig.savefig(target_path)
In [ ]: