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

n_rows and n_columns must be positive integer. (Same as #853 and #836) #883

Closed
WillTirone opened this issue Nov 14, 2021 · 8 comments
Closed
Assignees
Labels
bug 🐛 Something isn't working

Comments

@WillTirone
Copy link

Describe the bug

This is similar to #853 and #836, but posting anyway just as another example with version info and a screenshot in Jupyter Notebook. Feel free to mark as a duplicate if desired.

When attempting the basic profile.to_widgets() example in the README, I encounter the attached error that n-rows and n-columns must be positive integers.
pandas_error

To Reproduce

follow the example in picture above

Version information:

Windows 10
Python: 3.8.5
Jupyter Notebook: 6.1.4
pandas-profiling: 3.1.0

Additional context

Just wanted to throw this out there since I've never used the profiling report and it seems the basic example is broken - I could be doing something obviously wrong though.

Happy to attempt a bug fix and PR if this is an actual issue. Let me know what else you all might need.

@sbrugman sbrugman added the bug 🐛 Something isn't working label Nov 14, 2021
@sbrugman
Copy link
Collaborator

This is indeed a bug, a PR is very much welcome 👍

@WillTirone
Copy link
Author

@sbrugman I will give it my best shot and let you know what I find!

@WillTirone
Copy link
Author

@sbrugman this seems to be fixed in the current pandas-profiling version on GitHub (3.1.1). I've been playing around with it, but I just cloned the code and was trying to recreate examples when I noticed it works. Here's the example from #853 that now works but fails in 3.1.0.
image

Let me know if you need anything else to close this issue

@AdamXCA
Copy link

AdamXCA commented Nov 30, 2021

I have the same problem as this, and I fixed it by the steps below.

uninstall pandas profiling
update Anaconda
update Notebook
!pip install https://github.com/pandas-profiling/pandas-profiling/archive/refs/tags/v3.0.0.zip

let me know if it works for you

@haugstve
Copy link

@WillTirone
I don't think this is fixed in version 3.1.1

I installed pandas profiling using
pip install https://github.com/pandas-profiling/pandas-profiling/archive/master.zip

Relevant versions from conda list:

python                              3.10.1          h38b4d05_2_cpython    conda-forge
pandas                              1.3.5           py310hdd25497_0    conda-forge
pandas-profiling              3.1.1                    pypi_0    pypi 
ipykernel                          6.6.0           py310ha188af9_0    conda-forge
ipython                             7.30.1          py310h2ec42d9_0    conda-forge
ipython-genutils              0.2.0                    pypi_0    pypi
ipython_genutils              0.2.0                      py_1    conda-forge
ipywidgets                        7.6.5                    pypi_0    pypi
jupyter-client                    7.1.0                    pypi_0    pypi
jupyter_client                    7.1.0              pyhd8ed1ab_0    conda-forge
jupyter_core                      4.9.1           py310h2ec42d9_1    conda-forge
jupyterlab                          2.1.0                    pypi_0    pypi
jupyterlab-pygments        0.1.2                    pypi_0    pypi
jupyterlab-server              1.0.9                    pypi_0    pypi
jupyterlab-widgets           1.0.2                    pypi_0    pypi
jupyterlab_pygments       0.1.2              pyh9f0ad1d_0    conda-forge
jupyterlab_server             1.0.9                      py_0    conda-forge
jupyterlab_widgets           1.0.2              pyhd8ed1ab_0    conda-forge

I can't share my dataset so I'm not of much help. Maybe some of the others which have reported this #836 can be asked to test version 3.1.1?

@haugstve
Copy link

A quick follow up.

I just tried version 3.0.0 and it still didn't work on my dataset. The reason it doesn't work on my dataset might be more unrelated to the bug. Before I get the n-rows and n-columns must be positive integers I get a RuntimeWarning: overflow encountered in long_scalars. I like pandas profiling and appreciate the work you guys are putting in.

@prodramp
Copy link

prodramp commented Mar 7, 2022

I hit the same error with the titanic dataset.

!pip show pandas-profiling

Name: pandas-profiling
Version: 3.1.0
Summary: Generate profile report for pandas DataFrame
Home-page: https://github.com/pandas-profiling/pandas-profiling
Author: Simon Brugman
Author-email: [email protected]
License: MIT
Location: /Users/avkash/anaconda3/envs/python38/lib/python3.8/site-packages
Requires: htmlmin, jinja2, joblib, markupsafe, matplotlib, missingno, multimethod, numpy, pandas, phik, pydantic, PyYAML, requests, scipy, seaborn, tangled-up-in-unicode, tqdm, visions
Required-by:

Here is the titanic dataset url, I am using:

https://raw.githubusercontent.com/prodramp/publiccode/master/datasets/titanic.csv
Just use the following code to repro:

data_source_url = "https://raw.githubusercontent.com/prodramp/publiccode/master/datasets/titanic.csv"
df = pd.read_csv(data_source_url)
report = ProfileReport(df)
report.to_widgets()

@ApurvBhusari
Copy link

Instead of using to_widgets use to_notebook_iframe(). Hope it works for you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants