def normalizedIntradayCountStats(intradayStats, limitCount=5):
# For each minute, number of days for which we have a valid measure (record)
notNullCount = intradayStats.count()
# Ignore minutes where we have low level of records
notNullCount[notNullCount < limitCount] = None
# Count how many times each value appears for each minute
valueCount = intradayStats.apply(pd.value_counts)
# Normalize each minute by records count
res = valueCount.div(notNullCount, axis=1)
return res
评论列表
文章目录