Python Forum
Emulate slicing for a method
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Emulate slicing for a method
#4
Properties are usually decorated methods - so loc is not an attribute

Output:
In [7]: pandas.DataFrame.loc Out[7]: <property at 0x7fd722e2ce58> In [9]: pandas.DataFrame.loc?? Type: property String form: <property object at 0x7fd722e2ce58> Source: # pandas.DataFrame.loc.fget pandas.DataFrame.loc.fget = functools.partial(<class 'pandas.core.indexing._LocIndexer'>, 'loc')
Test everything in a Python shell (iPython, Azure Notebook, etc.)
  • Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
  • Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
  • You posted a claim that something you did not test works? Be prepared to eat your hat.
Reply


Messages In This Thread
Emulate slicing for a method - by heras - Jul-28-2018, 09:14 PM
RE: Emulate slicing for a method - by ichabod801 - Jul-28-2018, 09:33 PM
RE: Emulate slicing for a method - by heras - Jul-28-2018, 10:00 PM
RE: Emulate slicing for a method - by volcano63 - Jul-29-2018, 02:55 PM
RE: Emulate slicing for a method - by ichabod801 - Jul-30-2018, 01:03 AM
RE: Emulate slicing for a method - by heras - Jul-30-2018, 10:36 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020