
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
4주차 숙제 3가지 질문
(사진 1번으로 글꼴 설정 후 2번 -> 3번 그래프 나옴, 4번은 엑셀 파일 내용)




!sudo apt-get install -y fonts-NanumBarunGothic
!sudo fc-cache -fv
!rm ~/.cache/matplatlib -rf
plt.rc('font', family='NanumBarunGothic')
[3]
5초
!sudo apt-get install -y fonts-NanumBarunGothic
!sudo fc-cache -fv
!rm ~/.cache/matplatlib -rf
plt.rc('font', family='NanumBarunGothic')
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package fonts-NanumBarunGothic
/usr/share/fonts: caching, new cache contents: 0 fonts, 1 dirs
/usr/share/fonts/truetype: caching, new cache contents: 0 fonts, 2 dirs
/usr/share/fonts/truetype/humor-sans: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/truetype/liberation: caching, new cache contents: 16 fonts, 0 dirs
/usr/local/share/fonts: caching, new cache contents: 0 fonts, 0 dirs
/root/.local/share/fonts: skipping, no such directory
/root/.fonts: skipping, no such directory
/usr/share/fonts/truetype: skipping, looped directory detected
/usr/share/fonts/truetype/humor-sans: skipping, looped directory detected
/usr/share/fonts/truetype/liberation: skipping, looped directory detected
/var/cache/fontconfig: cleaning cache directory
/root/.cache/fontconfig: not cleaning non-existent cache directory
/root/.fontconfig: not cleaning non-existent cache directory
fc-cache: succeeded
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)
#그래프 타이틀
plt.title('할인 율 별 수강 신청 자 수')
#x축 레이블
plt.xlabel('할인 적용 범위')
#y축 레이블
plt.ylabel('수업 신청한 수강생')
#그래프 보여주기
plt.show()
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
/usr/local/lib/python3.10/dist-packages/IPython/core/pylabtools.py:151: UserWarning: Glyph 49688 (\N{HANGUL SYLLABLE SU}) missing from current font.
fig.canvas.print_figure(bytes_io, **kw)
/usr/local/lib/python3.10/dist-packages/IPython/core/pylabtools.py:151: UserWarning: Glyph 50629 (\N{HANGUL SYLLABLE EOB}) missing from current font.
fig.canvas.print_figure(bytes_io, **kw)
/usr/local/lib/python3.10/dist-packages/IPython/core/pylabtools.py:151: UserWarning: Glyph 49888 (\N{HANGUL SYLLABLE SIN}) missing from current font.
fig.canvas.print_figure(bytes_io, **kw)
/usr/local/lib/python3.10/dist-packages/IPython/core/pylabtools.py:151: UserWarning: Glyph 52397 (\N{HANGUL SYLLABLE CEONG}) missing from current font.
fig.canvas.print_figure(bytes_io, **kw)
/usr/local/lib/python3.10/dist-packages/IPython/core/pylabtools.py:151: UserWarning: Glyph 54620 (\N{HANGUL SYLLABLE HAN}) missing from current font.
fig.canvas.print_figure(bytes_io, **kw)
/usr/local/lib/python3.10/dist-packages/IPython/core/pylabtools.py:151: UserWarning: Glyph 44053 (\N{HANGUL SYLLABLE GANG}) missing from current font.
fig.canvas.print_figure(bytes_io, **kw)
/usr/local/lib/python3.10/dist-packages/IPython/core/pylabtools.py:151: UserWarning: Glyph 49373 (\N{HANGUL SYLLABLE SAENG}) missing from current font.
fig.canvas.print_figure(bytes_io, **kw)
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
/usr/local/lib/python3.10/dist-packages/IPython/core/pylabtools.py:151: UserWarning: Glyph 54624 (\N{HANGUL SYLLABLE HAL}) missing from current font.
fig.canvas.print_figure(bytes_io, **kw)
/usr/local/lib/python3.10/dist-packages/IPython/core/pylabtools.py:151: UserWarning: Glyph 51064 (\N{HANGUL SYLLABLE IN}) missing from current font.
fig.canvas.print_figure(bytes_io, **kw)
/usr/local/lib/python3.10/dist-packages/IPython/core/pylabtools.py:151: UserWarning: Glyph 50984 (\N{HANGUL SYLLABLE YUL}) missing from current font.
fig.canvas.print_figure(bytes_io, **kw)
/usr/local/lib/python3.10/dist-packages/IPython/core/pylabtools.py:151: UserWarning: Glyph 48324 (\N{HANGUL SYLLABLE BYEOL}) missing from current font.
fig.canvas.print_figure(bytes_io, **kw)
/usr/local/lib/python3.10/dist-packages/IPython/core/pylabtools.py:151: UserWarning: Glyph 51088 (\N{HANGUL SYLLABLE JA}) missing from current font.
fig.canvas.print_figure(bytes_io, **kw)
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
/usr/local/lib/python3.10/dist-packages/IPython/core/pylabtools.py:151: UserWarning: Glyph 47564 (\N{HANGUL SYLLABLE MAN}) missing from current font.
fig.canvas.print_figure(bytes_io, **kw)
/usr/local/lib/python3.10/dist-packages/IPython/core/pylabtools.py:151: UserWarning: Glyph 50896 (\N{HANGUL SYLLABLE WEON}) missing from current font.
fig.canvas.print_figure(bytes_io, **kw)
/usr/local/lib/python3.10/dist-packages/IPython/core/pylabtools.py:151: UserWarning: Glyph 53216 (\N{HANGUL SYLLABLE KU}) missing from current font.
fig.canvas.print_figure(bytes_io, **kw)
/usr/local/lib/python3.10/dist-packages/IPython/core/pylabtools.py:151: UserWarning: Glyph 54256 (\N{HANGUL SYLLABLE PON}) missing from current font.
fig.canvas.print_figure(bytes_io, **kw)
/usr/local/lib/python3.10/dist-packages/IPython/core/pylabtools.py:151: UserWarning: Glyph 44536 (\N{HANGUL SYLLABLE GEU}) missing from current font.
fig.canvas.print_figure(bytes_io, **kw)
/usr/local/lib/python3.10/dist-packages/IPython/core/pylabtools.py:151: UserWarning: Glyph 47353 (\N{HANGUL SYLLABLE RUB}) missing from current font.
fig.canvas.print_figure(bytes_io, **kw)
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
/usr/local/lib/python3.10/dist-packages/IPython/core/pylabtools.py:151: UserWarning: Glyph 51201 (\N{HANGUL SYLLABLE JEOG}) missing from current font.
fig.canvas.print_figure(bytes_io, **kw)
/usr/local/lib/python3.10/dist-packages/IPython/core/pylabtools.py:151: UserWarning: Glyph 50857 (\N{HANGUL SYLLABLE YONG}) missing from current font.
fig.canvas.print_figure(bytes_io, **kw)
/usr/local/lib/python3.10/dist-packages/IPython/core/pylabtools.py:151: UserWarning: Glyph 48276 (\N{HANGUL SYLLABLE BEOM}) missing from current font.
fig.canvas.print_figure(bytes_io, **kw)
/usr/local/lib/python3.10/dist-packages/IPython/core/pylabtools.py:151: UserWarning: Glyph 50948 (\N{HANGUL SYLLABLE WI}) missing from current font.
fig.canvas.print_figure(bytes_io, **kw)
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
WARNING:matplotlib.font_manager:findfont: Font family 'NanumBarunGothic' not found.
