/astro-pandas-tutorials

These are tutorials on how to use Pandas Data Frames for professional astronomy. Import common types of astronomical data, filter, sort, and plot. Contributions welcome!

Primary LanguageJupyter Notebook

astro-pandas-tutorials

These are tutorials on how to use Pandas Data Frames for professional astronomy. Import common types of astronomical data, filter, sort, and plot. Contributions welcome! Started by Jane Rigby, Oct. 2016.

Tutorial #0, Why Pandas?, illustrates the power of Pandas for dealing with astronomical data.

Tutorial #1, Get data into Pandas, shows examples of importing ascii tables, machine-readable tables from the Astrophysical Journal, binary fits tables, and csv tables. It relies on astropy.tables to read the astronomy-specific formats, and then convert via Tables.table.to_pandas().

Tutorial #2, Basic filtering, visualization, and math, shows how to work with a data frame, do math on it, and make simple plots. The example is a machine-readable table from a recent ApJ paper.

Tutorial #3, MRD to Pandas to Seaborn, grabs a machine-readable table from an ApJS journal article, converts to a Pandas data frame (via astropy Tables), filters the data, and plots a density plot using seaborn.

Tutorial #4, Filter 3D-HST catalog and plot Re, sersic index, shows off the power of Pandas. This tutorial reads in two large catalogs, uses the parameters in one catalog to filter the second catalog, and then makes groovy plots.

Tutoral #5, Plot directly from Pandas, shows how you can directly plot a Pandas DataFrame, in a matplotlib-compatible way, which may help with quick-look visualization.

Tutorial #6, Tables - Pandas and Astropy, is in progress. It shows where astropy and pandas currently don't play well together.

Tutoral #7 is your chance to contribute!

Other resources: The O'Reilly book Python for Data Analysis: Data Wrangling with Pandas, NumPy, and IPython, by Wes McKinney (the creator of Pandas), is getting rave reviews.

Here's a trove of Brown Dwarf examples using Pandas.