Comments (1)
Awesome you found a bug!
After investigation it is a bug (feature) in Pandas that calls NumPy with illegal arguments, caused by the infinities in your data.
As a workaround you can replace the infinities with missing values like so:
df.replace(to_replace=np.inf, value=np.NaN, inplace=True)
Depending on what you are trying to do, NaN might actually be better than infinities. Are the infinities real, mathematical infinities? If they are right-censored, for example because your sensor can only read to a certain upper limit, than replacing it with the right-censored value might be more appropriate.
In any case, a lot of calculated statistics will be invalid. For example, when there is a positive infinity, the calculated mean should be positive infinity as well, but the value will now be ignored, skewing the results.
I will leave this bug open for now to think about how we should deal with infinities:
- Replace them with NaN's by default
- Group them in separate bins and plot them separately
- Reject the variable since algorithms won't fit anyway
Would love input on this as well.
To reproduce:
import pandas as pd
import numpy as np
series=pd.Series([2.307568, 59.642170, np.inf, 1241.660000, np.inf])
plot = series.plot(kind='hist', bins=10)
from ydata-profiling.
Related Issues (20)
- pandas.Series.to_dict() got an unexpected keyword argument 'orient' HOT 2
- No module named 'ydata_profiling' HOT 1
- Bug Report - 'matplotlib.cbook' has no attribute 'mplDeprecation' IT has be renamed to UserWarning HOT 1
- no module named "pydantic.v1" HOT 1
- Bug Report
- Feature Request HOT 1
- Bugging creation of report
- Bug Report: Comparing reports from Spark HOT 1
- Upgrade Visions library
- 'NoneType' object has no attribute 'replace' HOT 4
- Crashes with memory leak, seems to be deadlock related HOT 1
- Feat: Use ibis as single backend HOT 3
- No module named 'scipy.stats._mvn' error when importing ProfileReport HOT 2
- Feature Request: use CJK (non-ascii) character
- Bug Report HOT 1
- Bug Report: ValueError: NaTType does not support strftime HOT 1
- Bug Report: DispatchError: Function <code object pandas_missing_bar HOT 2
- Bug Report: Confusing Error with Geometry Column HOT 1
- AttributeError: module 'numba' has no attribute 'generated_jit' HOT 3
- Categorical Variable showing as word cloud instead of bar
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 ydata-profiling.