|
258 | 258 | "metadata": {}, |
259 | 259 | "outputs": [], |
260 | 260 | "source": [ |
261 | | - "nba.loc[nba[\"team_id\"] == \"MNL\", \"date_game\"].min()\n", |
| 261 | + "nba[\"date_played\"] = pd.to_datetime(nba[\"date_game\"])" |
| 262 | + ] |
| 263 | + }, |
| 264 | + { |
| 265 | + "cell_type": "code", |
| 266 | + "execution_count": null, |
| 267 | + "metadata": {}, |
| 268 | + "outputs": [], |
| 269 | + "source": [ |
| 270 | + "nba.loc[nba[\"team_id\"] == \"MNL\", \"date_played\"].min()\n", |
262 | 271 | "# Expected:\n", |
263 | | - "# '1/1/1949'" |
| 272 | + "# Timestamp('1948-11-04 00:00:00')" |
264 | 273 | ] |
265 | 274 | }, |
266 | 275 | { |
|
269 | 278 | "metadata": {}, |
270 | 279 | "outputs": [], |
271 | 280 | "source": [ |
272 | | - "nba.loc[nba[\"team_id\"] == \"MNL\", \"date_game\"].max()\n", |
| 281 | + "nba.loc[nba[\"team_id\"] == \"MNL\", \"date_played\"].max()\n", |
273 | 282 | "# Expected:\n", |
274 | | - "# '4/9/1959'" |
| 283 | + "# Timestamp('1960-03-26 00:00:00')" |
275 | 284 | ] |
276 | 285 | }, |
277 | 286 | { |
|
280 | 289 | "metadata": {}, |
281 | 290 | "outputs": [], |
282 | 291 | "source": [ |
283 | | - "nba.loc[nba[\"team_id\"] == \"MNL\", \"date_game\"].agg((\"min\", \"max\"))\n", |
| 292 | + "nba.loc[nba[\"team_id\"] == \"MNL\", \"date_played\"].agg((\"min\", \"max\"))\n", |
284 | 293 | "# Expected:\n", |
285 | | - "# min 1/1/1949\n", |
286 | | - "# max 4/9/1959\n", |
287 | | - "# Name: date_game, dtype: object" |
| 294 | + "# min 1948-11-04\n", |
| 295 | + "# max 1960-03-26\n", |
| 296 | + "# Name: date_played, dtype: datetime64[ns]" |
288 | 297 | ] |
289 | 298 | }, |
290 | 299 | { |
|
1541 | 1550 | ], |
1542 | 1551 | "metadata": { |
1543 | 1552 | "kernelspec": { |
1544 | | - "argv": [ |
1545 | | - "/home/reka/anaconda3/bin/python", |
1546 | | - "-m", |
1547 | | - "ipykernel_launcher", |
1548 | | - "-f", |
1549 | | - "{connection_file}" |
1550 | | - ], |
1551 | 1553 | "display_name": "Python 3", |
1552 | | - "env": {}, |
1553 | | - "interrupt_mode": "signal", |
1554 | 1554 | "language": "python", |
1555 | | - "metadata": {}, |
1556 | 1555 | "name": "python3" |
1557 | 1556 | }, |
1558 | | - "language": "python" |
| 1557 | + "language": "python", |
| 1558 | + "language_info": { |
| 1559 | + "codemirror_mode": { |
| 1560 | + "name": "ipython", |
| 1561 | + "version": 3 |
| 1562 | + }, |
| 1563 | + "file_extension": ".py", |
| 1564 | + "mimetype": "text/x-python", |
| 1565 | + "name": "python", |
| 1566 | + "nbconvert_exporter": "python", |
| 1567 | + "pygments_lexer": "ipython3", |
| 1568 | + "version": "3.9.1" |
| 1569 | + } |
1559 | 1570 | }, |
1560 | 1571 | "nbformat": 4, |
1561 | 1572 | "nbformat_minor": 2 |
|
0 commit comments