-1
假設一個熊貓的數據幀的樣子:如何提取熊貓數據框的第n行作爲熊貓數據框?
X_test.head(4)
BoxRatio Thrust Velocity OnBalRun vwapGain
5 -0.163 -0.817 0.741 1.702 0.218
8 0.000 0.000 0.732 1.798 0.307
11 0.417 -0.298 2.036 4.107 1.793
13 0.054 -0.574 1.323 2.553 1.185
我怎樣才能提取第三行(如ROW3)作爲PD數據幀? 換句話說,row3.shape應該是(1,5)和row3.head()應爲:
0.417 -0.298 2.036 4.107 1.793
你有https://stackoverflow.com/questions/16096627/pandas-select-row-of-data-frame-by-integer-index嗎? – Zero
其實0已經找到了詳細的相應答案 – bellum
可能重複[Pandas選擇整行索引數據幀的行](https://stackoverflow.com/questions/16096627/pandas-select-row-of-data-frame-by-整數索引) – bellum