In [2]:
# Following tutorial at http://data8.org/datascience/tutorial.html
from datascience import Table
# HIDDEN
import matplotlib
matplotlib.use('Agg')
from datascience import Table
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
plt.style.use('fivethirtyeight')
In [3]:
t = Table().with_columns([
'letter', ['a', 'b', 'c', 'z'],
'count', [9, 3, 3, 1],
'points', [1, 2, 2, 10]
])
print(t)
In [4]:
Table.read_table('sample.csv')
Out[4]:
In [5]:
Table.read_table('http://data8.org/textbook/notebooks/sat2014.csv')
Out[5]:
In [13]:
t = Table().with_columns({
'letter': ['a', 'b', 'c', 'z'],
'count': [ 9, 3, 3, 1],
'points': [ 1, 2, 2, 10],
})
print(t)
In [14]:
t
Out[14]:
In [15]:
t.column('letter')
Out[15]:
In [16]:
t.column(1)
Out[16]:
In [17]:
t['letter']
Out[17]:
In [18]:
t[1]
Out[18]:
In [19]:
t.rows
Out[19]:
In [20]:
t.rows[0]
Out[20]:
In [21]:
t.row(0)
Out[21]:
In [23]:
second = t.rows[1]
second
Out[23]:
In [24]:
second[0]
Out[24]:
In [25]:
second[1]
Out[25]:
In [26]:
t.num_rows
Out[26]:
In [27]:
t
Out[27]:
In [ ]: