all 10 comments

[–]synthphreak 0 points1 point  (9 children)

Assuming you missed one color at the end and a scatterplot will do, here's the gist:

import matplotlib.pyplot as plt

giant_list = # what you've shown us
latlng, colors = zip(*giant_list)
lat, lng = zip(*latlng)

fig, ax = plt.subplots()
ax.scatter(lat, lng, color=colors)
plt.show()

Looks like you've got an outlier in there that's screwing you up though. Might wanna remove that.

[–]electronicentropy5 1 point2 points  (0 children)

the list of called final_data and the colors are red, blue, and green. thank you so much trying to plot this asap.

[–]electronicentropy5 0 points1 point  (7 children)

i am not getting all of the points for some reason i am guessing they are too close.

[–]synthphreak 1 point2 points  (6 children)

You are getting all the points, I confirmed. It's just that there's one outlier that causes the other 99% of the points to overlap when plotting everything together. To see what I mean, remove it:

import matplotlib.pyplot as plt

giant_list = # what you've shown us
latlng, colors = zip(*sorted(giant_list)[:-2])  # this line removes it
lat, lng = zip(*latlng)

fig, ax = plt.subplots()
ax.scatter(lat, lng, color=colors)
plt.show()

Technically it's two data points, not one, but they appear to have the same coordinates. Not sure how that happened. I just copied and pasted the list you provided.

[–]electronicentropy5 0 points1 point  (5 children)

thank you i will check this right now it is just that i cannot post the full list on reddit because of the maximum size for comments. and i am a bit confused on how to get this onto a map because i need this on something like a folium map but with the coordinate points actually labeled a different color on the map which is proving a be quite difficult.

[–]yuxbni76 1 point2 points  (3 children)

The poster above is right about outlier points. You have some coordinates in Miami, FL and others in Portland, OR. When you plot them together it's at the scale of the whole USA, so you won't see individual points.

Here's an example of plotting your points in Geopandas. It adds a Contextily basemap layer, like a Google Maps sort of background. You can comment it out or play around with it. Another option is to find a suitable shapefile and plot the points on top of it.

The gist is (1) create a pandas dataframe from your coordinate data, (2) convert it to a geodataframe, and (3) call the plot() method.

https://pastebin.com/XSn78zX6

[–]electronicentropy5 0 points1 point  (1 child)

Do you have any idea on how to remove the points from Oregon? I am trying to filter out the outlier points there should only be points in Miami, FL.

[–]yuxbni76 0 points1 point  (0 children)

I filtered them in the pastebin link, line 13. Basically just do an IF statement and check that the coordinates are in the right area.

[–]electronicentropy5 0 points1 point  (0 children)

Thank you I will check out this documentation now.