-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoperations.py
41 lines (33 loc) · 1.1 KB
/
operations.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
class Opr:
def __init__(self, data):
self.data = data
def mean(self):
columns = input("enter the columns (use \";\" as separator) : ").split(";")
means = {}
for col in columns:
if col not in self.data.columns:
print(f"There is no column named {col}.")
else:
means[col] = self.data[col].mean()
print(means)
def median(self):
columns = input("enter the columns (use \";\" as separator) : ").split(";")
medians = {}
for col in columns:
if col not in self.data.columns:
print(f"There is no column named {col}.")
else:
medians[col] = self.data[col].median()
print(medians)
def dataInfo(self):
print(self.data.info())
def showNull(self):
print(self.data.isna().sum())
def showHead(self):
print(self.data.head())
def showTail(self):
print(self.data.tail())
def describeCsv(self):
print(self.data.describe())
def showColumns(self):
print(self.data.columns)