Feature request: Support for plotting `pint` scalars

Open
#4,719 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
pandas, python

Research direction

Start with the MWE linked in pint-pandas issue #249 and reproduce the reported AttributeError through the Plotly Pandas dataframe backend. Trace how Pint scalars are recognized during plotting, then verify that the MWE produces figures without the error for unit-bearing data.

Written by the indexing model from the issue text.

Description

feature P3

I love the figures generated with plotly. I want to use it as the backend for a Pandas dataframe that has units of measurement using (Pint). Unfortunately, these plots fail with the error:

AttributeError: 'float' object has no attribute 'tolist'

It seems that the issue is that Plotly is not recognizing Pint scalars as scalars. A MWE example is given on the following pint-pandas issue.

Thanks.

Dominant language
Python
Stars
18.8k
Forks
2.8k
Avg merge
16h 26m
Merged PRs (30d)
21

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from plotly/plotly.py

All issues in plotly/plotly.py

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.