首页 > 解决方案 > 在 python 中使用 ggplot 的 Power BI

问题描述

我在 Python 中为 Power BI 创建了以下代码。这没有显示任何东西。

    # 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(Company, Target)
    # dataset = dataset.drop_duplicates()

    # Paste or type your script code here:
    import matplotlib.pyplot as plt 
    from plotnine import *
    from plotnine.data import mpg

    (ggplot(dataset)         # data 
     + aes(x='Company')    # variable 
     + geom_bar(size=20)) # ype of plot 

    plt.show()

标签: python-3.xpowerbipython-ggplot

解决方案


推荐阅读