Course Content
Pandas: First Steps
Pandas: First Steps
Task: Drink of the Hour
Swipe to start coding
At CafΓ© Pandasia, every hour has a special featured drink! The cafΓ© keeps track of the featured drinks in a list, and they want you to help them organize it into a pandas.Series
β and access the drink based on the hour of the day.
For simplicity, weβll say the cafΓ© is open from 8 AM to 1 PM, and each hour has one special drink.
- Create a Series from the
drinks
list. - Store the Series in a variable called
hourly_specials
. - In the
print
statement, replace the___
with appropriate code to output the drink featured at 10 AM using numerical indexing (8 AM is index0
).
Note
Both
iloc
and normal indexing are accepted as valid methods of indexing in this task.
Solution
Thanks for your feedback!
Task: Drink of the Hour
Swipe to start coding
At CafΓ© Pandasia, every hour has a special featured drink! The cafΓ© keeps track of the featured drinks in a list, and they want you to help them organize it into a pandas.Series
β and access the drink based on the hour of the day.
For simplicity, weβll say the cafΓ© is open from 8 AM to 1 PM, and each hour has one special drink.
- Create a Series from the
drinks
list. - Store the Series in a variable called
hourly_specials
. - In the
print
statement, replace the___
with appropriate code to output the drink featured at 10 AM using numerical indexing (8 AM is index0
).
Note
Both
iloc
and normal indexing are accepted as valid methods of indexing in this task.
Solution
Thanks for your feedback!