in this video there is scatter plot command i am facing an ambiguity in that command can you please explain
scatterplotCommand
Hey,
If you have 2 columns in X matrix and you want to display a scatter plot on x axis and y axis. Then you can use this code :
x = X[:,0] # means all rows in X matrix but only the first column y = X[:,1] # means all rows in X matrix but only the second column # this will put first column on x axis and second column values on y axis plt.scatter(x, y)
Thanks
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.