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

Add official support for Python 3.12 #155

Closed
shakedzy opened this issue Dec 9, 2023 · 2 comments · Fixed by #158
Closed

Add official support for Python 3.12 #155

shakedzy opened this issue Dec 9, 2023 · 2 comments · Fixed by #158
Labels
versioning Raise awareness to issues arising from versions of dependencies

Comments

@shakedzy
Copy link
Owner

shakedzy commented Dec 9, 2023

As Python 3.12 was released, dython needs to be tested for it too.

@shakedzy shakedzy added the versioning Raise awareness to issues arising from versions of dependencies label Dec 9, 2023
@shakedzy shakedzy changed the title Add Python 3.12 to test workflows Add official support for Python 3.12 Dec 9, 2023
@Pesche007
Copy link

Thanks for your work.

Just upgraded to Python 3 (running Pandas 2.1.1) and some future warings pop up

`import pandas as pd
from sklearn import datasets
from dython.nominal import associations

Load data

iris = datasets.load_iris()

Convert int classes to strings to allow associations

method to automatically recognize categorical columns

target = ['C{}'.format(i) for i in iris.target]

Prepare data

X = pd.DataFrame(data=iris.data, columns=iris.feature_names)
y = pd.DataFrame(data=target, columns=['target'])
df = pd.concat([X, y], axis=1)

Plot features associations

associations(df)`

C:\Users\User\AppData\Roaming\Python\Python310\site-packages\dython\nominal.py:708: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
inf_nan.loc[columns[i], columns[j]] = _inf_nan_str(ij)
C:\Users\User\AppData\Roaming\Python\Python310\site-packages\dython\nominal.py:709: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
inf_nan.loc[columns[j], columns[i]] = _inf_nan_str(ji)

@shakedzy
Copy link
Owner Author

@Pesche007 this seems to be a bug in Pandas, which was solved in version 2.1.2: pandas-dev/pandas#55025
Try upgrading Pandas and see if it is solved.

@shakedzy shakedzy linked a pull request Jan 27, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
versioning Raise awareness to issues arising from versions of dependencies
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants