Skip to content

Commit d5a7531

Browse files
committed
add support for to_pandas_df
1 parent 9978e3e commit d5a7531

File tree

1 file changed

+6
-0
lines changed
  • packages/python/plotly/plotly/express

1 file changed

+6
-0
lines changed

Diff for: packages/python/plotly/plotly/express/_core.py

+6
Original file line numberDiff line numberDiff line change
@@ -1334,6 +1334,9 @@ def build_dataframe(args, constructor):
13341334
elif hasattr(args["data_frame"], "toPandas"):
13351335
args["data_frame"] = args["data_frame"].toPandas()
13361336
columns = args["data_frame"].columns
1337+
elif hasattr(args["data_frame"], "to_pandas_df"):
1338+
args["data_frame"] = args["data_frame"].to_pandas_df()
1339+
columns = args["data_frame"].columns
13371340
else:
13381341
args["data_frame"] = pd.DataFrame(args["data_frame"])
13391342
columns = args["data_frame"].columns
@@ -1431,10 +1434,13 @@ def build_dataframe(args, constructor):
14311434
if not (
14321435
hasattr(df_not_pandas, "to_pandas")
14331436
or hasattr(df_not_pandas, "toPandas")
1437+
or hasattr(df_not_pandas, "to_pandas_df")
14341438
):
14351439
raise exc
14361440
if hasattr(df_not_pandas, "toPandas"):
14371441
args["data_frame"] = df_not_pandas.toPandas()
1442+
elif hasattr(df_not_pandas, "to_pandas_df"):
1443+
args["data_frame"] = df_not_pandas.to_pandas_df()
14381444
else:
14391445
args["data_frame"] = df_not_pandas.to_pandas()
14401446

0 commit comments

Comments
 (0)