简体   繁体   中英

Python Introspection: How do I find out what functions can be applied to instances of classes

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?

您可以使用dir(object),它提供了对象的所有相关属性

print(dir(air_passengers.rolling_window(window = 12)))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM