Transform the 2 numerical features (age and education_years) into 2 (nominal) categorical features. Specifically, use equal-width binning with the following 3 bins for each numerical feature: low, mid, and high. Once you do that, all the 5 descriptive features in your dataset will be categorical. Your dataset’s name after Task 1 needs to be df_all_cat. Please make sure to run the following code for marking purposes:
# so that we can see all the columns
pd.set_option(‘display.max_columns’, None)
print(df_all_cat.shape)
df_all_cat.head()
###
# please run below in a separate cell!!!
for col in df_all_cat.columns.tolist():
print(col + ‘:’)
print(df_all_cat[col].value_counts())
print(‘********’)
HINT: You can use the cut() function in Pandas for equal-width binning.

Found something interesting ?

• On-time delivery guarantee
• PhD-level professional writers
• Free Plagiarism Report

• 100% money-back guarantee
• Absolute Privacy & Confidentiality
• High Quality custom-written papers

Related Model Questions

Feel free to peruse our college and university model questions. If any our our assignment tasks interests you, click to place your order. Every paper is written by our professional essay writers from scratch to avoid plagiarism. We guarantee highest quality of work besides delivering your paper on time.

Grab your Discount!

25% Coupon Code: SAVE25
get 25% !!