xlabel,ylabel不工作了str'object不是callab

2024-10-01 09:38:17 发布

您现在位置:Python中文网/ 问答频道 /正文

我不会放弃我的语法,因为他们会显示我的语法错误。这是我的密码。在

file = 'SAW data omgekeerd goed.csv'
data = pd.read_csv(file, sep = ';', parse_dates= True, index_col = 0, dayfirst = True)

plt.plot(data['0.005 (B4.01) Studielandschap'])
plt.xlabel('Month')
plt.ylabel('Value')
plt.show()

File "C:/Users/steven/Documents/BIM/Minor Data Science/Outlier detection SAW/Anomaly detection 0.1.py", line 24, in plt.xlabel('Month') TypeError: 'str' object is not callable


Tags: csvtrue密码data语法pltfilepd
1条回答
网友
1楼 · 发布于 2024-10-01 09:38:17

你在这之前做过plt.xlabel='month'吗? 这将导致导入函数的更改,从而导致类型错误。 重新启动并运行,应该没问题。在

编辑:如果由于某种原因你不想重新启动。 您可以通过以下方式重新加载模块

from importlib import reload
matplotlib=reload(matplotlib)

如果不是3.4+

相关问题 更多 >