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

Getting Started Coding Amazon Alexa Skills for Developers

Getting Started First read our blog post on how to get started with Alexa Skill building or watch our youtube video on the topic Blog...