
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
작성한 코드 및 에러 메세지
# 그래프 설정
days = 60
bull_or_bear = "bull"
# 3x1 서브플롯 생성
fig, axis = plt.subplots(3, 1, figsize=(20, 12))
# 각 CSV 파일에 대해 처리
for file_path in file_list:
try:
# CSV 파일 읽기
df = pd.read_csv(file_path, index_col='date', parse_dates=True)
# 급상승한 데이터프레임들 추출
bull_dfs = get_bull_and_bear_dfs(df, bull_or_bear, days)
# 급상승 데이터가 있는 경우 그래프 그리기
if bull_dfs:
for bull_df in bull_dfs:
plot_graph(bull_df, axis)
except Exception as e:
print(f"Error processing {file_path}: {str(e)}")
# 그래프 제목 설정
plt.suptitle(f'{bull_or_bear} last {days}-day trends', fontsize=16)
# 그래프 레이아웃 조정
plt.tight_layout()
# 그래프 표시
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-2-a973a34c486b> in <cell line: 11>()
9 # 3x1 서브플롯 생성
10
---> 11 fig, axis = plt.subplots(3, 1, figsize=(20, 12))
12
13
NameError: name 'plt' is not defined
plt.show()오류 발생 시, 작성한 코드 전체와 에러 메시지를 첨부해 주세요.
Tip 1) </> 아이콘을 눌러 코드박스를 만들어 보세요.
Tip 2) Ctrl+A(맥의 경우 Command+A) 단축키로 코드를 한 번에 선택할 수 있어요!
