我的資料框:
*Ca *O *Ca Ca Hy
0 1 2 3 4 5
1 1
2 1 5
3 1 6 7 8
4 5
5 6
6 6
7 6
8 9
9 9 12
10 9 9 10 11
所需的資料框將如下所示:
*Ca *O *Ca Ca Hy
0 1 2 3 4 5
1 1
2 1 5
3 1 6 7 8
4 5
5 6
6 6
7 6
8 9
9 9 12
10 9 9 10 11
11 10 12 13 14 15
12 10 15
13 10 16 17 18
14 10
15 15
16 16
17 16
18 16
.........
那相當于:
Ca[i]=a和Ca[i 10]=a 10但是Ca[i 9]=!a 9我們可以說 i =>10 我想在 250 的范圍內每 10 行獲取一次序列。希望很清楚。
uj5u.com熱心網友回復:
國際大學聯合會,
pd.concat([df, df 10], ignore_index=True)
也許:
pd.concat([df i for i in range(0, 250, 10)], ignore_index=True).head(40)
很好看,@piRSquared 目擊......
pd.concat(map(df.add, range(0, 250, 10)), ignore_index=True)
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/453434.html
