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

np.int was a deprecated #49

Open
bkhnk48 opened this issue Feb 11, 2024 · 1 comment
Open

np.int was a deprecated #49

bkhnk48 opened this issue Feb 11, 2024 · 1 comment

Comments

@bkhnk48
Copy link

bkhnk48 commented Feb 11, 2024

I run my code that uses PyFTS as an essential library. However, I got this error:

/usr/local/lib/python3.10/dist-packages/pyFTS/partitioners/partitioner.py:238: UserWarning:
set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.

Traceback (most recent call last):
File "/root/python/forecast/pyFTSexample/pyFTSExam.ipynb", line 78, in
model.fit(train)
File "/usr/local/lib/python3.10/dist-packages/pyFTS/common/fts.py", line 384, in fit
self.train(mdata, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/pyFTS/models/yu.py", line 62, in train
tmpdata = self.partitioner.fuzzyfy(ndata, method='maximum', mode='sets')
File "/usr/local/lib/python3.10/dist-packages/pyFTS/partitioners/partitioner.py", line 144, in fuzzyfy
mv = self.fuzzyfy(inst, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/pyFTS/partitioners/partitioner.py", line 157, in fuzzyfy
tmp = self[ix].membership(data)
File "/usr/local/lib/python3.10/dist-packages/pyFTS/partitioners/partitioner.py", line 286, in getitem
if isinstance(item, (int, np.int, np.int8, np.int16, np.int32, np.int64)):
File "/usr/local/lib/python3.10/dist-packages/numpy/init.py", line 324, in getattr
raise AttributeError(former_attrs[attr])
AttributeError: module 'numpy' has no attribute 'int'.
np.int was a deprecated alias for the builtin int. To avoid this error in existing code, use int by itself. Doing this will not modify any behavior and is safe. When replacing np.int, you may wish to use e.g. np.int64 or np.int32 to specify the precision. If you wish to review your current use, check the release note link for additional information.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations. Did you mean: 'inf'?

Perhaps, the line

if isinstance(item, (int, np.int, np.int8, np.int16, np.int32, np.int64)):

should be:

if isinstance(item, (int, np.int8, np.int16, np.int32, np.int64)):

Does anyone have other solution by chance?

@bkhnk48
Copy link
Author

bkhnk48 commented Feb 11, 2024

I have edited the "/usr/local/lib/python3.10/dist-packages/pyFTS/partitioners/partitioner.py", line 286.

if isinstance(item, (int, np.int, np.int8, np.int16, np.int32, np.int64)):

to

if isinstance(item, (int, np.int8, np.int16, np.int32, np.int64)):

It works for my case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant