I have a pandas Dataframe which has a couple of columns. I want to get the first 3 elements out of the Information Column based on a value in Protocol.
For example: I want the first 3 elements in Information IF the protocol is TCP.
Using below code I can separate the columns needed for my operation. But I have no clue how to adapt the next piece of code to this.
chunk[['Protocol', 'Information']] = chunk[['Protocol', 'Information']]
EDIT:
I wish to update the values. Not separate them.