Intro to Pandas Series
Intro to Pandas Series Data Science Project
Intro to Pandas for Data Analysis

Intro to Pandas Series

The Series is the fundamental building block of Pandas. In this project, you'll learn about Series, a particular Data Structure of pandas. You'll learn how to create them, what's their structure, their index, etc. In following projects you'll learn about its relationship with DataFrames.

Project Activities

All our Data Science projects include bite-sized activities to test your knowledge and practice in an environment with constant feedback.

All our activities include solutions with explanations on how they work and why we chose them.

codevalidated

Check your knowledge: create a series

Create a series under the variable my_series that contains three elements:

  • a > 9
  • b > 11
  • c > -5

The name of your Series should be "My First Series"

The series should look like this:

codevalidated

Check your knowledge: location by index

Select the revenue of Intel and store it in a variable named intel_revenue:

codevalidated

Check your knowledge: location by position

Select the revenue of the "second to last" element in our series s and store it in a variable named second_to_last.

codevalidated

Check your knowledge: multiple selection

Use multiple label selection to retrieve the revenues of the companies:

  • Samsung
  • Dell Technologies
  • Panasonic
  • Microsoft

Store the result in the variable sub_series. Important! The values must be in that order.

input

What's the average revenue of American Companies?

What's the average revenue of the companies contained in the variable american_companies? Enter the whole number (that is, without decimals).

input

What's the median revenue of the American Companies?

Enter the value as a whole number

multiplechoice

What company has the largest revenue?

Using all the companies (stored in the Series in s), which company has the largest revenue?

multiplechoice

Sort company names lexicographically. Which one comes first?

Using all the companies (stored in the Series in s), which name is the "first" one in lexicographic (or alphabetical) order. That is, aa comes before than ab.

codevalidated

Sort American Companies by Revenue

Create a new variable american_companies_desc that contains the results of sorting american_companies by revenue (this is, by value) in descending order.

codevalidated

Sort (and mutate) international companies

Now it's time to do what we told you NOT to do, but we need practice it. There's a new series defined named international_companies. Your task is to sort them by Revenue in descending order (larger to smaller) but doing it in place, that is, modifying the series.

If you make a mistake, you can always re-run the cell that generates the Series.

codevalidated

Insert Amazon's Revenue

Insert a new element in our series s, Amazon with a total revenue of: $469,822 (million dollars).

codevalidated

Delete the revenue of Meta

Remove the entry for Meta from the series s.

Intro to Pandas SeriesIntro to Pandas Series
Author

Santiago Basulto

This project is part of

Intro to Pandas for Data Analysis

Explore other projects