import pandas as pd
planets = pd.read_csv("planets.csv")

"""
Explanation: Visualization of Exoplanet Data using Python
by Yanal Kashou
This is a free dataset of exoplanets from the RDatasets.
The data was obtained from the URLs below of the .csv data file and the .html documentation file, respectively:  

https://raw.github.com/vincentarelbundock/Rdatasets/master/csv/HSAUR/planets.csv  
https://raw.github.com/vincentarelbundock/Rdatasets/master/doc/HSAUR/planets.html

Read in the Dataset
End of explanation
"""


planets.head(3)

planets = planets.rename(columns = {'Unnamed: 0':'Number'})
planets.shape

planets.describe()

p25 = planets.sample(n=25)
p25 = p25.drop('Number', 1)
p25

"""
Explanation: Brief Exploration
End of explanation
"""


import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import kendalltau
import seaborn as sns
sns.set(style="ticks")

sns.jointplot(planets.period, planets.eccen, kind="hex", stat_func=kendalltau, color="blue")
plt.show()

"""
Explanation: Plotting with PyPlot and Seaborn
Hexbin Plot
End of explanation
"""


sns.kdeplot(planets.period, planets.eccen)
plt.show()

"""
Explanation: Density Plot
End of explanation
"""


sns.lmplot('mass', 'eccen', data=planets, fit_reg=False)
plt.show()

"""
Explanation: Simple Scatter Plot
End of explanation
"""


