ydataai / ydata-profiling

1 Line of code data quality profiling & exploratory data analysis for Pandas and Spark DataFrames.
https://docs.profiling.ydata.ai
MIT License
12.37k stars 1.67k forks source link

FutureWarning: `is_categorical_dtype` is deprecated #1501

Open cloudy-sfu opened 9 months ago

cloudy-sfu commented 9 months ago

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

fabclmnt commented 9 months ago

Hi @cloudy-sfu ,

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

kalverra commented 9 months ago

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

kalverra commented 9 months ago

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'')
cloudy-sfu commented 8 months ago

Hi @cloudy-sfu ,

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

Python 3.12 @fabclmnt

sapountzis commented 8 months ago

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))