In finance, market data is price and trade data for a given instrument like a
stock, currency pair, or futures contract. Often times this data is visualized
as a chart of historical data.

Python is an excellent language for working with financial data. Python syntax
is compact for data exploration using an interactive shell like iPython. There
is also strong support for downloading, manipulating, and visualizing financial
market data through popular open source libraries like Pandas and Matplotlib.

The above is a Pandas DataFrame, a two-dimensional tabular, column-oriented data
structure with rich, high-performance time series functionality built on top of
NumPy’s array-computing features. A DataFrame provides many of the capabilities
of a spreadsheet and relational database with flexible handling of missing data
and integration with Matplotlib for visualization.

# summary statistics accross the whole DataFrame
df.describe()

Open

High

Low

Close

Volume

Adj Close

count

1258.000000

1258.000000

1258.000000

1258.000000

1.258000e+03

1258.000000

mean

136.639539

137.375763

135.841924

136.679245

1.685675e+08

130.850079

std

25.695177

25.643999

25.745236

25.700838

7.963665e+07

28.457251

min

87.700000

88.490000

87.000000

87.960000

3.967750e+07

79.860000

25%

116.085000

117.275000

115.080000

116.295000

1.153016e+08

107.932500

50%

132.555000

133.220000

131.640000

132.500000

1.524652e+08

125.405000

75%

154.820000

155.540000

154.150000

154.907500

2.046574e+08

151.655000

max

195.350000

196.050000

195.170000

195.600000

7.178287e+08

195.600000

8 rows × 6 columns

Slicing a DataFrame’s column yields a Series that can be operated on alone as
seen below.