business-science / pytimetk

Time series easier, faster, more fun. Pytimetk.
https://business-science.github.io/pytimetk/
MIT License
696 stars 60 forks source link

Error: 'DataFrame' object has no attribute 'binarize' #283

Closed MohammadSoltani100 closed 9 months ago

MohammadSoltani100 commented 11 months ago

Dear pytimetk team, I hope this message finds you well. I am reaching out to report an issue that I encountered while using the pytimetk library.

I attempted to use the binarize function on a DataFrame created with Pandas, following the provided documentation. However, I encountered the following error:

import pytimetk as tk import pandas as pd

d = pd.DataFrame(df2) d.glimpse()

<class 'pandas.core.frame.DataFrame'>: 2524 rows of 7 columns doy: int64 [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, ... SH: float64 [4.0, 5.6, 6.9, 11.0, 5.0, 5.8, 0.0, 0.0, 0.0, 1 ... Tn: float64 [5.81, 5.86, 3.2, 3.1, -0.6, 2.5, 8.86, 8.6, 7.6 ... Tx: float64 [14.5, 19.3, 12.8, 14.2, 16.3, 19.6, 16.4, 10.8, ... n: float64 [5.13, 5.13, 4.25, 1.75, 4.25, 6.25, 7.38, 8.0, ... Ra: float64 [31.05, 31.27, 31.49, 31.7, 31.92, 32.13, 32.35, ... SR: int64 [1130, 1530, 1669, 168, 1851, 1952, 225, 131, 16 ...

df_binarized = d.binarize(n_bins=4, thresh_infreq=0.01, name_infreq="-OTHER", one_hot=True) df_binarized.glimpse()

AttributeError: 'DataFrame' object has no attribute 'binarize'

pytimetk Version: [0.2.1] Python Version: [3.11.5] Operating System: [Microsoft Windows 10]

Thank you for your attention to this matter. I appreciate your efforts in maintaining this valuable library.

Best regards,

mdancho84 commented 11 months ago

You probably need to upgrade to the development version. 0.2.1 doesn't have binarize. Follow the installation instructions:

pip install git+https://github.com/business-science/pytimetk.git
MohammadSoltani100 commented 11 months ago

Thank you. works.