ydata-profiling icon indicating copy to clipboard operation
ydata-profiling copied to clipboard

FutureWarning: `is_categorical_dtype` is deprecated

Open cloudy-sfu opened this issue 1 year ago • 5 comments

Current Behaviour

Not applicable

Expected Behaviour

Not applicable

Data Description

...\venv\Lib\site-packages\ydata_profiling\model\typeset.py:208: FutureWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, CategoricalDtype) instead
  is_valid_dtype = pdt.is_categorical_dtype(series) and not pdt.is_bool_dtype(

Code that reproduces the bug

ProfileReport(
    df, tsmode=True, title='ERCOT Houston LZ',
    plot={
        'dpi': 300,
        'image_format': 'png',
    },
    correlations={
        "auto": {"calculate": False},
        "pearson": {"calculate": True},
        "spearman": {"calculate": False},
        "kendall": {"calculate": False},
        "phi_k": {"calculate": False},
        "cramers": {"calculate": False},
    },
    interactions={
        'continuous': False,
    }
)
profile.to_file(output_file='...')

pandas-profiling version

v4.6.1

Dependencies

joblib==1.3.2
numpy==1.26.1
pandas==2.1.3
python-dateutil==2.8.2
pytz==2023.3.post1
scikit-learn==1.3.2
scipy==1.11.3
six==1.16.0
threadpoolctl==3.2.0
tzdata==2023.3

OS

Windows 11

Checklist

  • [X] There is not yet another bug report for this issue in the issue tracker
  • [X] The problem is reproducible from this bug report. This guide can help to craft a minimal bug report.
  • [X] The issue has not been resolved by the entries listed under Common Issues.

cloudy-sfu avatar Nov 13 '23 23:11 cloudy-sfu

Hi @cloudy-sfu ,

can you please share what is the python version that you are using?

fabclmnt avatar Dec 04 '23 19:12 fabclmnt

I'm getting the same issue on an Intel MacBook Pro, MacOS 14.1.2 and Python 3.9.2

kalverra avatar Dec 09 '23 20:12 kalverra

In 2 different profiles, I also get

To hide this warning, disable the calculation
(using `df.profile_report(correlations={"auto": {"calculate": False}})`
If this is problematic for your use case, please report this as an issue:
https://github.com/ydataai/ydata-profiling/issues
(include the error message: 'Function <code object pandas_auto_compute at 0x7fb6d20000e0, file "/Users/path/to/python3.9/site-packages/ydata_profiling/model/pandas/correlations_pandas.py", line 164>')
  warnings.warn(

If this is problematic for your use case, please report this as an issue:
https://github.com/ydataai/ydata-profiling/issues
(include the error message: 'could not convert string to float: 'success'')

kalverra avatar Dec 09 '23 20:12 kalverra

Hi @cloudy-sfu ,

can you please share what is the python version that you are using?

Python 3.12 @fabclmnt

cloudy-sfu avatar Dec 30 '23 06:12 cloudy-sfu

From pandas 2.1.0

Deprecated is_categorical_dtype(), use isinstance(obj.dtype, pd.CategoricalDtype) instead ([GH 52527](https://github.com/pandas-dev/pandas/issues/52527))

sapountzis avatar Jan 05 '24 09:01 sapountzis