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
.
This exercise is part of the course
Monte Carlo Simulations in Python
Exercise instructions
- Use the
pairplot()
function inseaborn
to visually examine the relationship between the columnstc
,ldl
, andhdl
india
(specified in that order). - Use the
.corr()
method frompandas
to measure the correlation coefficients betweentc
,ldl
, andhdl
india
(specified in that order).
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Create a pairplot of tc, ldl, and hdl
____(dia[[____]])
plt.show()
# Calculate correlation coefficients
print(____)