Capitalisation function

def empty_cell(dataset, index):
    for row in dataset:
        empty = row[index]
        if not empty:
            empty = "Not Applicable"
        row[index] = empty

Hi everyone, I have tried to convert the lesson from cleaning and preparing data in python. String capitalisation. into a standalone function with the code above. When I run the function in the guided project it produces a syntax error. Would appreciate any guidance on this issue. Thanks!

Hey, Gen.

You’re going to need to share a lot more context around this. What are the mission and screen numbers?
What is the full code you’re using? Also, please share your notebook.

The data that I am not using is not relavant to the function, I use it to test if the function has any issues

Mission : Cleaning and preparing data in python
Screen number : 5

Guided Project.ipynb (14.9 KB)

Thanks for your help! :smiley:

The reason why I asked for more context is that I couldn’t find anything wrong with your code.

I just tested your notebook and it runs fine. You must have done something that is not visible in the code anymore.

1 Like