Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

2/7/24, 11:33 PM DATp2.

ipynb - Colaboratory

import pandas as pd
df=pd.read_csv('/content/state_results.csv')
df.head(5)

output Release Period State Measure ID Bottom-box Percentage Middle-box Percentage Top-box Percentage

0 07_2015 AK H_CLEAN_HSP 8 22 70

1 07_2015 AK H_COMP_1 9 17 74

2 07_2015 AK H_COMP_2 10 15 75

3 07_2015 AK H_COMP_3 11 21 68

4 07_2015 AK H_COMP_5 19 17 64

import pandas as pd
df=pd.read_csv('/content/state_results.csv')
print(f'The mean of Bottom-box Percentage :{df["Bottom-box Percentage"].mean()}')
print(f'The median of Bottom-box Percentage :{df["Bottom-box Percentage"].median()}')
print(f'The mode of Bottom-box Percentage :{df["Bottom-box Percentage"].mode()}')
print(f'The range of Bottom-box Percentage :{df["Bottom-box Percentage"].max()-df["Bottom-box Percentage"].min()}')
print(f'The variance of Bottom-box Percentage :{df["Bottom-box Percentage"].var()}')
print(f'The stanndard deviation of Bottom-box Percentage :{df["Bottom-box Percentage"].std()}')

The mean of Bottom-box Percentage :8.394323144104803


The median of Bottom-box Percentage :7.0
The mode of Bottom-box Percentage :0 5
Name: Bottom-box Percentage, dtype: int64
The range of Bottom-box Percentage :27
The variance of Bottom-box Percentage :21.029450186011516
The stanndard deviation of Bottom-box Percentage :4.5857878479070004

import pandas as pd
df=pd.read_csv('/content/test.csv')
df.head(5)

id CustomerId Surname CreditScore Geography Gender Age Tenure Balanc

0 165034 15773898 Lucchese 586 France Female 23.0 2 0.0

1 165035 15782418 Nott 683 France Female 46.0 2 0.0

2 165036 15807120 K? 656 France Female 34.0 7 0.0

3 165037 15808905 O'Donnell 681 France Male 36.0 8 0.0

4 165038 15607314 Higgins 752 Germany Male 38 0 10 121263 6

df=pd.read_csv('/content/test.csv')
print(f'The mean of EstimatedSalary :{df["EstimatedSalary"].mean()}')
print(f'The median of EstimatedSalary :{df["EstimatedSalary"].median()}')
print(f'The mode of EstimatedSalary :{df["EstimatedSalary"].mode()}')
print(f'The range of EstimatedSalary :{df["EstimatedSalary"].max()-df["EstimatedSalary"].min()}')
print(f'The variance of EstimatedSalary :{df["EstimatedSalary"].var()}')
print(f'The stanndard deviation of EstimatedSalary :{df["EstimatedSalary"].std()}')

The mean of EstimatedSalary :112315.14776542177


The median of EstimatedSalary :117832.23
The mode of EstimatedSalary :0 88890.05
Name: EstimatedSalary, dtype: float64
The range of EstimatedSalary :199980.90000000002
The variance of EstimatedSalary :2527781580.1270676
The stanndard deviation of EstimatedSalary :50277.048243975776

import pandas as pd
df=pd.read_csv('/content/train.csv')
df.head(5)

id CustomerId Surname CreditScore Geography Gender Age Tenure Balan

0 0 15674932 Okwudilichukwu 668 France Male 33.0 3 0

1 1 15749177 Okwudiliolisa 627 France Male 33.0 1 0

2 2 15694510 Hsueh 678 France Male 40.0 10 0

3 3 15741417 Kao 581 France Male 34.0 2 148882

4 4 15766172 Chiemenam 716 Spain Male 33 0 5 0

https://colab.research.google.com/drive/1UacWZ8mEnblZwbseDBvmT-oW9qHobFt9#scrollTo=sjYFqJfvreQO 1/2
2/7/24, 11:33 PM DATp2.ipynb - Colaboratory

df=pd.read_csv('/content/test.csv')
print(f'The mean of CreditScore :{df["CreditScore"].mean()}')
print(f'The median of CreditScore :{df["CreditScore"].median()}')
print(f'The stanndard deviation of CreditScore :{df["CreditScore"].std()}')

print(f'The mode of CreditScore :{df["CreditScore"].mode()}')


print(f'The range of CreditScore :{df["CreditScore"].max()-df["CreditScore"].min()}')
print(f'The variance of CreditScore :{df["CreditScore"].var()}')

The mean of CreditScore :656.5307890168419


The median of CreditScore :660.0
The stanndard deviation of CreditScore :80.31541451758156
The mode of CreditScore :0 850
Name: CreditScore, dtype: int64
The range of CreditScore :500
The variance of CreditScore :6450.565809130951

https://colab.research.google.com/drive/1UacWZ8mEnblZwbseDBvmT-oW9qHobFt9#scrollTo=sjYFqJfvreQO 2/2

You might also like