1

I was wondering if it is possible to create a counter for each row as you apply a function to a Pandas dataframe like this:

data['column'] = data.apply(lambda x: function(x['url']), axis=1)

The output should be something similar to this:

1
2
3
4
5
...

Thanks

Miguel Santos
  • 1,806
  • 3
  • 17
  • 30

0 Answers0