Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Task: Drink of the Hour | Getting Started
Pandas: First Steps
course content

Contenu du cours

Pandas: First Steps

Pandas: First Steps

1. Getting Started
2. Basics of Dataframes

book
Task: Drink of the Hour

Tâche

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 index 0).

Note

Both iloc and normal indexing are accepted as valid methods of indexing in this task.

Solution

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 1. Chapitre 6
toggle bottom row

book
Task: Drink of the Hour

Tâche

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 index 0).

Note

Both iloc and normal indexing are accepted as valid methods of indexing in this task.

Solution

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 1. Chapitre 6
Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Nous sommes désolés de vous informer que quelque chose s'est mal passé. Qu'est-il arrivé ?
some-alt