Воспользуйтесь модулем Pandas:
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
url='http://wiki.stat.ucla.edu/socr/index.php/SOCR_Data_Dinov_020108_HeightsWeights'
# parse all HTML tables into a list of DataFrames
# and select the second (index==1) element (DF)
df = pd.read_html(url)[1]
# set column names with values from the first row
df.columns = df.iloc[0]
# get rid of first row (column names have already been set)
df = df.iloc[1:]
# cast data types to numeric ones
df[['Height(Inches)', 'Weight(Pounds)']] = df[['Height(Inches)', 'Weight(Pounds)']].astype('float16')
# set fancier matplotlib style
matplotlib.style.use('ggplot')
# plot scatter plot
df.plot.scatter(x='Height(Inches)',y='Weight(Pounds)', s=20)
plt.show()
Результат:
Гистограмма распределения веса:
# plot a histogram for the `Weight(Pounds)` column
df[['Weight(Pounds)']].plot.hist(width=6, alpha=0.6)
X
и что поY
?