开始使用免费开始使用

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

本练习是课程的一部分

Practicing Coding Interview Questions in Python

查看课程

练习说明

  • 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.

交互式实操练习

通过完成这段示例代码来试试这个练习。

# 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(____)
编辑并运行代码