Today have tried to check files with path directory name. Previously it worked, until I tried to create 104 if/else statements.
How to dispose of this overflow error? More specific question: Does def(x) for several checks the only one solution to optimise such cases in Python?!
data['path'].apply( lambda path: 'hotdog' if '/hotdog/' in path Else ‘hotdog2’ if ‚’/hotdog2/’ in path Else ... Else’hotdog104’ if ... else 'nothotdog' ) I’ve done similar to this...
Aucun commentaire:
Enregistrer un commentaire