Skip to content
Snippets Groups Projects
Commit 835e906d authored by wa2-alaaiddin's avatar wa2-alaaiddin :speech_balloon:
Browse files

Task 1 Updated Version

parent b895e722
No related branches found
No related tags found
No related merge requests found
%% Cell type:markdown id: tags:
# UFCFVQ-15-M Programming for Data Science
# Programming Task 1
## Student Id: 23003188
%% Cell type:markdown id: tags:
#### Reading the Task1.dat dataset
Creating a variable to read task 1.dat to call it faster between tasks.
%% Cell type:code id: tags:
``` python
#Creating a variable called (List) and opening the 'task 1.dat' file as 'read' mode
List = open('task1.dat','r')
#Reading the data of the file.
List = List.read()
#The type is (string) at this point and item are one below each other (not a list)
print(f'1) The data at this point is {type(List)}')
#Removing the \n and making it as list
ConvertToList = list(List.strip().split())
#The type is (list) at this point but each item is (string) inside the list is e.g['148', '85', '183']
print(f'2) The items inside {type(ConvertToList)} is {type(ConvertToList[0])} | Now its a list of string')
#Converting all string numbers to (integer)
List = list(map(int, ConvertToList))
#Now all numbers are integer niside the list e.g [148, 85, 183]
print(f'3) The items inside {type(List)} is {type(List[0])} | Now its a list of integer')
```
%% Output
1) The data at this point is <class 'str'>
2) The items inside <class 'list'> is <class 'str'> | Now its a list of string
3) The items inside <class 'list'> is <class 'int'> | Now its a list of integer
%% Cell type:markdown id: tags:
### Requirement FR1.1 - Find the arithmetic mean
%% Cell type:code id: tags:
``` python
#function to get the mean of a python list
def meanFinder(List):
#assining the varivale to be global so it can be called any were else (as it has been called in FR1.7)
global ListMean
MeanListSum = 0
MeanListLength = 0
#Find the sum of the list using pure python
for DataInList in List:
MeanListSum += DataInList
#Find the Length of the list using pure python
for DataLength in List:
MeanListLength += 1
#Find the mean of the list using the mathematical mean equation
ListMean = MeanListSum/MeanListLength
#Print The result and round it to 3 decimal places
print(f'The mean of the list = {round(ListMean,3)}')
ListMean = sum(List)/len(List)
###
##Fast Alternative way with pre-built python functions
##---
#meanEq = sum(List)/len(List)
#return meanEq
##---
###
#Rturn The result
return ListMean
#Calling the function and passing the >> List << argument to it
meanFinder(List)
print(f'The mean of the list = {meanFinder(List)}')
```
%% Output
The mean of the list = 120.895
The mean of the list = 120.89453125
%% Cell type:markdown id: tags:
##### MARK: %
#### FEEDBACK:
%% Cell type:markdown id: tags:
### Requirement FR1.2 - Find the standard deviation
%% Cell type:code id: tags:
``` python
#Function to find the standard deviation
def StdDevFinder(List):
#assining the varivale to be global so it can be called any were else (as it has been called in FR1.7)
global STD_DEV
#Find the sum of the list using pre-bulid python function (len)
StdListSum = sum(List)
#Find the length of the list using pre-bulid python function (len)
StdListLength = len(List)
#Find the mean of the list
StdListMean = StdListSum/StdListLength
#Find the variance among the list using its mathematical equation
# (Square each deviation from the mean & Calculate the variance)
StdVariance = sum((DataInList - StdListMean)**2 for DataInList in List) / StdListLength
StdVariance = sum((DataInList - ListMean)**2 for DataInList in List) / len(List)
STD_DEV = StdVariance ** 0.5
#Print The result and round it to 3 decimal places
print(f'Standard Devision of the list = {round(STD_DEV,3)}')
#Rturn The result
return STD_DEV
#Calling the function and passing the >> List << argument to it
StdDevFinder(List)
print(f'Standard Devision of the list = {StdDevFinder(List)}')
```
%% Output
Standard Devision of the list = 31.952
Standard Devision of the list = 31.95179590820272
%% Cell type:markdown id: tags:
##### MARK: %
#### FEEDBACK:
%% Cell type:markdown id: tags:
### Requirement FR1.3 - Find the min/max values
%% Cell type:code id: tags:
``` python
#Function to find the minimum value in a python list
def MinFinder(List):
#set a variable that carry the first number in the list to compare it with other numbers in the list
ListMin=List[0]
#For loop to accsses each number in the list
for numbers in range(1,len(List)):
#If the new number is smaller than the next number in the list, assign it as (ListMin) 'the new smallest number'
if List[numbers] <ListMin:
ListMin=List[numbers]
#Print out the smallest number
print(f'The minimum number in the list = {ListMin}')
###
##Fast Alternative way with pre-built python functions
##---
#ListMin = min(List)
#return ListMin
##---
###
ListMin = min(List)
return ListMin
#Function to find the maximum value in a python list
def MaxFinder(List):
#set a variable that carry the first number in the list to compare it with other numbers in the list
ListMax=List[0]
#For loop to accsses each number in the list
for numbers in range(1,len(List)):
#If the new number is bigger than the next number in the list, assign it as (ListMax) 'the new largest number'
if(List[numbers]>ListMax):
ListMax=List[numbers]
#Print out the largest number
print(f'The max number in the list = {ListMax}')
###
##Fast Alternative way with pre-build python functions
##---
#ListMax = max(List)
#return ListMax
##---
###
ListMax = max(List)
return ListMax
#Calling the functions and passing the >> List << argument to it
MinFinder(List)
MaxFinder(List)
print(f'The minimum number in the list = {MinFinder(List)}')
print(f'The maximum in the list = {MaxFinder(List)}')
```
%% Output
The minimum number in the list = 0
The max number in the list = 199
The maximum in the list = 199
%% Cell type:markdown id: tags:
##### MARK: %
#### FEEDBACK:
%% Cell type:markdown id: tags:
#### Percentile Function
Creating Percentile Function to be used for FR1.4 to FR1.7
%% Cell type:code id: tags:
``` python
#A function has been created before the question to calculate all percentile inside the List
#The function takes two arguments, List(the data list), percentile(the percentile number)
def percentileFinder(List,percentile):
#Firstly, finding the length of the list
ListNumber = len(List)
#Multiplying the length with the percentile number and dividing it by 100 (percentile equation)
Listpercentile = ListNumber * percentile / 100
#If the number inside the (List Percentile) is integer, sort it and return it to (List Percentile list)
if Listpercentile.is_integer():
Listpercentile = sorted(List)[int(Listpercentile)]
return Listpercentile
#else, remove it from (List Percentile list)
else:
Listpercentile = sorted(List)[int(round(Listpercentile)) -1]
return Listpercentile
```
%% Cell type:markdown id: tags:
### Requirement FR1.4 - Find the 25th percentile
%% Cell type:code id: tags:
``` python
#Finding the 25 percentile
percentileOf_25 = percentileFinder(List,25)
#Print the result
print(f'The 25 percentile = {percentileOf_25}')
```
%% Output
The 25 percentile = 99
%% Cell type:markdown id: tags:
##### MARK: %
#### FEEDBACK:
%% Cell type:markdown id: tags:
### Requirement FR1.5 - Find the 50th percentile
%% Cell type:code id: tags:
``` python
#Finding the 50 percentile
percentileOf_50 = percentileFinder(List,50)
#Print the result
print(f'The 50 percentile = {percentileOf_50}')
```
%% Output
The 50 percentile = 117
%% Cell type:markdown id: tags:
##### MARK: %
#### FEEDBACK:
%% Cell type:markdown id: tags:
### Requirement FR1.6 - Find the 75th percentile
%% Cell type:code id: tags:
``` python
#Finding the 75 percentile
percentileOf_75 = percentileFinder(List,75)
#Print the result
print(f'The 75 percentile = {percentileOf_75}')
```
%% Output
The 75 percentile = 141
%% Cell type:markdown id: tags:
##### MARK: %
#### FEEDBACK:
%% Cell type:markdown id: tags:
### Requirement FR1.7 - Print the set of summary statistics in tabular form
%% Cell type:code id: tags:
``` python
#Creating a dictionary that contains all the needed summary with the right definition and variable
TabularDic = {
'Count':len(List),
'Mean':round(ListMean,3),
'StdDev':round(STD_DEV,3),
'StdDev':round(StdDevFinder(List),3),
'Minimum':min(List),
'25 percentile':percentileOf_25,
'50 percentile':percentileOf_50,
'70 percentile':percentileOf_75,
'Maximum':max(List)
}
#Printing out the result
print('Summary Statistics\n')
#Using the for loop to access each items in the dictionary (definition = names) (variables = data)
for definition, variables in TabularDic.items():
print(f'{definition: <30}{variables}')
```
%% Output
Summary Statistics
Count 768
Mean 120.895
StdDev 31.952
Minimum 0
25 percentile 99
50 percentile 117
70 percentile 141
Maximum 199
%% Cell type:markdown id: tags:
##### MARK: %
#### FEEDBACK:
%% Cell type:markdown id: tags:
### Requirement FR1.8 - Read data from a file into memory
%% Cell type:code id: tags:
``` python
#Opening 'task 1.dat' file as 'read' mode and reading its content
FileName = open('task1.dat','r')
FileName = FileName.read()
#Removing ('\n')
ConvertToList = list(FileName.strip().split())
#Converting it to integer list
List = list(map(int, ConvertToList))
#Finding the file size inside the computer memory
def getSize(file):
file.seek(0,2) #To count from the from the start of the file, and stop at the end.
FileSize = file.tell() # To get file position
#Print file size in memory
print(f'[+] Memory Size >>> {FileSize*0.001} (KB) | {FileSize} Bytes | {round(FileSize*0.000001,6)} (MB)\n')
#Print file size
print(f'[+] File Size >>> {FileSize*0.001} (KB) | {FileSize} Bytes | {round(FileSize*0.000001,6)} (MB)\n')
FileName = open('task1.dat','r')
getSize(FileName)
print(f'[+] The data type is {type(List)} and the numbers inside is {type(List[0])}\n')
print(f"[+] The file content as shown:\n\n{List}")
print(f"[+] The file content as shown:\n\n{List[0:]}")
```
%% Output
[+] Memory Size >>> 3.638 (KB) | 3638 Bytes | 0.003638 (MB)
[+] File Size >>> 3.638 (KB) | 3638 Bytes | 0.003638 (MB)
[+] The data type is <class 'list'> and the numbers inside is <class 'int'>
[+] The file content as shown:
[148, 85, 183, 89, 137, 116, 78, 115, 197, 125, 110, 168, 139, 189, 166, 100, 118, 107, 103, 115, 126, 99, 196, 119, 143, 125, 147, 97, 145, 117, 109, 158, 88, 92, 122, 103, 138, 102, 90, 111, 180, 133, 106, 171, 159, 180, 146, 71, 103, 105, 103, 101, 88, 176, 150, 73, 187, 100, 146, 105, 84, 133, 44, 141, 114, 99, 109, 109, 95, 146, 100, 139, 126, 129, 79, 0, 62, 95, 131, 112, 113, 74, 83, 101, 137, 110, 106, 100, 136, 107, 80, 123, 81, 134, 142, 144, 92, 71, 93, 122, 163, 151, 125, 81, 85, 126, 96, 144, 83, 95, 171, 155, 89, 76, 160, 146, 124, 78, 97, 99, 162, 111, 107, 132, 113, 88, 120, 118, 117, 105, 173, 122, 170, 84, 96, 125, 100, 93, 129, 105, 128, 106, 108, 108, 154, 102, 57, 106, 147, 90, 136, 114, 156, 153, 188, 152, 99, 109, 88, 163, 151, 102, 114, 100, 131, 104, 148, 120, 110, 111, 102, 134, 87, 79, 75, 179, 85, 129, 143, 130, 87, 119, 0, 73, 141, 194, 181, 128, 109, 139, 111, 123, 159, 135, 85, 158, 105, 107, 109, 148, 113, 138, 108, 99, 103, 111, 196, 162, 96, 184, 81, 147, 179, 140, 112, 151, 109, 125, 85, 112, 177, 158, 119, 142, 100, 87, 101, 162, 197, 117, 142, 134, 79, 122, 74, 171, 181, 179, 164, 104, 91, 91, 139, 119, 146, 184, 122, 165, 124, 111, 106, 129, 90, 86, 92, 113, 111, 114, 193, 155, 191, 141, 95, 142, 123, 96, 138, 128, 102, 146, 101, 108, 122, 71, 106, 100, 106, 104, 114, 108, 146, 129, 133, 161, 108, 136, 155, 119, 96, 108, 78, 107, 128, 128, 161, 151, 146, 126, 100, 112, 167, 144, 77, 115, 150, 120, 161, 137, 128, 124, 80, 106, 155, 113, 109, 112, 99, 182, 115, 194, 129, 112, 124, 152, 112, 157, 122, 179, 102, 105, 118, 87, 180, 106, 95, 165, 117, 115, 152, 178, 130, 95, 0, 122, 95, 126, 139, 116, 99, 0, 92, 137, 61, 90, 90, 165, 125, 129, 88, 196, 189, 158, 103, 146, 147, 99, 124, 101, 81, 133, 173, 118, 84, 105, 122, 140, 98, 87, 156, 93, 107, 105, 109, 90, 125, 119, 116, 105, 144, 100, 100, 166, 131, 116, 158, 127, 96, 131, 82, 193, 95, 137, 136, 72, 168, 123, 115, 101, 197, 172, 102, 112, 143, 143, 138, 173, 97, 144, 83, 129, 119, 94, 102, 115, 151, 184, 94, 181, 135, 95, 99, 89, 80, 139, 90, 141, 140, 147, 97, 107, 189, 83, 117, 108, 117, 180, 100, 95, 104, 120, 82, 134, 91, 119, 100, 175, 135, 86, 148, 134, 120, 71, 74, 88, 115, 124, 74, 97, 120, 154, 144, 137, 119, 136, 114, 137, 105, 114, 126, 132, 158, 123, 85, 84, 145, 135, 139, 173, 99, 194, 83, 89, 99, 125, 80, 166, 110, 81, 195, 154, 117, 84, 0, 94, 96, 75, 180, 130, 84, 120, 84, 139, 91, 91, 99, 163, 145, 125, 76, 129, 68, 124, 114, 130, 125, 87, 97, 116, 117, 111, 122, 107, 86, 91, 77, 132, 105, 57, 127, 129, 100, 128, 90, 84, 88, 186, 187, 131, 164, 189, 116, 84, 114, 88, 84, 124, 97, 110, 103, 85, 125, 198, 87, 99, 91, 95, 99, 92, 154, 121, 78, 130, 111, 98, 143, 119, 108, 118, 133, 197, 151, 109, 121, 100, 124, 93, 143, 103, 176, 73, 111, 112, 132, 82, 123, 188, 67, 89, 173, 109, 108, 96, 124, 150, 183, 124, 181, 92, 152, 111, 106, 174, 168, 105, 138, 106, 117, 68, 112, 119, 112, 92, 183, 94, 108, 90, 125, 132, 128, 94, 114, 102, 111, 128, 92, 104, 104, 94, 97, 100, 102, 128, 147, 90, 103, 157, 167, 179, 136, 107, 91, 117, 123, 120, 106, 155, 101, 120, 127, 80, 162, 199, 167, 145, 115, 112, 145, 111, 98, 154, 165, 99, 68, 123, 91, 195, 156, 93, 121, 101, 56, 162, 95, 125, 136, 129, 130, 107, 140, 144, 107, 158, 121, 129, 90, 142, 169, 99, 127, 118, 122, 125, 168, 129, 110, 80, 115, 127, 164, 93, 158, 126, 129, 134, 102, 187, 173, 94, 108, 97, 83, 114, 149, 117, 111, 112, 116, 141, 175, 92, 130, 120, 174, 106, 105, 95, 126, 65, 99, 102, 120, 102, 109, 140, 153, 100, 147, 81, 187, 162, 136, 121, 108, 181, 154, 128, 137, 123, 106, 190, 88, 170, 89, 101, 122, 121, 126, 93]
%% Cell type:markdown id: tags:
##### MARK: %
#### FEEDBACK:
%% Cell type:markdown id: tags:
### Requirement FR1.9 - Design and build a data structure to store CSV data in memory
%% Cell type:markdown id: tags:
Following the given instruction in the appendix.A (output structure), this task has been created.
To be visualised better, the data output has been limited to 10 in each row.
%% Cell type:markdown id: tags:
##### Explanation 1 Example for "EachClmToList"
['A','B','C'],
['1','2','3'],
['4','5','6'],so on..
Therfore EachClmToList[0] = ['A','1','4'..]
##### Explanation 2
For loop is created to reach out to every single data inside 'AppendTolist' in the range of the data length,
(768) or (767) if we count from 0. To be able to do so, 2 for loop should be created as shown, one to count the number of
columns which is (9) or 8 if we count the zero, and the other to count the number of data in each row.
therefore it will start from [0][0].. [1][0].. [2][0] until it reaches [767][0] and switch to [0][1]..
and continue until it reaches the last data in the file which is at [767][8].
while so, the data (numbers) will be appended to a new list called 'EachClmToList'
##### Explanation 3
A mathematical operation to create a sublist of (each data under each line for the header ) to achieve exploration 1, therefore
for every end of a line create a new list for the next line, and at the end, we will have a total of 9 lists that
achieved to carry each column of data into one list
%% Cell type:code id: tags:
``` python
CsvFile = open('task1.csv','r')
AppendTolist = [] #Creating an empty list to append all the CSV data inside it
ColumnHeader = [] #Creating an empty list to append the CSV Column Header (Name of each column)
#Refer to Explanation (1)
EachClmToList = [] #Creating an empty list to append Each column-row (each data under each line for the header )
'''
For loop to read the data inside the CSV file and remove all (\n). therefore all data will be on the same line
but split by a (,) so each line is a sublist, eg. [[Row 1],[Row 2],[Row 3]..]
'''
for data in CsvFile:
data = data.replace('\n','').split(',')
AppendTolist.append(data) #Append (adding) the new data into the 'AppendTolist' list
#print(AppendTolist[0:5])
#For loop to append only the first list >> [0] << of the 'AppendTolist', which is the columns header to another list.
for subList in AppendTolist[0]:
ColumnHeader.append(subList) #append to another list.
#Removing the appended it from the main list 'AppendTolist'
AppendTolist.remove(AppendTolist[0])
#Refer to Explanation (2)
for clmLen in range(len(ColumnHeader)): #9 aka 8 as it starts from 0
#print(ColumnHeader)
for RowLen in range(len(AppendTolist)):#768 aka 767 as it satrts from 0
#print(AppendTolist[767][8])
EachClmToList.append(AppendTolist[RowLen][clmLen])
#print(EachClmToList)
#to avoid python errors, a new variable is created called 'numberOfDataInEach' that carries row length in each line.
numberOfDataInEach = len(AppendTolist)
#Refer to Explanation (3)
EachClmToList = [EachClmToList[x:x+numberOfDataInEach] for x in range(0, len(EachClmToList), numberOfDataInEach)]
#As per as requested the data is stored in the memory and can be called later for analyzing
```
%% Cell type:markdown id: tags:
##### MARK: %
#### FEEDBACK:
%% Cell type:markdown id: tags:
### Requirement FR1.10 - Create and demonstrate a function to read CSV data from a file into memory
%% Cell type:code id: tags:
``` python
#Creating function to construct the data structure and to call it after.
def dataStrcuture():
for x in range(len(ColumnHeader)):
print(f'"{ColumnHeader[x]}" : {list(map(float,EachClmToList[x][:10]))}') #numbers has been converted to float
#Only 10 data have been printed to better visualize the result, for the whole result remove [:10], [:] or none
#list(map(float,EachClmToList[x][:10]))
dataStrcuture()
```
%% Output
"Pregnancies" : [6.0, 1.0, 8.0, 1.0, 0.0, 5.0, 3.0, 10.0, 2.0, 8.0]
"Glucose" : [148.0, 85.0, 183.0, 89.0, 137.0, 116.0, 78.0, 115.0, 197.0, 125.0]
"BloodPressure" : [72.0, 66.0, 64.0, 66.0, 40.0, 74.0, 50.0, 0.0, 70.0, 96.0]
"SkinThickness" : [35.0, 29.0, 0.0, 23.0, 35.0, 0.0, 32.0, 0.0, 45.0, 0.0]
"Insulin" : [0.0, 0.0, 0.0, 94.0, 168.0, 0.0, 88.0, 0.0, 543.0, 0.0]
"BMI" : [33.6, 26.6, 23.3, 28.1, 43.1, 25.6, 31.0, 35.3, 30.5, 0.0]
"DiabetesPedigreeFunction" : [0.627, 0.351, 0.672, 0.167, 2.288, 0.201, 0.248, 0.134, 0.158, 0.232]
"Age" : [50.0, 31.0, 32.0, 21.0, 33.0, 30.0, 26.0, 29.0, 53.0, 54.0]
"Outcome" : [1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 1.0]
%% Cell type:markdown id: tags:
##### MARK: %
#### FEEDBACK:
%% Cell type:markdown id: tags:
### Requirement FR1.11 - Create and demonstrate a generic statistical summary function
%% Cell type:code id: tags:
``` python
print('"Stats" : ["Mean","Stdev", "Min", Max","25%","50%","75%"]\n')
#Calling the file
def dataStrcuture():
global data
#Creating an empty list to append Each column-row (each data under each line for the header )
ConvertdeToFloat = []
#For loop to convet rto float in a way that it can be called later in other tasks.
for x in range(len(ColumnHeader)):
EachClmInListToFloat = list(map(float,EachClmToList[x][:]))
ConvertdeToFloat.append(EachClmInListToFloat)
#Creating variables that contains the required information to create the data structure
#and calling function that has been saved in memory before.
for x in range(len(ColumnHeader)):
data = [round(meanFinder(ConvertdeToFloat[x][:]),3),
round(StdDevFinder((ConvertdeToFloat[x][:])),3),
MinFinder(ConvertdeToFloat[x][:]),
MaxFinder(ConvertdeToFloat[x][:]),
percentileFinder(ConvertdeToFloat[x][:],25),
percentileFinder(ConvertdeToFloat[x][:],50),
percentileFinder(ConvertdeToFloat[x][:],75)
]
print(f'"{ColumnHeader[x]}" : {data}')
dataStrcuture()
```
%% Output
"Stats" : ["Mean","Stdev", "Min", Max","25%","50%","75%"]
"Pregnancies" : [3.845, 3.367, 0.0, 17.0, 1.0, 3.0, 6.0]
"Glucose" : [120.895, 31.952, 0.0, 199.0, 99.0, 117.0, 141.0]
"BloodPressure" : [69.105, 19.343, 0.0, 122.0, 62.0, 72.0, 80.0]
"SkinThickness" : [20.536, 15.942, 0.0, 99.0, 0.0, 23.0, 32.0]
"Insulin" : [79.799, 115.169, 0.0, 846.0, 0.0, 32.0, 128.0]
"BMI" : [31.993, 7.879, 0.0, 67.1, 27.3, 32.0, 36.6]
"DiabetesPedigreeFunction" : [0.472, 0.331, 0.078, 2.42, 0.244, 0.374, 0.627]
"Age" : [33.241, 11.753, 21.0, 81.0, 24.0, 29.0, 41.0]
"Outcome" : [0.349, 0.477, 0.0, 1.0, 0.0, 0.0, 1.0]
%% Cell type:markdown id: tags:
##### MARK: %
# MARK: %
#### FEEDBACK:
%% Cell type:markdown id: tags:
### Requirement FR1.12 - Create and demonstrate a function to print a custom table
%% Cell type:code id: tags:
``` python
#Calling the file
def dataStrcuture():
newList = [element.replace('DiabetesPedigreeFunction', 'DiabPedFnc') for element in ColumnHeader]
clmName = [newList]
Status = ["Mean","Stdev", "Min", "Max","25%","50%","75%"]
format_row = "{: >13} " * (len(Status)+1)
print(stars.rjust(121,'*'))
print(format_row.format("Status", *Status))
print(stars.rjust(121,'*'))
ConvertdeToFloat = []
#For loop to convet into float in a way that it can be called later in other tasks.
Status = ["Mean","Stdev", "Min", "Max","25%","50%","75%"]
for x in range(len(ColumnHeader)):
EachClmInListToFloat = list(map(float,EachClmToList[x][:]))
ConvertdeToFloat.append(EachClmInListToFloat)
#Creating variables that contains the required information to create the data structure
#and calling function that has been saved in memory before.
for x in range(len(ColumnHeader)):
data = [[round(meanFinder(ConvertdeToFloat[x][:]),3),
round(StdDevFinder((ConvertdeToFloat[x][:])),3),
MaxFinder(ConvertdeToFloat[x][:]),
MinFinder(ConvertdeToFloat[x][:]),
percentileFinder(ConvertdeToFloat[x][:],25),
percentileFinder(ConvertdeToFloat[x][:],50),
percentileFinder(ConvertdeToFloat[x][:],75)
]]
format_row = "{:>15}" * (len(Status) + 1)
for names, row in zip(clmName, data):
#print(team[x])
print(format_row.format(names[x], *row))
dataStrcuture()
stars = '*'
print(stars.rjust(121,'*'))
```
%% Output
*************************************************************************************************************************
Status Mean Stdev Min Max 25% 50% 75%
*************************************************************************************************************************
Pregnancies 3.845 3.367 17.0 0.0 1.0 3.0 6.0
Glucose 120.895 31.952 199.0 0.0 99.0 117.0 141.0
BloodPressure 69.105 19.343 122.0 0.0 62.0 72.0 80.0
SkinThickness 20.536 15.942 99.0 0.0 0.0 23.0 32.0
Insulin 79.799 115.169 846.0 0.0 0.0 32.0 128.0
BMI 31.993 7.879 67.1 0.0 27.3 32.0 36.6
DiabPedFnc 0.472 0.331 2.42 0.078 0.244 0.374 0.627
Age 33.241 11.753 81.0 21.0 24.0 29.0 41.0
Outcome 0.349 0.477 1.0 0.0 0.0 0.0 1.0
*************************************************************************************************************************
%% Cell type:markdown id: tags:
##### MARK: %
#### FEEDBACK:
%% Cell type:markdown id: tags:
# Process Development Report for Task 1
%% Cell type:markdown id: tags:
in FR1.2 there is another formula for STd.Dev. we can use that also
%% Cell type:raw id: tags:
%% Cell type:markdown id: tags:
##### MARK: %
#### FEEDBACK:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment