LoslegenKostenlos loslegen

Standard DataFrame methods

You are given the diabetes dataset storing information on female patients tested for diabetes. You will focus on blood glucose levels and the test results. Subjects, tested positively, usually have higher blood glucose levels after performing the so-called glucose tolerance test. Your task is to investigate whether it is true for this specific dataset.

The plasma glucose column corresponds to the glucose levels. The test result column corresponds to the diabetes test results.

You must use standard DataFrame methods (the numpy module is not imported for you).

Diese Übung ist Teil des Kurses

Practicing Coding Interview Questions in Python

Kurs anzeigen

Anleitung zur Übung

  • Load the data from the diabetes.csv file.
  • Calculate the mean glucose level in the entire dataset.
  • Group the data according to the diabetes test results.
  • Calculate the mean glucose levels per group.

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Load the data from the diabetes.csv file
diabetes = ____
print(diabetes.info())

# Calculate the mean glucose level in the entire dataset
print(____)

# Group the data according to the diabetes test results
diabetes_grouped = ____

# Calculate the mean glucose levels per group
print(____)
Code bearbeiten und ausführen