You are given an array of points of size 300x2 in the file /cxldata/mltut/points.csv in CSV format.
Each row in this file gives the (x, y) coordinates of a point on a map. Make a scatter plot of these points as per the instructions given below, and use the scatter plot to guess how many clusters there are.
Given a CSV file in the folder /cxldata/mltut/points.csv. You can load as a DataFrame in the notebook using pandas using the following way:
import pandas as pd
pointsdf = pd.read_csv("/cxldata/mltut/points.csv");
Now, convert it into a numpy array
import numpy as np
points = np.array(pointsdf)
Create an array called xs that contains the values of points[:,0] - that is, column 0 of points.
your code comes here
Create an array called ys that contains the values of points[:,1] - that is, column 1 of points.
your code comes here
You can import it in the following way:
import matplotlib.pyplot as plt
Make a scatter plot by passing xs and ys to the plt.scatter() function. Call the plt.show() function to show your plot.
your code comes here
How many clusters do you see?
Taking you to the next exercise in seconds...
Want to create exercises like this yourself? Click here.
No hints are availble for this assesment
Please login to comment
14 Comments
Hi
I could not access the file
What error are you facing?
Upvote ShareI am getting the Following Error
jupyter.f.cloudxlab.com took too long to respond & Lab Console is Not Working.
Upvote ShareHi,
I checked from my end and it is working fine now. Could you please check once and let me know if you are still facing this issue?
Thanks.
Upvote ShareIts Resolve. Thankyou!
Upvote ShareHi,
It may be due to a poor internet connection.
Thanks.
Upvote Sharecan you please give me the pull command, steps how to pull this file?
Upvote ShareHi,
This file is already there in this location, you do not need to pull it.
Thanks.
Upvote ShareI am getting file does not exist ...please reply
Upvote ShareHi,
Would request you to share a screenshot of your code and the error that you are getting.
Thanks.
-- Rajtilak Bhattacharjee
Upvote ShareHi
Upvote ShareI have written a code as required and got the answer also i.e. three clusters but stillunable to submit.
Thanks
Hi,
Would suggest you to restart your server using the link below and then try once again:
https://discuss.cloudxlab.c...
Thanks.
-- Rajtilak Bhattacharjee
Upvote Share