<jupyter_start><jupyter_text>Lender Completed Listings<jupyter_code>def lender_completed_listings(x):
    return hashmap[x["MemberKey"]].query("ListingStatus == 'Completed' and ListingStartDate < '{0}'".format(x["ListingStartDate"]))["ListingKey"].nunique()

start = timeit.default_timer()    
data["LenderCompletedListings"] = data[["MemberKey", "ListingStartDate"]].swifter.apply(lender_completed_listings, axis=1)
stop = timeit.default_timer()
print "Feature engineering completed in {0} seconds".format((stop-start))<jupyter_output>Feature engineering completed in 4413.8087196 seconds<jupyter_text>Lender Repaid Listings<jupyter_code>def lender_repaid_listings(x):
    return hashmap[x["MemberKey"]].query("RepaidOrNot == True and ListingStartDate < '{0}'".format(x["ListingStartDate"]))["ListingKey"].nunique()

start = timeit.default_timer()   
data["LenderRepaidListings"] = data[["MemberKey", "ListingStartDate"]].swifter.apply(lender_repaid_listings, axis=1)
stop = timeit.default_timer()
print "Feature engineering completed in {0} seconds".format((stop-start))<jupyter_output>Feature engineering completed in 4162.0689696 seconds<jupyter_text>Lender Total Listings<jupyter_code>def lender_total_listings(x):
    return hashmap[x["MemberKey"]].query("ListingStartDate < '{0}'".format(x["ListingStartDate"]))["ListingKey"].nunique()

start = timeit.default_timer()    
data["LenderTotalListings"] = data[["MemberKey", "ListingStartDate"]].swifter.apply(lender_total_listings, axis=1)
stop = timeit.default_timer()
print "Feature engineering completed in {0} seconds".format((stop-start)) 
data[["MemberKey", "ListingKey", "ListingStartDate", "ListingStatus", "RepaidOrNot", "LenderCompletedListings", "LenderRepaidListings", "LenderTotalListings"]].query("MemberKey=='{0}'".format(memberkeys[0])).sort_values("ListingStartDate")<jupyter_output><empty_output><jupyter_text>Save Data<jupyter_code>data.to_csv("../Data/lender_listing_fe/lender_listing_fe_60k.csv", index=False)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15491559086395235, 'fraction_numerical': 0.01737835153922542, 'mean_word_length': 10.852941176470589, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '298939', 'license': 'MIT', 'n_tokens_mistral': 700, 'n_tokens_neox': 672, 'n_words': 90, 'path': 'WebSci19-P2P-Lending/Notebooks/preprocessing/p_lender_listing_fe_temporal.ipynb', 'repo_name': 'LINK-NU/CRII-1755873', 'size': '2014'}