커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
4주차 과제 에러 문의
undefined주차
북마크
김*기
댓글
1
추천
0
조회수
8
조회수
8
답변 완료

* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.

* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.



안녕하세요?

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>




취소
 공유
취소
댓글 0
댓글 알림
나의얼굴