The 365 Data Science team is proud to invite you to our own community forum. A very well built system to support your queries, questions and give the chance to show your knowledge and help others in their path of becoming Data Science specialists.
Ask
Anybody can ask a question
Answer
Anybody can answer
Vote
The best answers are voted up and moderated by our team

Credit Risk Modeling

Credit Risk Modeling

0
Votes
1
Answer

In the section of ‘Preprocessing Discrete Variables: Automating Calculations’, about the code below,
 
df_inputs_prepr[‘home_ownership:RENT_OTHER_NONE_ANY’] = sum([df_inputs_prepr[‘home_ownership:RENT’], df_inputs_prepr[‘home_ownershipTHER’],
df_inputs_prepr[‘home_ownership:NONE’],df_inputs_prepr[‘home_ownership:ANY’]]).
Although ‘rent’  is one of the categories, but [‘home_ownership:RENT’] is not the column of the dataset. How come we can directly use df[‘home_ownership:RENT’]?

1 Answer

365 Team
0
Votes

Hi,
Could you please try to remove RENT and keep the code as:

  1. df_inputs_prepr[‘home_ownership:OTHER_NONE_ANY’] = sum([ df_inputs_prepr[‘home_ownership:OTHER’],
  2. df_inputs_prepr[‘home_ownership:NONE’],
  3. df_inputs_prepr[‘home_ownership:ANY’]])

Best,
The 365 Team