ProfileReport(df) 将计算的间隔显示为 MISSING、REJECTED、UNSUPPORTED
ProfileReport(df) shows calculated intervals as MISSING, REJECTED, UNSUPPORTED
在数据框中,我将 m/d/yyyy 格式的字符串转换为日期时间,然后减去它们以获得间隔。出于某种原因,这些计算字段在 pandas.ProfileReport() 中被描述为缺失、拒绝、不支持,我无法在 .agg 计算中使用它们
df['RequestedStartDT'] = pd.to_datetime(df['Requested Start Date'])
df['RequestedEndDT'] = pd.to_datetime(df['Requested End Date'])
df['TargetedStartDT'] = pd.to_datetime(df['Targeted Start Date'])
df['TargetedEndDT'] = pd.to_datetime(df['Targeted End Date'])
df['ActualStartDT'] = pd.to_datetime(df['Actual Start Date'])
df['ActualEndDT'] = pd.to_datetime(df['Actual End Date'])
df['RequestedInterval'] = df['RequestedEndDT'] - df['RequestedStartDT']
df['TargetedInterval'] = df['TargetedStartDT'] - df['TargetedEndDT']
df['ActualInterval'] = df['ActualEndDT'] - df['ActualStartDT']
对于计算和聚合这些间隔的更好方法有什么建议吗?
这是数据示例
原来我需要显式转换字段
df['RequestedInterval'] =df['RequestedInterval']/np.timedelta64(1,'D')
df['TargetedInterval'] =df['TargetedInterval']/np.timedelta64(1,'D')
df['ActualInterval'] =df['ActualInterval']/np.timedelta64(1,'D')
在数据框中,我将 m/d/yyyy 格式的字符串转换为日期时间,然后减去它们以获得间隔。出于某种原因,这些计算字段在 pandas.ProfileReport() 中被描述为缺失、拒绝、不支持,我无法在 .agg 计算中使用它们
df['RequestedStartDT'] = pd.to_datetime(df['Requested Start Date'])
df['RequestedEndDT'] = pd.to_datetime(df['Requested End Date'])
df['TargetedStartDT'] = pd.to_datetime(df['Targeted Start Date'])
df['TargetedEndDT'] = pd.to_datetime(df['Targeted End Date'])
df['ActualStartDT'] = pd.to_datetime(df['Actual Start Date'])
df['ActualEndDT'] = pd.to_datetime(df['Actual End Date'])
df['RequestedInterval'] = df['RequestedEndDT'] - df['RequestedStartDT']
df['TargetedInterval'] = df['TargetedStartDT'] - df['TargetedEndDT']
df['ActualInterval'] = df['ActualEndDT'] - df['ActualStartDT']
对于计算和聚合这些间隔的更好方法有什么建议吗?
这是数据示例
原来我需要显式转换字段
df['RequestedInterval'] =df['RequestedInterval']/np.timedelta64(1,'D')
df['TargetedInterval'] =df['TargetedInterval']/np.timedelta64(1,'D')
df['ActualInterval'] =df['ActualInterval']/np.timedelta64(1,'D')