MulaiMulai sekarang secara gratis

Calculating salary percentiles

In the video, you saw that the conversion of numeric data into categories sometimes makes it easier to identify patterns.

Your task is to convert the "Salary_USD" column into categories based on its percentiles. First, you need to find the percentiles and store them as variables.

pandas has been imported as pd and the salaries dataset read in as DataFrame called salaries.

Latihan ini adalah bagian dari kursus

Exploratory Data Analysis in Python

Lihat Kursus

Petunjuk latihan

  • Find the 25th percentile of "Salary_USD".
  • Store the median of "Salary_USD" as salaries_median.
  • Get the 75th percentile of salaries.

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Find the 25th percentile
twenty_fifth = ____["____"].____(____)

# Save the median
salaries_median = ____["____"].____()

# Gather the 75th percentile
seventy_fifth = ____
print(twenty_fifth, salaries_median, seventy_fifth)
Edit dan Jalankan Kode