Help on Additional data cleaning tasks

Screen Link:
https://app.dataquest.io/m/293/data-cleaning-basics/12/challenge-clean-a-string-column

My Code:

Replace this line with your code

What I expected to happen:

What actually happened:

Replace this line with the output/error

So this is in regards to the additional exercise that comes at the end of the mission. I am trying to solve the below one

  • Extract the screen resolution from the screen column.
  • Extract the processor speed from the cpu column.

Any leads as to how to extract these. I tried "laptops[“screen”].str.split(" ").str[4] " but this is giving my NaN for the values which don’t have the 4 space in between. Getting the same thing for processor speed.

Any help/suggestion would be helpful

Hi!
Try to apply negative indexing in order to get to the last element in a list [-1], this way you extract the data which goes after the last space, no matter how many spaces there are in the string.

2 Likes

Thanks @ksenia.kustanovich… it worked like a charm

1 Like