
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
안녕하세요?
4주차 과제를 하던 중 해설 영상 및 노션페이지 답안과 같은 구성으로 코드를 시도해봤지만 에러가 발생해 문의 드립니다.
확인해주시면 감사하겠습니다!
[작성 코드]
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
plt.rc('font', family='NanumBarunGothic')
sparta_data=pd.read_table('/content/user_db1.csv',sep=',')
students_discounted = sparta_data.groupby('discounted')['user_id'].count()
students_discounted
#그래프 사이즈
plt.figure(figsize=(10,5))
x_list =["1만원", "2만원", "3만원"]
#x,y 값 설정
plt.bar(x_list, students_discounted.values)
#그래프 타이틀
plt.title('할인가격 별 수강 신청자 수 분석')
#x축 레이블
plt.xlabel('할인 적용 범위')
#y축 레이블
plt.ylabel('수강 신청한 수강생')
#그래프 보여주기
plt.show()
[에러 메세지]
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-28-ab33c824f9bc> in <cell line: 15>()
13 x_list =["1만원", "2만원", "3만원"]
14 #x,y 값 설정
---> 15 plt.bar(x_list, students_discounted.values)
16
17 #그래프 타이틀
TypeError: 'list' object is not callable
<Figure size 1000x500 with 0 Axes>
