<jupyter_start><jupyter_text>In search of life  Abstract  Requirement Specification, Necessary Imports<jupyter_code>import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as clr
import matplotlib.cm as cm
from mpl_toolkits.mplot3d import Axes3D
import seaborn as sns
from scipy.stats.stats import pearsonr
allExoplanets = pd.read_csv('confirmed_exoplanets.csv',low_memory=False,error_bad_lines=False)
print('Data Points, Features = '+str(allExoplanets.shape))
print('All Features of PHL-EC:\n\n')
for i in allExoplanets:
    print("{feature}".format(feature=i),sep='\t')
allExoplanets
sc = ['P. SFlux Max (EU)','P. SFlux Mean (EU)','P. SFlux Min (EU)']
allExoplanets[sc]
## object type scienctific notation ke float korar portion ## last checkpoint
allExoplanets['P. SFlux Max (EU)'] = pd.to_numeric(allExoplanets['P. SFlux Max (EU)'],errors='coerce')
allExoplanets['P. SFlux Mean (EU)'] = pd.to_numeric(allExoplanets['P. SFlux Mean (EU)'],errors='coerce')
allExoplanets['P. SFlux Min (EU)'] = pd.to_numeric(allExoplanets['P. SFlux Min (EU)'],errors='coerce')
allExoplanets[sc]
cat = len(allExoplanets.select_dtypes(include=['object']).columns)
num = len(allExoplanets.select_dtypes(include=['int64','float64']).columns)
print('Features of allExoplanets consists of ', cat, 'categorical', ' and ',
num, 'numerical features')
print('\n\nCategorical Features:\n ')
for i in allExoplanets.select_dtypes(include=['object']).columns:
    print("{feature}".format(feature=i),end='\t')
print('\n\nNumerical Features:\n ')
for i in allExoplanets.select_dtypes(include=['int64','float64']).columns:
    print("{feature}".format(feature=i),end='\t')
desc = pd.DataFrame()
for c in allExoplanets:
    desc[c]=(allExoplanets[c].describe())
desc.head()
#allExoplanets.isnull()
###print(allExoplanets.isnull().sum() * 100 / len(allExoplanets),end='\t\t\t\t')
f, ax = plt.subplots(figsize=(10, 15))
stat_count = allExoplanets.isnull().sum()
sns.set(style="darkgrid")
sns.barplot(stat_count.values,stat_count.index, alpha=0.9)
plt.title('Frequency Distribution Empty Cells with respect to Features')
plt.xlabel('Number of Miss', fontsize=12)
plt.ylabel('Features', fontsize=12)
plt.show()
x = allExoplanets['S. RA (hrs)']*14
y = allExoplanets['S. DEC (deg)']
#area = np.pi * allExoplanets['S. Radius (SU)']**2
csp=plt.cm.RdYlBu(np.linspace(0,1,len(allExoplanets)))
fig,ax = plt.subplots(figsize=(14,7))
dists = allExoplanets['S. Distance (pc)']
dists.fillna(value=np.mean(dists),inplace=True)
ax=plt.scatter(x,y,s=1000/dists**.5,alpha=0.3,c=csp,cmap=cm.coolwarm)
#ax=plt.scatter(x, y, s=area, c = colors, cmap = colormap, alpha=0.3)
plt.xlabel('RA')
plt.ylabel('Dec')
plt.title('Galactic Map in RA/Dec',size=20)
plt.figure(1,figsize=(16,12))
plt.show()
## x = allExoplanets['S. RA (hrs)']*14
y = allExoplanets['S. DEC (deg)']
#area = np.pi * allExoplanets['S. Radius (SU)']**2
csp=plt.cm.RdBu(np.linspace(0,1,len(allExoplanets)))
fig,ax = plt.subplots()
dists = allExoplanets['S. Distance (pc)']
dists.fillna(value=np.mean(dists),inplace=True)
ax=plt.scatter(x,y,s=1000/dists,alpha=0.3,c=csp,cmap=cm.coolwarm)
#ax=plt.scatter(x, y, s=area, c = colors, cmap = colormap, alpha=0.3)
plt.xlabel('RA')
plt.ylabel('Dec')
plt.title('Galactic Map in RA/Dec',size=20)
plt.figure(1,figsize=(16,12))
plt.annotate('Earth', xy = (0,0),
xytext = (560, 0),
textcoords = 'offset points', ha = 'right', va = 'bottom',
bbox = dict(boxstyle = 'round,pad=0.5', fc = 'blue', alpha = 0.05),
arrowprops = dict(arrowstyle = '->',connectionstyle = 'arc3,rad=0')
)
plt.annotate('Mars', xy = (319.3208,18.6386),
xytext = (350, 0),
textcoords = 'offset points', ha = 'right', va = 'bottom',
bbox = dict(boxstyle = 'round,pad=0.5', fc = 'blue', alpha = 0.05),
arrowprops = dict(arrowstyle = '->',connectionstyle = 'arc3,rad=0')
)
plt.annotate('Sun', xy = (18,-23.5),
xytext = (450, 7),
textcoords = 'offset points', ha = 'right', va = 'bottom',
bbox = dict(boxstyle = 'round,pad=0.5', fc = 'blue', alpha = 0.05),
arrowprops = dict(arrowstyle = '->',connectionstyle = 'arc3,rad=0')
)
plt.annotate('Proxima Centauri', xy = (217.4292,-62.6794),
xytext = (400, 0),
textcoords = 'offset points', ha = 'right', va = 'bottom',
bbox = dict(boxstyle = 'round,pad=0.5', fc = 'blue', alpha = 0.05),
arrowprops = dict(arrowstyle = '->',connectionstyle = 'arc3,rad=0')
)
plt.annotate('Alpha Persei a.k.a Mirfak System', xy = (51.0792,49.8611),
xytext = (600, 0),
textcoords = 'offset points', ha = 'right', va = 'bottom',
bbox = dict(boxstyle = 'round,pad=0.5', fc = 'blue', alpha = 0.05),
arrowprops = dict(arrowstyle = '->',connectionstyle = 'arc3,rad=0')
)
plt.annotate('Epsilon Canis Majoris a.k.a Adhara System', xy = (104.6583,-28.9719),
xytext = (700, 0),
textcoords = 'offset points', ha = 'right', va = 'bottom',
bbox = dict(boxstyle = 'round,pad=0.5', fc = 'blue', alpha = 0.1),
arrowprops = dict(arrowstyle = '->',connectionstyle = 'arc3,rad=0')
)
plt.show()
x = allExoplanets['S. RA (hrs)']*14
y = allExoplanets['S. DEC (deg)']
z = allExoplanets['S. Distance (pc)']**2
area = np.pi * allExoplanets['S. Radius (SU)']**2
sl = plt.cm.coolwarm(np.linspace(0,1,len(allExoplanets)))
#csp2=plt.cm.(oec['HostStarTempK'])
fig = plt.figure(figsize=(30,50))
ax = fig.add_subplot(621, projection='3d')
ax.axis('on')
ax.scatter(x,y,z,cmap=cm.coolwarm,alpha=0.2,s=area,c=sl)
ax.set_xlabel('RA ')
ax.set_ylabel('Dec ')
ax.set_zlabel('Distance from Sun')
plt.title('Galactic Map in RA/Dec/Distance from Host Planet',size=20)
plt.show()
x2 = allExoplanets['S. Mass (SU)']
y2 = allExoplanets['S. Age (Gyrs)']
z2 = allExoplanets['S. Teff (K)']
area2 = np.pi * allExoplanets['S. Radius (SU)']**2
#x1 = oec['RA_dd']
#y1 = oec['Dec_dd']
#z1 = dists/1000
#area = np.pi * oec['HostStarRadiusSlrRad']**2
#csp2=plt.cm.(oec['HostStarTempK'])
fig = plt.figure(figsize=(30,40))
ax = fig.add_subplot(421, projection='3d')
ax.axis('on')
ax.scatter(x2,y2,z2,cmap=cm.hot,alpha=0.5,s=area2,c=allExoplanets['S. Luminosity (SU)'])
ax.set_xlabel('Star Mass')
ax.set_ylabel('Star Age')
ax.set_zlabel('Effective Temp')
plt.title('Mass vs Age vs Effective Temp vs Luminosity(Color Increment)')
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.20277912425270642, 'fraction_numerical': 0.03829374697043141, 'mean_word_length': 6.34282325029656, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '289422', 'license': 'MIT', 'n_tokens_mistral': 2755, 'n_tokens_neox': 2539, 'n_words': 490, 'path': 'documentation.ipynb', 'repo_name': 'kaguya-anumi/In-Search-of-Life', 'size': '6189'}