diff --git a/packages/python/plotly/plotly/express/_doc.py b/packages/python/plotly/plotly/express/_doc.py index 5a920680891..3a5b9344e19 100644 --- a/packages/python/plotly/plotly/express/_doc.py +++ b/packages/python/plotly/plotly/express/_doc.py @@ -1,6 +1,10 @@ import inspect from textwrap import TextWrapper +try: + getfullargspec = inspect.getfullargspec +except AttributeError: # python 2 + getfullargspec = inspect.getargspec # TODO contents of columns # TODO explain categorical @@ -505,7 +509,7 @@ def make_docstring(fn, override_dict={}): tw = TextWrapper(width=75, initial_indent=" ", subsequent_indent=" ") result = (fn.__doc__ or "") + "\nParameters\n----------\n" - for param in inspect.getargspec(fn)[0]: + for param in getfullargspec(fn)[0]: if override_dict.get(param): param_doc = override_dict[param] else: