Python-Module03-Case Study03
Python-Module03-Case Study03
1. Business challenge/requirement
GoodsKart—largest ecommerce company of Indonesia with revenue of $2B+
acquired another ecommerce company FairDeal. FairDeal has its own IT system to
maintain records of customer, sales etc. For ease of maintenance and cost savings
GoodsKart is integrating customer databases of both the organizations hence customer
data of FairDeal has to be converted in GoodsKart Customer Format.
Answer:
import pandas as pd
df = pd.read_csv('FairDealCustomerData.csv',header=None)
df[1] = df[1]+df[0]
del df[0]
fairCustList = list(df[df[2]==0][1].str.strip())
blockcustlist= list(df[df[2]==1][1].str.strip())
fairCustList
class customer:
customers = []
def __init__(self,custlst):
self.customers = custlst
def __del__(self):
self.customers =[]
def IsFair(self,name):
if name in self.customers:
else:
raise Exception
try:
fr = customer(fairCustList)
# print(fr.customers)
except:
******