In your first homework you are asked to read two data files:

💡 IMPORTANT:

I’m not a coding/CS expert. Our goal here is to learn from each other. If you notice something that I said and is generally wrong, please feel free to correct me. When helping each other it’s important to be polite and respectful.

Most of my tutorials will be in Python. If you are using another coding language and want to read these data files, please reach out, and I will be happy to help. I can’t promise to you that I will know how to do so, but with some magical Googling ✨ we can find a solution 😄

Remember to never tool shame others. Just because you might have a fancier way solving the homework, does not mean you need to be rude about it or forcefully share it with others.

Coding:

The data we are dealing with in this homework is tabular. In most scenarios when regarding any sorts of data analysis, we usually encounter tabular data structures (because they are nice and very organized!). The nice thing is that they are very easy to use with Python. Here are some of my favorite Python packages that can read tabular data:

In this scenario, we can simply use astropy.io.ascii to read the table as an astropy.table object. See how I read the data:

from astropy.io import ascii

# Let's assume that my MIST_iso.cmd is sitting in one directory behind called data/
data_path = '../data'
iso_table = ascii.read(f"{data_path}/MIST_iso.cmd")

#Same thing if you want to read the Gaia EDR3 table
data = ascii.read(f"{data_path}/Gao2018_GaiaEDR3.csv")

#If you want a list of all the column headers; 
print (iso_table.keys())

# Let's say I want to call the log_g column:
print (iso_table['log_g'])

General Tips