subconjunto de um DataFrame Python

Estou fazendo a transição de R para Python. Eu comecei a usar o Pandas. Eu tenho um código R que subconjuntos bem:

k1 <- subset(data, Product = p.id & Month < mn & Year == yr, select = c(Time, Product))

Agora, quero fazer coisas semelhantes em Python. isto é o que eu tenho até agora:

import pandas as pd
data = pd.read_csv("../data/monthly_prod_sales.csv")


#first, index the dataset by Product. And, get all that matches a given 'p.id' and time.
 data.set_index('Product')
 k = data.ix[[p.id, 'Time']]

# then, index this subset with Time and do more subsetting..

Estou começando a sentir que estou fazendo o caminho errado. talvez haja uma solução elegante. Alguém pode ajudar? Eu preciso extrair mês e ano do timestamp que eu tenho e faço subconjuntos. Talvez exista um one-liner que realize tudo isso:

k1 <- subset(data, Product = p.id & Time >= start_time & Time < end_time, select = c(Time, Product))

obrigado.

questionAnswers(4)

yourAnswerToTheQuestion