I access rows in pandas with the loc function as below:
pdf.loc[pdf.a>2]
Is this vectorised? Is it better than using numpy
pdf[pdf.a>2]
I access rows in pandas with the loc function as below:
pdf.loc[pdf.a>2]
Is this vectorised? Is it better than using numpy
pdf[pdf.a>2]
This timing suggests there is no slow down with loc
testa = pd.DataFrame(np.arange(10000000),columns =['q'])
%timeit testb = testa.loc[testa.q>6]
%timeit testc = testa[testa.q>7]
1 loop, best of 3: 207 ms per loop
1 loop, best of 3: 208 ms per loop