dayToHostPairTuple = access_logs.map(lambda log: (log.date_time.day, log.host)) dayGroupedHosts = dayToHostPairTuple.groupByKey() dayHostCount = dayGroupedHosts.map(la