ccfdtdmav
ccfdtdmav
Coursera Class for DA Training: Data Management and Visualizatio
9 posts
Don't wanna be here? Send us removal request.
ccfdtdmav · 2 years ago
Text
Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media
Exploring Statistical Interactions
Attached in the pictures you will see the program used and the output.
My null hypothesis is that latitude has no impact on diameter, with my alternate hypothesis being latitude does have an impact on diameter. Based on the given p-value of 1.0 for an association between diameter and latitude it can be concluded that the null hypothesis should be rejected and the alternate accepted.
A secondary null hypothesis, which is that latitude does not effect depth, which would make the alternate hypothesis that latitude does effect depth. Based on the given p-value of 2.8069210064046035e-120 it can be concluded that the null hypothesis should be accepted.
0 notes
ccfdtdmav · 2 years ago
Text
Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media
Pearson Correlation
Attached in the pictures you will see the program used and the output.
My null hypothesis is that depth has no impact on diameter, with my alternate hypothesis being depth does have an impact on diameter. Based on the given p-value of 0.0 for an association between diameter and depth it can be concluded that the null hypothesis should be accepted.
A secondary null hypothesis, which is that latitude does not effect depth, which would make the alternate hypothesis that latitude does effect depth. Based on the given p-value of 7.237944153e-156 it can be concluded that the null hypothesis should be accepted.
0 notes
ccfdtdmav · 2 years ago
Text
Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media
Chi-Squared Test of Independence
Attached in the pictures you will see the program used along with the output. My null hypothesis is that depth has no impact on diameter, with my alternate hypothsis being depth does have an impact on diameter.
Using the p-value of 0.850 from the regression results, the Tukey HSD test, and the chi-square p-value of 0.28064 it can be concluded that the null hypothesis should be accepted.
0 notes
ccfdtdmav · 2 years ago
Text
Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media
Hypothesis Testing and ANOVA
Attached in the pictures you will see the program used with part of the output, and below is the Tukey HSD Test. My null hypothesis is that depth has no an impact on diameter, with my alternate hypothsis being depth does have an impact on diameter.
The output contains a subgroup of data that is restricted to diameter of 75 to 100 and a depth of 2 to 5. The regression results for the p-value return a value of 0.03612. In relation to depth of the craters, it's mean roughly consistent no matter the diameter of the crater with the standard deviation being 0.367696. For the diameter of the craters, the mean of the diameter seems to have no consistent values along with there being a scattered standard deviation. Based on this information it can be concluded that the null hypothesis should not be rejected.
Tukey HSD Test
Multiple Comparison of Means - Tukey HSD, FWER=0.05
group1 group2 meandiff p-adj lower upper reject
2.0 2.01 -13.92 1.0 -64.4576 36.6176 False 2.0 2.03 -1.67 1.0 -42.9337 39.5937 False 2.0 2.06 -2.58 1.0 -53.1176 47.9576 False 2.0 2.07 7.74 1.0 -42.7976 58.2776 False 2.0 2.1 -2.04 1.0 -43.3037 39.2237 False 2.0 2.11 -5.18 1.0 -46.4437 36.0837 False 2.0 2.12 6.93 1.0 -43.6076 57.4676 False 2.0 2.13 -8.7533 1.0 -46.4218 28.9151 False 2.0 2.14 -6.59 1.0 -57.1276 43.9476 False 2.0 2.16 -9.7 1.0 -60.2376 40.8376 False 2.0 2.19 -8.48 1.0 -59.0176 42.0576 False 2.0 2.2 1.98 1.0 -48.5576 52.5176 False 2.0 2.25 -2.43 1.0 -43.6937 38.8337 False 2.0 2.28 6.36 1.0 -44.1776 56.8976 False 2.0 2.29 -3.17 1.0 -44.4337 38.0937 False 2.0 2.3 -6.42 1.0 -56.9576 44.1176 False 2.0 2.32 -9.2633 1.0 -46.9318 28.4051 False 2.0 2.33 -14.59 0.9999 -65.1276 35.9476 False 2.0 2.35 -1.2 1.0 -51.7376 49.3376 False 2.0 2.4 -7.25 1.0 -57.7876 43.2876 False 2.0 2.41 1.74 1.0 -48.7976 52.2776 False 2.0 2.42 -5.85 1.0 -56.3876 44.6876 False 2.0 2.44 -11.67 1.0 -62.2076 38.8676 False 2.0 2.45 -1.275 1.0 -42.5387 39.9887 False 2.0 2.49 10.16 1.0 -40.3776 60.6976 False 2.0 2.5 -11.13 1.0 -61.6676 39.4076 False 2.0 2.52 -6.04 1.0 -56.5776 44.4976 False 2.0 2.53 -13.61 1.0 -64.1476 36.9276 False 2.0 2.54 -10.18 1.0 -60.7176 40.3576 False 2.0 2.55 -2.6533 1.0 -40.3218 35.0151 False 2.0 2.56 -0.54 1.0 -51.0776 49.9976 False 2.0 2.62 4.45 1.0 -46.0876 54.9876 False 2.0 2.65 0.0 1.0 -41.2637 41.2637 False 2.0 2.67 -6.235 1.0 -47.4987 35.0287 False 2.0 2.72 3.62 1.0 -46.9176 54.1576 False 2.0 2.76 -7.77 1.0 -58.3076 42.7676 False 2.0 2.9 2.73 1.0 -47.8076 53.2676 False 2.0 2.91 -8.555 1.0 -49.8187 32.7087 False 2.0 2.97 0.35 1.0 -50.1876 50.8876 False 2.0 3.14 5.84 1.0 -44.6976 56.3776 False 2.0 3.8 -10.91 1.0 -61.4476 39.6276 False 2.0 4.95 -1.25 1.0 -51.7876 49.2876 False 2.01 2.03 12.25 1.0 -38.2876 62.7876 False 2.01 2.06 11.34 1.0 -47.0158 69.6958 False 2.01 2.07 21.66 0.9958 -36.6958 80.0158 False 2.01 2.1 11.88 1.0 -38.6576 62.4176 False 2.01 2.11 8.74 1.0 -41.7976 59.2776 False 2.01 2.12 20.85 0.9975 -37.5058 79.2058 False 2.01 2.13 5.1667 1.0 -42.4806 52.8139 False 2.01 2.14 7.33 1.0 -51.0258 65.6858 False 2.01 2.16 4.22 1.0 -54.1358 62.5758 False 2.01 2.19 5.44 1.0 -52.9158 63.7958 False 2.01 2.2 15.9 1.0 -42.4558 74.2558 False 2.01 2.25 11.49 1.0 -39.0476 62.0276 False 2.01 2.28 20.28 0.9984 -38.0758 78.6358 False 2.01 2.29 10.75 1.0 -39.7876 61.2876 False 2.01 2.3 7.5 1.0 -50.8558 65.8558 False 2.01 2.32 4.6567 1.0 -42.9906 52.3039 False 2.01 2.33 -0.67 1.0 -59.0258 57.6858 False 2.01 2.35 12.72 1.0 -45.6358 71.0758 False 2.01 2.4 6.67 1.0 -51.6858 65.0258 False 2.01 2.41 15.66 1.0 -42.6958 74.0158 False 2.01 2.42 8.07 1.0 -50.2858 66.4258 False 2.01 2.44 2.25 1.0 -56.1058 60.6058 False 2.01 2.45 12.645 1.0 -37.8926 63.1826 False 2.01 2.49 24.08 0.9838 -34.2758 82.4358 False 2.01 2.5 2.79 1.0 -55.5658 61.1458 False 2.01 2.52 7.88 1.0 -50.4758 66.2358 False 2.01 2.53 0.31 1.0 -58.0458 58.6658 False 2.01 2.54 3.74 1.0 -54.6158 62.0958 False 2.01 2.55 11.2667 1.0 -36.3806 58.9139 False 2.01 2.56 13.38 1.0 -44.9758 71.7358 False 2.01 2.62 18.37 0.9997 -39.9858 76.7258 False 2.01 2.65 13.92 1.0 -36.6176 64.4576 False 2.01 2.67 7.685 1.0 -42.8526 58.2226 False 2.01 2.72 17.54 0.9999 -40.8158 75.8958 False 2.01 2.76 6.15 1.0 -52.2058 64.5058 False 2.01 2.9 16.65 0.9999 -41.7058 75.0058 False 2.01 2.91 5.365 1.0 -45.1726 55.9026 False 2.01 2.97 14.27 1.0 -44.0858 72.6258 False 2.01 3.14 19.76 0.9989 -38.5958 78.1158 False 2.01 3.8 3.01 1.0 -55.3458 61.3658 False 2.01 4.95 12.67 1.0 -45.6858 71.0258 False
0 notes
ccfdtdmav · 2 years ago
Text
Creating Graphs for Your Data
Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media
Based on the attached graphs, it can be determined that there is not a corelation between depth and diameter. However, between latitude & depth, latitude & diameter, and latitude & rough volume there seems to be a positive relationship the higher the latitude. This leads to that if the latitude is further north then the overall size of the crater will be larger.
Program:
Import libaries.
import pandas import numpy import sys import seaborn as sns import matplotlib.pyplot as plt
original_stdout = sys.stdout
Set table size.
pandas.set_option('display.max_columns', 500) pandas.set_option('display.max_rows', 500) pandas.set_option('display.width', 150)
Import dataset.
dataset = pandas.read_csv('marscrater_pds.csv', low_memory = False) data = dataset.copy()
Uppercase all DataFrame column names.
data.columns = map(str.upper, data.columns)
Drop unused columns.
del data['CRATER_ID']
del data['CRATER_NAME'] del data['LONGITUDE_CIRCLE_IMAGE'] del data['MORPHOLOGY_EJECTA_1'] del data['MORPHOLOGY_EJECTA_2'] del data['MORPHOLOGY_EJECTA_3'] del data['NUMBER_LAYERS']
Bugfix for display formates to avoid run time errors.
pandas.set_option('display.float_format', lambda x:'%f'%x)
print(len(data)) print(len(data.columns))
Ensure entires are numeric.
data['LATITUDE_CIRCLE_IMAGE'] = pandas.to_numeric(data['LATITUDE_CIRCLE_IMAGE']) data['DIAM_CIRCLE_IMAGE'] = pandas.to_numeric(data['DIAM_CIRCLE_IMAGE']) data['DEPTH_RIMFLOOR_TOPOG'] = pandas.to_numeric(data['DEPTH_RIMFLOOR_TOPOG'])
print ("01 Raw Data Counts and Percentages") print ("02 Subgrouped Dataset") print ("03 Subgrouped Counts and Percentages") print ("04 Subgrouped Dataset w/ Rough Volumes") print ("\n_____01 Raw Data Counts and Percentages__________________________________________________________________________________")
print ("Raw Dataset for Mars Craters")
print ("\nCounts for Crater Latitude:") print ("Entry: Count:") c1 = data['LATITUDE_CIRCLE_IMAGE'].value_counts(sort = False, dropna = False) print (c1)
print ("\nPercentages for Crater Latitude:") print ("Entry: Percentage:") p1 = data['LATITUDE_CIRCLE_IMAGE'].value_counts(sort = False, normalize = True) print (p1)
print ("\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ")
print ("\nCounts for Crater Diameter:") print ("Entry: Count:") c2 = data['DIAM_CIRCLE_IMAGE'].value_counts(sort = False) print (c2)
print ("\nPercentages for Crater Diameter:") print ("Entry: Percentage:") p2 = data['DIAM_CIRCLE_IMAGE'].value_counts(sort = False, normalize = True) print (p2)
print ("\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ")
print ("\nCounts for Crater Depth:") print ("Entry: Count:") c3 = data['DEPTH_RIMFLOOR_TOPOG'].value_counts(sort = False) print (c3)
print ("\nPercentages for Crater Depth:") print ("Entry: Percentage:") p3 = data['DEPTH_RIMFLOOR_TOPOG'].value_counts(sort = False, normalize = True) print (p3)
print ("\n_____02 Subgrouped Dataset_______________________________________________________________________________________________")
print ("Subgrouped Dataset for Mars Craters")
print ("\nSubgroup of Data (Diameter 75-100 & Depth 2-5):") sub1 = data [(data['DIAM_CIRCLE_IMAGE'] >= 75) & (data['DIAM_CIRCLE_IMAGE'] <= 100) & (data['DEPTH_RIMFLOOR_TOPOG'] >= 2) & (data['DEPTH_RIMFLOOR_TOPOG'] <= 5)] sub2 = sub1.copy() print (sub2)
print ("\n_____03 Subgrouped Counts and Percentages_________________________________________________________________________________")
print ("\nCounts for Crater Latitude:") print ("Entry: Count:") c12 = sub2['LATITUDE_CIRCLE_IMAGE'].value_counts(sort = False, dropna = False) print (c12)
print ("\nPercentages for Crater Latitude:") print ("Entry: Percentage:") p12 = sub2['LATITUDE_CIRCLE_IMAGE'].value_counts(sort = False, normalize = True) print (p12)
print ("\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ")
print ("\nCounts for Crater Diameter:") print ("Entry: Count:") c22 = sub2['DIAM_CIRCLE_IMAGE'].value_counts(sort = False) print (c22)
print ("\nPercentages for Crater Diameter:") print ("Entry: Percentage:") p22 = sub2['DIAM_CIRCLE_IMAGE'].value_counts(sort = False, normalize = True) print (p22)
print ("\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ")
print ("\nCounts for Crater Depth:") print ("Entry: Count:") c32 = sub2['DEPTH_RIMFLOOR_TOPOG'].value_counts(sort = False) print (c32)
print ("\nPercentages for Crater Depth:") print ("Entry: Percentage:") p32 = sub2['DEPTH_RIMFLOOR_TOPOG'].value_counts(sort = False, normalize = True) print (p32)
print ("\n_____04 Subgrouped Dataset w/ Rough Volumes_________________________________________________________________________________")
print ("Subgrouped Dataset w/ Rough Volumes")
Rough volume of crater.
sub3 = sub2.copy() sub3['ROUGH_VOLUME'] = sub3['DIAM_CIRCLE_IMAGE'] * sub3['DEPTH_RIMFLOOR_TOPOG'] * 3.14
sub3['ROUGH_VOLUME'] = pandas.to_numeric(data['ROUGH_VOLUME'])
print (sub3)
print ("\n_____05 Subgrouped Counts and Percentages for ROUGH_VOLUME__________________________________________________________________")
print ("\nCounts for Rough Volume:") print ("Entry: Count:")
c42 = sub3.groupby('ROUGH_VOLUME').size()
c42 = sub3['ROUGH_VOLUME'].value_counts(sort = False) print (c42)
print ("\nPercentages for Rough Volume:") print ("Entry: Percentage:")
p42 = sub3.groupby('ROUGH_VOLUME').size() * 100 / len(sub3)
p42 = sub3['ROUGH_VOLUME'].value_counts(sort = False, normalize = True) print (p42)
print ("\n_____06 Described Variables______________________________________________________________________________________________")
Univariate Graphs for Variables
sns.displot (sub3['LATITUDE_CIRCLE_IMAGE'].dropna(), kde = False) plt.xlabel('Latitude of Crater') plt.title('Counts of Crater Latitudes') plt.show()
sns.displot (sub3['DIAM_CIRCLE_IMAGE'].dropna(), kde = False) plt.xlabel('Diameter of Crater') plt.title('Counts of Crater Diameters') plt.show()
sns.displot (sub3['DEPTH_RIMFLOOR_TOPOG'].dropna(), kde = False) plt.xlabel('Depth of Crater') plt.title('Counts of Crater Depths') plt.show()
sns.displot (sub3['ROUGH_VOLUME'].dropna(), kde = False) plt.xlabel('Rough Volume of Crater') plt.title('Counts of Crater Rough Volumes') plt.show()
Bivariate Graphs for Variables
scat1 = sns.regplot (x = 'DEPTH_RIMFLOOR_TOPOG', y = 'DIAM_CIRCLE_IMAGE', data = sub3) plt.xlabel ("Depth of Crater") plt.ylabel ("Diameter of Crater") plt.title ("Depth vs Diameter") plt.show()
scat2 = sns.regplot (x = 'LATITUDE_CIRCLE_IMAGE', y = 'DIAM_CIRCLE_IMAGE', data = sub3) plt.xlabel ("Latitude of Crater") plt.ylabel ("Diameter of Crater") plt.title ("Latitude vs Diameter") plt.show()
scat3 = sns.regplot (x = 'LATITUDE_CIRCLE_IMAGE', y = 'DEPTH_RIMFLOOR_TOPOG', data = sub3) plt.xlabel ("Latitude of Crater") plt.ylabel ("Depth of Crater") plt.title ("Latitude vs Depth") plt.show()
scat3 = sns.regplot (x = 'LATITUDE_CIRCLE_IMAGE', y = 'ROUGH_VOLUME', data = sub3) plt.xlabel ("Latitude of Crater") plt.ylabel ("Rough Volume of Crater") plt.title ("Latitude vs Rough Volume") plt.show()
Variable Descriptions
print ("\nDescribe Crater Latitude:") desc1 = sub3['LATITUDE_CIRCLE_IMAGE'].describe() print (desc1)
print ("\nDescribe Crater Diameter:") desc2 = sub3['DIAM_CIRCLE_IMAGE'].describe() print (desc2)
print ("\nDescribe Crater Depth:") desc3 = sub3['DEPTH_RIMFLOOR_TOPOG'].describe() print (desc3)
print ("\nDescribe Crater Rough Volume:") desc4 = sub3['ROUGH_VOLUME'].describe() print (desc4)
print ("\n_________________________________________________________________________________________________________________________")
print ("\nBegin write to file.")
Writes the programs console output to a file named "output.txt" when the program runs.
with open ('output.txt', 'w') as f:sys.stdout = f print ("01 Raw Data Counts and Percentages") print ("02 Subgrouped Dataset") print ("03 Subgrouped Counts and Percentages") print ("\n_____01 Raw Data Counts and Percentages__________________________________________________________________________________") print ("Raw Dataset for Mars Craters") print ("\nCounts for Crater Latitude:") print ("Entry: Count:") print (c1) print ("\nPercentages for Crater Latitude:") print ("Entry: Percentage:") print (p1) print ("\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ") print ("\nCounts for Crater Diameter:") print ("Entry: Count:") print (c2) print ("\nPercentages for Crater Diameter:") print ("Entry: Percentage:") print (p2) print ("\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ") print ("\nCounts for Crater Depth:") print ("Entry: Count:") print (c3) print ("\nPercentages for Crater Depth:") print ("Entry: Percentage:") print (p3) print ("\n_____02 Subgrouped Dataset_______________________________________________________________________________________________") print ("Subgrouped Dataset for Mars Craters") print ("\nSubgroup of Data (Diameter 75-100 & Depth 2-5):") print (sub2) print ("\n_____03 Subgrouped Counts and Percentages_________________________________________________________________________________") print ("\nCounts for Crater Latitude:") print ("Entry: Count:") print (c12) print ("\nPercentages for Crater Latitude:") print ("Entry: Percentage:") print (p12) print ("\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ") print ("\nCounts for Crater Diameter:") print ("Entry: Count:") print (c22) print ("\nPercentages for Crater Diameter:") print ("Entry: Percentage:") print (p22) print ("\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ") print ("\nCounts for Crater Depth:") print ("Entry: Count:") print (c32) print ("\nPercentages for Crater Depth:") print ("Entry: Percentage:") print (p32) print ("\n_____04 Subgrouped Dataset w/ Rough Volumes_________________________________________________________________________________") print ("Subgrouped Dataset w/ Rough Volumes") print (sub3) print ("\n_____05 Subgrouped Counts and Percentages for ROUGH_VOLUME_________________________________________________________________________________") print ("\nCounts for Rough Volume:") print ("Entry: Count:") print (c42) print ("\nPercentages for Rough Volume:") print ("Entry: Percentage:") print (p42) print ("\n_____06 Described Variables______________________________________________________________________________________________") print ("\nDescribe Crater Latitude:") print (desc1) print ("\nDescribe Crater Diameter:") print (desc2) print ("\nDescribe Crater Depth:") print (desc3) print ("\nDescribe Crater Rough Volume:") print (desc4) print ("\n_________________________________________________________________________________________________________________________") sys.stdout = original_stdout
print ("Output has been written to file 'output.txt'.")
0 notes
ccfdtdmav · 2 years ago
Text
Making Data Management Decisions - Output
02 Subgrouped Dataset__________________________________________________________________________________________ Subgrouped Dataset for Mars Craters
Subgroup of Data (Diameter 75-100 & Depth 2-5): CRATER_ID LATITUDE_CIRCLE_IMAGE DIAM_CIRCLE_IMAGE DEPTH_RIMFLOOR_TOPOG 59129 08-000003 12.252000 92.490000 2.900000 67273 10-000003 26.990000 99.920000 2.490000 80203 11-000012 12.931000 96.690000 2.120000 80207 11-000016 13.416000 94.210000 2.620000 80208 11-000017 10.690000 93.380000 2.720000 80209 11-000018 21.897000 90.920000 2.290000 80211 11-000020 12.937000 89.220000 2.560000 80214 11-000023 13.662000 86.940000 2.320000 80217 11-000026 24.340000 78.630000 2.500000 80219 11-000028 23.863000 75.170000 2.330000 96950 12-000021 14.591000 97.960000 2.000000 96952 12-000023 1.568000 95.850000 2.650000 96965 12-000036 11.510000 81.990000 2.760000 96976 12-000047 20.818000 75.840000 2.010000 115814 13-000020 25.497000 94.210000 2.100000 115820 13-000026 28.957000 89.820000 2.670000 115823 13-000029 28.417000 83.670000 2.650000 129732 14-000003 5.454000 96.120000 2.280000 143255 15-000004 12.337000 83.910000 2.420000 150918 16-000027 -14.877000 88.560000 2.350000 173696 18-000004 -16.312000 88.510000 4.950000 173702 18-000010 -2.945000 78.850000 3.800000 173703 18-000011 -28.447000 77.230000 2.670000 188267 19-000014 -21.887000 95.600000 3.140000 188270 19-000017 -18.878000 90.110000 2.970000 188271 19-000018 -24.630000 87.180000 2.060000 188276 19-000023 -29.952000 84.280000 2.250000 208726 20-000021 -23.321000 98.090000 2.450000 208741 20-000036 -21.966000 82.260000 2.290000 208750 20-000045 -19.145000 75.610000 2.910000 227419 21-000010 -28.393000 98.240000 2.030000 227425 21-000016 -9.375000 93.360000 2.550000 227429 21-000020 -27.342000 90.380000 2.250000 227435 21-000026 -21.738000 86.640000 2.130000 227439 21-000030 -21.882000 81.560000 2.000000 227440 21-000031 -27.836000 81.280000 2.190000 227444 21-000035 -28.892000 77.940000 2.030000 227446 21-000037 -27.017000 77.120000 2.550000 247403 22-000015 -1.134000 86.800000 2.910000 266829 23-000020 -24.662000 91.500000 2.410000 266839 23-000030 -9.591000 78.730000 2.130000 284506 24-000033 -55.153000 97.500000 2.070000 284528 24-000055 -30.285000 77.650000 2.130000 284537 24-000064 -61.441000 75.350000 2.320000 300280 25-000031 -57.397000 82.510000 2.400000 300281 25-000032 -46.806000 81.230000 2.100000 300282 25-000033 -62.914000 80.060000 2.160000 316280 26-000020 -48.342000 83.720000 2.520000 316281 26-000021 -36.591000 83.340000 2.300000 316282 26-000022 -59.424000 83.170000 2.140000 316283 26-000023 -44.129000 79.200000 2.320000 331072 27-000026 -49.604000 90.840000 2.550000 331081 27-000035 -40.107000 79.580000 2.540000 331084 27-000038 -39.665000 78.880000 2.450000 331089 27-000043 -34.609000 78.090000 2.440000 344994 28-000018 -53.189000 78.470000 2.110000 354524 29-000013 -40.258000 91.740000 2.200000 354543 29-000032 -45.362000 76.150000 2.530000 370682 30-000030 -74.964000 90.690000 2.110000
03 Subgrouped Counts and Percentages____________________________________________________________________________
Counts for Crater Latitude: Entry: Count: 12.252000 1 26.990000 1 12.931000 1 13.416000 1 10.690000 1 21.897000 1 12.937000 1 13.662000 1 24.340000 1 23.863000 1 14.591000 1 1.568000 1 11.510000 1 20.818000 1 25.497000 1 28.957000 1 28.417000 1 5.454000 1 12.337000 1 -14.877000 1 -16.312000 1 -2.945000 1 -28.447000 1 -21.887000 1 -18.878000 1 -24.630000 1 -29.952000 1 -23.321000 1 -21.966000 1 -19.145000 1 -28.393000 1 -9.375000 1 -27.342000 1 -21.738000 1 -21.882000 1 -27.836000 1 -28.892000 1 -27.017000 1 -1.134000 1 -24.662000 1 -9.591000 1 -55.153000 1 -30.285000 1 -61.441000 1 -57.397000 1 -46.806000 1 -62.914000 1 -48.342000 1 -36.591000 1 -59.424000 1 -44.129000 1 -49.604000 1 -40.107000 1 -39.665000 1 -34.609000 1 -53.189000 1 -40.258000 1 -45.362000 1 -74.964000 1 Name: LATITUDE_CIRCLE_IMAGE, dtype: int64
Percentages for Crater Latitude: Entry: Percentage: 12.252000 0.016949 26.990000 0.016949 12.931000 0.016949 13.416000 0.016949 10.690000 0.016949 21.897000 0.016949 12.937000 0.016949 13.662000 0.016949 24.340000 0.016949 23.863000 0.016949 14.591000 0.016949 1.568000 0.016949 11.510000 0.016949 20.818000 0.016949 25.497000 0.016949 28.957000 0.016949 28.417000 0.016949 5.454000 0.016949 12.337000 0.016949 -14.877000 0.016949 -16.312000 0.016949 -2.945000 0.016949 -28.447000 0.016949 -21.887000 0.016949 -18.878000 0.016949 -24.630000 0.016949 -29.952000 0.016949 -23.321000 0.016949 -21.966000 0.016949 -19.145000 0.016949 -28.393000 0.016949 -9.375000 0.016949 -27.342000 0.016949 -21.738000 0.016949 -21.882000 0.016949 -27.836000 0.016949 -28.892000 0.016949 -27.017000 0.016949 -1.134000 0.016949 -24.662000 0.016949 -9.591000 0.016949 -55.153000 0.016949 -30.285000 0.016949 -61.441000 0.016949 -57.397000 0.016949 -46.806000 0.016949 -62.914000 0.016949 -48.342000 0.016949 -36.591000 0.016949 -59.424000 0.016949 -44.129000 0.016949 -49.604000 0.016949 -40.107000 0.016949 -39.665000 0.016949 -34.609000 0.016949 -53.189000 0.016949 -40.258000 0.016949 -45.362000 0.016949 -74.964000 0.016949 Name: LATITUDE_CIRCLE_IMAGE, dtype: float64
Counts for Crater Diameter: Entry: Count: 92.490000 1 99.920000 1 96.690000 1 94.210000 2 93.380000 1 90.920000 1 89.220000 1 86.940000 1 78.630000 1 75.170000 1 97.960000 1 95.850000 1 81.990000 1 75.840000 1 89.820000 1 83.670000 1 96.120000 1 83.910000 1 88.560000 1 88.510000 1 78.850000 1 77.230000 1 95.600000 1 90.110000 1 87.180000 1 84.280000 1 98.090000 1 82.260000 1 75.610000 1 98.240000 1 93.360000 1 90.380000 1 86.640000 1 81.560000 1 81.280000 1 77.940000 1 77.120000 1 86.800000 1 91.500000 1 78.730000 1 97.500000 1 77.650000 1 75.350000 1 82.510000 1 81.230000 1 80.060000 1 83.720000 1 83.340000 1 83.170000 1 79.200000 1 90.840000 1 79.580000 1 78.880000 1 78.090000 1 78.470000 1 91.740000 1 76.150000 1 90.690000 1 Name: DIAM_CIRCLE_IMAGE, dtype: int64
Percentages for Crater Diameter: Entry: Percentage: 92.490000 0.016949 99.920000 0.016949 96.690000 0.016949 94.210000 0.033898 93.380000 0.016949 90.920000 0.016949 89.220000 0.016949 86.940000 0.016949 78.630000 0.016949 75.170000 0.016949 97.960000 0.016949 95.850000 0.016949 81.990000 0.016949 75.840000 0.016949 89.820000 0.016949 83.670000 0.016949 96.120000 0.016949 83.910000 0.016949 88.560000 0.016949 88.510000 0.016949 78.850000 0.016949 77.230000 0.016949 95.600000 0.016949 90.110000 0.016949 87.180000 0.016949 84.280000 0.016949 98.090000 0.016949 82.260000 0.016949 75.610000 0.016949 98.240000 0.016949 93.360000 0.016949 90.380000 0.016949 86.640000 0.016949 81.560000 0.016949 81.280000 0.016949 77.940000 0.016949 77.120000 0.016949 86.800000 0.016949 91.500000 0.016949 78.730000 0.016949 97.500000 0.016949 77.650000 0.016949 75.350000 0.016949 82.510000 0.016949 81.230000 0.016949 80.060000 0.016949 83.720000 0.016949 83.340000 0.016949 83.170000 0.016949 79.200000 0.016949 90.840000 0.016949 79.580000 0.016949 78.880000 0.016949 78.090000 0.016949 78.470000 0.016949 91.740000 0.016949 76.150000 0.016949 90.690000 0.016949 Name: DIAM_CIRCLE_IMAGE, dtype: float64
Counts for Crater Depth: Entry: Count: 2.900000 1 2.490000 1 2.120000 1 2.620000 1 2.720000 1 2.290000 2 2.560000 1 2.320000 3 2.500000 1 2.330000 1 2.000000 2 2.650000 2 2.760000 1 2.010000 1 2.100000 2 2.670000 2 2.280000 1 2.420000 1 2.350000 1 4.950000 1 3.800000 1 3.140000 1 2.970000 1 2.060000 1 2.250000 2 2.450000 2 2.910000 2 2.030000 2 2.550000 3 2.130000 3 2.190000 1 2.410000 1 2.070000 1 2.400000 1 2.160000 1 2.520000 1 2.300000 1 2.140000 1 2.540000 1 2.440000 1 2.110000 2 2.200000 1 2.530000 1 Name: DEPTH_RIMFLOOR_TOPOG, dtype: int64
Percentages for Crater Depth: Entry: Percentage: 2.900000 0.016949 2.490000 0.016949 2.120000 0.016949 2.620000 0.016949 2.720000 0.016949 2.290000 0.033898 2.560000 0.016949 2.320000 0.050847 2.500000 0.016949 2.330000 0.016949 2.000000 0.033898 2.650000 0.033898 2.760000 0.016949 2.010000 0.016949 2.100000 0.033898 2.670000 0.033898 2.280000 0.016949 2.420000 0.016949 2.350000 0.016949 4.950000 0.016949 3.800000 0.016949 3.140000 0.016949 2.970000 0.016949 2.060000 0.016949 2.250000 0.033898 2.450000 0.033898 2.910000 0.033898 2.030000 0.033898 2.550000 0.050847 2.130000 0.050847 2.190000 0.016949 2.410000 0.016949 2.070000 0.016949 2.400000 0.016949 2.160000 0.016949 2.520000 0.016949 2.300000 0.016949 2.140000 0.016949 2.540000 0.016949 2.440000 0.016949 2.110000 0.033898 2.200000 0.016949 2.530000 0.016949 Name: DEPTH_RIMFLOOR_TOPOG, dtype: float64
04 Subgrouped Dataset w/ Rough Volumes____________________________________________________________________________ Subgrouped Dataset w/ Rough Volumes CRATER_ID LATITUDE_CIRCLE_IMAGE DIAM_CIRCLE_IMAGE DEPTH_RIMFLOOR_TOPOG ROUGH_VOLUME 59129 08-000003 12.252000 92.490000 2.900000 842.213940 67273 10-000003 26.990000 99.920000 2.490000 781.234512 80203 11-000012 12.931000 96.690000 2.120000 643.645992 80207 11-000016 13.416000 94.210000 2.620000 775.046828 80208 11-000017 10.690000 93.380000 2.720000 797.539904 80209 11-000018 21.897000 90.920000 2.290000 653.769352 80211 11-000020 12.937000 89.220000 2.560000 717.186048 80214 11-000023 13.662000 86.940000 2.320000 633.340512 80217 11-000026 24.340000 78.630000 2.500000 617.245500 80219 11-000028 23.863000 75.170000 2.330000 549.958754 96950 12-000021 14.591000 97.960000 2.000000 615.188800 96952 12-000023 1.568000 95.850000 2.650000 797.567850 96965 12-000036 11.510000 81.990000 2.760000 710.558136 96976 12-000047 20.818000 75.840000 2.010000 478.656576 115814 13-000020 25.497000 94.210000 2.100000 621.220740 115820 13-000026 28.957000 89.820000 2.670000 753.032916 115823 13-000029 28.417000 83.670000 2.650000 696.218070 129732 14-000003 5.454000 96.120000 2.280000 688.142304 143255 15-000004 12.337000 83.910000 2.420000 637.615308 150918 16-000027 -14.877000 88.560000 2.350000 653.484240 173696 18-000004 -16.312000 88.510000 4.950000 1375.710930 173702 18-000010 -2.945000 78.850000 3.800000 940.838200 173703 18-000011 -28.447000 77.230000 2.670000 647.480874 188267 19-000014 -21.887000 95.600000 3.140000 942.577760 188270 19-000017 -18.878000 90.110000 2.970000 840.347838 188271 19-000018 -24.630000 87.180000 2.060000 563.915112 188276 19-000023 -29.952000 84.280000 2.250000 595.438200 208726 20-000021 -23.321000 98.090000 2.450000 754.606370 208741 20-000036 -21.966000 82.260000 2.290000 591.498756 208750 20-000045 -19.145000 75.610000 2.910000 690.878814 227419 21-000010 -28.393000 98.240000 2.030000 626.201408 227425 21-000016 -9.375000 93.360000 2.550000 747.533520 227429 21-000020 -27.342000 90.380000 2.250000 638.534700 227435 21-000026 -21.738000 86.640000 2.130000 579.465648 227439 21-000030 -21.882000 81.560000 2.000000 512.196800 227440 21-000031 -27.836000 81.280000 2.190000 558.930048 227444 21-000035 -28.892000 77.940000 2.030000 496.805148 227446 21-000037 -27.017000 77.120000 2.550000 617.499840 247403 22-000015 -1.134000 86.800000 2.910000 793.126320 266829 23-000020 -24.662000 91.500000 2.410000 692.417100 266839 23-000030 -9.591000 78.730000 2.130000 526.561986 284506 24-000033 -55.153000 97.500000 2.070000 633.730500 284528 24-000055 -30.285000 77.650000 2.130000 519.338730 284537 24-000064 -61.441000 75.350000 2.320000 548.909680 300280 25-000031 -57.397000 82.510000 2.400000 621.795360 300281 25-000032 -46.806000 81.230000 2.100000 535.630620 300282 25-000033 -62.914000 80.060000 2.160000 542.998944 316280 26-000020 -48.342000 83.720000 2.520000 662.459616 316281 26-000021 -36.591000 83.340000 2.300000 601.881480 316282 26-000022 -59.424000 83.170000 2.140000 558.869132 316283 26-000023 -44.129000 79.200000 2.320000 576.956160 331072 27-000026 -49.604000 90.840000 2.550000 727.355880 331081 27-000035 -40.107000 79.580000 2.540000 634.698248 331084 27-000038 -39.665000 78.880000 2.450000 606.823840 331089 27-000043 -34.609000 78.090000 2.440000 598.294344 344994 28-000018 -53.189000 78.470000 2.110000 519.895138 354524 29-000013 -40.258000 91.740000 2.200000 633.739920 354543 29-000032 -45.362000 76.150000 2.530000 604.950830 370682 30-000030 -74.964000 90.690000 2.110000 600.857526
05 Subgrouped Counts and Percentages for ROUGH_VOLUME____________________________________________________________________________
Counts for Rough Volume: Entry: Count: 842.213940 1 781.234512 1 643.645992 1 775.046828 1 797.539904 1 653.769352 1 717.186048 1 633.340512 1 617.245500 1 549.958754 1 615.188800 1 797.567850 1 710.558136 1 478.656576 1 621.220740 1 753.032916 1 696.218070 1 688.142304 1 637.615308 1 653.484240 1 1375.710930 1 940.838200 1 647.480874 1 942.577760 1 840.347838 1 563.915112 1 595.438200 1 754.606370 1 591.498756 1 690.878814 1 626.201408 1 747.533520 1 638.534700 1 579.465648 1 512.196800 1 558.930048 1 496.805148 1 617.499840 1 793.126320 1 692.417100 1 526.561986 1 633.730500 1 519.338730 1 548.909680 1 621.795360 1 535.630620 1 542.998944 1 662.459616 1 601.881480 1 558.869132 1 576.956160 1 727.355880 1 634.698248 1 606.823840 1 598.294344 1 519.895138 1 633.739920 1 604.950830 1 600.857526 1 Name: ROUGH_VOLUME, dtype: int64
Percentages for Rough Volume: Entry: Percentage: 842.213940 0.016949 781.234512 0.016949 643.645992 0.016949 775.046828 0.016949 797.539904 0.016949 653.769352 0.016949 717.186048 0.016949 633.340512 0.016949 617.245500 0.016949 549.958754 0.016949 615.188800 0.016949 797.567850 0.016949 710.558136 0.016949 478.656576 0.016949 621.220740 0.016949 753.032916 0.016949 696.218070 0.016949 688.142304 0.016949 637.615308 0.016949 653.484240 0.016949 1375.710930 0.016949 940.838200 0.016949 647.480874 0.016949 942.577760 0.016949 840.347838 0.016949 563.915112 0.016949 595.438200 0.016949 754.606370 0.016949 591.498756 0.016949 690.878814 0.016949 626.201408 0.016949 747.533520 0.016949 638.534700 0.016949 579.465648 0.016949 512.196800 0.016949 558.930048 0.016949 496.805148 0.016949 617.499840 0.016949 793.126320 0.016949 692.417100 0.016949 526.561986 0.016949 633.730500 0.016949 519.338730 0.016949 548.909680 0.016949 621.795360 0.016949 535.630620 0.016949 542.998944 0.016949 662.459616 0.016949 601.881480 0.016949 558.869132 0.016949 576.956160 0.016949 727.355880 0.016949 634.698248 0.016949 606.823840 0.016949 598.294344 0.016949 519.895138 0.016949 633.739920 0.016949 604.950830 0.016949 600.857526 0.016949 Name: ROUGH_VOLUME, dtype: float64
0 notes
ccfdtdmav · 2 years ago
Text
Making Data Management Decisions - Summary and Program
For my dataset, I restricted my data to a Diameter of 75-100 and a depth of 2 to 5. After that I created a new variable, which is the rough volume of the crater. This rough volume is in a pure cylindrical shape only.
For the latitude of the craters, 2/3 of the craters are in the southern hemisphere with 1/3 being in the northern hemisphere. There is a higher extreme of the craters in the southern hemisphere then in the northern hemisphere, with the range being -74.964 to 28.957. Not a single latitude repeats, so all entries share the same percentage.
Unlike the latitude of the craters, the diameter has no distinguishing outliers. The diameters are relatively distributed evenly with only one diameter repeating, 94.21 with occured twice. Because of this, all of these entries share the same percentage expect for the previously stated diameter which has a percentage of 3.3898%.
The section of the data that is the most interesting is the depth. With the depth, there is repeating up to 3 times. The depth is also distributed fairly evenly from 2 to 3.14. However, there are two outliers after 3.14, those being 3.8 and 4.95.
For the rough volume, the group of data is relatively normal. None of the volumes repeat. There is only one outlier within the group of data, and that is and entry for 1375.710930.
Program:
Import libaries.
import pandas import numpy import sys
original_stdout = sys.stdout
Set table size.
pandas.set_option('display.max_columns', 500) pandas.set_option('display.max_rows', 500) pandas.set_option('display.width', 150)
Import dataset.
dataset = pandas.read_csv('marscrater_pds.csv', low_memory = False) data = dataset.copy()
Uppercase all DataFrame column names.
data.columns = map(str.upper, data.columns)
Drop unused columns.
del data['CRATER_ID']
del data['CRATER_NAME'] del data['LONGITUDE_CIRCLE_IMAGE'] del data['MORPHOLOGY_EJECTA_1'] del data['MORPHOLOGY_EJECTA_2'] del data['MORPHOLOGY_EJECTA_3'] del data['NUMBER_LAYERS']
Bugfix for display formates to avoid run time errors.
pandas.set_option('display.float_format', lambda x:'%f'%x)
print(len(data)) print(len(data.columns))
Ensure entires are numeric.
data['LATITUDE_CIRCLE_IMAGE'] = pandas.to_numeric(data['LATITUDE_CIRCLE_IMAGE']) data['DIAM_CIRCLE_IMAGE'] = pandas.to_numeric(data['DIAM_CIRCLE_IMAGE']) data['DEPTH_RIMFLOOR_TOPOG'] = pandas.to_numeric(data['DEPTH_RIMFLOOR_TOPOG'])
print ("01 Raw Data Counts and Percentages") print ("02 Subgrouped Dataset") print ("03 Subgrouped Counts and Percentages") print ("04 Subgrouped Dataset w/ Rough Volumes") print ("\n_____01 Raw Data Counts and Percentages__________________________________________________________________________________")
print ("Raw Dataset for Mars Craters")
print ("\nCounts for Crater Latitude:") print ("Entry: Count:") c1 = data['LATITUDE_CIRCLE_IMAGE'].value_counts(sort = False, dropna = False) print (c1)
print ("\nPercentages for Crater Latitude:") print ("Entry: Percentage:") p1 = data['LATITUDE_CIRCLE_IMAGE'].value_counts(sort = False, normalize = True) print (p1)
print ("\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ")
print ("\nCounts for Crater Diameter:") print ("Entry: Count:") c2 = data['DIAM_CIRCLE_IMAGE'].value_counts(sort = False) print (c2)
print ("\nPercentages for Crater Diameter:") print ("Entry: Percentage:") p2 = data['DIAM_CIRCLE_IMAGE'].value_counts(sort = False, normalize = True) print (p2)
print ("\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ")
print ("\nCounts for Crater Depth:") print ("Entry: Count:") c3 = data['DEPTH_RIMFLOOR_TOPOG'].value_counts(sort = False) print (c3)
print ("\nPercentages for Crater Depth:") print ("Entry: Percentage:") p3 = data['DEPTH_RIMFLOOR_TOPOG'].value_counts(sort = False, normalize = True) print (p3)
print ("\n_____02 Subgrouped Dataset_______________________________________________________________________________________________")
print ("Subgrouped Dataset for Mars Craters")
print ("\nSubgroup of Data (Diameter 75-100 & Depth 2-5):") sub1 = data [(data['DIAM_CIRCLE_IMAGE'] >= 75) & (data['DIAM_CIRCLE_IMAGE'] <= 100) & (data['DEPTH_RIMFLOOR_TOPOG'] >= 2) & (data['DEPTH_RIMFLOOR_TOPOG'] <= 5)] sub2 = sub1.copy() print (sub2)
print ("\n_____03 Subgrouped Counts and Percentages_________________________________________________________________________________")
print ("\nCounts for Crater Latitude:") print ("Entry: Count:") c12 = sub2['LATITUDE_CIRCLE_IMAGE'].value_counts(sort = False, dropna = False) print (c12)
print ("\nPercentages for Crater Latitude:") print ("Entry: Percentage:") p12 = sub2['LATITUDE_CIRCLE_IMAGE'].value_counts(sort = False, normalize = True) print (p12)
print ("\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ")
print ("\nCounts for Crater Diameter:") print ("Entry: Count:") c22 = sub2['DIAM_CIRCLE_IMAGE'].value_counts(sort = False) print (c22)
print ("\nPercentages for Crater Diameter:") print ("Entry: Percentage:") p22 = sub2['DIAM_CIRCLE_IMAGE'].value_counts(sort = False, normalize = True) print (p22)
print ("\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ")
print ("\nCounts for Crater Depth:") print ("Entry: Count:") c32 = sub2['DEPTH_RIMFLOOR_TOPOG'].value_counts(sort = False) print (c32)
print ("\nPercentages for Crater Depth:") print ("Entry: Percentage:") p32 = sub2['DEPTH_RIMFLOOR_TOPOG'].value_counts(sort = False, normalize = True) print (p32)
print ("\n_____04 Subgrouped Dataset w/ Rough Volumes_________________________________________________________________________________")
print ("Subgrouped Dataset w/ Rough Volumes")
Rough volume of crater.
sub3 = sub2.copy() sub3['ROUGH_VOLUME'] = sub3['DIAM_CIRCLE_IMAGE'] * sub3['DEPTH_RIMFLOOR_TOPOG'] * 3.14
sub3['ROUGH_VOLUME'] = pandas.to_numeric(data['ROUGH_VOLUME'])
print (sub3)
print ("\n_____05 Subgrouped Counts and Percentages for ROUGH_VOLUME_________________________________________________________________________________")
print ("\nCounts for Rough Volume:") print ("Entry: Count:")
c42 = sub3.groupby('ROUGH_VOLUME').size()
c42 = sub3['ROUGH_VOLUME'].value_counts(sort = False) print (c42)
print ("\nPercentages for Rough Volume:") print ("Entry: Percentage:")
p42 = sub3.groupby('ROUGH_VOLUME').size() * 100 / len(sub3)
p42 = sub3['ROUGH_VOLUME'].value_counts(sort = False, normalize = True) print (p42)
print ("\n_________________________________________________________________________________________________________________________")
print ("\nBegin write to file.")
Writes the programs console output to a file named "output.txt" when the program runs.
with open ('output.txt', 'w') as f:sys.stdout = f print ("01 Raw Data Counts and Percentages") print ("02 Subgrouped Dataset") print ("03 Subgrouped Counts and Percentages") print ("\n_____01 Raw Data Counts and Percentages__________________________________________________________________________________") print ("Raw Dataset for Mars Craters") print ("\nCounts for Crater Latitude:") print ("Entry: Count:") print (c1) print ("\nPercentages for Crater Latitude:") print ("Entry: Percentage:") print (p1) print ("\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ") print ("\nCounts for Crater Diameter:") print ("Entry: Count:") print (c2) print ("\nPercentages for Crater Diameter:") print ("Entry: Percentage:") print (p2) print ("\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ") print ("\nCounts for Crater Depth:") print ("Entry: Count:") print (c3) print ("\nPercentages for Crater Depth:") print ("Entry: Percentage:") print (p3) print ("\n_____02 Subgrouped Dataset_______________________________________________________________________________________________") print ("Subgrouped Dataset for Mars Craters") print ("\nSubgroup of Data (Diameter 75-100 & Depth 2-5):") print (sub2) print ("\n_____03 Subgrouped Counts and Percentages_________________________________________________________________________________") print ("\nCounts for Crater Latitude:") print ("Entry: Count:") print (c12) print ("\nPercentages for Crater Latitude:") print ("Entry: Percentage:") print (p12) print ("\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ") print ("\nCounts for Crater Diameter:") print ("Entry: Count:") print (c22) print ("\nPercentages for Crater Diameter:") print ("Entry: Percentage:") print (p22) print ("\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ") print ("\nCounts for Crater Depth:") print ("Entry: Count:") print (c32) print ("\nPercentages for Crater Depth:") print ("Entry: Percentage:") print (p32) print ("\n_____04 Subgrouped Dataset w/ Rough Volumes_________________________________________________________________________________") print ("Subgrouped Dataset w/ Rough Volumes") print (sub3) print ("\n_____05 Subgrouped Counts and Percentages for ROUGH_VOLUME_________________________________________________________________________________") print ("\nCounts for Rough Volume:") print ("Entry: Count:") print (c42) print ("\nPercentages for Rough Volume:") print ("Entry: Percentage:") print (p42) print ("\n_________________________________________________________________________________________________________________________") sys.stdout = original_stdout
print ("Output has been written to file 'output.txt'.")
0 notes
ccfdtdmav · 2 years ago
Text
Running Your First Program
For my dataset, I restricted my data to a Diameter of 75-100 and a depth of 2 to 5.
For the latitude of the craters, 2/3 of the craters are in the southern hemisphere with 1/3 being in the northern hemisphere. There is a higher extreme of the craters in the southern hemisphere then in the northern hemisphere, with the range being -74.964 to 28.957. Not a single latitude repeats, so all entries share the same percentage.
Unlike the latitude of the craters, the diameter has no distinguishing outliers. The diameters are relatively distributed evenly with only one diameter repeating, 94.21 with occured twice. Because of this, all of these entries share the same percentage expect for the previously stated diameter which has a percentage of 3.3898%.
The section of the data that is the most interesting is the depth. With the depth, there is repeating up to 3 times. The depth is also distributed fairly evenly from 2 to 3.14. However, there are two outliers after 3.14, those being 3.8 and 4.95.
Program:
Import libaries.
import pandas import numpy import sys
original_stdout = sys.stdout
Import dataset.
dataset = pandas.read_csv('marscrater_pds.csv', low_memory = False) data = dataset.copy()
Uppercase all DataFrame column names.
data.columns = map(str.upper, data.columns)
Drop unused columns.
del data['CRATER_ID'] del data['CRATER_NAME'] del data['LONGITUDE_CIRCLE_IMAGE'] del data['MORPHOLOGY_EJECTA_1'] del data['MORPHOLOGY_EJECTA_2'] del data['MORPHOLOGY_EJECTA_3'] del data['NUMBER_LAYERS']
Bugfix for display formates to avoid run time errors.
pandas.set_option('display.float_format', lambda x:'%f'%x)
print(len(data)) print(len(data.columns))
Ensure entires are numeric.
data['LATITUDE_CIRCLE_IMAGE'] = pandas.to_numeric(data['LATITUDE_CIRCLE_IMAGE']) data['DIAM_CIRCLE_IMAGE'] = pandas.to_numeric(data['DIAM_CIRCLE_IMAGE']) data['DEPTH_RIMFLOOR_TOPOG'] = pandas.to_numeric(data['DEPTH_RIMFLOOR_TOPOG'])
print ("01 Raw Data Counts and Percentages") print ("02 Subgrouped Dataset") print ("03 Subgrouped Counts and Percentages") print ("\n_____01 Raw Data Counts and Percentages__________________________________________________________________________________")
print ("Raw Dataset for Mars Craters")
print ("\nCounts for Crater Latitude:") print ("Entry: Count:") c1 = data['LATITUDE_CIRCLE_IMAGE'].value_counts(sort = False, dropna = False) print (c1)
print ("\nPercentages for Crater Latitude:") print ("Entry: Percentage:") p1 = data['LATITUDE_CIRCLE_IMAGE'].value_counts(sort = False, normalize = True) print (p1)
print ("\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ")
print ("\nCounts for Crater Diameter:") print ("Entry: Count:") c2 = data['DIAM_CIRCLE_IMAGE'].value_counts(sort = False) print (c2)
print ("\nPercentages for Crater Diameter:") print ("Entry: Percentage:") p2 = data['DIAM_CIRCLE_IMAGE'].value_counts(sort = False, normalize = True) print (p2)
print ("\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ")
print ("\nCounts for Crater Depth:") print ("Entry: Count:") c3 = data['DEPTH_RIMFLOOR_TOPOG'].value_counts(sort = False) print (c3)
print ("\nPercentages for Crater Depth:") print ("Entry: Percentage:") p3 = data['DEPTH_RIMFLOOR_TOPOG'].value_counts(sort = False, normalize = True) print (p3)
print ("\n_____02 Subgrouped Dataset_______________________________________________________________________________________________")
print ("Subgrouped Dataset for Mars Craters")
print ("\nSubgroup of Data (Diameter 75-100 & Depth 2-5):") sub1 = data [(data['DIAM_CIRCLE_IMAGE'] >= 75) & (data['DIAM_CIRCLE_IMAGE'] <= 100) & (data['DEPTH_RIMFLOOR_TOPOG'] >= 2) & (data['DEPTH_RIMFLOOR_TOPOG'] <= 5)] sub2 = sub1.copy() print (sub2)
print ("\n_____03 Subgrouped Counts and Percentages_________________________________________________________________________________")
print ("\nCounts for Crater Latitude:") print ("Entry: Count:") c12 = sub2['LATITUDE_CIRCLE_IMAGE'].value_counts(sort = False, dropna = False) print (c12)
print ("\nPercentages for Crater Latitude:") print ("Entry: Percentage:") p12 = sub2['LATITUDE_CIRCLE_IMAGE'].value_counts(sort = False, normalize = True) print (p12)
print ("\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ")
print ("\nCounts for Crater Diameter:") print ("Entry: Count:") c22 = sub2['DIAM_CIRCLE_IMAGE'].value_counts(sort = False) print (c22)
print ("\nPercentages for Crater Diameter:") print ("Entry: Percentage:") p22 = sub2['DIAM_CIRCLE_IMAGE'].value_counts(sort = False, normalize = True) print (p22)
print ("\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ")
print ("\nCounts for Crater Depth:") print ("Entry: Count:") c32 = sub2['DEPTH_RIMFLOOR_TOPOG'].value_counts(sort = False) print (c32)
print ("\nPercentages for Crater Depth:") print ("Entry: Percentage:") p32 = sub2['DEPTH_RIMFLOOR_TOPOG'].value_counts(sort = False, normalize = True) print (p32)
print ("\n_________________________________________________________________________________________________________________________")
print ("\nBegin write to file.")
Writes the programs console output to a file named "output.txt" when the program runs.
with open ('output.txt', 'w') as f:sys.stdout = f print ("01 Raw Data Counts and Percentages") print ("02 Subgrouped Dataset") print ("03 Subgrouped Counts and Percentages") print ("\n_____01 Raw Data Counts and Percentages__________________________________________________________________________________") print ("Raw Dataset for Mars Craters") print ("\nCounts for Crater Latitude:") print ("Entry: Count:") print (c1) print ("\nPercentages for Crater Latitude:") print ("Entry: Percentage:") print (p1) print ("\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ") print ("\nCounts for Crater Diameter:") print ("Entry: Count:") print (c2) print ("\nPercentages for Crater Diameter:") print ("Entry: Percentage:") print (p2) print ("\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ") print ("\nCounts for Crater Depth:") print ("Entry: Count:") print (c3) print ("\nPercentages for Crater Depth:") print ("Entry: Percentage:") print (p3) print ("\n_____02 Subgrouped Dataset_______________________________________________________________________________________________") print ("Subgrouped Dataset for Mars Craters") print ("\nSubgroup of Data (Diameter 75-100 & Depth 2-5):") print (sub2) print ("\n_____03 Subgrouped Counts and Percentages_________________________________________________________________________________") print ("\nCounts for Crater Latitude:") print ("Entry: Count:") print (c12) print ("\nPercentages for Crater Latitude:") print ("Entry: Percentage:") print (p12) print ("\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ") print ("\nCounts for Crater Diameter:") print ("Entry: Count:") print (c22) print ("\nPercentages for Crater Diameter:") print ("Entry: Percentage:") print (p22) print ("\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ") print ("\nCounts for Crater Depth:") print ("Entry: Count:") print (c32) print ("\nPercentages for Crater Depth:") print ("Entry: Percentage:") print (p32) print ("\n_________________________________________________________________________________________________________________________") sys.stdout = original_stdout
print ("Output has been written to file 'output.txt'.")
Output:
01 Raw Data Counts and Percentages 02 Subgrouped Dataset 03 Subgrouped Counts and Percentages
01 Raw Data Counts and Percentages_____________________________________________________________________________ Raw Dataset for Mars Craters
Counts for Crater Latitude: Entry: Count: 84.367000 1 72.760000 2 69.244000 1 70.107000 1 77.996000 1 .. -69.498000 1 -71.540000 1 -77.415000 1 -79.415000 1 -79.664000 1 Name: LATITUDE_CIRCLE_IMAGE, Length: 129197, dtype: int64
Percentages for Crater Latitude: Entry: Percentage: 84.367000 0.000003 72.760000 0.000005 69.244000 0.000003 70.107000 0.000003 77.996000 0.000003 … -69.498000 0.000003 -71.540000 0.000003 -77.415000 0.000003 -79.415000 0.000003 -79.664000 0.000003 Name: LATITUDE_CIRCLE_IMAGE, Length: 129197, dtype: float64
Counts for Crater Diameter: Entry: Count: 82.100000 1 82.020000 1 79.630000 1 74.810000 1 73.530000 2 .. 31.180000 1 30.940000 2 30.560000 1 29.740000 1 28.420000 1 Name: DIAM_CIRCLE_IMAGE, Length: 6240, dtype: int64
Percentages for Crater Diameter: Entry: Percentage: 82.100000 0.000003 82.020000 0.000003 79.630000 0.000003 74.810000 0.000003 73.530000 0.000005 … 31.180000 0.000003 30.940000 0.000005 30.560000 0.000003 29.740000 0.000003 28.420000 0.000003 Name: DIAM_CIRCLE_IMAGE, Length: 6240, dtype: float64
Counts for Crater Depth: Entry: Count: 0.220000 1189 1.970000 20 0.090000 2008 0.130000 1763 0.110000 1953 … 2.940000 1 -0.420000 1 2.690000 1 3.080000 1 2.570000 1 Name: DEPTH_RIMFLOOR_TOPOG, Length: 296, dtype: int64
Percentages for Crater Depth: Entry: Percentage: 0.220000 0.003094 1.970000 0.000052 0.090000 0.005224 0.130000 0.004587 0.110000 0.005081 … 2.940000 0.000003 -0.420000 0.000003 2.690000 0.000003 3.080000 0.000003 2.570000 0.000003 Name: DEPTH_RIMFLOOR_TOPOG, Length: 296, dtype: float64
02 Subgrouped Dataset__________________________________________________________________________________________ Subgrouped Dataset for Mars Craters
Subgroup of Data (Diameter 75-100 & Depth 2-5): LATITUDE_CIRCLE_IMAGE DIAM_CIRCLE_IMAGE DEPTH_RIMFLOOR_TOPOG 59129 12.252000 92.490000 2.900000 67273 26.990000 99.920000 2.490000 80203 12.931000 96.690000 2.120000 80207 13.416000 94.210000 2.620000 80208 10.690000 93.380000 2.720000 80209 21.897000 90.920000 2.290000 80211 12.937000 89.220000 2.560000 80214 13.662000 86.940000 2.320000 80217 24.340000 78.630000 2.500000 80219 23.863000 75.170000 2.330000 96950 14.591000 97.960000 2.000000 96952 1.568000 95.850000 2.650000 96965 11.510000 81.990000 2.760000 96976 20.818000 75.840000 2.010000 115814 25.497000 94.210000 2.100000 115820 28.957000 89.820000 2.670000 115823 28.417000 83.670000 2.650000 129732 5.454000 96.120000 2.280000 143255 12.337000 83.910000 2.420000 150918 -14.877000 88.560000 2.350000 173696 -16.312000 88.510000 4.950000 173702 -2.945000 78.850000 3.800000 173703 -28.447000 77.230000 2.670000 188267 -21.887000 95.600000 3.140000 188270 -18.878000 90.110000 2.970000 188271 -24.630000 87.180000 2.060000 188276 -29.952000 84.280000 2.250000 208726 -23.321000 98.090000 2.450000 208741 -21.966000 82.260000 2.290000 208750 -19.145000 75.610000 2.910000 227419 -28.393000 98.240000 2.030000 227425 -9.375000 93.360000 2.550000 227429 -27.342000 90.380000 2.250000 227435 -21.738000 86.640000 2.130000 227439 -21.882000 81.560000 2.000000 227440 -27.836000 81.280000 2.190000 227444 -28.892000 77.940000 2.030000 227446 -27.017000 77.120000 2.550000 247403 -1.134000 86.800000 2.910000 266829 -24.662000 91.500000 2.410000 266839 -9.591000 78.730000 2.130000 284506 -55.153000 97.500000 2.070000 284528 -30.285000 77.650000 2.130000 284537 -61.441000 75.350000 2.320000 300280 -57.397000 82.510000 2.400000 300281 -46.806000 81.230000 2.100000 300282 -62.914000 80.060000 2.160000 316280 -48.342000 83.720000 2.520000 316281 -36.591000 83.340000 2.300000 316282 -59.424000 83.170000 2.140000 316283 -44.129000 79.200000 2.320000 331072 -49.604000 90.840000 2.550000 331081 -40.107000 79.580000 2.540000 331084 -39.665000 78.880000 2.450000 331089 -34.609000 78.090000 2.440000 344994 -53.189000 78.470000 2.110000 354524 -40.258000 91.740000 2.200000 354543 -45.362000 76.150000 2.530000 370682 -74.964000 90.690000 2.110000
03 Subgrouped Counts and Percentages____________________________________________________________________________
Counts for Crater Latitude: Entry: Count: 12.252000 1 26.990000 1 12.931000 1 13.416000 1 10.690000 1 21.897000 1 12.937000 1 13.662000 1 24.340000 1 23.863000 1 14.591000 1 1.568000 1 11.510000 1 20.818000 1 25.497000 1 28.957000 1 28.417000 1 5.454000 1 12.337000 1 -14.877000 1 -16.312000 1 -2.945000 1 -28.447000 1 -21.887000 1 -18.878000 1 -24.630000 1 -29.952000 1 -23.321000 1 -21.966000 1 -19.145000 1 -28.393000 1 -9.375000 1 -27.342000 1 -21.738000 1 -21.882000 1 -27.836000 1 -28.892000 1 -27.017000 1 -1.134000 1 -24.662000 1 -9.591000 1 -55.153000 1 -30.285000 1 -61.441000 1 -57.397000 1 -46.806000 1 -62.914000 1 -48.342000 1 -36.591000 1 -59.424000 1 -44.129000 1 -49.604000 1 -40.107000 1 -39.665000 1 -34.609000 1 -53.189000 1 -40.258000 1 -45.362000 1 -74.964000 1 Name: LATITUDE_CIRCLE_IMAGE, dtype: int64
Percentages for Crater Latitude: Entry: Percentage: 12.252000 0.016949 26.990000 0.016949 12.931000 0.016949 13.416000 0.016949 10.690000 0.016949 21.897000 0.016949 12.937000 0.016949 13.662000 0.016949 24.340000 0.016949 23.863000 0.016949 14.591000 0.016949 1.568000 0.016949 11.510000 0.016949 20.818000 0.016949 25.497000 0.016949 28.957000 0.016949 28.417000 0.016949 5.454000 0.016949 12.337000 0.016949 -14.877000 0.016949 -16.312000 0.016949 -2.945000 0.016949 -28.447000 0.016949 -21.887000 0.016949 -18.878000 0.016949 -24.630000 0.016949 -29.952000 0.016949 -23.321000 0.016949 -21.966000 0.016949 -19.145000 0.016949 -28.393000 0.016949 -9.375000 0.016949 -27.342000 0.016949 -21.738000 0.016949 -21.882000 0.016949 -27.836000 0.016949 -28.892000 0.016949 -27.017000 0.016949 -1.134000 0.016949 -24.662000 0.016949 -9.591000 0.016949 -55.153000 0.016949 -30.285000 0.016949 -61.441000 0.016949 -57.397000 0.016949 -46.806000 0.016949 -62.914000 0.016949 -48.342000 0.016949 -36.591000 0.016949 -59.424000 0.016949 -44.129000 0.016949 -49.604000 0.016949 -40.107000 0.016949 -39.665000 0.016949 -34.609000 0.016949 -53.189000 0.016949 -40.258000 0.016949 -45.362000 0.016949 -74.964000 0.016949 Name: LATITUDE_CIRCLE_IMAGE, dtype: float64
Counts for Crater Diameter: Entry: Count: 92.490000 1 99.920000 1 96.690000 1 94.210000 2 93.380000 1 90.920000 1 89.220000 1 86.940000 1 78.630000 1 75.170000 1 97.960000 1 95.850000 1 81.990000 1 75.840000 1 89.820000 1 83.670000 1 96.120000 1 83.910000 1 88.560000 1 88.510000 1 78.850000 1 77.230000 1 95.600000 1 90.110000 1 87.180000 1 84.280000 1 98.090000 1 82.260000 1 75.610000 1 98.240000 1 93.360000 1 90.380000 1 86.640000 1 81.560000 1 81.280000 1 77.940000 1 77.120000 1 86.800000 1 91.500000 1 78.730000 1 97.500000 1 77.650000 1 75.350000 1 82.510000 1 81.230000 1 80.060000 1 83.720000 1 83.340000 1 83.170000 1 79.200000 1 90.840000 1 79.580000 1 78.880000 1 78.090000 1 78.470000 1 91.740000 1 76.150000 1 90.690000 1 Name: DIAM_CIRCLE_IMAGE, dtype: int64
Percentages for Crater Diameter: Entry: Percentage: 92.490000 0.016949 99.920000 0.016949 96.690000 0.016949 94.210000 0.033898 93.380000 0.016949 90.920000 0.016949 89.220000 0.016949 86.940000 0.016949 78.630000 0.016949 75.170000 0.016949 97.960000 0.016949 95.850000 0.016949 81.990000 0.016949 75.840000 0.016949 89.820000 0.016949 83.670000 0.016949 96.120000 0.016949 83.910000 0.016949 88.560000 0.016949 88.510000 0.016949 78.850000 0.016949 77.230000 0.016949 95.600000 0.016949 90.110000 0.016949 87.180000 0.016949 84.280000 0.016949 98.090000 0.016949 82.260000 0.016949 75.610000 0.016949 98.240000 0.016949 93.360000 0.016949 90.380000 0.016949 86.640000 0.016949 81.560000 0.016949 81.280000 0.016949 77.940000 0.016949 77.120000 0.016949 86.800000 0.016949 91.500000 0.016949 78.730000 0.016949 97.500000 0.016949 77.650000 0.016949 75.350000 0.016949 82.510000 0.016949 81.230000 0.016949 80.060000 0.016949 83.720000 0.016949 83.340000 0.016949 83.170000 0.016949 79.200000 0.016949 90.840000 0.016949 79.580000 0.016949 78.880000 0.016949 78.090000 0.016949 78.470000 0.016949 91.740000 0.016949 76.150000 0.016949 90.690000 0.016949 Name: DIAM_CIRCLE_IMAGE, dtype: float64
Counts for Crater Depth: Entry: Count: 2.900000 1 2.490000 1 2.120000 1 2.620000 1 2.720000 1 2.290000 2 2.560000 1 2.320000 3 2.500000 1 2.330000 1 2.000000 2 2.650000 2 2.760000 1 2.010000 1 2.100000 2 2.670000 2 2.280000 1 2.420000 1 2.350000 1 4.950000 1 3.800000 1 3.140000 1 2.970000 1 2.060000 1 2.250000 2 2.450000 2 2.910000 2 2.030000 2 2.550000 3 2.130000 3 2.190000 1 2.410000 1 2.070000 1 2.400000 1 2.160000 1 2.520000 1 2.300000 1 2.140000 1 2.540000 1 2.440000 1 2.110000 2 2.200000 1 2.530000 1 Name: DEPTH_RIMFLOOR_TOPOG, dtype: int64
Percentages for Crater Depth: Entry: Percentage: 2.900000 0.016949 2.490000 0.016949 2.120000 0.016949 2.620000 0.016949 2.720000 0.016949 2.290000 0.033898 2.560000 0.016949 2.320000 0.050847 2.500000 0.016949 2.330000 0.016949 2.000000 0.033898 2.650000 0.033898 2.760000 0.016949 2.010000 0.016949 2.100000 0.033898 2.670000 0.033898 2.280000 0.016949 2.420000 0.016949 2.350000 0.016949 4.950000 0.016949 3.800000 0.016949 3.140000 0.016949 2.970000 0.016949 2.060000 0.016949 2.250000 0.033898 2.450000 0.033898 2.910000 0.033898 2.030000 0.033898 2.550000 0.050847 2.130000 0.050847 2.190000 0.016949 2.410000 0.016949 2.070000 0.016949 2.400000 0.016949 2.160000 0.016949 2.520000 0.016949 2.300000 0.016949 2.140000 0.016949 2.540000 0.016949 2.440000 0.016949 2.110000 0.033898 2.200000 0.016949 2.530000 0.016949 Name: DEPTH_RIMFLOOR_TOPOG, dtype: float64
0 notes
ccfdtdmav · 2 years ago
Text
Getting Your Research Project Started
After review of the different codebooks, the codebook on Mars craters is the most fascinating to me. My personal codebook on this will include CRATER_ID, LATITUDE_CIRCLE_IMAGE, DIAM_CIRCLE_IMAGE, and DEPTH_RIMFLOOR_TOPOG. Based on further research into the relation between diameter, depth, and latitude of craters on I wish to pose the following hypothesis: There is a positive correlation between the diameter and depth of craters on Mars, where as the diameter or depth increases the other variable will increase as well. A secondary question that I want to propose as well is if latitude has an impact on the depth and diameter of the craters.
After review of the below articles ("The morphology of small fresh craters on Mars and the Moon", "The production of small primary craters on Mars and the Moon", and "Degradation of mid-latitude craters on Mars"), I believe that there is a clear connection between depth and diameter with latitude possibly having an impact on both of those characteristics.
"The morphology of small fresh craters on Mars and the Moon". Ingrid J. Daubar, C. Atwood-Stone, S. Byrne, A. S. McEwen, P. S. Russell. https://agupubs.onlinelibrary.wiley.com/doi/full/10.1002/2014JE004671
"The production of small primary craters on Mars and the Moon". Jean-Pierre Williams, Asmin V. Pathare, Oded Aharonson. https://www.sciencedirect.com/science/article/pii/S001910351400133X
"Degradation of mid-latitude craters on Mars". Daniel C. Berman, David A. Crown, Leslie F. Bleamaster III. https://www.sciencedirect.com/science/article/pii/S001910350800359X
0 notes