1

enter image description here

I have tried the below code in python:

y = df.drop(["userid"], axis=1)
plt.figure(figsize=(20, 20))
plt.scatter(df['userid'], y)
plt.xlabel('userid')
plt.ylabel('privilages')

But I get an error which says 'x and y must be the same size'

P H
  • 294
  • 1
  • 3
  • 16
  • scatter() expects 2 flat arrays (or 2 two-dimensional arrays that it internally flattens) of the same size for x and y coordinates. What are the (x, y) coordinates that you expect to see in this plot? – zzz Oct 15 '19 at 13:23
  • If you are looking at plotting multiple points for the same X coordinate, then this might help - https://stackoverflow.com/questions/34280444/python-scatter-plot-with-multiple-y-values-for-each-x – zzz Oct 15 '19 at 13:24
  • I want to plot the user id and privilages on x and y axis respectively. and the co-oridates shoould be (u1,p1), (u2,p2)..... – P H Oct 15 '19 at 14:15

0 Answers0