In [3]:
import numpy as np
import pandas as pd
from pandas import Series, DataFrame
In [5]:
import webbrowser
website = 'http://en.wikipedia.org/wiki/NFL_win-loss_records'
webbrowser.open(website)
Out[5]:
In [6]:
nfl_frame = pd.read_clipboard()
In [7]:
nfl_frame
Out[7]:
In [8]:
nfl_frame.columns
Out[8]:
In [9]:
nfl_frame.Rank
Out[9]:
In [10]:
nfl_frame.Team
Out[10]:
In [12]:
nfl_frame['First NFL Season']
Out[12]:
In [14]:
DataFrame(nfl_frame, columns=['Team', 'First NFL Season', 'Total Games'])
Out[14]:
In [15]:
nfl_frame.head()
Out[15]:
In [16]:
nfl_frame.head(2)
Out[16]:
In [17]:
nfl_frame.tail(2)
Out[17]:
In [19]:
nfl_frame.ix[3]
Out[19]:
In [20]:
nfl_frame['Stadium'] = 'Levi\'s Stadium'
In [22]:
nfl_frame['Stadium']
Out[22]:
In [23]:
nfl_frame
Out[23]:
In [26]:
nfl_frame['Stadium'] = np.arange(4)
In [27]:
nfl_frame
Out[27]:
In [28]:
del nfl_frame['Stadium']
In [29]:
nfl_frame
Out[29]:
In [30]:
data = {'City': ['SF', 'LA', 'NYC'], 'Population': [837000,3880000,8400000]}
In [31]:
city_frame = DataFrame(data)
In [32]:
city_frame
Out[32]:
In [36]:
city_frame
Out[36]:
In [ ]: