Python Tutorial: Exoplanet and Star Data Analysis
Find the code files here: https://github.com/whatdamath/spaceengine
Hello and welcome to What Da Math!
In this video, we will talk about analysis exoplanet data with Python
Links:
https://exoplanetarchive.ipac.caltech.edu/
https://exoplanets.nasa.gov
https://seaborn.pydata.org/examples/horizontal_boxplot.html
Code:
%matplotlib inline
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
planets = pd.read_csv("planets.csv", sep=',')
sns.set(style="ticks")
# Initialize the figure with a logarithmic x axis
f, ax = plt.subplots(figsize=(7, 6))
ax.set_xscale("log")
# Load the example planets dataset
#planets = sns.load_dataset("planets")
# replace pl_pnum and st_mass with other column names
sns.boxplot(x="pl_pnum", y="st_mass", data=planets)
# Add in points to show each observation
sns.swarmplot(x="pl_pnum", y="st_mass", data=planets,
size=2, color=".3", linewidth=0)
# Tweak the visual presentation
ax.xaxis.grid(True)
ax.set(ylabel="")
sns.despine(trim=True, left=True)
Support this channel on Patreon to help me make this a full time job:
https://www.patreon.com/whatdamath
Space Engine is available for free here: http://spaceengine.org
Enjoy and please subscribe.
Twitter: https://twitter.com/WhatDaMath
Facebook: https://www.facebook.com/whatdamath
Twitch: http://www.twitch.tv/whatdamath
Bitcoins to spare? Donate them here to help this channel grow!
1GFiTKxWyEjAjZv4vsNtWTUmL53HgXBuvu