K0nkere / DL_Dice-detection-project

DnD dice detection with CNN and transfer learning / Project for ML Bookcamp
0 stars 0 forks source link

How to: Collections #14

Open K0nkere opened 1 year ago

K0nkere commented 1 year ago

Named tuple for DataFrame creation

from collections import namedtuple

rr = namedtuple("RevenueRow", ["hour", "zone", "amount", "trips_cnt"])

def unwrap_func(row):
    output = rr(
        hour=row[0][0],
        zone=row[0][1],
        amount=row[1][0],
        trips_cnt=row[1][1]
    )