I'm very new to python. Would like to seek your advise.
I have this simple dataframe list of items workers request for.
I tried this to get unique values:
import numpy as np
import pandas as pd
df = pd.read_csv('item.csv')
column_values=df[['Name', 'Item']].values
unique_values = np.unique(column_values)
print(unique_values)
print('Total no. of items: ')
print('No. of hand sanitizer: ')
print('No. of mask: ')
print('No. of wet tissue: ')
print('\n')
I'm not sure how to code the counting and which type of loop to use for the name.
I tried a few coding to get it list the name of the requestor, total no. of items requested, total of each item but cannot get the output as below by using loop:
My desired output would be like this:
Eric
Total no. of items: 11
No. of hand sanitizer: 5
No. of mask: 3
No. of wet tissue: 3
Farhana
Total no. of items: 9
No. of hand sanitizer: 5
No. of mask: 2
No. of wet tissue: 2
.... and so on
Appreciate your advise and input.