본문 바로가기

ETC/오류고치기

2024 COLAB 코랩 워드클라우드 한글 깨짐 쉬운 해결법

!apt-get install fonts-nanum*
!apt-get install fontconfig
!pip install WordCloud
!pip install konlpy
!pip install wordcloud matplotlib PIL
from wordcloud import WordCloud
import matplotlib.pyplot as plt
from PIL import Image
import numpy as np
    word_freq = Counter(text.split(","))
    wordcloud = WordCloud(width=800, height=400, background_color='white', font_path='/content/NanumBarunGothic.ttf').generate_from_frequencies(word_freq)
728x90