I have following csv and i need to filter specific set of rows
table entity_name node_name src_name table_col_name look_up_indicator type keys
gw_policy account ns0 fullname insured_name N attribute NA
gw_policy polocy ns1 agent_name insured_id N attribute NA
gw_policy account ns2 phone_num agent_phone N attribute NA
gw_policy account ns0 fullname insured_name N attribute NA
gw_policy polocy ns1 agent_name agent N attribute NA
gw_policy account ns2 phone_num a_phone N attribute NA
gw_policy account ns0 fullname agen_name N attribute NA
gw_policy polocy ns1 agent_name agent N attribute N
Now from above csv i need to get set of rows based on range of row name
ie, in this case i need to get the rows between two 'insured_name' and two 'agent', from the column name 'table_col_name'
so the result would look like
#Expected
# For the insured_name
insured_name
insured_id
agent_phone
insured_name
# For the agent
agent
a_phone
agen_name
agent
So how can achieve this using pandas?
Appreciated for the help?
Thanks
agent. How to decide which 2 agents to pick out of these two?