12 Useful Pandas Techniques in Python for Data Manipulation6

Article

Code:

data[‘Gender’].fillna(mode(data[‘Gender’]).mode[0], inplace=True)

data[‘Married’].fillna(mode(data[‘Married’]).mode[0], inplace=True)

data[‘Self_Employed’].fillna(mode(data[‘Self_Employed’]).mode[0], inplace=True)

print data.apply(num_missing)

Error Message:

File “C:\Users\joncb\AppData\Local\Temp/ipykernel_5944/1225634374.py” , line 5

print data.apply(num_missing)

^

SyntaxError: invalid syntax

How to fix this problem?

You missed a blanket

you typed print data.apply(num_missing)
it should be print (data.apply(num_missing))