묻고 답해요
141만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결파이썬 증권 데이터 수집과 분석으로 신호와 소음 찾기
데이터 시각화 도구 소개와 한글폰트 설정 에러
데이터 시각화 도구 소개와 한글폰트 설정 에러 위에 강좌를 실습 중에 에러가 발생합니다. 우분투, 주피터노트북 사용, 나눔바른고딕 폰트 있습니다. 도와주세요!!!! 1. 우분투에 나눔바른고딕 폰트 있음: 제가 실습하는 환경 (base) root@gd-virtual-machine:/usr/share/fonts/truetype/nanum# lsb_release -d Description: Ubuntu 20.04.4 LTS (base) root@gd-virtual-machine:/usr/share/fonts/truetype/nanum# (base) root@gd-virtual-machine:/usr/share/fonts/truetype/nanum# (base) root@gd-virtual-machine:/usr/share/fonts/truetype/nanum# ls NanumBarunGothic.ttf NanumBarunGothic.ttf (base) root@gd-virtual-machine:/usr/share/fonts/truetype/nanum# 2. 에러 발생(강의 코드) def get_font_family(): import platform system_name = platform.system() if system_name == "Darwin" : font_family = "AppleGothic" elif system_name == "Windows": font_family = "Malgun Gothic" else: import matplotlib.font_manager as fm fontpath = '/usr/share/fonts/truetype/nanum/NanumBarunGothic.ttf' font = fm.FontProperties(fname=fontpath, size=9) fm._rebuild() font_family = "NanumBarunGothic" return font_family AttributeError Traceback (most recent call last) /tmp/ipykernel_1662/385091406.py in <module> ----> 1 get_font_family() /tmp/ipykernel_1662/3056356644.py in get_font_family() 11 fontpath = '/usr/share/fonts/truetype/nanum/NanumBarunGothic.ttf' 12 font = fm.FontProperties(fname=fontpath, size=9) ---> 13 fm._rebuild() 14 font_family = "NanumBarunGothic" 15 return font_family AttributeError: module 'matplotlib.font_manager' has no attribute '_rebuild' 3. 에러 발생(수업자료 소스 코드) def get_font_family(): """ 시스템 환경에 따른 기본 폰트명을 반환하는 함수 """ import platform system_name = platform.system() if system_name == "Darwin" : font_family = "AppleGothic" elif system_name == "Windows": font_family = "Malgun Gothic" else: # Linux(colab) !apt-get install fonts-nanum -qq > /dev/null !fc-cache -fv import matplotlib as mpl mpl.font_manager._rebuild() findfont = mpl.font_manager.fontManager.findfont mpl.font_manager.findfont = findfont mpl.backends.backend_agg.findfont = findfont font_family = "NanumBarunGothic" return font_family /usr/share/fonts: caching, new cache contents: 0 fonts, 6 dirs /usr/share/fonts/X11: caching, new cache contents: 0 fonts, 4 dirs /usr/share/fonts/X11/Type1: caching, new cache contents: 8 fonts, 0 dirs /usr/share/fonts/X11/encodings: caching, new cache contents: 0 fonts, 1 dirs /usr/share/fonts/X11/encodings/large: caching, new cache contents: 0 fonts, 0 dirs /usr/share/fonts/X11/misc: caching, new cache contents: 89 fonts, 0 dirs /usr/share/fonts/X11/util: caching, new cache contents: 0 fonts, 0 dirs /usr/share/fonts/cMap: caching, new cache contents: 0 fonts, 0 dirs /usr/share/fonts/cmap: caching, new cache contents: 0 fonts, 5 dirs /usr/share/fonts/cmap/adobe-cns1: caching, new cache contents: 0 fonts, 0 dirs /usr/share/fonts/cmap/adobe-gb1: caching, new cache contents: 0 fonts, 0 dirs /usr/share/fonts/cmap/adobe-japan1: caching, new cache contents: 0 fonts, 0 dirs /usr/share/fonts/cmap/adobe-japan2: caching, new cache contents: 0 fonts, 0 dirs /usr/share/fonts/cmap/adobe-korea1: caching, new cache contents: 0 fonts, 0 dirs /usr/share/fonts/opentype: caching, new cache contents: 0 fonts, 3 dirs /usr/share/fonts/opentype/malayalam: caching, new cache contents: 7 fonts, 0 dirs /usr/share/fonts/opentype/noto: caching, new cache contents: 28 fonts, 0 dirs /usr/share/fonts/opentype/urw-base35: caching, new cache contents: 35 fonts, 0 dirs /usr/share/fonts/truetype: caching, new cache contents: 0 fonts, 50 dirs /usr/share/fonts/truetype/Gargi: caching, new cache contents: 1 fonts, 0 dirs /usr/share/fonts/truetype/Gubbi: caching, new cache contents: 1 fonts, 0 dirs /usr/share/fonts/truetype/Nakula: caching, new cache contents: 1 fonts, 0 dirs /usr/share/fonts/truetype/Navilu: caching, new cache contents: 1 fonts, 0 dirs /usr/share/fonts/truetype/Sahadeva: caching, new cache contents: 1 fonts, 0 dirs /usr/share/fonts/truetype/Sarai: caching, new cache contents: 1 fonts, 0 dirs /usr/share/fonts/truetype/abyssinica: caching, new cache contents: 1 fonts, 0 dirs /usr/share/fonts/truetype/arphic: caching, new cache contents: 0 fonts, 0 dirs /usr/share/fonts/truetype/dejavu: caching, new cache contents: 6 fonts, 0 dirs /usr/share/fonts/truetype/droid: caching, new cache contents: 1 fonts, 0 dirs /usr/share/fonts/truetype/fonts-beng-extra: caching, new cache contents: 6 fonts, 0 dirs /usr/share/fonts/truetype/fonts-deva-extra: caching, new cache contents: 3 fonts, 0 dirs /usr/share/fonts/truetype/fonts-gujr-extra: caching, new cache contents: 5 fonts, 0 dirs /usr/share/fonts/truetype/fonts-guru-extra: caching, new cache contents: 1 fonts, 0 dirs /usr/share/fonts/truetype/fonts-kalapi: caching, new cache contents: 1 fonts, 0 dirs /usr/share/fonts/truetype/fonts-orya-extra: caching, new cache contents: 1 fonts, 0 dirs /usr/share/fonts/truetype/fonts-telu-extra: caching, new cache contents: 2 fonts, 0 dirs /usr/share/fonts/truetype/fonts-yrsa-rasa: caching, new cache contents: 10 fonts, 0 dirs /usr/share/fonts/truetype/freefont: caching, new cache contents: 12 fonts, 0 dirs /usr/share/fonts/truetype/kacst: caching, new cache contents: 15 fonts, 0 dirs /usr/share/fonts/truetype/kacst-one: caching, new cache contents: 2 fonts, 0 dirs /usr/share/fonts/truetype/lao: caching, new cache contents: 1 fonts, 0 dirs /usr/share/fonts/truetype/liberation: caching, new cache contents: 16 fonts, 0 dirs /usr/share/fonts/truetype/liberation2: caching, new cache contents: 12 fonts, 0 dirs /usr/share/fonts/truetype/lohit-assamese: caching, new cache contents: 1 fonts, 0 dirs /usr/share/fonts/truetype/lohit-bengali: caching, new cache contents: 1 fonts, 0 dirs /usr/share/fonts/truetype/lohit-devanagari: caching, new cache contents: 1 fonts, 0 dirs /usr/share/fonts/truetype/lohit-gujarati: caching, new cache contents: 1 fonts, 0 dirs /usr/share/fonts/truetype/lohit-kannada: caching, new cache contents: 1 fonts, 0 dirs /usr/share/fonts/truetype/lohit-malayalam: caching, new cache contents: 1 fonts, 0 dirs /usr/share/fonts/truetype/lohit-oriya: caching, new cache contents: 1 fonts, 0 dirs /usr/share/fonts/truetype/lohit-punjabi: caching, new cache contents: 1 fonts, 0 dirs /usr/share/fonts/truetype/lohit-tamil: caching, new cache contents: 1 fonts, 0 dirs /usr/share/fonts/truetype/lohit-tamil-classical: caching, new cache contents: 1 fonts, 0 dirs /usr/share/fonts/truetype/lohit-telugu: caching, new cache contents: 1 fonts, 0 dirs /usr/share/fonts/truetype/lyx: caching, new cache contents: 11 fonts, 0 dirs /usr/share/fonts/truetype/malayalam: caching, new cache contents: 10 fonts, 0 dirs /usr/share/fonts/truetype/nanum: caching, new cache contents: 31 fonts, 0 dirs /usr/share/fonts/truetype/noto: caching, new cache contents: 2 fonts, 0 dirs /usr/share/fonts/truetype/openoffice: caching, new cache contents: 1 fonts, 0 dirs /usr/share/fonts/truetype/padauk: caching, new cache contents: 4 fonts, 0 dirs /usr/share/fonts/truetype/pagul: caching, new cache contents: 1 fonts, 0 dirs /usr/share/fonts/truetype/samyak: caching, new cache contents: 1 fonts, 0 dirs /usr/share/fonts/truetype/samyak-fonts: caching, new cache contents: 3 fonts, 0 dirs /usr/share/fonts/truetype/sinhala: caching, new cache contents: 1 fonts, 0 dirs /usr/share/fonts/truetype/tibetan-machine: caching, new cache contents: 1 fonts, 0 dirs /usr/share/fonts/truetype/tlwg: caching, new cache contents: 58 fonts, 0 dirs /usr/share/fonts/truetype/ttf-bitstream-vera: caching, new cache contents: 10 fonts, 0 dirs /usr/share/fonts/truetype/ttf-khmeros-core: caching, new cache contents: 2 fonts, 0 dirs /usr/share/fonts/truetype/ubuntu: caching, new cache contents: 14 fonts, 0 dirs /usr/share/fonts/type1: caching, new cache contents: 0 fonts, 1 dirs /usr/share/fonts/type1/urw-base35: caching, new cache contents: 35 fonts, 0 dirs /root/anaconda3/fonts: skipping, no such directory /root/.local/share/fonts: skipping, no such directory /root/.fonts: skipping, no such directory /usr/share/fonts/X11: skipping, looped directory detected /usr/share/fonts/cMap: skipping, looped directory detected /usr/share/fonts/cmap: skipping, looped directory detected /usr/share/fonts/opentype: skipping, looped directory detected /usr/share/fonts/truetype: skipping, looped directory detected /usr/share/fonts/type1: skipping, looped directory detected /usr/share/fonts/X11/Type1: skipping, looped directory detected /usr/share/fonts/X11/encodings: skipping, looped directory detected /usr/share/fonts/X11/misc: skipping, looped directory detected /usr/share/fonts/X11/util: skipping, looped directory detected /usr/share/fonts/cmap/adobe-cns1: skipping, looped directory detected /usr/share/fonts/cmap/adobe-gb1: skipping, looped directory detected /usr/share/fonts/cmap/adobe-japan1: skipping, looped directory detected /usr/share/fonts/cmap/adobe-japan2: skipping, looped directory detected /usr/share/fonts/cmap/adobe-korea1: skipping, looped directory detected /usr/share/fonts/opentype/malayalam: skipping, looped directory detected /usr/share/fonts/opentype/noto: skipping, looped directory detected /usr/share/fonts/opentype/urw-base35: skipping, looped directory detected /usr/share/fonts/truetype/Gargi: skipping, looped directory detected /usr/share/fonts/truetype/Gubbi: skipping, looped directory detected /usr/share/fonts/truetype/Nakula: skipping, looped directory detected /usr/share/fonts/truetype/Navilu: skipping, looped directory detected /usr/share/fonts/truetype/Sahadeva: skipping, looped directory detected /usr/share/fonts/truetype/Sarai: skipping, looped directory detected /usr/share/fonts/truetype/abyssinica: skipping, looped directory detected /usr/share/fonts/truetype/arphic: skipping, looped directory detected /usr/share/fonts/truetype/dejavu: skipping, looped directory detected /usr/share/fonts/truetype/droid: skipping, looped directory detected /usr/share/fonts/truetype/fonts-beng-extra: skipping, looped directory detected /usr/share/fonts/truetype/fonts-deva-extra: skipping, looped directory detected /usr/share/fonts/truetype/fonts-gujr-extra: skipping, looped directory detected /usr/share/fonts/truetype/fonts-guru-extra: skipping, looped directory detected /usr/share/fonts/truetype/fonts-kalapi: skipping, looped directory detected /usr/share/fonts/truetype/fonts-orya-extra: skipping, looped directory detected /usr/share/fonts/truetype/fonts-telu-extra: skipping, looped directory detected /usr/share/fonts/truetype/fonts-yrsa-rasa: skipping, looped directory detected /usr/share/fonts/truetype/freefont: skipping, looped directory detected /usr/share/fonts/truetype/kacst: skipping, looped directory detected /usr/share/fonts/truetype/kacst-one: skipping, looped directory detected /usr/share/fonts/truetype/lao: skipping, looped directory detected /usr/share/fonts/truetype/liberation: skipping, looped directory detected /usr/share/fonts/truetype/liberation2: skipping, looped directory detected /usr/share/fonts/truetype/lohit-assamese: skipping, looped directory detected /usr/share/fonts/truetype/lohit-bengali: skipping, looped directory detected /usr/share/fonts/truetype/lohit-devanagari: skipping, looped directory detected /usr/share/fonts/truetype/lohit-gujarati: skipping, looped directory detected /usr/share/fonts/truetype/lohit-kannada: skipping, looped directory detected /usr/share/fonts/truetype/lohit-malayalam: skipping, looped directory detected /usr/share/fonts/truetype/lohit-oriya: skipping, looped directory detected /usr/share/fonts/truetype/lohit-punjabi: skipping, looped directory detected /usr/share/fonts/truetype/lohit-tamil: skipping, looped directory detected /usr/share/fonts/truetype/lohit-tamil-classical: skipping, looped directory detected /usr/share/fonts/truetype/lohit-telugu: skipping, looped directory detected /usr/share/fonts/truetype/lyx: skipping, looped directory detected /usr/share/fonts/truetype/malayalam: skipping, looped directory detected /usr/share/fonts/truetype/nanum: skipping, looped directory detected /usr/share/fonts/truetype/noto: skipping, looped directory detected /usr/share/fonts/truetype/openoffice: skipping, looped directory detected /usr/share/fonts/truetype/padauk: skipping, looped directory detected /usr/share/fonts/truetype/pagul: skipping, looped directory detected /usr/share/fonts/truetype/samyak: skipping, looped directory detected /usr/share/fonts/truetype/samyak-fonts: skipping, looped directory detected /usr/share/fonts/truetype/sinhala: skipping, looped directory detected /usr/share/fonts/truetype/tibetan-machine: skipping, looped directory detected /usr/share/fonts/truetype/tlwg: skipping, looped directory detected /usr/share/fonts/truetype/ttf-bitstream-vera: skipping, looped directory detected /usr/share/fonts/truetype/ttf-khmeros-core: skipping, looped directory detected /usr/share/fonts/truetype/ubuntu: skipping, looped directory detected /usr/share/fonts/type1/urw-base35: skipping, looped directory detected /usr/share/fonts/X11/encodings/large: skipping, looped directory detected /root/anaconda3/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 --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) /tmp/ipykernel_1662/385091406.py in <module> ----> 1 get_font_family() /tmp/ipykernel_1662/3296694249.py in get_font_family() 16 17 import matplotlib as mpl ---> 18 mpl.font_manager._rebuild() 19 findfont = mpl.font_manager.fontManager.findfont 20 mpl.font_manager.findfont = findfont AttributeError: module 'matplotlib.font_manager' has no attribute '_rebuild'
-
해결됨일잘하는 마케터, MD에게 꼭 필요한 파이썬 데이터 분석
데이터시각화 파트에서 사용되는 엑셀파일은 어디서 받을 수있나요?
안녕하세요. 선생님, 강의 잘 듣고 있습니다~ 데이터 시각화에서 사용되는 엑셀파일들은 어디서 받을 수 있을지 문의드립니다. 강의에는 코드 url만 있어서요 ㅠㅠ 감사합니다.