Ad

Wednesday, March 21, 2018

Difference between iloc and loc in Pandas

ix is deprecated, use of iloc and loc are encouraged.

.loc for label based indexing or
.iloc for positional indexing

Useful for querying row data
df.head(5)
df.loc[0:5]
Also powerful for column based querying
df_pro_desc.loc[0:2,["col_1", "col_2"]]

No comments:

Post a Comment

Applying for jobs at the Lending Club

We tried to figure out Lending Club 's tech stack for 2019. Our analysis shows Lending Club asks for skills in Python, Tableau, SQL and ...