題目會給定一個pandas DataFrame作為輸入,要求我們在原有的資料表上,將所有在欄位quantity
的缺失值填補為0。
Example 1:
Input:+-----------------+----------+-------+
| name | quantity | price |
+-----------------+----------+-------+
| Wristwatch | None | 135 |
| WirelessEarbuds | None | 821 |
| GolfClubs | 779 | 9319 |
| Printer | 849 | 3051 |
+-----------------+----------+-------+
Output:
+-----------------+----------+-------+
| name | quantity | price |
+-----------------+----------+-------+
| Wristwatch | 0 | 135 |
| WirelessEarbuds | 0 | 821 |
| GolfClubs | 779 | 9319 |
| Printer | 849 | 3051 |
+-----------------+----------+-------+
Explanation:
The quantity for Wristwatch and WirelessEarbuds are filled by 0.
所有在quantity欄位有空缺的地方,都補上0