我想重新缩放列'w'
。你知道吗
我平均了'w'
。你知道吗
aveData_set = Data_Set.groupby(['buildingid', pd.Grouper(key='reporttime',freq='15T')])['w'].mean().reset_index()
aveData设置结果:
然后我希望每个24H
重新缩放列'w'
。你知道吗
ScaleData_set = aveData_set.groupby(['buildingid', pd.Grouper(key='reporttime',freq='24H')])['w'].apply(lambda x: (x-x.min())/(x.max()-x.min())).reset_index()
但结果很奇怪,有些栏目已经消失了。你知道吗
缩放数据集结果:
我真的需要你的帮助救命啊。很多谢谢。你知道吗
输出是预期的,因为缩放不是聚合值。它返回与原始
DataFrame
大小相同的Series
。你知道吗因此可以创建新列:
或重新分配回:
这里^{} 像^{} 一样工作,用类似的lambda函数检查更好的解释here:
样本:
相关问题 更多 >
编程相关推荐