ecdf with normed histogram
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 18.8k
- Forks
- 2.8k
- Ø Merge
- 16 Std. 26 Min.
- Gemergte PRs (30 T.)
- 21
Beschreibung
I really like the plotly.express.ecdf and have been using it a lot in my daily work.
When I show ecdf plots in meetings, I usually show it with marginal='histogram', since this is easier understandable for the non-data-scientists in the room.
However, since the amount of data varies I would like to have a normalized histogram, i.e. have percent values.
I know this would be possible with subplots, but there are really a lot of ugly adjustments to make.
So a solution could be to show the percentage in the hint as well, or something like histnorm from plotly.express.histogram.
Example for easy testing:
import plotly.express as px
import numpy as np
import pandas as pd
# Generate random data
np.random.seed(42) # For reproducibility
data = np.random.normal(loc=0, scale=1, size=1000) # Normal distribution data
# Create a pandas dataframe
df = pd.DataFrame({'Values': data})
# Create ECDF plot with histogram
fig = px.ecdf(data,
ecdfnorm='percent',
marginal='histogram')
# Show the figure
fig.show()
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit dem px.ecdf-Einstiegspunkt und vergleiche, wie marginal='histogram' mit histnorm in px.histogram konfiguriert wird. Ermittle, ob normalisierte marginale Bins oder Prozentangaben in den Hover-Informationen das beabsichtigte Verhalten sind, und überprüfe anschließend das Ergebnis mit dem bereitgestellten NumPy- und pandas-Beispiel; abgeschlossen ist die Aufgabe, wenn das ECDF-Histogramm-Marginal Prozentangaben ohne manuelle Subplots darstellen kann.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- numpy, pandas, plotly, python
- Bereich
- data-visualization
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 38/100