LoslegenKostenlos loslegen

Examining tc, ldl, and hdl

The diabetes dataset, dia, will be used as the real-world example for both this chapter and the next. Proper data exploration is a foundation for performing effective Monte Carlo simulations, so you'll continue exploring the data in the exercises!

In this exercise, you'll focus on three variables: tc, ldl, and hdl. The dia DataFrame has been loaded for you.

The following libraries have been imported for you: pandas as pd, numpy as np, matplotlib.pyplot as plt, and seaborn as sns.

Diese Übung ist Teil des Kurses

Monte Carlo Simulations in Python

Kurs anzeigen

Anleitung zur Übung

  • Use the pairplot() function in seaborn to visually examine the relationship between the columns tc, ldl, and hdl in dia (specified in that order).
  • Use the .corr() method from pandas to measure the correlation coefficients between tc, ldl, and hdl in dia (specified in that order).

Interaktive Übung

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

# Create a pairplot of tc, ldl, and hdl
____(dia[[____]])
plt.show()

# Calculate correlation coefficients
print(____)
Code bearbeiten und ausführen