I have a list of attachments (.pdf files) in a folder and another dataframe with name and values. Each name may have multiple rows if the name has multiple values.
I want to print out the values corresponding to each name in a loop.
df = pd.DataFrame(data = {'Name': ["Peter", "Peter", "Peter", "Jack", "Jack"],
'Value': ['a','b','c','a','nan']})
I tried these two loops:
for i in df0['Name'].unique():
print(df['Values'][df['Name'] == i], '\n')
for i,j in df.groupby('Name'):
print(df['Values'][df['Name'] == i])
where each "printout" is a series. Instead I want to print out each data value for each name but "grouped".
For example:
Peter:
a
b
c
next
Jack:
a