zhaokg / Rbeast

Bayesian Change-Point Detection and Time Series Decomposition
208 stars 36 forks source link

AttributeError #8

Closed p207345 closed 10 months ago

p207345 commented 1 year ago

i reproduce the first example in Spyder then, i replace it with my own data, and it worked but, want to change to another personal data, i restarted the kernel and everything because appears the next error : 'Traceback (most recent call last):

File ~\AppData\Local\anaconda3\envs\rbeast\lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec exec(code, globals, locals)

File c:\users\marciba\documents\python scripts\rbeast.py:8 import Rbeast as rb

File ~\Documents\Python Scripts\Rbeast.py:21 o = rb.beast(nile, season='none')

AttributeError: partially initialized module 'Rbeast' has no attribute 'beast' (most likely due to a circular import)' and i have uninstalled Rbeast and reinstall and still don't work, can you help me?

here is the code: import Rbeast as rb

import pandas as pd import numpy as np

path_base = r"C:\Users\Marciba\Documents\Python Scripts"

data = pd.read_csv(path_base + '\ACfiltered.csv',sep=",") col= ['index','newindex','Event Date','C2H2_Acetylene'] data.columns=col

data['Event Date'] = pd.to_datetime(data['Event Date'],format="%Y-%m-%d %H:%M:%S")

nile = np.array(data['C2H2_Acetylene']) year = np.array(data['Event Date'])

nile, year = rb.load_example('nile')

o = rb.beast(nile, season='none') rb.plot(o, title= 'Annual streamflow of the nile river') rb.print(o)

p207345 commented 1 year ago

it solved running line by line, thank you.

zhaokg commented 10 months ago

Thanks a lot for sharing the issue and more importantly, giving BEAST a try. Glad that the problem got solved on your end. If you are still interested or using BEAST, I recently uploaded a new version to PyPI: https://pypi.org/project/Rbeast/.