Count occurences of rows based one cell content with pandas
When asking code related questions, its always a good practice to at least provide a sample of the data. Since, you've not given one, I'll create it based on your question.
import pandas as pd

df = pd.DataFrame([('A','01','prod_1'), 
                   ('A','01', 'prod_2'), 
                   ('A','02','prod_X'), 
                   ('B','05','prod_1'),
                   ('C','06','prod_2'),
                   ('C','06','prod_X')], 
                 columns=['customer', 'ordernum', 'product'])
print (df)
        customer ordernum product
0        A       01  prod_1
1        A       01  prod_2
2        A       02  prod_X
3        B       05  prod_1
4        C       06  prod_2
5        C       06  prod_X

Now, you can use size() or Counter like,
val_count = df.groupby(['product','ordernum']).size()
print(val_count)
product  ordernum
prod_1   01          1
         05          1
prod_2   01          1
         06          1
prod_X   02          1
         06          1
dtype: int64

prod_order_count = df.groupby(['product', 'ordernum']).agg(Counter)
print(prod_order_count)
                  customer
product ordernum          
prod_1  01        {'A': 1}
        05        {'B': 1}
prod_2  01        {'A': 1}
        06        {'C': 1}
prod_X  02        {'A': 1}
        06        {'C': 1}