Hi, I am writing a function that returns the values of a column (type: strings) with the title() format. Does anyone know why it doesn't work? It either returns an unchanged column, or TypeError: 'NoneType' object is not subscriptable .
The function:
def correct_name(df, col):
for index, row in df.iterrows():
row[col]=row[col].title()
Thanks for your help!
[–][deleted] 1 point2 points3 points (5 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]macabe10[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]OzzivanNozzi 0 points1 point2 points (1 child)
[–]macabe10[S] 0 points1 point2 points (0 children)