If 'transforms' is being deprecated, what will replace it?

Hi,
I’m new to Plotly, using via Plotly Python and Streamlit.

I’m using it for data analysis, so aggregates are important - I see ‘transforms’ are being deprecated but searched and could not find what it is being replaced by.

Should I be learning ‘transforms’ or something else for aggregates?

Thanks and Happy New Year,
Mike

Hey @mike_finko welcome to the community.

What exactly are you referring to? Did you get an deprecation warning or something? If so, it would be good to know what you did codewise.

There is a ‘warning’ on a number of web pages with instructions, here is an example:

hi @mike_finko
:wave: welcome to the community.

Unfortunately, this is not something we plan to offer within Plotly.js because we want Plotly.js to maintain the display role. We want Plotly.js to focus on displaying data visualization and not play the role of analysis.

That said, you can replicate some of these functions using the px.histogram.

Or you can do the aggregations in Pandas. For example:

import plotly.io as pio
import pandas as pd

subject = ['Moe','Larry','Curly','Moe','Larry','Curly','Moe','Larry','Curly','Moe','Larry','Curly']
score = [1,6,2,8,2,9,4,5,1,5,2,8]

df = pd.DataFrame(
    {
        'subject': subject,
        'score': score
    }
)

grouped_data = df.groupby('subject', sort=False).sum()

data = [dict(
  type = 'scatter',
  x = grouped_data.index,
  y = grouped_data.score,
  mode = 'markers',
)]

fig_dict = dict(data=data)

pio.show(fig_dict, validate=False)
1 Like

Hi @adamschroeder

Thanks for the explanation (and this example), it makes sense. Good to know, I’ll go the direction of Pandas.

br,
Mike