Skip to content

Commit 1436c82

Browse files
authored
Merge pull request #7 from Team-Fourth-Dimension/master
Enabling new commits
2 parents bfe4704 + 05d9dfe commit 1436c82

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

Notebook.py

+15-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import seaborn as sns
66

77
def cleaning_data():
8-
# Importing the datasets
8+
# Importing the datasets
99
portfolio = pd.read_json("portfolio.json",lines=True)
1010
profile = pd.read_json("profile.json",lines=True)
1111
transcript = pd.read_json("transcript.json",lines=True)
@@ -33,6 +33,7 @@ def cleaning_data():
3333
# renaming the id column to offer_id
3434
cleaned_portfolio = cleaned_portfolio.rename(columns={'id':'offer_id'})
3535

36+
3637
# Data Cleaning of profile dataset
3738

3839
# To check the number of NULL values in each column
@@ -106,5 +107,18 @@ def cleaning_data():
106107
# cleaning offers
107108
offers = offers.drop(['transaction','record'],axis=1)
108109
offers = offers.rename(columns={'record_value':'offer_id'})
110+
111+
offers['offer_type'] = offers['offer_id'].copy()
112+
113+
offers['offer_type'].replace(['ae264e3637204a6fb9bb56bc8210ddfd','4d5c57ea9a6940dd891ad53e9dbe8da0',\
114+
'9b98b8c7a33c4b65b9aebfe6a799e6d9','f19421c1d4aa40978ebb69ca19b0e20d'],\
115+
'bogo', inplace=True)
116+
117+
offers['offer_type'].replace(['0b1e1539f2cc45b7b9fa7c272da2e1d7','2298d6c36e964ae4a3e7e9706d1fb8c2',\
118+
'fafdcd668e3743c1bb461111dcafc2a4','2906b810c7d4411798c6938adc9daaa5'],\
119+
'discount', inplace=True)
120+
121+
offers['offer_type'].replace(['3f207df678b143eea3cee63160fa8bed','5a8bc65990b245e5a138643cd4eb9837'],\
122+
'informational', inplace=True)
109123

110124
return cleaned_portfolio, cleaned_profile, offers, transactions

0 commit comments

Comments
 (0)