Skip to content
Advertisement

Panda iterating through CSV matching index out-of-bounds

I’m running into an issue with my locate / match statement. I’m trying to match the column “IP” assign it as the index and iterate through a csv of a few thousand hosts.

Whenever the below script makes its way back up to process the second ‘IP’ I fail with a “single positional indexer is out-of-bounds”.

Thank you all.

JavaScript

Here is the csv content:

https://i.stack.imgur.com/EziH4.png

Advertisement

Answer

It seems you are not using iterrows properly and there are several inconsistencies in your code.

Try to define your whoisyou function like this:

JavaScript

And then you could call it like this:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement