Data Analysis - Anscombe's quartet

Data on wiki

Analysis with Pandas - Python Data Analysis Library

In [1]:
import pandas as pd
In [2]:
kwartet = pd.read_html('https://pl.wikipedia.org/wiki/Kwartet_Anscombe%27a')
df = kwartet[1][2:]
print(df)
       0      1     2     3     4      5     6      7
2   10.0   8.04  10.0  9.14  10.0   7.46   8.0   6.58
3    8.0   6.95   8.0  8.14   8.0   6.77   8.0   5.76
4   13.0   7.58  13.0  8.74  13.0  12.74   8.0   7.71
5    9.0   8.81   9.0  8.77   9.0   7.11   8.0   8.84
6   11.0   8.33  11.0  9.26  11.0   7.81   8.0   8.47
7   14.0   9.96  14.0  8.10  14.0   8.84   8.0   7.04
8    6.0   7.24   6.0  6.13   6.0   6.08   8.0   5.25
9    4.0   4.26   4.0  3.10   4.0   5.39  19.0  12.50
10  12.0  10.84  12.0  9.13  12.0   8.15   8.0   5.56
11   7.0   4.82   7.0  7.26   7.0   6.42   8.0   7.91
12   5.0   5.68   5.0  4.74   5.0   5.73   8.0   6.89
In [3]:
df.astype('float').describe()
Out[3]:
0 1 2 3 4 5 6 7
count 11.000000 11.000000 11.000000 11.000000 11.000000 11.000000 11.000000 11.000000
mean 9.000000 7.500909 9.000000 7.500909 9.000000 7.500000 9.000000 7.500909
std 3.316625 2.031568 3.316625 2.031657 3.316625 2.030424 3.316625 2.030579
min 4.000000 4.260000 4.000000 3.100000 4.000000 5.390000 8.000000 5.250000
25% 6.500000 6.315000 6.500000 6.695000 6.500000 6.250000 8.000000 6.170000
50% 9.000000 7.580000 9.000000 8.140000 9.000000 7.110000 8.000000 7.040000
75% 11.500000 8.570000 11.500000 8.950000 11.500000 7.980000 8.000000 8.190000
max 14.000000 10.840000 14.000000 9.260000 14.000000 12.740000 19.000000 12.500000
In [ ]:


Copyright © 2017 Sebastian Zajac with Bootstrap and Angular.js technology