Comments (4)
Good point. Reproducing your example, this does happen in your example. Trying to scale it up to larger input distributions alleviates the issue though.
Your example is a sweet spot for this error, rescaling your distribution to be larger, the zeroing out stops happening very quickly due to the O(count^2) and O(count^3) terms in the numerator and denominator equations counteracting lifting the very small m4 and m2^2 above the e-14 threshold.
Doing a check of the form (pseudocode)
count < 100 and abs(frexp(denominator) - frexp(numerator)) < 24
before doing the zeroing out should alleviate this issue, but I would like to hear someone else's opinion before putting in a PR.
from pandas.
Another note: the kurtosis fomulation then still deviates from the scipy implementation by 3, up until a distribution size of about 10x your example, using the same shape of your example.
I was not able to iron out that instability, though.
from pandas.
Another note: the kurtosis fomulation then still deviates from the scipy implementation by 3, up until a distribution size of about 10x your example, using the same shape of your example.
I was not able to iron out that instability, though.
Do you mean that the difference of their output is roughly 3? If you have not set bias=False
in scipy
or polars
, the difference here will be roughly 3.
from pandas.
Do you mean that the difference of their output is roughly 3?
Exactly
If you have not set
bias=False
inscipy
orpolars
, the difference here will be roughly 3.
I did not, so then that's also explained. Then I see no issues with my solution anymore.
from pandas.
Related Issues (20)
- DOC: Style extensibility doc links to invalid ecosystem page
- BUG: get_level_values() in a MultiIndex returns DatetimeIndex without frequency even though the index level has a frequency (and unique values). HOT 4
- BUG: incorrect assumption of full-name month format when "May" is initial month HOT 20
- BUG: `np.where` called with `ps.Series` returns `np.array` instead of `pd.Series` HOT 5
- BUG: groupby with as_index=False drops groupings when names collide HOT 1
- DOC: Inconsistent and incomplete documentation of `pandas.eval` HOT 2
- DOC: Mailing list section has no link to subscribe to the mailing list HOT 2
- BUG: groupby.apply requires func to be hashable. raises unhashable type error otherwise HOT 2
- DOC: Incorrect Source Link HOT 3
- DOC: Missing Source Links
- RLS: 2.2.3 HOT 2
- ENH: Infer column dtype when constructing object with pd.NA HOT 2
- BUG: pytest fails for conda editable installation in Mac HOT 3
- BUG: NonExistentTimeError with resample("7D"), but only when DST day is not part of the date range HOT 2
- BUG: pandas.Grouper should not accept args and kwargs and should have permanent arguments HOT 1
- PERF: df.unstack() is 500 times slower since pandas>=2.1 HOT 5
- BUG: Losing information when handling of `NoneType`s in `pd.json_normalize` HOT 2
- BUG: `pd.infer_freq` incompatible with `Series["timestamp[s][pyarrow]"]`.
- BUILD: Pandas 2.1.1 DLL load failed HOT 2
- ENH: Add index_col parameter to the Dataframe constructor HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pandas.