0

For example: air_passengers.rolling_window(window = 12).mean().plot()

How do I find out that mean() can be applied to a rolling_window()? How do I find out that plot() can be applied to a mean()?

Is there something equivalent to doc for this?

  • Possible duplicate of [How do I get list of methods in a Python class?](https://stackoverflow.com/questions/1911281/how-do-i-get-list-of-methods-in-a-python-class) – mikuszefski Mar 06 '18 at 12:33
  • I want to know what functions can be applied rather than the list of methods of the class [I'm probably using the wrong term, but e.g mean() is not a method of rolling_window [i think?], but can be applied] – Hegerty Mar 06 '18 at 13:56
  • Well, not really. It is probably like this. `air_passengers` is an object of a class that has a method `rolling_window()`. This returns an object of a class that has a method `mean()`, which then again returns an object of a class that has a method `plot()`. Hope everything is unclear, now. – mikuszefski Mar 06 '18 at 15:29

1 Answers1

0

you can use dir(object), which give all associated attributes of a object

print(dir(air_passengers.rolling_window(window = 12)))
Anvesh
  • 607
  • 1
  • 5
  • 19