篩選股票資料。
在這個練習中,你要篩選 Alphabet 的股票資料,並再次使用 DataFrame alphabet。此 DataFrame 的前幾列如下:
| close | volume | open | high | low | |
|---|---|---|---|---|---|
| date | |||||
| 2019-08-02 | 1196.32 | 1745450 | 1203.00 | 1209.500 | 1190.00 |
| 2019-08-01 | 1211.78 | 1771271 | 1217.63 | 1236.298 | 1207.00 |
| 2019-07-31 | 1218.20 | 1997999 | 1224.87 | 1234.910 | 1208.18 |
| 2019-07-30 | 1228.00 | 1430775 | 1227.00 | 1236.910 | 1225.32 |
| 2019-07-29 | 1241.84 | 2069127 | 1242.50 | 1248.995 | 1230.20 |
本練習屬於課程
Intermediate Python for Finance
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Mask for large enough daily high
high_mask = alphabet.high ____ 500
# Filter using the mask
alphabet.____[____]