Created
April 1, 2016 18:53
-
-
Save barentsen/1267b3956d25d26ad1a09544badeb067 to your computer and use it in GitHub Desktop.
Compute the median radius of all confirmed Kepler planets using Python and the NASA Exoplanet Archive.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Compute the median radius of all confirmed Kepler planets.""" | |
import pandas as pd | |
# Fetch the table of confirmed exoplanets from NExSci | |
planets = pd.read_csv('http://exoplanetarchive.ipac.caltech.edu/cgi-bin/nstedAPI/nph-nstedAPI?table=exoplanets&select=*') | |
# Select the Kepler planets | |
kepler_planets = planets[planets.pl_kepflag == 1] | |
# Do your statistics | |
print(kepler_planets.pl_rade.median()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment