題目會給定一個pandas DataFrame作為輸入,要求我們在原有的資料表上,將欄位grade的資料型別從原本的float變更為int整數型別。
Example 1:
Input:
DataFrame students:
+------------+------+-----+-------+
| student_id | name | age | grade |
+------------+------+-----+-------+
| 1 | Ava | 6 | 73.0 |
| 2 | Kate | 15 | 87.0 |
+------------+------+-----+-------+
Output:
+------------+------+-----+-------+
| student_id | name | age | grade |
+------------+------+-----+-------+
| 1 | Ava | 6 | 73 |
| 2 | Kate | 15 | 87 |
+------------+------+-----+-------+
Explanation:
The data types of the column grade is converted to int.
grade欄位從原本的float浮點數 轉換為 int整數型別。