def count_product_ops(df_op):
    """計算每個品種的工序數量，回傳 dict[productCode:str, op_count:int]"""
    _df = df_op.sequence
    _df.index = df_op.productCode
    _df = _df.groupby(_df.index).nunique()
    # {'PD000': 8, 'PD001': 15, 'PD002': 15, 'PD003': 13, 'PD004': 24, 'PD005': 24}
    return _df.to_dict()