Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PX ECDF #3330

Merged
merged 12 commits into from
Aug 13, 2021
Merged

PX ECDF #3330

merged 12 commits into from
Aug 13, 2021

Conversation

nicolaskruchten
Copy link
Contributor

@nicolaskruchten nicolaskruchten commented Aug 3, 2021

Resolves #3010 and closes #2765 by adding ECDF to PX itself.

@nicolaskruchten nicolaskruchten mentioned this pull request Aug 3, 2021
@nicolaskruchten nicolaskruchten changed the title PX ECDF and KDE PX ECDF Aug 13, 2021
@eisenlohr
Copy link

Hi @nicolaskruchten,

Many thanks for getting the ECDF functionality integrated into px! In the past, I was using my own hack to accomplish this, so your work is much appreciated. I was wondering whether you would consider adding this little bit (3 lines in the middle):

            if "ecdfmode" in args:
                base = args["x"] if args["orientation"] == "v" else args["y"]
                var = args["x"] if args["orientation"] == "h" else args["y"]
                ascending = args.get("ecdfmode", "standard") != "reversed"
                group = group.sort_values(by=base, ascending=ascending)

                head = group.head(1).copy()
                head['count'] = 0
                group = pd.concat([head,group])

                group_sum = group[var].sum()  # compute here before next line mutates
                group[var] = group[var].cumsum()
                if not ascending:
                    group = group.sort_values(by=base, ascending=True)

to _core.py in order for the ECDF to run between 0 and 1 instead of 1/N and 1?

If you want, I can try to fork, add the above three-line snippet, and put in a pull request. However, I am somewhat concerned that I get tangled up in the procedures of how to contribute to plotly...

@eisenlohr
Copy link

The above snippet is too simple and does not consider all cases. I will do a proper pull request!

@archmoj archmoj deleted the distfuncs2 branch November 23, 2021 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

histogram facets and marginals don't follow the rules
2 participants