PowerBI 没有将数据字段传递给 Python 脚本

PowerBI is not passing over the datafield to the Python script

我正在尝试 运行 在 PowerBI 中创建一个简单的 Python 脚本以使其正常工作,但它只提供了许多 errors.I 尝试过的:

  1. 重新安装 Numpy 和 Matplotlib。
  2. 尝试使用 Python 3.5 和 3.6
  3. 卸载 Conda 并重新安装

我有一张显示我的问题的屏幕截图(下面的一个屏幕显示所有内容)。对于标记为 "Label" 和 "Data".

的 x 和 y,数据只是 a、b、c 和 1、2、3

Screen shot of error and code

代码在这里:

# 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() 

您需要注释掉以下内容:

dataset = pandas.DataFrame(Data, Label)

即使它是 'commented out',它也会 运行。它只是为视觉设置数据框,这里是一个 none 工作示例,如果它没有被注释掉的话:

希望对您有所帮助