educative.io

Hi, how do I report an error in a challenge?

I would like to report an error in the challenge: Create City and State Columns from the Address (Challenge: Create City and State Columns from the Address - Mastering Data Analysis with Python Pandas).

The states in the expected output have a preceding blank space.


Course: Mastering Data Analysis with Python Pandas - Learn Interactively
Lesson: Challenge: Create City and State Columns from the Address - Mastering Data Analysis with Python Pandas

Hi @Pierre_Fransson, The preceding blank space is not an error in this challenge. The space in the expected output is due to the comma (,) used to split the city of the staff, and there’s a space in our dataset in city names. For example, consider the code and output below where I have printed the whole dataset to demonstrate how the space is being printed from the given dataset:

I hope this helps! Happy Learning :slight_smile:

Hi Komal, Thanks for your reply. However, I can unfortunately not agree with it. The blank space is clearly an error given the info in the challenge. Also it does not make sense to have a column with preceeding spaces. The simple solution is to add a space in the split string. I.e., ", ". This will create a clean column without preceeding spaces.

Preceeding and trailing spaces are bad in string content since it is not always easy to spot them and they can generate simple and unnecessary errors when comparing strings.


Course: Mastering Data Analysis with Python Pandas - Learn Interactively
Lesson: Challenge: The Age of Employees - Mastering Data Analysis with Python Pandas

Hi @Pierre_Fransson, You’re right. We can split the string by adding a space in it. The test case written for this code contains the expected output as [' TX', ' CA', ' TX', ' FL', ' CA', ' GA'] which needs to be fixed by removing the spaces from the expected output.

Thank you for going into the details of this course and pointing this out. We’ll surely fix this soon.

1 Like

Hi @Pierre_Fransson, it has been fixed. :tada: Please refresh your lesson to see the updated test case and solution.

Happy Learning :slight_smile:

1 Like

Hi Komal, Works like a charm. :slight_smile: Thanks for speedy responses!
Best regards
Pierre


Course: Mastering Data Analysis with Python Pandas - Learn Interactively
Lesson: The groupby Function - Mastering Data Analysis with Python Pandas


Course: Mastering Data Analysis with Python Pandas - Learn Interactively
Lesson: Challenge: Create City and State Columns from the Address - Mastering Data Analysis with Python Pandas

1 Like