Forum Discussion

009co's avatar
009co
Icon for Helper IV rankHelper IV
4 years ago
Solved

Basic Power BI Python weirdness - getting "Python script error. KeyError: '

Very basic Power BI Python weirdness happening.   I create Python visual, drag two columns in values, one column is a text value and the other column is a whole number.   I just want to plot the ...
  • Greg_Deckler's avatar
    4 years ago

    009co 

    # 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(Status, Days)
    # dataset = dataset.drop_duplicates()
    
    import matplotlib.pyplot as plt
    dataset.plot(x='Status', y='Days', kind='bar')
    plt.show()