3
私は2頭のフォームのパンダがあるとします。私は、生成Pythonは:代わりに他の二つの行を含めることで、単一のデータフレームを作成
>>> df
A B C
first 62.184209 39.414005 60.716563
second 51.508214 94.354199 16.938342
third 36.081861 39.440953 38.088336
>>> df1
A B C
first 0.828069 0.762570 0.717368
second 0.136098 0.991668 0.547499
third 0.120465 0.546807 0.346949
>>>
を:
import pandas as pd
import numpy as np
df = pd.DataFrame(np.random.random([3, 3])*100,
columns=['A', 'B', 'C'], index=['first', 'second', 'third'])
df1 = pd.DataFrame(np.random.random([3, 3]),
columns=['A', 'B', 'C'], index=['first', 'second', 'third'])
はあなたが見つけることができる賢いと何かを得る最速の方法:
A B C
first 62.184209 39.414005 60.716563
first_s 0.828069 0.762570 0.717368
second 51.508214 94.354199 16.938342
second_s 0.136098 0.991668 0.547499
third 36.081861 39.440953 38.088336
third_s 0.120465 0.546807 0.346949
?
私はサイクルのために、2番目から1番目と2番目の行から偶数番目の行を取ると言っていますが、それは私にとって非常に効率的ではないようです。
ありますか?アルファベット順でソートせずに – Thegamer23