西风残钟 2023-04-06 00:01 采纳率: 0%
浏览 17

positional argument follows keyword argument

学Python制作词云过程中出现“positional argument follows keyword argument”报错,之前在在线编辑器中看了看说是问题在第12行。

img

from random import *
counts={}
with open("new.csv",'r',encoding='utf-8') as a:
    for t in a :
        t=t.strip()
        code,name=t.split(",")
        counts[name]=randint(30,100)
import matplotlib.pyplot as plt
from wordcloud import WordCloud
from imageio.v2 import imread
pic=imread('love.png')
wc=WordCloud(mask=pic, font_path== 'Songti.ttc',
               repeat=False,
               background_color='white',
               max_words=100,
               max_font_size=120,
               min_font_size=10,
               random_state=50,
               scale=1 )
wc.generate_from_frequencies(counts)
plt.imshow(wc)
plt.show()
  • 写回答

2条回答 默认 最新

  • threenewbee 2023-04-06 00:31
    关注

    wc=WordCloud(mask=pic, font_path== 'Songti.ttc',
    目测=你写成了==

    评论

报告相同问题?

问题事件

  • 创建了问题 4月6日