I have read this documentation:
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.loc.html
You can use a syntax like df.loc[df['shield'] > 6, ['max_speed']].
I tried using Github and found out:
Suppose you have a pandas.core.frame.DataFrame object, i.e. a DataFrame called df.
The type of df.loc is pandas.core.indexing._LocIndexer.
Nevertheless, I could not sort out these questions:
How do you make a Python function/class accepting a syntax like above?
Where in the source code of
pandas.core.frame.DataFrameis the propertyself.locdefined??
get_locbecomeself.loc?? Sorry for being so stupid, but I don't get it :/get_locfunction but I cannot find any @property decorator or any other syntax definingself.loc. I git cloned the pandas repo. Usedgit grep -n self.locandgit grep -A1 @property | grep locbut I can't find it. Could you solve my issue?.locis implemented but it is implemented somewhere in this file. github.com/pandas-dev/pandas/blob/master/pandas/core/…. Implementation of loc is more complex. You can search inindexing.pyfile for some in depth explanation . Write answer if you find a good explanation for this.