gustavorsantos
Published in

gustavorsantos

List the methods associated with an object in Python.

Use <dir( )> to know what methods an object offer to you.

Python’s built-in function is good when we need to discover, remember or confirm that a method exists and is associated with the object we are working with.

The dir( ) will list what you can do. From there, you can use it (if you already know) or research more about the method on the Internet.

When you come across a new type of object in Python or even familiar ones, but you’re looking for a specific function, dir( ) comes in handy.

In the output, there are usually several results starting with __, which are for Python internal use and you can just disregard.

--

--

Let’s make better decisions. Data driven decisions. I use Python, R, Excel and SQL to create Data Science projects.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Gustavo Santos

Data Scientist. I extract insights from data to help people and companies to make better and data driven decisions. | In: https://www.linkedin.com/in/gurezende/