Основной официальный сайт pandas. Официальная документация.
Основными структурами данных в pandas являются Series и DataFrame.
Полезные функции
Как правило нам нужно импортировать:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
Примеры применения
For the Series object (let's call it s), pandas offers three types of addressing.
- s.iloc[] -- for integer position addressing;
- s.loc[] -- for index label addressing; and
- s.ix[] -- for a hybrid of integer position and label addressing.
Приведу пример.
import pandas as pd
import string
idx = [i for i in string.uppercase] # A, B, C .. Z
t = pd.Series(range(26), index=idx) # 0, 1, 2 .. 25
#примеры
t[0] # --> 0
t['A'] # --> 0
t[['A','M']] # --> [0, 12]
t['A':'D'] # --> [0, 1, 2, 3]
t.iloc[25] # --> 25
t.loc['Z'] # --> 25
t.loc[['A','Z']] # --> [0, 25]
t.ix['A':'C'] # --> [0, 1, 2]
t.ix[0:2] # --> [0, 1]
Ссылки по теме pandas
- Официальный сайт pandas и страничка уроков
- Habr. Введение в анализ данных с помощью Pandas
- PyData video
- Youtube.com Python Pandas Cookbook Alfred Essa
- ENG. Финансовый анализ с pandas.