newbie here
I've got a Pandas DataFrame that contains that contains the column crewjob as below. It looks like each row is a list.
crewjob
[Director, Screenplay, Screenplay, Screenplay,...
[Executive Producer, Screenplay, Original Musi...
[Director, Characters, Writer, Sound Recordist]
[Director, Screenplay, Producer, Producer, Pro...
[Original Music Composer, Director of Photogra...
[Director, Screenplay, Producer, Producer, Ori...
[Director, Screenplay, Producer, Original Musi...
[Screenplay, Screenplay, Director, Novel]
[Director, Screenplay, Screenplay, Producer, P...
I'd like to extract for each row the position of director within the list. I've tried the enumerate method and it chucks out a blank list.
indices = [i for i, x in enumerate(creditsdf['crewjob']) if x == "Director"]
I've also tried the .index method
creditsdf['test'] = creditsdf['crewjob'].index("Director")
Which gives the following error;
TypeError: 'RangeIndex' object is not callable