October 2019
Beginner to intermediate
674 pages
16h 43m
English
append is a simpler version of concat that concatenates along axis=0. Here is an illustration of its use, where we slice out the first two rows and the first three columns of the stockData DataFrame:
In [145]: stockDataA=stockDataDF.ix[:2,:3]
stockDataA
Out[145]: Closing price EPS Shares Outstanding(M)
Symbol
AAPL 501.53 40.32 892.45
AMZN 346.15 0.59 459.00
And the remaining rows can be obtained as shown following:
In [147]: stockDataB=stockDataDF[2:]
stockDataB
Out[147]:
Closing price EPS Shares Outstanding(M) P/E Market Cap(B) Beta
Symbol
FB 61.48 0.59 2450.00 104.93 150.92 NaN
GOOG 1133.43 36.05 335.83 31.44 380.64 0.87
TWTR 65.25 -0.30 555.20 NaN 36.23 NaN
YHOO 34.90 1.27 1010.00 27.48 35.36 0.66
Now, we use append ...
Read now
Unlock full access