Giter Site home page Giter Site logo

Comments (4)

darynwhite avatar darynwhite commented on May 17, 2024 2

Well, that did fix it, and you were correct. Despite it being NaNs and float32 data, Pandas had it be of dtype: object.

Your suggestion of calling it with .astype("float32") worked before pulling the PyPi update, but the changes from #90 also fixed it.

Thanks! I look forward to integrating this into our workflows!

from plotly-resampler.

jvdd avatar jvdd commented on May 17, 2024

Hi @darynwhite,

Sounds like an awesome project!
Thanks for pointing out this issue :)

This is indeed unexpected / weird behavior. Plotly-Resampler should behave exactly the same as plotly.

I believe in your exanple plotly-resampler considers the datatype of hf_y as string (categorical) - as your y-axis is inverted and takes weird non-uniform steps.
Does it work as expected when you call .astype("float32") on the series that you pass as hf_y?.

Can you give me more details of the datatype of hf_y (and perhaps also hf_x)?
Giving a minimal reproducible example would be even more awesome!

Cheers, Jeroen

from plotly-resampler.

jonasvdd avatar jonasvdd commented on May 17, 2024

Hi @darynwhite (@jvdd),

Thank you for submitting this issue!

I digged into it, and was able to reconstruct a minimal example of the undesired behavior.
The problem indeed is that your input hf_y data is of type object, which is cast to string by this code snippet below ⬇️

# If the categorical or string-like hf_y data is of type object (happens
# when y argument is used for the trace constructor instead of hf_y), we
# transform it to type string as such it will be sent as categorical data
# to the downsampling algorithm
if hf_y.dtype == "object":
hf_y = hf_y.astype("str")

But as this is diverging behavior from plotly w.r.t. numeric series of dtype object, I will fix this in a future PR!
Will create a release fix later this day!

from plotly-resampler.

jonasvdd avatar jonasvdd commented on May 17, 2024

Is fixed in plotly-resampler 0.7.2.2

from plotly-resampler.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.