<jupyter_start><jupyter_text>get-dataThis notebook collects the sample data from the [Github Link](https://github.com/IBMDevConnect/RBSHack2018/raw/master/hackdata/hack_data_v1.zip) and imports it into the Watson Studio project.<jupyter_code># Add the project access token here. For more info, see this blog:
# https://medium.com/ibm-data-science-experience/control-your-dsx-projects-using-python-c69e13880312
import requests, zipfile
url = 'https://github.com/IBMDevConnect/RBSHack2018/raw/master/hackdata/hack_data_v1.zip'
target_path = 'hack_data_v1.zip'

response = requests.get(url, stream=True)
handle = open(target_path, "wb")
for chunk in response.iter_content(chunk_size=512):
    if chunk:  # filter out keep-alive new chunks
        handle.write(chunk)
handle.close()
with zipfile.ZipFile(target_path) as zf:
    zf.extractall()
for filename in ['test_indessa.csv', 'train_indessa.csv']:
    with open(filename, 'rb') as file:
        project.save_data(data=file,file_name=filename,overwrite=True)
#     print(zf.namelist())
#     for filename in ['test_indessa.csv', 'train_indessa.csv']:
#         try:
#             data = zf.read(filename)
#         except KeyError:
#             print('ERROR: Did not find %s in zip file' % filename)
#         else:
#             print(filename, ':')
#             project.save_data(data=repr(data),file_name=filename,overwrite=True)
#         print()

!head test_indessa.csv<jupyter_output>member_id,loan_amnt,funded_amnt,funded_amnt_inv,term,batch_enrolled,int_rate,grade,sub_grade,emp_title,emp_length,home_ownership,annual_inc,verification_status,pymnt_plan,desc,purpose,title,zip_code,addr_state,dti,delinq_2yrs,inq_last_6mths,mths_since_last_delinq,mths_since_last_record,open_acc,pub_rec,revol_bal,revol_util,total_acc,initial_list_status,total_rec_int,total_rec_late_fee,recoveries,collection_recovery_fee,collections_12_mths_ex_med,mths_since_last_major_derog,application_type,verification_status_joint,last_week_pay,acc_now_delinq,tot_coll_amt,tot_cur_bal,total_rev_hi_lim
11937648,14000,14000,14000,60 months,BAT4711174,16.24,C,C5,Data Analyst,4 years,RENT,73500,Source Verified,n,,credit_card,wrap it up,450xx,OH,28.65,1,1,20,,16,0,29828,65.3,53,f,3915.61,0,0,0,0,,INDIVIDUAL,,104th week,0,0,85230,45700
38983318,16000,16000,16000,60 months,BAT4318899,9.49,B,B2,Senior Database Administrator,5 years,MORTGAGE,105000,Source Verified,n,,major_purchase,Major purchase,275xx,NC,31.[...]
{'fraction_non_alphanumeric': 0.12137310993052718, 'fraction_numerical': 0.0686554965263588, 'mean_word_length': 6.722397476340694, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 3, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '514451', 'license': 'MIT', 'n_tokens_mistral': 1027, 'n_tokens_neox': 921, 'n_words': 114, 'path': 'get-data-clean.ipynb', 'repo_name': 'joe-plumb/loan-data-scikit-example', 'size': '2447'}