Source

talks / pandas / Data-Solution.ipynb

Full commit
   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "<style>\n",
      "img[alt=Miki], img[alt=Eric] {\n",
      "    width: 50px;\n",
      "}\n",
      "</style>"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Pandas\n",
      "------\n",
      "\n",
      "[pandas](http://pandas.pydata.org/) is an open source, BSD-licensed library providing high-performance, easy-to-use data structures and data analysis tools for the Python programming language."
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "#This Workshop\n",
      "We'll show you the basics on how to work with data. First part will (by ![Miki](http://intranet/badge/tebekamiki.jpg \"Miki\")) will focus on cleaning data and second part (by ![Eric](http://intranet/badge/klusmaneric.jpg \"Eric\")) will focus on analytics and visualization and on using pandas for to do QA of Tableau reports.\n",
      "\n",
      "We highly recommend [Python for Data Analysis](http://shop.oreilly.com/product/0636920023784.do) by Wes McKinney (pandas main developer); it is an excellent book.\n",
      "\n",
      "# IPython Notebook\n",
      "This is an [IPython notebook](http://ipython.org/notebook.html): you can do many cool things with it - including running code!\n",
      "\n",
      "Note that this notebook server was started with `--pylab=inline` for some import shortcuts and inline graphs."
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "# Getting Data\n",
      "We'll use an [sqlite3](http://docs.python.org/2/library/sqlite3.html) database. Pandas has a [read_frame](http://pandas.pydata.org/pandas-docs/dev/generated/pandas.io.sql.read_frame.html) function that get data from an SQL connection to a [DataFrame](http://pandas.pydata.org/pandas-docs/dev/generated/pandas.DataFrame.html).\n",
      "\n",
      "Download [the database](http://dm-miki.s3.amazonaws.com/talks/edw.sqlite.bz2) and uncompress it. Then use `sqlite3` and `read_frame` to load the table `FACT_OMNITURE_PAGE_VIEWS` to a DataFrame called `df`. "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import sqlite3\n",
      "from pandas.io.sql import read_frame\n",
      "db = sqlite3.connect('edw.sqlite')\n",
      "df = read_frame('SELECT * FROM FACT_OMNITURE_PAGE_VIEWS', db)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 1
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "# First Look at the Data\n",
      "\n",
      "## `df` value"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "df"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "html": [
        "<pre>\n",
        "&lt;class 'pandas.core.frame.DataFrame'&gt;\n",
        "Int64Index: 10000 entries, 0 to 9999\n",
        "Data columns (total 32 columns):\n",
        "DAY_KEY                     10000  non-null values\n",
        "CONTENT_METADATA_KEY        10000  non-null values\n",
        "CATEGORY_KEY                10000  non-null values\n",
        "SITE_KEY                    10000  non-null values\n",
        "SEARCH_ENGINE_KEY           10000  non-null values\n",
        "GEOGRAPHY_KEY               10000  non-null values\n",
        "REFERRER_HOST_KEY           10000  non-null values\n",
        "STUDIO_KEY                  10000  non-null values\n",
        "CONTENT_KEY                 10000  non-null values\n",
        "SEARCH_PHRASE_KEY           10000  non-null values\n",
        "USER_AGENT_KEY              10000  non-null values\n",
        "PAGE_TYPE_KEY               10000  non-null values\n",
        "SUB_PAGE_TYPE_KEY           10000  non-null values\n",
        "QCD_PRIMARY_KEY             10000  non-null values\n",
        "VISIT_KEY                   10000  non-null values\n",
        "EVENT_DTM                   10000  non-null values\n",
        "IP_ADDRESS                  10000  non-null values\n",
        "IP_ADDRESS_NBR              10000  non-null values\n",
        "GOOGLE_RANK                 1032  non-null values\n",
        "VISITORIZED                 10000  non-null values\n",
        "VISITOR_ID                  10000  non-null values\n",
        "VERSION_ID                  10000  non-null values\n",
        "REFERRER                    8162  non-null values\n",
        "FULL_URI                    10000  non-null values\n",
        "UTM_SOURCE                  335  non-null values\n",
        "UTM_MEDIUM                  391  non-null values\n",
        "UTM_CAMPAIGN                379  non-null values\n",
        "LTV_TAG                     4405  non-null values\n",
        "EDW_CREATED_DTM             10000  non-null values\n",
        "SOURCE_FILE_TRACKING_ID     10000  non-null values\n",
        "ODS_OMD_WORK_INSTANCE_ID    10000  non-null values\n",
        "EDW_OMD_WORK_INSTANCE_ID    10000  non-null values\n",
        "dtypes: int64(19), object(13)\n",
        "</pre>"
       ],
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 2,
       "text": [
        "<class 'pandas.core.frame.DataFrame'>\n",
        "Int64Index: 10000 entries, 0 to 9999\n",
        "Data columns (total 32 columns):\n",
        "DAY_KEY                     10000  non-null values\n",
        "CONTENT_METADATA_KEY        10000  non-null values\n",
        "CATEGORY_KEY                10000  non-null values\n",
        "SITE_KEY                    10000  non-null values\n",
        "SEARCH_ENGINE_KEY           10000  non-null values\n",
        "GEOGRAPHY_KEY               10000  non-null values\n",
        "REFERRER_HOST_KEY           10000  non-null values\n",
        "STUDIO_KEY                  10000  non-null values\n",
        "CONTENT_KEY                 10000  non-null values\n",
        "SEARCH_PHRASE_KEY           10000  non-null values\n",
        "USER_AGENT_KEY              10000  non-null values\n",
        "PAGE_TYPE_KEY               10000  non-null values\n",
        "SUB_PAGE_TYPE_KEY           10000  non-null values\n",
        "QCD_PRIMARY_KEY             10000  non-null values\n",
        "VISIT_KEY                   10000  non-null values\n",
        "EVENT_DTM                   10000  non-null values\n",
        "IP_ADDRESS                  10000  non-null values\n",
        "IP_ADDRESS_NBR              10000  non-null values\n",
        "GOOGLE_RANK                 1032  non-null values\n",
        "VISITORIZED                 10000  non-null values\n",
        "VISITOR_ID                  10000  non-null values\n",
        "VERSION_ID                  10000  non-null values\n",
        "REFERRER                    8162  non-null values\n",
        "FULL_URI                    10000  non-null values\n",
        "UTM_SOURCE                  335  non-null values\n",
        "UTM_MEDIUM                  391  non-null values\n",
        "UTM_CAMPAIGN                379  non-null values\n",
        "LTV_TAG                     4405  non-null values\n",
        "EDW_CREATED_DTM             10000  non-null values\n",
        "SOURCE_FILE_TRACKING_ID     10000  non-null values\n",
        "ODS_OMD_WORK_INSTANCE_ID    10000  non-null values\n",
        "EDW_OMD_WORK_INSTANCE_ID    10000  non-null values\n",
        "dtypes: int64(19), object(13)"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "## Columns"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "df.columns"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 3,
       "text": [
        "Index([u'DAY_KEY', u'CONTENT_METADATA_KEY', u'CATEGORY_KEY', u'SITE_KEY', u'SEARCH_ENGINE_KEY', u'GEOGRAPHY_KEY', u'REFERRER_HOST_KEY', u'STUDIO_KEY', u'CONTENT_KEY', u'SEARCH_PHRASE_KEY', u'USER_AGENT_KEY', u'PAGE_TYPE_KEY', u'SUB_PAGE_TYPE_KEY', u'QCD_PRIMARY_KEY', u'VISIT_KEY', u'EVENT_DTM', u'IP_ADDRESS', u'IP_ADDRESS_NBR', u'GOOGLE_RANK', u'VISITORIZED', u'VISITOR_ID', u'VERSION_ID', u'REFERRER', u'FULL_URI', u'UTM_SOURCE', u'UTM_MEDIUM', u'UTM_CAMPAIGN', u'LTV_TAG', u'EDW_CREATED_DTM', u'SOURCE_FILE_TRACKING_ID', u'ODS_OMD_WORK_INSTANCE_ID', u'EDW_OMD_WORK_INSTANCE_ID'], dtype=object)"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "## Some Values from DAY_KEY, SITE_KEY and IP_ADDRESS"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "df[['DAY_KEY', 'SITE_KEY', 'IP_ADDRESS']].head()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "html": [
        "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
        "<table border=\"1\" class=\"dataframe\">\n",
        "  <thead>\n",
        "    <tr style=\"text-align: right;\">\n",
        "      <th></th>\n",
        "      <th>DAY_KEY</th>\n",
        "      <th>SITE_KEY</th>\n",
        "      <th>IP_ADDRESS</th>\n",
        "    </tr>\n",
        "  </thead>\n",
        "  <tbody>\n",
        "    <tr>\n",
        "      <th>0</th>\n",
        "      <td> 20131101</td>\n",
        "      <td>  180001</td>\n",
        "      <td>   66.87.65.133</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1</th>\n",
        "      <td> 20131101</td>\n",
        "      <td>  180001</td>\n",
        "      <td>  161.31.62.126</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2</th>\n",
        "      <td> 20131101</td>\n",
        "      <td> 1280001</td>\n",
        "      <td> 24.171.168.246</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>3</th>\n",
        "      <td> 20131101</td>\n",
        "      <td>  730001</td>\n",
        "      <td>  130.85.58.235</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>4</th>\n",
        "      <td> 20131101</td>\n",
        "      <td>  180001</td>\n",
        "      <td>   80.2.127.232</td>\n",
        "    </tr>\n",
        "  </tbody>\n",
        "</table>\n",
        "</div>"
       ],
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 4,
       "text": [
        "    DAY_KEY  SITE_KEY      IP_ADDRESS\n",
        "0  20131101    180001    66.87.65.133\n",
        "1  20131101    180001   161.31.62.126\n",
        "2  20131101   1280001  24.171.168.246\n",
        "3  20131101    730001   130.85.58.235\n",
        "4  20131101    180001    80.2.127.232"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "## Data Types"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "df.dtypes"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 5,
       "text": [
        "DAY_KEY                      int64\n",
        "CONTENT_METADATA_KEY         int64\n",
        "CATEGORY_KEY                 int64\n",
        "SITE_KEY                     int64\n",
        "SEARCH_ENGINE_KEY            int64\n",
        "GEOGRAPHY_KEY                int64\n",
        "REFERRER_HOST_KEY            int64\n",
        "STUDIO_KEY                   int64\n",
        "CONTENT_KEY                  int64\n",
        "SEARCH_PHRASE_KEY            int64\n",
        "USER_AGENT_KEY               int64\n",
        "PAGE_TYPE_KEY                int64\n",
        "SUB_PAGE_TYPE_KEY            int64\n",
        "QCD_PRIMARY_KEY              int64\n",
        "VISIT_KEY                    int64\n",
        "EVENT_DTM                   object\n",
        "IP_ADDRESS                  object\n",
        "IP_ADDRESS_NBR               int64\n",
        "GOOGLE_RANK                 object\n",
        "VISITORIZED                 object\n",
        "VISITOR_ID                  object\n",
        "VERSION_ID                  object\n",
        "REFERRER                    object\n",
        "FULL_URI                    object\n",
        "UTM_SOURCE                  object\n",
        "UTM_MEDIUM                  object\n",
        "UTM_CAMPAIGN                object\n",
        "LTV_TAG                     object\n",
        "EDW_CREATED_DTM             object\n",
        "SOURCE_FILE_TRACKING_ID      int64\n",
        "ODS_OMD_WORK_INSTANCE_ID     int64\n",
        "EDW_OMD_WORK_INSTANCE_ID     int64\n",
        "dtype: object"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "# Cleaning Data\n",
      "\n",
      "You should know you data. However, everything that is an `object` is probably a string and need to be checked.\n",
      "\n",
      "For example `EVENT_DTM` (event date time) should be a [datetime](http://docs.python.org/2/library/datetime.html) object.  Check whether that's currently the case or not."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "df['EVENT_DTM'][0]"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 6,
       "text": [
        "u'2013-11-01 05:51:12.507'"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Fix `EVENT_DTM` column to be of `pandas.Timestamp` object. You'll find [pandas.to_datetime](http://pandas.pydata.org/pandas-docs/dev/generated/pandas.tseries.tools.to_datetime.html#pandas.tseries.tools.to_datetime) helpful (you can ignore the milliseconds for simplicity)."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import pandas as pd\n",
      "df['EVENT_DTM'] = df['EVENT_DTM'].map(pd.to_datetime)\n",
      "df['EVENT_DTM'][0]"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 7,
       "text": [
        "Timestamp('2013-11-01 05:51:12.507000', tz=None)"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Cleanup `GOOGLE_RANK` to be a number or `nan`."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "df['GOOGLE_RANK'].head()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 8,
       "text": [
        "0    None\n",
        "1       2\n",
        "2       5\n",
        "3    None\n",
        "4    None\n",
        "Name: GOOGLE_RANK, dtype: object"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "def to_int(v):\n",
      "    try:\n",
      "        return int(v)\n",
      "    except (ValueError, TypeError):\n",
      "        return np.nan\n",
      "df['GOOGLE_RANK'] = df['GOOGLE_RANK'].map(to_int)\n",
      "df['GOOGLE_RANK'].head()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 9,
       "text": [
        "0   NaN\n",
        "1     2\n",
        "2     5\n",
        "3   NaN\n",
        "4   NaN\n",
        "Name: GOOGLE_RANK, dtype: float64"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "# Joining Tables\n",
      "\n",
      "In the current DataFrame, we have only `SITE_KEY`, however we'd like to have the site name as well. Load another DataFrame from the `DIM_SITE` table and join it with the previous data frame on `SITE_KEY`.\n",
      "\n",
      "See [pandas.merge](http://pandas.pydata.org/pandas-docs/dev/merging.html#database-style-dataframe-joining-merging) function."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "sites = read_frame('SELECT * FROM DIM_SITE', db)\n",
      "sites"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "html": [
        "<pre>\n",
        "&lt;class 'pandas.core.frame.DataFrame'&gt;\n",
        "Int64Index: 187 entries, 0 to 186\n",
        "Data columns (total 17 columns):\n",
        "SITE_KEY                       187  non-null values\n",
        "SITE_ID                        184  non-null values\n",
        "PROPERTY_NAME                  187  non-null values\n",
        "PROPERTY_CODE                  184  non-null values\n",
        "BUSINESS_OWNER_NAME            169  non-null values\n",
        "ACQUISITION_DATE               99  non-null values\n",
        "GENERAL_LEDGER_DIVISION_NBR    187  non-null values\n",
        "OMNITURE_SITE_NAME             186  non-null values\n",
        "SOURCE_SYSTEM_ID               186  non-null values\n",
        "SITE_STATUS_CODE               187  non-null values\n",
        "PROPERTY_TYPE                  187  non-null values\n",
        "EDW_CREATED_DTM                187  non-null values\n",
        "EDW_MODIFIED_DTM               19  non-null values\n",
        "SOURCE_FILE_TRACKING_ID        187  non-null values\n",
        "ODS_OMD_WORK_INSTANCE_ID       187  non-null values\n",
        "EDW_OMD_WORK_INSTANCE_ID       187  non-null values\n",
        "GOOGLE_ANALYTICS_ID            187  non-null values\n",
        "dtypes: int64(6), object(11)\n",
        "</pre>"
       ],
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 10,
       "text": [
        "<class 'pandas.core.frame.DataFrame'>\n",
        "Int64Index: 187 entries, 0 to 186\n",
        "Data columns (total 17 columns):\n",
        "SITE_KEY                       187  non-null values\n",
        "SITE_ID                        184  non-null values\n",
        "PROPERTY_NAME                  187  non-null values\n",
        "PROPERTY_CODE                  184  non-null values\n",
        "BUSINESS_OWNER_NAME            169  non-null values\n",
        "ACQUISITION_DATE               99  non-null values\n",
        "GENERAL_LEDGER_DIVISION_NBR    187  non-null values\n",
        "OMNITURE_SITE_NAME             186  non-null values\n",
        "SOURCE_SYSTEM_ID               186  non-null values\n",
        "SITE_STATUS_CODE               187  non-null values\n",
        "PROPERTY_TYPE                  187  non-null values\n",
        "EDW_CREATED_DTM                187  non-null values\n",
        "EDW_MODIFIED_DTM               19  non-null values\n",
        "SOURCE_FILE_TRACKING_ID        187  non-null values\n",
        "ODS_OMD_WORK_INSTANCE_ID       187  non-null values\n",
        "EDW_OMD_WORK_INSTANCE_ID       187  non-null values\n",
        "GOOGLE_ANALYTICS_ID            187  non-null values\n",
        "dtypes: int64(6), object(11)"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "joined = pd.merge(df, sites, how='outer', on='SITE_KEY')\n",
      "joined"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "html": [
        "<pre>\n",
        "&lt;class 'pandas.core.frame.DataFrame'&gt;\n",
        "Int64Index: 10121 entries, 0 to 10120\n",
        "Data columns (total 48 columns):\n",
        "DAY_KEY                        10000  non-null values\n",
        "CONTENT_METADATA_KEY           10000  non-null values\n",
        "CATEGORY_KEY                   10000  non-null values\n",
        "SITE_KEY                       10121  non-null values\n",
        "SEARCH_ENGINE_KEY              10000  non-null values\n",
        "GEOGRAPHY_KEY                  10000  non-null values\n",
        "REFERRER_HOST_KEY              10000  non-null values\n",
        "STUDIO_KEY                     10000  non-null values\n",
        "CONTENT_KEY                    10000  non-null values\n",
        "SEARCH_PHRASE_KEY              10000  non-null values\n",
        "USER_AGENT_KEY                 10000  non-null values\n",
        "PAGE_TYPE_KEY                  10000  non-null values\n",
        "SUB_PAGE_TYPE_KEY              10000  non-null values\n",
        "QCD_PRIMARY_KEY                10000  non-null values\n",
        "VISIT_KEY                      10000  non-null values\n",
        "EVENT_DTM                      10000  non-null values\n",
        "IP_ADDRESS                     10000  non-null values\n",
        "IP_ADDRESS_NBR                 10000  non-null values\n",
        "GOOGLE_RANK                    512  non-null values\n",
        "VISITORIZED                    10000  non-null values\n",
        "VISITOR_ID                     10000  non-null values\n",
        "VERSION_ID                     10000  non-null values\n",
        "REFERRER                       8162  non-null values\n",
        "FULL_URI                       10000  non-null values\n",
        "UTM_SOURCE                     335  non-null values\n",
        "UTM_MEDIUM                     391  non-null values\n",
        "UTM_CAMPAIGN                   379  non-null values\n",
        "LTV_TAG                        4405  non-null values\n",
        "EDW_CREATED_DTM_x              10000  non-null values\n",
        "SOURCE_FILE_TRACKING_ID_x      10000  non-null values\n",
        "ODS_OMD_WORK_INSTANCE_ID_x     10000  non-null values\n",
        "EDW_OMD_WORK_INSTANCE_ID_x     10000  non-null values\n",
        "SITE_ID                        10106  non-null values\n",
        "PROPERTY_NAME                  10121  non-null values\n",
        "PROPERTY_CODE                  10106  non-null values\n",
        "BUSINESS_OWNER_NAME            10066  non-null values\n",
        "ACQUISITION_DATE               9068  non-null values\n",
        "GENERAL_LEDGER_DIVISION_NBR    10121  non-null values\n",
        "OMNITURE_SITE_NAME             10108  non-null values\n",
        "SOURCE_SYSTEM_ID               10108  non-null values\n",
        "SITE_STATUS_CODE               10121  non-null values\n",
        "PROPERTY_TYPE                  10121  non-null values\n",
        "EDW_CREATED_DTM_y              10121  non-null values\n",
        "EDW_MODIFIED_DTM               1964  non-null values\n",
        "SOURCE_FILE_TRACKING_ID_y      10121  non-null values\n",
        "ODS_OMD_WORK_INSTANCE_ID_y     10121  non-null values\n",
        "EDW_OMD_WORK_INSTANCE_ID_y     10121  non-null values\n",
        "GOOGLE_ANALYTICS_ID            10121  non-null values\n",
        "dtypes: datetime64[ns](1), float64(20), int64(5), object(22)\n",
        "</pre>"
       ],
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 11,
       "text": [
        "<class 'pandas.core.frame.DataFrame'>\n",
        "Int64Index: 10121 entries, 0 to 10120\n",
        "Data columns (total 48 columns):\n",
        "DAY_KEY                        10000  non-null values\n",
        "CONTENT_METADATA_KEY           10000  non-null values\n",
        "CATEGORY_KEY                   10000  non-null values\n",
        "SITE_KEY                       10121  non-null values\n",
        "SEARCH_ENGINE_KEY              10000  non-null values\n",
        "GEOGRAPHY_KEY                  10000  non-null values\n",
        "REFERRER_HOST_KEY              10000  non-null values\n",
        "STUDIO_KEY                     10000  non-null values\n",
        "CONTENT_KEY                    10000  non-null values\n",
        "SEARCH_PHRASE_KEY              10000  non-null values\n",
        "USER_AGENT_KEY                 10000  non-null values\n",
        "PAGE_TYPE_KEY                  10000  non-null values\n",
        "SUB_PAGE_TYPE_KEY              10000  non-null values\n",
        "QCD_PRIMARY_KEY                10000  non-null values\n",
        "VISIT_KEY                      10000  non-null values\n",
        "EVENT_DTM                      10000  non-null values\n",
        "IP_ADDRESS                     10000  non-null values\n",
        "IP_ADDRESS_NBR                 10000  non-null values\n",
        "GOOGLE_RANK                    512  non-null values\n",
        "VISITORIZED                    10000  non-null values\n",
        "VISITOR_ID                     10000  non-null values\n",
        "VERSION_ID                     10000  non-null values\n",
        "REFERRER                       8162  non-null values\n",
        "FULL_URI                       10000  non-null values\n",
        "UTM_SOURCE                     335  non-null values\n",
        "UTM_MEDIUM                     391  non-null values\n",
        "UTM_CAMPAIGN                   379  non-null values\n",
        "LTV_TAG                        4405  non-null values\n",
        "EDW_CREATED_DTM_x              10000  non-null values\n",
        "SOURCE_FILE_TRACKING_ID_x      10000  non-null values\n",
        "ODS_OMD_WORK_INSTANCE_ID_x     10000  non-null values\n",
        "EDW_OMD_WORK_INSTANCE_ID_x     10000  non-null values\n",
        "SITE_ID                        10106  non-null values\n",
        "PROPERTY_NAME                  10121  non-null values\n",
        "PROPERTY_CODE                  10106  non-null values\n",
        "BUSINESS_OWNER_NAME            10066  non-null values\n",
        "ACQUISITION_DATE               9068  non-null values\n",
        "GENERAL_LEDGER_DIVISION_NBR    10121  non-null values\n",
        "OMNITURE_SITE_NAME             10108  non-null values\n",
        "SOURCE_SYSTEM_ID               10108  non-null values\n",
        "SITE_STATUS_CODE               10121  non-null values\n",
        "PROPERTY_TYPE                  10121  non-null values\n",
        "EDW_CREATED_DTM_y              10121  non-null values\n",
        "EDW_MODIFIED_DTM               1964  non-null values\n",
        "SOURCE_FILE_TRACKING_ID_y      10121  non-null values\n",
        "ODS_OMD_WORK_INSTANCE_ID_y     10121  non-null values\n",
        "EDW_OMD_WORK_INSTANCE_ID_y     10121  non-null values\n",
        "GOOGLE_ANALYTICS_ID            10121  non-null values\n",
        "dtypes: datetime64[ns](1), float64(20), int64(5), object(22)"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "# Initial Insights\n",
      "\n",
      "## Most Popular Site\n",
      "\n",
      "Find the most popular site by using [pandas.value_counts](http://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.value_counts.html#pandas.Series.value_counts) on `PROPERTY_NAME`."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "sites = pd.value_counts(joined['PROPERTY_NAME'])\n",
      "sites.head()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 12,
       "text": [
        "eHow             3720\n",
        "ehowenespanol    1698\n",
        "Cracked          1104\n",
        "Livestrong        839\n",
        "i-am-bored        634\n",
        "dtype: int64"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "## Busiest Hour\n",
      "Find the busiest hour."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "hours = pd.value_counts(df['EVENT_DTM'].map(lambda v: v.hour))\n",
      "xs = range(0, 25)  # We want all hours\n",
      "ys = [hours.get(x, 0) for x in xs]\n",
      "bar(xs, ys)\n",
      "grid()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "display_data",
       "svg": [
        "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n",
        "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
        "  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
        "<!-- Created with matplotlib (http://matplotlib.org/) -->\n",
        "<svg height=\"256pt\" version=\"1.1\" viewBox=\"0 0 376 256\" width=\"376pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
        " <defs>\n",
        "  <style type=\"text/css\">\n",
        "*{stroke-linecap:butt;stroke-linejoin:round;}\n",
        "  </style>\n",
        " </defs>\n",
        " <g id=\"figure_1\">\n",
        "  <g id=\"patch_1\">\n",
        "   <path d=\"\n",
        "M0 256.117\n",
        "L376.694 256.117\n",
        "L376.694 0\n",
        "L0 0\n",
        "z\n",
        "\" style=\"fill:#ffffff;\"/>\n",
        "  </g>\n",
        "  <g id=\"axes_1\">\n",
        "   <g id=\"patch_2\">\n",
        "    <path d=\"\n",
        "M29.1344 235.239\n",
        "L363.934 235.239\n",
        "L363.934 12.0391\n",
        "L29.1344 12.0391\n",
        "z\n",
        "\" style=\"fill:#ffffff;\"/>\n",
        "   </g>\n",
        "   <g id=\"patch_3\">\n",
        "    <path clip-path=\"url(#p4764608df1)\" d=\"\n",
        "M29.1344 235.239\n",
        "L39.848 235.239\n",
        "L39.848 161.902\n",
        "L29.1344 161.902\n",
        "z\n",
        "\" style=\"fill:#0000ff;stroke:#000000;\"/>\n",
        "   </g>\n",
        "   <g id=\"patch_4\">\n",
        "    <path clip-path=\"url(#p4764608df1)\" d=\"\n",
        "M42.5264 235.239\n",
        "L53.24 235.239\n",
        "L53.24 171.149\n",
        "L42.5264 171.149\n",
        "z\n",
        "\" style=\"fill:#0000ff;stroke:#000000;\"/>\n",
        "   </g>\n",
        "   <g id=\"patch_5\">\n",
        "    <path clip-path=\"url(#p4764608df1)\" d=\"\n",
        "M55.9184 235.239\n",
        "L66.632 235.239\n",
        "L66.632 166.685\n",
        "L55.9184 166.685\n",
        "z\n",
        "\" style=\"fill:#0000ff;stroke:#000000;\"/>\n",
        "   </g>\n",
        "   <g id=\"patch_6\">\n",
        "    <path clip-path=\"url(#p4764608df1)\" d=\"\n",
        "M69.3104 235.239\n",
        "L80.024 235.239\n",
        "L80.024 163.815\n",
        "L69.3104 163.815\n",
        "z\n",
        "\" style=\"fill:#0000ff;stroke:#000000;\"/>\n",
        "   </g>\n",
        "   <g id=\"patch_7\">\n",
        "    <path clip-path=\"url(#p4764608df1)\" d=\"\n",
        "M82.7024 235.239\n",
        "L93.416 235.239\n",
        "L93.416 145.64\n",
        "L82.7024 145.64\n",
        "z\n",
        "\" style=\"fill:#0000ff;stroke:#000000;\"/>\n",
        "   </g>\n",
        "   <g id=\"patch_8\">\n",
        "    <path clip-path=\"url(#p4764608df1)\" d=\"\n",
        "M96.0944 235.239\n",
        "L106.808 235.239\n",
        "L106.808 117.9\n",
        "L96.0944 117.9\n",
        "z\n",
        "\" style=\"fill:#0000ff;stroke:#000000;\"/>\n",
        "   </g>\n",
        "   <g id=\"patch_9\">\n",
        "    <path clip-path=\"url(#p4764608df1)\" d=\"\n",
        "M109.486 235.239\n",
        "L120.2 235.239\n",
        "L120.2 92.3911\n",
        "L109.486 92.3911\n",
        "z\n",
        "\" style=\"fill:#0000ff;stroke:#000000;\"/>\n",
        "   </g>\n",
        "   <g id=\"patch_10\">\n",
        "    <path clip-path=\"url(#p4764608df1)\" d=\"\n",
        "M122.878 235.239\n",
        "L133.592 235.239\n",
        "L133.592 69.7522\n",
        "L122.878 69.7522\n",
        "z\n",
        "\" style=\"fill:#0000ff;stroke:#000000;\"/>\n",
        "   </g>\n",
        "   <g id=\"patch_11\">\n",
        "    <path clip-path=\"url(#p4764608df1)\" d=\"\n",
        "M136.27 235.239\n",
        "L146.984 235.239\n",
        "L146.984 72.9408\n",
        "L136.27 72.9408\n",
        "z\n",
        "\" style=\"fill:#0000ff;stroke:#000000;\"/>\n",
        "   </g>\n",
        "   <g id=\"patch_12\">\n",
        "    <path clip-path=\"url(#p4764608df1)\" d=\"\n",
        "M149.662 235.239\n",
        "L160.376 235.239\n",
        "L160.376 74.8539\n",
        "L149.662 74.8539\n",
        "z\n",
        "\" style=\"fill:#0000ff;stroke:#000000;\"/>\n",
        "   </g>\n",
        "   <g id=\"patch_13\">\n",
        "    <path clip-path=\"url(#p4764608df1)\" d=\"\n",
        "M163.054 235.239\n",
        "L173.768 235.239\n",
        "L173.768 63.0562\n",
        "L163.054 63.0562\n",
        "z\n",
        "\" style=\"fill:#0000ff;stroke:#000000;\"/>\n",
        "   </g>\n",
        "   <g id=\"patch_14\">\n",
        "    <path clip-path=\"url(#p4764608df1)\" d=\"\n",
        "M176.446 235.239\n",
        "L187.16 235.239\n",
        "L187.16 65.2882\n",
        "L176.446 65.2882\n",
        "z\n",
        "\" style=\"fill:#0000ff;stroke:#000000;\"/>\n",
        "   </g>\n",
        "   <g id=\"patch_15\">\n",
        "    <path clip-path=\"url(#p4764608df1)\" d=\"\n",
        "M189.838 235.239\n",
        "L200.552 235.239\n",
        "L200.552 68.4768\n",
        "L189.838 68.4768\n",
        "z\n",
        "\" style=\"fill:#0000ff;stroke:#000000;\"/>\n",
        "   </g>\n",
        "   <g id=\"patch_16\">\n",
        "    <path clip-path=\"url(#p4764608df1)\" d=\"\n",
        "M203.23 235.239\n",
        "L213.944 235.239\n",
        "L213.944 39.7796\n",
        "L203.23 39.7796\n",
        "z\n",
        "\" style=\"fill:#0000ff;stroke:#000000;\"/>\n",
        "   </g>\n",
        "   <g id=\"patch_17\">\n",
        "    <path clip-path=\"url(#p4764608df1)\" d=\"\n",
        "M216.622 235.239\n",
        "L227.336 235.239\n",
        "L227.336 64.6505\n",
        "L216.622 64.6505\n",
        "z\n",
        "\" style=\"fill:#0000ff;stroke:#000000;\"/>\n",
        "   </g>\n",
        "   <g id=\"patch_18\">\n",
        "    <path clip-path=\"url(#p4764608df1)\" d=\"\n",
        "M230.014 235.239\n",
        "L240.728 235.239\n",
        "L240.728 58.9111\n",
        "L230.014 58.9111\n",
        "z\n",
        "\" style=\"fill:#0000ff;stroke:#000000;\"/>\n",
        "   </g>\n",
        "   <g id=\"patch_19\">\n",
        "    <path clip-path=\"url(#p4764608df1)\" d=\"\n",
        "M243.406 235.239\n",
        "L254.12 235.239\n",
        "L254.12 77.0859\n",
        "L243.406 77.0859\n",
        "z\n",
        "\" style=\"fill:#0000ff;stroke:#000000;\"/>\n",
        "   </g>\n",
        "   <g id=\"patch_20\">\n",
        "    <path clip-path=\"url(#p4764608df1)\" d=\"\n",
        "M256.798 235.239\n",
        "L267.512 235.239\n",
        "L267.512 67.5202\n",
        "L256.798 67.5202\n",
        "z\n",
        "\" style=\"fill:#0000ff;stroke:#000000;\"/>\n",
        "   </g>\n",
        "   <g id=\"patch_21\">\n",
        "    <path clip-path=\"url(#p4764608df1)\" d=\"\n",
        "M270.19 235.239\n",
        "L280.904 235.239\n",
        "L280.904 77.4048\n",
        "L270.19 77.4048\n",
        "z\n",
        "\" style=\"fill:#0000ff;stroke:#000000;\"/>\n",
        "   </g>\n",
        "   <g id=\"patch_22\">\n",
        "    <path clip-path=\"url(#p4764608df1)\" d=\"\n",
        "M283.582 235.239\n",
        "L294.296 235.239\n",
        "L294.296 90.7968\n",
        "L283.582 90.7968\n",
        "z\n",
        "\" style=\"fill:#0000ff;stroke:#000000;\"/>\n",
        "   </g>\n",
        "   <g id=\"patch_23\">\n",
        "    <path clip-path=\"url(#p4764608df1)\" d=\"\n",
        "M296.974 235.239\n",
        "L307.688 235.239\n",
        "L307.688 97.8116\n",
        "L296.974 97.8116\n",
        "z\n",
        "\" style=\"fill:#0000ff;stroke:#000000;\"/>\n",
        "   </g>\n",
        "   <g id=\"patch_24\">\n",
        "    <path clip-path=\"url(#p4764608df1)\" d=\"\n",
        "M310.366 235.239\n",
        "L321.08 235.239\n",
        "L321.08 122.682\n",
        "L310.366 122.682\n",
        "z\n",
        "\" style=\"fill:#0000ff;stroke:#000000;\"/>\n",
        "   </g>\n",
        "   <g id=\"patch_25\">\n",
        "    <path clip-path=\"url(#p4764608df1)\" d=\"\n",
        "M323.758 235.239\n",
        "L334.472 235.239\n",
        "L334.472 159.032\n",
        "L323.758 159.032\n",
        "z\n",
        "\" style=\"fill:#0000ff;stroke:#000000;\"/>\n",
        "   </g>\n",
        "   <g id=\"patch_26\">\n",
        "    <path clip-path=\"url(#p4764608df1)\" d=\"\n",
        "M337.15 235.239\n",
        "L347.864 235.239\n",
        "L347.864 167.641\n",
        "L337.15 167.641\n",
        "z\n",
        "\" style=\"fill:#0000ff;stroke:#000000;\"/>\n",
        "   </g>\n",
        "   <g id=\"patch_27\">\n",
        "    <path clip-path=\"url(#p4764608df1)\" d=\"\n",
        "M350.542 235.239\n",
        "L361.256 235.239\n",
        "L361.256 235.239\n",
        "L350.542 235.239\n",
        "z\n",
        "\" style=\"fill:#0000ff;stroke:#000000;\"/>\n",
        "   </g>\n",
        "   <g id=\"matplotlib.axis_1\">\n",
        "    <g id=\"xtick_1\">\n",
        "     <g id=\"line2d_1\">\n",
        "      <path clip-path=\"url(#p4764608df1)\" d=\"\n",
        "M29.1344 235.239\n",
        "L29.1344 12.0391\" style=\"fill:none;stroke:#000000;stroke-dasharray:1.000000,3.000000;stroke-dashoffset:0.0;stroke-width:0.5;\"/>\n",
        "     </g>\n",
        "     <g id=\"line2d_2\">\n",
        "      <defs>\n",
        "       <path d=\"\n",
        "M0 0\n",
        "L0 -4\" id=\"m93b0483c22\" style=\"stroke:#000000;stroke-width:0.5;\"/>\n",
        "      </defs>\n",
        "      <g>\n",
        "       <use style=\"stroke:#000000;stroke-width:0.5;\" x=\"29.134375\" xlink:href=\"#m93b0483c22\" y=\"235.2390625\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "     <g id=\"line2d_3\">\n",
        "      <defs>\n",
        "       <path d=\"\n",
        "M0 0\n",
        "L0 4\" id=\"m741efc42ff\" style=\"stroke:#000000;stroke-width:0.5;\"/>\n",
        "      </defs>\n",
        "      <g>\n",
        "       <use style=\"stroke:#000000;stroke-width:0.5;\" x=\"29.134375\" xlink:href=\"#m741efc42ff\" y=\"12.0390625\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "     <g id=\"text_1\">\n",
        "      <!-- 0 -->\n",
        "      <defs>\n",
        "       <path d=\"\n",
        "M31.7812 66.4062\n",
        "Q24.1719 66.4062 20.3281 58.9062\n",
        "Q16.5 51.4219 16.5 36.375\n",
        "Q16.5 21.3906 20.3281 13.8906\n",
        "Q24.1719 6.39062 31.7812 6.39062\n",
        "Q39.4531 6.39062 43.2812 13.8906\n",
        "Q47.125 21.3906 47.125 36.375\n",
        "Q47.125 51.4219 43.2812 58.9062\n",
        "Q39.4531 66.4062 31.7812 66.4062\n",
        "M31.7812 74.2188\n",
        "Q44.0469 74.2188 50.5156 64.5156\n",
        "Q56.9844 54.8281 56.9844 36.375\n",
        "Q56.9844 17.9688 50.5156 8.26562\n",
        "Q44.0469 -1.42188 31.7812 -1.42188\n",
        "Q19.5312 -1.42188 13.0625 8.26562\n",
        "Q6.59375 17.9688 6.59375 36.375\n",
        "Q6.59375 54.8281 13.0625 64.5156\n",
        "Q19.5312 74.2188 31.7812 74.2188\" id=\"BitstreamVeraSans-Roman-30\"/>\n",
        "      </defs>\n",
        "      <g transform=\"translate(26.61484375 246.8375)scale(0.1 -0.1)\">\n",
        "       <use xlink:href=\"#BitstreamVeraSans-Roman-30\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "    </g>\n",
        "    <g id=\"xtick_2\">\n",
        "     <g id=\"line2d_4\">\n",
        "      <path clip-path=\"url(#p4764608df1)\" d=\"\n",
        "M96.0944 235.239\n",
        "L96.0944 12.0391\" style=\"fill:none;stroke:#000000;stroke-dasharray:1.000000,3.000000;stroke-dashoffset:0.0;stroke-width:0.5;\"/>\n",
        "     </g>\n",
        "     <g id=\"line2d_5\">\n",
        "      <g>\n",
        "       <use style=\"stroke:#000000;stroke-width:0.5;\" x=\"96.094375\" xlink:href=\"#m93b0483c22\" y=\"235.2390625\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "     <g id=\"line2d_6\">\n",
        "      <g>\n",
        "       <use style=\"stroke:#000000;stroke-width:0.5;\" x=\"96.094375\" xlink:href=\"#m741efc42ff\" y=\"12.0390625\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "     <g id=\"text_2\">\n",
        "      <!-- 5 -->\n",
        "      <defs>\n",
        "       <path d=\"\n",
        "M10.7969 72.9062\n",
        "L49.5156 72.9062\n",
        "L49.5156 64.5938\n",
        "L19.8281 64.5938\n",
        "L19.8281 46.7344\n",
        "Q21.9688 47.4688 24.1094 47.8281\n",
        "Q26.2656 48.1875 28.4219 48.1875\n",
        "Q40.625 48.1875 47.75 41.5\n",
        "Q54.8906 34.8125 54.8906 23.3906\n",
        "Q54.8906 11.625 47.5625 5.09375\n",
        "Q40.2344 -1.42188 26.9062 -1.42188\n",
        "Q22.3125 -1.42188 17.5469 -0.640625\n",
        "Q12.7969 0.140625 7.71875 1.70312\n",
        "L7.71875 11.625\n",
        "Q12.1094 9.23438 16.7969 8.0625\n",
        "Q21.4844 6.89062 26.7031 6.89062\n",
        "Q35.1562 6.89062 40.0781 11.3281\n",
        "Q45.0156 15.7656 45.0156 23.3906\n",
        "Q45.0156 31 40.0781 35.4375\n",
        "Q35.1562 39.8906 26.7031 39.8906\n",
        "Q22.75 39.8906 18.8125 39.0156\n",
        "Q14.8906 38.1406 10.7969 36.2812\n",
        "z\n",
        "\" id=\"BitstreamVeraSans-Roman-35\"/>\n",
        "      </defs>\n",
        "      <g transform=\"translate(93.73578125 246.8375)scale(0.1 -0.1)\">\n",
        "       <use xlink:href=\"#BitstreamVeraSans-Roman-35\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "    </g>\n",
        "    <g id=\"xtick_3\">\n",
        "     <g id=\"line2d_7\">\n",
        "      <path clip-path=\"url(#p4764608df1)\" d=\"\n",
        "M163.054 235.239\n",
        "L163.054 12.0391\" style=\"fill:none;stroke:#000000;stroke-dasharray:1.000000,3.000000;stroke-dashoffset:0.0;stroke-width:0.5;\"/>\n",
        "     </g>\n",
        "     <g id=\"line2d_8\">\n",
        "      <g>\n",
        "       <use style=\"stroke:#000000;stroke-width:0.5;\" x=\"163.054375\" xlink:href=\"#m93b0483c22\" y=\"235.2390625\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "     <g id=\"line2d_9\">\n",
        "      <g>\n",
        "       <use style=\"stroke:#000000;stroke-width:0.5;\" x=\"163.054375\" xlink:href=\"#m741efc42ff\" y=\"12.0390625\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "     <g id=\"text_3\">\n",
        "      <!-- 10 -->\n",
        "      <defs>\n",
        "       <path d=\"\n",
        "M12.4062 8.29688\n",
        "L28.5156 8.29688\n",
        "L28.5156 63.9219\n",
        "L10.9844 60.4062\n",
        "L10.9844 69.3906\n",
        "L28.4219 72.9062\n",
        "L38.2812 72.9062\n",
        "L38.2812 8.29688\n",
        "L54.3906 8.29688\n",
        "L54.3906 0\n",
        "L12.4062 0\n",
        "z\n",
        "\" id=\"BitstreamVeraSans-Roman-31\"/>\n",
        "      </defs>\n",
        "      <g transform=\"translate(157.573125 246.8375)scale(0.1 -0.1)\">\n",
        "       <use xlink:href=\"#BitstreamVeraSans-Roman-31\"/>\n",
        "       <use x=\"63.623046875\" xlink:href=\"#BitstreamVeraSans-Roman-30\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "    </g>\n",
        "    <g id=\"xtick_4\">\n",
        "     <g id=\"line2d_10\">\n",
        "      <path clip-path=\"url(#p4764608df1)\" d=\"\n",
        "M230.014 235.239\n",
        "L230.014 12.0391\" style=\"fill:none;stroke:#000000;stroke-dasharray:1.000000,3.000000;stroke-dashoffset:0.0;stroke-width:0.5;\"/>\n",
        "     </g>\n",
        "     <g id=\"line2d_11\">\n",
        "      <g>\n",
        "       <use style=\"stroke:#000000;stroke-width:0.5;\" x=\"230.014375\" xlink:href=\"#m93b0483c22\" y=\"235.2390625\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "     <g id=\"line2d_12\">\n",
        "      <g>\n",
        "       <use style=\"stroke:#000000;stroke-width:0.5;\" x=\"230.014375\" xlink:href=\"#m741efc42ff\" y=\"12.0390625\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "     <g id=\"text_4\">\n",
        "      <!-- 15 -->\n",
        "      <g transform=\"translate(224.6378125 246.8375)scale(0.1 -0.1)\">\n",
        "       <use xlink:href=\"#BitstreamVeraSans-Roman-31\"/>\n",
        "       <use x=\"63.623046875\" xlink:href=\"#BitstreamVeraSans-Roman-35\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "    </g>\n",
        "    <g id=\"xtick_5\">\n",
        "     <g id=\"line2d_13\">\n",
        "      <path clip-path=\"url(#p4764608df1)\" d=\"\n",
        "M296.974 235.239\n",
        "L296.974 12.0391\" style=\"fill:none;stroke:#000000;stroke-dasharray:1.000000,3.000000;stroke-dashoffset:0.0;stroke-width:0.5;\"/>\n",
        "     </g>\n",
        "     <g id=\"line2d_14\">\n",
        "      <g>\n",
        "       <use style=\"stroke:#000000;stroke-width:0.5;\" x=\"296.974375\" xlink:href=\"#m93b0483c22\" y=\"235.2390625\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "     <g id=\"line2d_15\">\n",
        "      <g>\n",
        "       <use style=\"stroke:#000000;stroke-width:0.5;\" x=\"296.974375\" xlink:href=\"#m741efc42ff\" y=\"12.0390625\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "     <g id=\"text_5\">\n",
        "      <!-- 20 -->\n",
        "      <defs>\n",
        "       <path d=\"\n",
        "M19.1875 8.29688\n",
        "L53.6094 8.29688\n",
        "L53.6094 0\n",
        "L7.32812 0\n",
        "L7.32812 8.29688\n",
        "Q12.9375 14.1094 22.625 23.8906\n",
        "Q32.3281 33.6875 34.8125 36.5312\n",
        "Q39.5469 41.8438 41.4219 45.5312\n",
        "Q43.3125 49.2188 43.3125 52.7812\n",
        "Q43.3125 58.5938 39.2344 62.25\n",
        "Q35.1562 65.9219 28.6094 65.9219\n",
        "Q23.9688 65.9219 18.8125 64.3125\n",
        "Q13.6719 62.7031 7.8125 59.4219\n",
        "L7.8125 69.3906\n",
        "Q13.7656 71.7812 18.9375 73\n",
        "Q24.125 74.2188 28.4219 74.2188\n",
        "Q39.75 74.2188 46.4844 68.5469\n",
        "Q53.2188 62.8906 53.2188 53.4219\n",
        "Q53.2188 48.9219 51.5312 44.8906\n",
        "Q49.8594 40.875 45.4062 35.4062\n",
        "Q44.1875 33.9844 37.6406 27.2188\n",
        "Q31.1094 20.4531 19.1875 8.29688\" id=\"BitstreamVeraSans-Roman-32\"/>\n",
        "      </defs>\n",
        "      <g transform=\"translate(291.3103125 246.8375)scale(0.1 -0.1)\">\n",
        "       <use xlink:href=\"#BitstreamVeraSans-Roman-32\"/>\n",
        "       <use x=\"63.623046875\" xlink:href=\"#BitstreamVeraSans-Roman-30\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "    </g>\n",
        "    <g id=\"xtick_6\">\n",
        "     <g id=\"line2d_16\">\n",
        "      <path clip-path=\"url(#p4764608df1)\" d=\"\n",
        "M363.934 235.239\n",
        "L363.934 12.0391\" style=\"fill:none;stroke:#000000;stroke-dasharray:1.000000,3.000000;stroke-dashoffset:0.0;stroke-width:0.5;\"/>\n",
        "     </g>\n",
        "     <g id=\"line2d_17\">\n",
        "      <g>\n",
        "       <use style=\"stroke:#000000;stroke-width:0.5;\" x=\"363.934375\" xlink:href=\"#m93b0483c22\" y=\"235.2390625\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "     <g id=\"line2d_18\">\n",
        "      <g>\n",
        "       <use style=\"stroke:#000000;stroke-width:0.5;\" x=\"363.934375\" xlink:href=\"#m741efc42ff\" y=\"12.0390625\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "     <g id=\"text_6\">\n",
        "      <!-- 25 -->\n",
        "      <g transform=\"translate(358.375 246.8375)scale(0.1 -0.1)\">\n",
        "       <use xlink:href=\"#BitstreamVeraSans-Roman-32\"/>\n",
        "       <use x=\"63.623046875\" xlink:href=\"#BitstreamVeraSans-Roman-35\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "    </g>\n",
        "   </g>\n",
        "   <g id=\"matplotlib.axis_2\">\n",
        "    <g id=\"ytick_1\">\n",
        "     <g id=\"line2d_19\">\n",
        "      <path clip-path=\"url(#p4764608df1)\" d=\"\n",
        "M29.1344 235.239\n",
        "L363.934 235.239\" style=\"fill:none;stroke:#000000;stroke-dasharray:1.000000,3.000000;stroke-dashoffset:0.0;stroke-width:0.5;\"/>\n",
        "     </g>\n",
        "     <g id=\"line2d_20\">\n",
        "      <defs>\n",
        "       <path d=\"\n",
        "M0 0\n",
        "L4 0\" id=\"m728421d6d4\" style=\"stroke:#000000;stroke-width:0.5;\"/>\n",
        "      </defs>\n",
        "      <g>\n",
        "       <use style=\"stroke:#000000;stroke-width:0.5;\" x=\"29.134375\" xlink:href=\"#m728421d6d4\" y=\"235.2390625\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "     <g id=\"line2d_21\">\n",
        "      <defs>\n",
        "       <path d=\"\n",
        "M0 0\n",
        "L-4 0\" id=\"mcb0005524f\" style=\"stroke:#000000;stroke-width:0.5;\"/>\n",
        "      </defs>\n",
        "      <g>\n",
        "       <use style=\"stroke:#000000;stroke-width:0.5;\" x=\"363.934375\" xlink:href=\"#mcb0005524f\" y=\"235.2390625\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "     <g id=\"text_7\">\n",
        "      <!-- 0 -->\n",
        "      <g transform=\"translate(20.0953125 237.9984375)scale(0.1 -0.1)\">\n",
        "       <use xlink:href=\"#BitstreamVeraSans-Roman-30\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "    </g>\n",
        "    <g id=\"ytick_2\">\n",
        "     <g id=\"line2d_22\">\n",
        "      <path clip-path=\"url(#p4764608df1)\" d=\"\n",
        "M29.1344 203.353\n",
        "L363.934 203.353\" style=\"fill:none;stroke:#000000;stroke-dasharray:1.000000,3.000000;stroke-dashoffset:0.0;stroke-width:0.5;\"/>\n",
        "     </g>\n",
        "     <g id=\"line2d_23\">\n",
        "      <g>\n",
        "       <use style=\"stroke:#000000;stroke-width:0.5;\" x=\"29.134375\" xlink:href=\"#m728421d6d4\" y=\"203.353348214\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "     <g id=\"line2d_24\">\n",
        "      <g>\n",
        "       <use style=\"stroke:#000000;stroke-width:0.5;\" x=\"363.934375\" xlink:href=\"#mcb0005524f\" y=\"203.353348214\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "     <g id=\"text_8\">\n",
        "      <!-- 100 -->\n",
        "      <g transform=\"translate(7.809375 206.112723214)scale(0.1 -0.1)\">\n",
        "       <use xlink:href=\"#BitstreamVeraSans-Roman-31\"/>\n",
        "       <use x=\"63.623046875\" xlink:href=\"#BitstreamVeraSans-Roman-30\"/>\n",
        "       <use x=\"127.24609375\" xlink:href=\"#BitstreamVeraSans-Roman-30\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "    </g>\n",
        "    <g id=\"ytick_3\">\n",
        "     <g id=\"line2d_25\">\n",
        "      <path clip-path=\"url(#p4764608df1)\" d=\"\n",
        "M29.1344 171.468\n",
        "L363.934 171.468\" style=\"fill:none;stroke:#000000;stroke-dasharray:1.000000,3.000000;stroke-dashoffset:0.0;stroke-width:0.5;\"/>\n",
        "     </g>\n",
        "     <g id=\"line2d_26\">\n",
        "      <g>\n",
        "       <use style=\"stroke:#000000;stroke-width:0.5;\" x=\"29.134375\" xlink:href=\"#m728421d6d4\" y=\"171.467633929\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "     <g id=\"line2d_27\">\n",
        "      <g>\n",
        "       <use style=\"stroke:#000000;stroke-width:0.5;\" x=\"363.934375\" xlink:href=\"#mcb0005524f\" y=\"171.467633929\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "     <g id=\"text_9\">\n",
        "      <!-- 200 -->\n",
        "      <g transform=\"translate(7.44375 174.227008929)scale(0.1 -0.1)\">\n",
        "       <use xlink:href=\"#BitstreamVeraSans-Roman-32\"/>\n",
        "       <use x=\"63.623046875\" xlink:href=\"#BitstreamVeraSans-Roman-30\"/>\n",
        "       <use x=\"127.24609375\" xlink:href=\"#BitstreamVeraSans-Roman-30\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "    </g>\n",
        "    <g id=\"ytick_4\">\n",
        "     <g id=\"line2d_28\">\n",
        "      <path clip-path=\"url(#p4764608df1)\" d=\"\n",
        "M29.1344 139.582\n",
        "L363.934 139.582\" style=\"fill:none;stroke:#000000;stroke-dasharray:1.000000,3.000000;stroke-dashoffset:0.0;stroke-width:0.5;\"/>\n",
        "     </g>\n",
        "     <g id=\"line2d_29\">\n",
        "      <g>\n",
        "       <use style=\"stroke:#000000;stroke-width:0.5;\" x=\"29.134375\" xlink:href=\"#m728421d6d4\" y=\"139.581919643\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "     <g id=\"line2d_30\">\n",
        "      <g>\n",
        "       <use style=\"stroke:#000000;stroke-width:0.5;\" x=\"363.934375\" xlink:href=\"#mcb0005524f\" y=\"139.581919643\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "     <g id=\"text_10\">\n",
        "      <!-- 300 -->\n",
        "      <defs>\n",
        "       <path d=\"\n",
        "M40.5781 39.3125\n",
        "Q47.6562 37.7969 51.625 33\n",
        "Q55.6094 28.2188 55.6094 21.1875\n",
        "Q55.6094 10.4062 48.1875 4.48438\n",
        "Q40.7656 -1.42188 27.0938 -1.42188\n",
        "Q22.5156 -1.42188 17.6562 -0.515625\n",
        "Q12.7969 0.390625 7.625 2.20312\n",
        "L7.625 11.7188\n",
        "Q11.7188 9.32812 16.5938 8.10938\n",
        "Q21.4844 6.89062 26.8125 6.89062\n",
        "Q36.0781 6.89062 40.9375 10.5469\n",
        "Q45.7969 14.2031 45.7969 21.1875\n",
        "Q45.7969 27.6406 41.2812 31.2656\n",
        "Q36.7656 34.9062 28.7188 34.9062\n",
        "L20.2188 34.9062\n",
        "L20.2188 43.0156\n",
        "L29.1094 43.0156\n",
        "Q36.375 43.0156 40.2344 45.9219\n",
        "Q44.0938 48.8281 44.0938 54.2969\n",
        "Q44.0938 59.9062 40.1094 62.9062\n",
        "Q36.1406 65.9219 28.7188 65.9219\n",
        "Q24.6562 65.9219 20.0156 65.0312\n",
        "Q15.375 64.1562 9.8125 62.3125\n",
        "L9.8125 71.0938\n",
        "Q15.4375 72.6562 20.3438 73.4375\n",
        "Q25.25 74.2188 29.5938 74.2188\n",
        "Q40.8281 74.2188 47.3594 69.1094\n",
        "Q53.9062 64.0156 53.9062 55.3281\n",
        "Q53.9062 49.2656 50.4375 45.0938\n",
        "Q46.9688 40.9219 40.5781 39.3125\" id=\"BitstreamVeraSans-Roman-33\"/>\n",
        "      </defs>\n",
        "      <g transform=\"translate(7.4734375 142.341294643)scale(0.1 -0.1)\">\n",
        "       <use xlink:href=\"#BitstreamVeraSans-Roman-33\"/>\n",
        "       <use x=\"63.623046875\" xlink:href=\"#BitstreamVeraSans-Roman-30\"/>\n",
        "       <use x=\"127.24609375\" xlink:href=\"#BitstreamVeraSans-Roman-30\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "    </g>\n",
        "    <g id=\"ytick_5\">\n",
        "     <g id=\"line2d_31\">\n",
        "      <path clip-path=\"url(#p4764608df1)\" d=\"\n",
        "M29.1344 107.696\n",
        "L363.934 107.696\" style=\"fill:none;stroke:#000000;stroke-dasharray:1.000000,3.000000;stroke-dashoffset:0.0;stroke-width:0.5;\"/>\n",
        "     </g>\n",
        "     <g id=\"line2d_32\">\n",
        "      <g>\n",
        "       <use style=\"stroke:#000000;stroke-width:0.5;\" x=\"29.134375\" xlink:href=\"#m728421d6d4\" y=\"107.696205357\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "     <g id=\"line2d_33\">\n",
        "      <g>\n",
        "       <use style=\"stroke:#000000;stroke-width:0.5;\" x=\"363.934375\" xlink:href=\"#mcb0005524f\" y=\"107.696205357\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "     <g id=\"text_11\">\n",
        "      <!-- 400 -->\n",
        "      <defs>\n",
        "       <path d=\"\n",
        "M37.7969 64.3125\n",
        "L12.8906 25.3906\n",
        "L37.7969 25.3906\n",
        "z\n",
        "\n",
        "M35.2031 72.9062\n",
        "L47.6094 72.9062\n",
        "L47.6094 25.3906\n",
        "L58.0156 25.3906\n",
        "L58.0156 17.1875\n",
        "L47.6094 17.1875\n",
        "L47.6094 0\n",
        "L37.7969 0\n",
        "L37.7969 17.1875\n",
        "L4.89062 17.1875\n",
        "L4.89062 26.7031\n",
        "z\n",
        "\" id=\"BitstreamVeraSans-Roman-34\"/>\n",
        "      </defs>\n",
        "      <g transform=\"translate(7.2 110.455580357)scale(0.1 -0.1)\">\n",
        "       <use xlink:href=\"#BitstreamVeraSans-Roman-34\"/>\n",
        "       <use x=\"63.623046875\" xlink:href=\"#BitstreamVeraSans-Roman-30\"/>\n",
        "       <use x=\"127.24609375\" xlink:href=\"#BitstreamVeraSans-Roman-30\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "    </g>\n",
        "    <g id=\"ytick_6\">\n",
        "     <g id=\"line2d_34\">\n",
        "      <path clip-path=\"url(#p4764608df1)\" d=\"\n",
        "M29.1344 75.8105\n",
        "L363.934 75.8105\" style=\"fill:none;stroke:#000000;stroke-dasharray:1.000000,3.000000;stroke-dashoffset:0.0;stroke-width:0.5;\"/>\n",
        "     </g>\n",
        "     <g id=\"line2d_35\">\n",
        "      <g>\n",
        "       <use style=\"stroke:#000000;stroke-width:0.5;\" x=\"29.134375\" xlink:href=\"#m728421d6d4\" y=\"75.8104910714\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "     <g id=\"line2d_36\">\n",
        "      <g>\n",
        "       <use style=\"stroke:#000000;stroke-width:0.5;\" x=\"363.934375\" xlink:href=\"#mcb0005524f\" y=\"75.8104910714\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "     <g id=\"text_12\">\n",
        "      <!-- 500 -->\n",
        "      <g transform=\"translate(7.4828125 78.5698660714)scale(0.1 -0.1)\">\n",
        "       <use xlink:href=\"#BitstreamVeraSans-Roman-35\"/>\n",
        "       <use x=\"63.623046875\" xlink:href=\"#BitstreamVeraSans-Roman-30\"/>\n",
        "       <use x=\"127.24609375\" xlink:href=\"#BitstreamVeraSans-Roman-30\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "    </g>\n",
        "    <g id=\"ytick_7\">\n",
        "     <g id=\"line2d_37\">\n",
        "      <path clip-path=\"url(#p4764608df1)\" d=\"\n",
        "M29.1344 43.9248\n",
        "L363.934 43.9248\" style=\"fill:none;stroke:#000000;stroke-dasharray:1.000000,3.000000;stroke-dashoffset:0.0;stroke-width:0.5;\"/>\n",
        "     </g>\n",
        "     <g id=\"line2d_38\">\n",
        "      <g>\n",
        "       <use style=\"stroke:#000000;stroke-width:0.5;\" x=\"29.134375\" xlink:href=\"#m728421d6d4\" y=\"43.9247767857\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "     <g id=\"line2d_39\">\n",
        "      <g>\n",
        "       <use style=\"stroke:#000000;stroke-width:0.5;\" x=\"363.934375\" xlink:href=\"#mcb0005524f\" y=\"43.9247767857\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "     <g id=\"text_13\">\n",
        "      <!-- 600 -->\n",
        "      <defs>\n",
        "       <path d=\"\n",
        "M33.0156 40.375\n",
        "Q26.375 40.375 22.4844 35.8281\n",
        "Q18.6094 31.2969 18.6094 23.3906\n",
        "Q18.6094 15.5312 22.4844 10.9531\n",
        "Q26.375 6.39062 33.0156 6.39062\n",
        "Q39.6562 6.39062 43.5312 10.9531\n",
        "Q47.4062 15.5312 47.4062 23.3906\n",
        "Q47.4062 31.2969 43.5312 35.8281\n",
        "Q39.6562 40.375 33.0156 40.375\n",
        "M52.5938 71.2969\n",
        "L52.5938 62.3125\n",
        "Q48.875 64.0625 45.0938 64.9844\n",
        "Q41.3125 65.9219 37.5938 65.9219\n",
        "Q27.8281 65.9219 22.6719 59.3281\n",
        "Q17.5312 52.7344 16.7969 39.4062\n",
        "Q19.6719 43.6562 24.0156 45.9219\n",
        "Q28.375 48.1875 33.5938 48.1875\n",
        "Q44.5781 48.1875 50.9531 41.5156\n",
        "Q57.3281 34.8594 57.3281 23.3906\n",
        "Q57.3281 12.1562 50.6875 5.35938\n",
        "Q44.0469 -1.42188 33.0156 -1.42188\n",
        "Q20.3594 -1.42188 13.6719 8.26562\n",
        "Q6.98438 17.9688 6.98438 36.375\n",
        "Q6.98438 53.6562 15.1875 63.9375\n",
        "Q23.3906 74.2188 37.2031 74.2188\n",
        "Q40.9219 74.2188 44.7031 73.4844\n",
        "Q48.4844 72.75 52.5938 71.2969\" id=\"BitstreamVeraSans-Roman-36\"/>\n",
        "      </defs>\n",
        "      <g transform=\"translate(7.409375 46.6841517857)scale(0.1 -0.1)\">\n",
        "       <use xlink:href=\"#BitstreamVeraSans-Roman-36\"/>\n",
        "       <use x=\"63.623046875\" xlink:href=\"#BitstreamVeraSans-Roman-30\"/>\n",
        "       <use x=\"127.24609375\" xlink:href=\"#BitstreamVeraSans-Roman-30\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "    </g>\n",
        "    <g id=\"ytick_8\">\n",
        "     <g id=\"line2d_40\">\n",
        "      <path clip-path=\"url(#p4764608df1)\" d=\"\n",
        "M29.1344 12.0391\n",
        "L363.934 12.0391\" style=\"fill:none;stroke:#000000;stroke-dasharray:1.000000,3.000000;stroke-dashoffset:0.0;stroke-width:0.5;\"/>\n",
        "     </g>\n",
        "     <g id=\"line2d_41\">\n",
        "      <g>\n",
        "       <use style=\"stroke:#000000;stroke-width:0.5;\" x=\"29.134375\" xlink:href=\"#m728421d6d4\" y=\"12.0390625\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "     <g id=\"line2d_42\">\n",
        "      <g>\n",
        "       <use style=\"stroke:#000000;stroke-width:0.5;\" x=\"363.934375\" xlink:href=\"#mcb0005524f\" y=\"12.0390625\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "     <g id=\"text_14\">\n",
        "      <!-- 700 -->\n",
        "      <defs>\n",
        "       <path d=\"\n",
        "M8.20312 72.9062\n",
        "L55.0781 72.9062\n",
        "L55.0781 68.7031\n",
        "L28.6094 0\n",
        "L18.3125 0\n",
        "L43.2188 64.5938\n",
        "L8.20312 64.5938\n",
        "z\n",
        "\" id=\"BitstreamVeraSans-Roman-37\"/>\n",
        "      </defs>\n",
        "      <g transform=\"translate(7.53125 14.7984375)scale(0.1 -0.1)\">\n",
        "       <use xlink:href=\"#BitstreamVeraSans-Roman-37\"/>\n",
        "       <use x=\"63.623046875\" xlink:href=\"#BitstreamVeraSans-Roman-30\"/>\n",
        "       <use x=\"127.24609375\" xlink:href=\"#BitstreamVeraSans-Roman-30\"/>\n",
        "      </g>\n",
        "     </g>\n",
        "    </g>\n",
        "   </g>\n",
        "   <g id=\"patch_28\">\n",
        "    <path d=\"\n",
        "M29.1344 12.0391\n",
        "L363.934 12.0391\" style=\"fill:none;stroke:#000000;\"/>\n",
        "   </g>\n",
        "   <g id=\"patch_29\">\n",
        "    <path d=\"\n",
        "M363.934 235.239\n",
        "L363.934 12.0391\" style=\"fill:none;stroke:#000000;\"/>\n",
        "   </g>\n",
        "   <g id=\"patch_30\">\n",
        "    <path d=\"\n",
        "M29.1344 235.239\n",
        "L363.934 235.239\" style=\"fill:none;stroke:#000000;\"/>\n",
        "   </g>\n",
        "   <g id=\"patch_31\">\n",
        "    <path d=\"\n",
        "M29.1344 235.239\n",
        "L29.1344 12.0391\" style=\"fill:none;stroke:#000000;\"/>\n",
        "   </g>\n",
        "  </g>\n",
        " </g>\n",
        " <defs>\n",
        "  <clipPath id=\"p4764608df1\">\n",
        "   <rect height=\"223.2\" width=\"334.8\" x=\"29.134375\" y=\"12.0390625\"/>\n",
        "  </clipPath>\n",
        " </defs>\n",
        "</svg>\n"
       ],
       "text": [
        "<matplotlib.figure.Figure at 0x10bdbce50>"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "# Saving\n",
      "\n",
      "Save `joined` to disk to a file called `joined.p`"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "joined.to_pickle('joined.p')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 14
    }
   ],
   "metadata": {}
  }
 ]
}