简体   繁体   English

在 DataFrame 中找到具有行空间范围的每一列的最大值

[英]find the max value of each column with spatial range of row in DataFrame

I want to code my Sliding Window and I have a huge data shep like this feature x ab c dg 1 2 3 4 5 6 2 4 5 6 9 4我想对我的滑动 Window 进行编码,并且我有一个像这个功能这样的庞大数据集 x ab c dg 1 2 3 4 5 6 2 4 5 6 9 4
3 6 7 8 6 0 4 2 3 5 7 9 5 2 2 2 2 2 enter image description here and label y 0 1 1 2 0 I want to define df with the same columns and zipping every 3 rows in one with the max value of each column --> this for feature x and define df2 with the same column and zipping every 3 rows in one with the most frequent. 3 6 7 8 6 0 4 2 3 5 7 9 5 2 2 2 2 2在此处输入图像描述和 label y 0 1 1 2 0我想用相同的列定义 df 并用最大值每 3 行压缩一次每列的 -> 这对于特征 x 并使用相同的列定义 df2 并以最频繁的方式每 3 行压缩一次。

there someone can help me:(有人可以帮助我:(

the first row maybe like this 6 7 8 9 6 with label 1第一行可能像这样 6 7 8 9 6 label 1

I get the answer but you can improve it!我得到了答案,但你可以改进它! 数据农场的代码

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 Pandas DataFrame 中查找具有每天最小值/最大值的行 - Find row with min/max value for each day in Pandas DataFrame 在一个 Pandas DataFrame 中找到每一行第二大值的列名 - Find the column name of the second largest value of each row in a Pandas DataFrame 熊猫:查找列名和值,每一行的最大值(和第二最大值) - Pandas: find column name and value with max (and second max) value for each row Pandas dataframe,在一行中,查找所选列中的最大值,并根据该值查找另一列的值 - Pandas dataframe, in a row, to find the max in selected column, and find value of another column based on that 在数据框中找到每个分区的最大值 - Find max value for each partition in dataframe 查找多个数字列的最大值和最小值,并返回 dataframe 和相应的行值 - Find max and min value for several numeric column and return dataframe with the corresponding row value Pandas:在列的每一行中查找最大值,并在另一列中标识相应的值 - Pandas: Find max value in each row of a column and identify corresponding values in another column 无法找到最大索引行的列值 - Unable to find column value of max index row 查找并返回最大值的行和最大值的行作为数组 - Find and return max value for a column and the row of the max value as an array 如何获取 dataframe 中每个组的每列的最大值? - How to get the max value of each column for each group in a dataframe?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM