Ask Anything Monday - Weekly Thread

Trying and failing to plot the data found on this link:

http://www-personal.umich.edu/~mejn/computational-physics/stars.txt

If you don't like clicking random sites it's basically just two columns of data with a load of rows, so an easy x-y plot in theory.

Here's what I have, it prints all the data however it's surrounded by " b' ' ", and the new line is specified during the printing everywhere as " \n ". Plotting this gives rubbish haha.

The code:

from urllib.request import urlopen

link = "http://www-personal.umich.edu/~mejn/computational-physics/stars.txt"

f = urlopen(link)
myfile = f.read()
print(myfile)

I'm guessing somewhere I'll need to specifiy a delimiter of the space key.

/r/learnpython Thread