我试图在PowerBI中运行一个简单的Python脚本以使其正常运行,但是它只会出现很多错误。我试图:
我有一个屏幕截图显示了我的问题(所有内容都在一个屏幕下面)。对于x和y,标记为“标签”和“数据”的数据仅为a,b,c和1,2,3。
此处的代码:
# The following code to create a dataframe and remove duplicated rows is always executed and acts as
a preamble for your script:
dataset = pandas.DataFrame(Data, Label)
# dataset = dataset.drop_duplicates()
# Paste or type your script code here:
import matplotlib.pyplot as plt
dataset.plot(kind='scatter', x='Label', y='Data', color='red')
plt.show()
答案 0 :(得分:0)
您需要注释掉以下内容:
dataset = pandas.DataFrame(Data, Label)
即使已被“注释掉”,它也会运行。只是为可视化设置了数据框架,这是一个不起作用的示例,如果未注释掉,则为
希望有帮助