-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresolving_payments.py
More file actions
52 lines (44 loc) · 1.16 KB
/
resolving_payments.py
File metadata and controls
52 lines (44 loc) · 1.16 KB
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
42
43
44
45
46
47
48
49
50
51
52
# This scripts resoves all strings
import pandas as pd
def check_upi(df):
lt_upi = list()
n = 0
for i in df["Description"]:
if "float" not in str(type(i)):
i = i.lower()
if "upi" in i:
lt_upi.append(n)
n=n+1
return lt_upi
def check_card(df):
lt_card = list()
n = 0
for i in df["Description"]:
if "float" not in str(type(i)):
i = i.lower()
if "debit card" in i:
lt_card.append(n)
n = n+1
return lt_card
def check_atm(df):
lt_atm = list()
n = 0
for i in df["Description"]:
if "float" not in str(type(i)):
i = i.lower()
if "atm" in i:
lt_atm.append(n)
n = n+1
return lt_atm
def summing(csv):
sum_lt = [0,0]
for i, rows in csv.iterrows():
i = rows['Debit']
if "str" in str(type(i)):
i = i.replace(",","")
sum_lt[0] = sum_lt[0] + float(i)
i = rows["Credit"]
if "str" in str(type(i)):
i = i.replace(",","")
sum_lt[1] = sum_lt[1] + float(i)
return sum_lt