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

plot.histogram.max_bins setting error #1688

Open
3 tasks done
shiyinhongsama opened this issue Jan 6, 2025 · 0 comments
Open
3 tasks done

plot.histogram.max_bins setting error #1688

shiyinhongsama opened this issue Jan 6, 2025 · 0 comments

Comments

@shiyinhongsama
Copy link

Current Behaviour

when histogram bins > setting plot.histogram.max_bins

Exception:ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() in Python 3.10

The failed code is : ~/anaconda3/lib/python3.11/site-packages/ydata_profiling/model/summary_algorithms.py:44, in histogram_compute(config, finite_values, n_unique, name, weights)

Expected Behaviour

The report generate success.

Data Description

~/anaconda3/lib/python3.11/site-packages/ydata_profiling/model/summary_algorithms.py:44, in histogram_compute(config, finite_values, n_unique, name, weights)

Code that reproduces the bug

from ydata_profiling.config import Settings
from ydata_profiling.utils.paths import get_config
import numpy as np
import pandas as pd
from ydata_profiling import ProfileReport

data = [[1.0, 999,"", 10, None],
        [34.54,3424,None,4,5],
        [9548.43,1,"fdsfv",54,876],
        [32,43.43,"dsfda",43,12],
        [1.0,5454,"cxcc",13,43],
        [45.7,43,"fsdfsfsfdsfsdf",1,54],
        ]

df = pd.DataFrame(np.array(data), columns=["a", "b", "c", "d", "e"])

conf = get_config("config_default.yaml")
conf = Settings().from_file(conf)
conf.plot.histogram.max_bins=2
conf.plot.histogram.bins = 0
profile = ProfileReport(df, config=conf, title="Pandas Profiling Report")
# profile.to_widgets(
profile.to_file("./your_report.html")

pandas-profiling version

v4.12.0

Dependencies

*

OS

Macbook M1ship

Checklist

  • There is not yet another bug report for this issue in the issue tracker
  • The problem is reproducible from this bug report. This guide can help to craft a minimal bug report.
  • The issue has not been resolved by the entries listed under Common Issues.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants