dummy_cols = pd.DataFrame()
for i in text_cols:
Replace this line with your code
What I expected to happen:
requisite changes must have been made in train set
What actually happened:
Replace this line with the output/error
I checked few of my columns using value counts to assert whether they do have requisite changes and they have but still my answer is not matching . what is wrong with my code ?
Focus on debugging your approach first
get_dummies to just one column in
- See what the above outputs before you assign it to
i corresponds to that single column
- Then assign that to
train[i] and print out
- Check if the outputs from the above two steps match or not.
Based on the above go through the content again to understand what exactly
get_dummies does and think about what you may or may not be missing or have to do differently.
If you get stuck or can’t progress, then ask questions focusing on what you tried, what you understood, and where you are stuck.
@the_doctor has a good approach also when posting here please do this
#Your code goes here
This way we can see what you have done
Secondly what can also help is using the solution code and work backwards from it