python - Why/How does Pandas use square brackets with .loc and .iloc? -
this question has answer here:
- pandas iloc vs ix vs loc explanation? 2 answers
so .loc , .iloc not typical functions. somehow use [ , ] surround arguments comparable normal array indexing. however, have never seen in library (that can think of, maybe numpy i'm blanking on), , have no idea how technically works/is defined in python code.
are brackets in case syntactic sugar function call? if so, how 1 make arbitrary function use brackets instead of parenthesis? otherwise, special use/defintion pandas?
thanks.
underneath covers, both using __setitem__ , __getitem__ functions.
Comments
Post a Comment