Open maciekinlondon opened 3 years ago
I'm getting similar error
AttributeError: partially initialized module 'trendet' has no attribute 'identify_df_trends' (most likely due to a circular import)
Hi both @maciekinlondon and @bagcivan, thanks for reporting it! I'll try to solve this later today hopefully and then release a new version with the updated code! :fire:
Hi alvarobartt, Im getting the same error. Strangly when I first installed the library it worked fine, without changing anything I returned to the code last night 3/10/2021 and it gave this error. Ive tried updating the library without success.
I was running the sample code listed below
Any news on a fix ? Thanks
import trendet
import matplotlib.pyplot as plt import seaborn as sns
sns.set(style='darkgrid')
df = trendet.identify_all_trends(stock='BBVA', country='Spain', from_date='01/01/2018', to_date='01/01/2019', window_size=5)
df.reset_index(inplace=True)
with plt.style.context('paper'): plt.figure(figsize=(20, 10))
ax = sns.lineplot(x=df['Date'], y=df['Close'])
labels = df['Up Trend'].dropna().unique().tolist()
for label in labels:
sns.lineplot(x=df[df['Up Trend'] == label]['Date'],
y=df[df['Up Trend'] == label]['Close'],
color='green')
ax.axvspan(df[df['Up Trend'] == label]['Date'].iloc[0],
df[df['Up Trend'] == label]['Date'].iloc[-1],
alpha=0.2,
color='green')
labels = df['Down Trend'].dropna().unique().tolist()
for label in labels:
sns.lineplot(x=df[df['Down Trend'] == label]['Date'],
y=df[df['Down Trend'] == label]['Close'],
color='red')
ax.axvspan(df[df['Down Trend'] == label]['Date'].iloc[0],
df[df['Down Trend'] == label]['Date'].iloc[-1],
alpha=0.2,
color='red')
plt.show()
Hi, I've tried to run trendet script but it gives me an attribute error: AttributeError: partially initialized module 'trendet' has no attribute 'identify_all_trends' (most likely due to a circular import) Do you have any idea what that could be?