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)
- BUG: rounding datetime in series is broken HOT 1
- BUG: DataFrame to JSON failed when it with UUID HOT 4
- ENH: merge_asof with "how” functionality
- ENH: is it possible to save a reference to a method depending on the version HOT 3
- ValueError: Usecols do not match columns, columns expected but not found: ['Col3', 'Col1'] HOT 6
- ENH: Query function to have a star * for all columns
- BUG: read_html returns empty list HOT 3
- database is locked
- BUG: Enlarging multilevel index fails if one or more level keys are None HOT 2
- BUG: `.dt.microsecond` for pyarrow-backed Series returns 0
- VOTE: Voting issue for PDEP-14: Dedicated string data type for pandas 3.0 HOT 11
- DEPR: `keep_default_dates` and `convert_dates` in `read_json`
- ENH: Add Option to Include Array Offset as MultiIndex Level in `explode()` HOT 6
- DOC: Sort the pandas API reference navbar in alphabetical order HOT 1
- ENH: In pd.cut(), allow bins='auto' (leveraging `np.histogram_bin_edges`) HOT 1
- QST: Critical Vulnerability detection in pandas Library by Fortify due to read_pickle function HOT 3
- BUG:
- BUG: incorrect cummax() results when applied to PyArrow dtypes HOT 1
- ENH: Add Dict type to pd.concat objs HOT 5
- BUG: pd.api.extensions.take does not accept NumpyExtensionArray HOT 2
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.