features:
1. strong scientific libraries
2. strongly maintained
3. fast
install pandas into Centos
$ sudo easy_install pandas >>> import numpy >>> numpy.version.version '1.13.3'
Print last 5 rows of the data frame
import pandas as pd
def test_run():
df = pd.read_csv("data/AAPL.csv")
print(df[-5:])
if __name__ == "__main__":
test_run()
compute max closing price of Apple and IBM
import pandas as pd
def get_max_close(sympol)
df = pd.read_csv("data/{}.csv".format(symbol))
return df['Close'].max()
def test_run():
for symbol in ['AAPL', 'IBM']:
print "Max close"
print symbol, get_max_close(symbol)
if __name__ == "__main__": # if run standalone
test_run()