0

I want to make a graph order frequency of each city. For this, I am trying to pass cities name on x-axis and their number on y-axis. I keep facing this error TypeError: bar() missing 1 required positional argument: 'height' . Here is the code:

order_status = df.Order_Status.value_counts()

#making separate column for unique cities 
unique_city = df.City.value_counts()

plt.bar(x=unique_city.index, y=unique_city.values)

Any help would be highly appreciated.

R. pro
  • 3
  • 4
  • Replace `y` with `height` https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.bar.html – Wouter Mar 16 '22 at 06:53

1 Answers1

0

Use:

unique_city.plot.bar()

Or like @ commented:

Replace y with height matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.bar.html

jezrael
  • 822,522
  • 95
  • 1,334
  • 1,252