Reputation: 4158
I am trying to extract the column values from pandas dataframe but the output includes index and datatype as well. The code is given below
for index, row in df_count_unique3.iterrows():
policy_number = []
for value in row['p_number']:
print(value)
value = PC_number[(PC_number.p_number1 == value)&(PC_number.PRole == "AccountHolder")]
policy_number.append(value['policy_number'])
PC_policy2['policy_number'] = policy_number
Output of PC_policy2
policy_number
2842824 P129487971 Name: policy_number, dtype..
Expected output:
policy_number
P129487971
Any suggestions would be great.
Upvotes: 2
Views: 3987