August 2021
Beginner to intermediate
112 pages
1h 29m
English
| Puzzle 9 | A Hefty Bonus |
| | import pandas as pd |
| | |
| | grades = pd.Series([61, 82, 57]) |
| | bonuses = pd.Series([10, 5, 10, 10]) |
| | out = grades + bonuses |
| | print(out) |
Guess the Output | |
|---|---|
|
|
Try to guess what the output is before moving to the next page. |
This code will print:
| | 0 71.0 |
| | 1 87.0 |
| | 2 67.0 |
| | 3 NaN |
| | dtype: float64</code></pre></td> |
pandas.Series and numpy.ndarray are different from Python lists. The + operator on Python lists does concatenation: ...
Read now
Unlock full access