Related
I have the following dataframe:
{
'views_per_day': {0: 37, 1: 26, 2: 10, 3: 17, 4: 5, 5: 13, 6: 5, 7: 15, 8: 7, 9: 7, 10: 3, 11: 13, 12: 9, 13: 27, 14: 13, 15: 6, 16: 17, 17: 12, 18: 9, 19: 16, 20: 6, 21: 11, 22: 5, 23: 12, 24: 10, 25: 4, 26: 12, 27: 8, 28: 9, 29: 8, 30: 11, 31: 18, 32: 15, 33: 4, 34: 8, 35: 7, 36: 8, 37: 8, 38: 5, 39: 8, 40: 10, 41: 33, 42: 8, 43: 7, 44: 7, 45: 7, 46: 7, 47: 7, 48: 6, 49: 7, 50: 6, 51: 5, 52: 3, 53: 6, 54: 13, 55: 6, 56: 6, 57: 7, 58: 6, 59: 5, 60: 4, 61: 5, 62: 6, 63: 6, 64: 3, 65: 6, 66: 6, 67: 4, 68: 5, 69: 4, 70: 6, 71: 5, 72: 5, 73: 3, 74: 4, 75: 5, 76: 8, 77: 30, 78: 9, 79: 5, 80: 5, 81: 6, 82: 5, 83: 4, 84: 7, 85: 4, 86: 4, 87: 5, 88: 3, 89: 3, 90: 7, 91: 3, 92: 4, 93: 8, 94: 2, 95: 3, 96: 5, 97: 4, 98: 4, 99: 4, 100: 4, 101: 4, 102: 4, 103: 3, 104: 4, 105: 6, 106: 3, 107: 3, 108: 3, 109: 3, 110: 3, 111: 3, 112: 4, 113: 3, 114: 3, 115: 4, 116: 3, 117: 3, 118: 2, 119: 3, 120: 3, 121: 2, 122: 4, 123: 4, 124: 4, 125: 26, 126: 3, 127: 3, 128: 5, 129: 3, 130: 2, 131: 4, 132: 3, 133: 4, 134: 3, 135: 4, 136: 3, 137: 3, 138: 5, 139: 2, 140: 5, 141: 3, 142: 3, 143: 4, 144: 3, 145: 3, 146: 4, 147: 4, 148: 7, 149: 3, 150: 3, 151: 3, 152: 2, 153: 3, 154: 12, 155: 3, 156: 2, 157: 3, 158: 2, 159: 2, 160: 3, 161: 4, 162: 2, 163: 2, 164: 4, 165: 3, 166: 3, 167: 5, 168: 1, 169: 2, 170: 11, 171: 3, 172: 2, 173: 4, 174: 4, 175: 2, 176: 6, 177: 2, 178: 4, 179: 2, 180: 3, 181: 2, 182: 2, 183: 2, 184: 2, 185: 2, 186: 2, 187: 2, 188: 3, 189: 2, 190: 3, 191: 2, 192: 2, 193: 2, 194: 3, 195: 3, 196: 2, 197: 2, 198: 2, 199: 3, 200: 2, 201: 2, 202: 2, 203: 2, 204: 3, 205: 2, 206: 2, 207: 2, 208: 1, 209: 5, 210: 2, 211: 2, 212: 2, 213: 5, 214: 3, 215: 3, 216: 1, 217: 2, 218: 2, 219: 1, 220: 2, 221: 2, 222: 3, 223: 3, 224: 2, 225: 1, 226: 4, 227: 1, 228: 1, 229: 2, 230: 2, 231: 4, 232: 1, 233: 2, 234: 1, 235: 1, 236: 2, 237: 2, 238: 2, 239: 8, 240: 2, 241: 2, 242: 1, 243: 2, 244: 1, 245: 1, 246: 2, 247: 1, 248: 1, 249: 2, 250: 3, 251: 4, 252: 4, 253: 1, 254: 41, 255: 28, 256: 59, 257: 35, 258: 11, 259: 12, 260: 12, 261: 8, 262: 6, 263: 8, 264: 10, 265: 15, 266: 15, 267: 5, 268: 8, 269: 15, 270: 11, 271: 16, 272: 11, 273: 12, 274: 11, 275: 5, 276: 9, 277: 10, 278: 20, 279: 5, 280: 11, 281: 5, 282: 7, 283: 9, 284: 9, 285: 9, 286: 9, 287: 4, 288: 9, 289: 4, 290: 6, 291: 4, 292: 8, 293: 3, 294: 9, 295: 9, 296: 9, 297: 5, 298: 4, 299: 10, 300: 18, 301: 4, 302: 5, 303: 5, 304: 11, 305: 9, 306: 7, 307: 4, 308: 7, 309: 9, 310: 5, 311: 4, 312: 8, 313: 3, 314: 7, 315: 12, 316: 3, 317: 6, 318: 6, 319: 6, 320: 6, 321: 7, 322: 6, 323: 6, 324: 8, 325: 6, 326: 3, 327: 6, 328: 4, 329: 4, 330: 4, 331: 7, 332: 6, 333: 10, 334: 3, 335: 5, 336: 6, 337: 13, 338: 12, 339: 3, 340: 5, 341: 5, 342: 4, 343: 5, 344: 3, 345: 3, 346: 5, 347: 4, 348: 5, 349: 2, 350: 5, 351: 5, 352: 13, 353: 10, 354: 7, 355: 2, 356: 3, 357: 5, 358: 4, 359: 7, 360: 4, 361: 4, 362: 4, 363: 6, 364: 5, 365: 4, 366: 4, 367: 6, 368: 6, 369: 5, 370: 4, 371: 4, 372: 2, 373: 3, 374: 4, 375: 4, 376: 4, 377: 4, 378: 4, 379: 4, 380: 4, 381: 2, 382: 3, 383: 4, 384: 2, 385: 4, 386: 4, 387: 4, 388: 5, 389: 3, 390: 3, 391: 4, 392: 3, 393: 3, 394: 3, 395: 2, 396: 4, 397: 3, 398: 2, 399: 3, 400: 2, 401: 4, 402: 3, 403: 3, 404: 4, 405: 3, 406: 4, 407: 4, 408: 5, 409: 3, 410: 6, 411: 3, 412: 3, 413: 2, 414: 3, 415: 3, 416: 3, 417: 3, 418: 1, 419: 2, 420: 5, 421: 4, 422: 3, 423: 2, 424: 3, 425: 3, 426: 3, 427: 2, 428: 3, 429: 3, 430: 3, 431: 3, 432: 2, 433: 3, 434: 3, 435: 2, 436: 2, 437: 3, 438: 2, 439: 2, 440: 4, 441: 16, 442: 2, 443: 2, 444: 2, 445: 2, 446: 2, 447: 2, 448: 2, 449: 2, 450: 2, 451: 3, 452: 3, 453: 2, 454: 2, 455: 2, 456: 4, 457: 2, 458: 3, 459: 2, 460: 2, 461: 2, 462: 2, 463: 1, 464: 3, 465: 3, 466: 2, 467: 2, 468: 18, 469: 2, 470: 2, 471: 2, 472: 5, 473: 2, 474: 3, 475: 2, 476: 2, 477: 2, 478: 2, 479: 2, 480: 1, 481: 4, 482: 2, 483: 2, 484: 2, 485: 2, 486: 3, 487: 2, 488: 2, 489: 6, 490: 1, 491: 3, 492: 2, 493: 1, 494: 2, 495: 3, 496: 3, 497: 2, 498: 1, 499: 2, 500: 1, 501: 1, 502: 1, 503: 1, 504: 1, 505: 1, 506: 3, 507: 4, 508: 2, 509: 2, 510: 1, 511: 1, 512: 2, 513: 2, 514: 2, 515: 2, 516: 1, 517: 1, 518: 1, 519: 1, 520: 1, 521: 3, 522: 11, 523: 2, 524: 1, 525: 48, 526: 51, 527: 20, 528: 26, 529: 23, 530: 8, 531: 6, 532: 17, 533: 17, 534: 15, 535: 12, 536: 17, 537: 14, 538: 12, 539: 18, 540: 11, 541: 14, 542: 10, 543: 7, 544: 13, 545: 10, 546: 10, 547: 5, 548: 8, 549: 7, 550: 7, 551: 9, 552: 5, 553: 8, 554: 19, 555: 5, 556: 14, 557: 11, 558: 7, 559: 5, 560: 6, 561: 8, 562: 8, 563: 12, 564: 8, 565: 7, 566: 4, 567: 7, 568: 8, 569: 9, 570: 4, 571: 6, 572: 7, 573: 14, 574: 5, 575: 4, 576: 6, 577: 8, 578: 6, 579: 6, 580: 3, 581: 3, 582: 6, 583: 3, 584: 3, 585: 7, 586: 6, 587: 4, 588: 11, 589: 6, 590: 4, 591: 5, 592: 5, 593: 4, 594: 7, 595: 5, 596: 5, 597: 3, 598: 7, 599: 5, 600: 5, 601: 4, 602: 5, 603: 4, 604: 4, 605: 5, 606: 5, 607: 5, 608: 4, 609: 3, 610: 6, 611: 4, 612: 5, 613: 4, 614: 4, 615: 4, 616: 4, 617: 5, 618: 4, 619: 4, 620: 5, 621: 4, 622: 4, 623: 2, 624: 4, 625: 4, 626: 3, 627: 7, 628: 2, 629: 4, 630: 4, 631: 7, 632: 3, 633: 4, 634: 4, 635: 3, 636: 3, 637: 3, 638: 4, 639: 3, 640: 3, 641: 2, 642: 3, 643: 2, 644: 3, 645: 3, 646: 3, 647: 3, 648: 3, 649: 3, 650: 3, 651: 4, 652: 2, 653: 5, 654: 4, 655: 4, 656: 5, 657: 4, 658: 3, 659: 3, 660: 2, 661: 6, 662: 2, 663: 4, 664: 3, 665: 3, 666: 2, 667: 4, 668: 4, 669: 7, 670: 3, 671: 2, 672: 2, 673: 6, 674: 2, 675: 2, 676: 2, 677: 2, 678: 2, 679: 4, 680: 3, 681: 3, 682: 2, 683: 3, 684: 3, 685: 2, 686: 2, 687: 3, 688: 3, 689: 2, 690: 2, 691: 2, 692: 2, 693: 2, 694: 2, 695: 2, 696: 4, 697: 2, 698: 5, 699: 2, 700: 2, 701: 3, 702: 2, 703: 2, 704: 3, 705: 2, 706: 3, 707: 2, 708: 3, 709: 2, 710: 2, 711: 2, 712: 2, 713: 2, 714: 2, 715: 2, 716: 2, 717: 2, 718: 2, 719: 2, 720: 3, 721: 3, 722: 2, 723: 2, 724: 2, 725: 2, 726: 3, 727: 2, 728: 2, 729: 2, 730: 2, 731: 2, 732: 2, 733: 2, 734: 2, 735: 2, 736: 2, 737: 2, 738: 2, 739: 2, 740: 2, 741: 2, 742: 2, 743: 1, 744: 2, 745: 2, 746: 2, 747: 2, 748: 2, 749: 2, 750: 2, 751: 2, 752: 1, 753: 4, 754: 4, 755: 1, 756: 1, 757: 1, 758: 3, 759: 5, 760: 2, 761: 2, 762: 1, 763: 2, 764: 2, 765: 2, 766: 1, 767: 2, 768: 1, 769: 1, 770: 1, 771: 2, 772: 1, 773: 1, 774: 1, 775: 1, 776: 1, 777: 1, 778: 1},
'status': {0: 'Extra', 1: 'Extra', 2: 'Extra', 3: 'Standard', 4: 'Extra', 5: 'Extra', 6: 'Extra', 7: 'Extra', 8: 'Standard', 9: 'Extra', 10: 'Extra', 11: 'Extra', 12: 'Extra', 13: 'Extra', 14: 'Standard', 15: 'Extra', 16: 'Extra', 17: 'Extra', 18: 'Extra', 19: 'Extra', 20: 'Extra', 21: 'Standard', 22: 'Standard', 23: 'Extra', 24: 'Standard', 25: 'Extra', 26: 'Extra', 27: 'Standard', 28: 'Extra', 29: 'Standard', 30: 'Extra', 31: 'Standard', 32: 'Extra', 33: 'Extra', 34: 'Standard', 35: 'Standard', 36: 'Standard', 37: 'Standard', 38: 'Standard', 39: 'Standard', 40: 'Extra', 41: 'Standard', 42: 'Extra', 43: 'Standard', 44: 'Standard', 45: 'Extra', 46: 'Standard', 47: 'Standard', 48: 'Standard', 49: 'Standard', 50: 'Standard', 51: 'Standard', 52: 'Standard', 53: 'Extra', 54: 'Standard', 55: 'Extra', 56: 'Standard', 57: 'Extra', 58: 'Standard', 59: 'Standard', 60: 'Extra', 61: 'Standard', 62: 'Extra', 63: 'Standard', 64: 'Extra', 65: 'Standard', 66: 'Standard', 67: 'Extra', 68: 'Standard', 69: 'Standard', 70: 'Extra', 71: 'Standard', 72: 'Extra', 73: 'Standard', 74: 'Standard', 75: 'Standard', 76: 'Standard', 77: 'Standard', 78: 'Standard', 79: 'Standard', 80: 'Standard', 81: 'Standard', 82: 'Standard', 83: 'Standard', 84: 'Standard', 85: 'Standard', 86: 'Standard', 87: 'Standard', 88: 'Standard', 89: 'Extra', 90: 'Extra', 91: 'Standard', 92: 'Extra', 93: 'Standard', 94: 'Standard', 95: 'Standard', 96: 'Standard', 97: 'Extra', 98: 'Standard', 99: 'Standard', 100: 'Standard', 101: 'Standard', 102: 'Standard', 103: 'Standard', 104: 'Standard', 105: 'Standard', 106: 'Standard', 107: 'Standard', 108: 'Standard', 109: 'Standard', 110: 'Standard', 111: 'Extra', 112: 'Standard', 113: 'Extra', 114: 'Standard', 115: 'Extra', 116: 'Standard', 117: 'Standard', 118: 'Extra', 119: 'Standard', 120: 'Standard', 121: 'Standard', 122: 'Standard', 123: 'Standard', 124: 'Extra', 125: 'Standard', 126: 'Standard', 127: 'Standard', 128: 'Standard', 129: 'Standard', 130: 'Extra', 131: 'Standard', 132: 'Standard', 133: 'Standard', 134: 'Standard', 135: 'Standard', 136: 'Standard', 137: 'Standard', 138: 'Standard', 139: 'Extra', 140: 'Standard', 141: 'Standard', 142: 'Standard', 143: 'Standard', 144: 'Standard', 145: 'Standard', 146: 'Standard', 147: 'Standard', 148: 'Standard', 149: 'Standard', 150: 'Extra', 151: 'Standard', 152: 'Standard', 153: 'Standard', 154: 'Extra', 155: 'Standard', 156: 'Extra', 157: 'Extra', 158: 'Standard', 159: 'Standard', 160: 'Standard', 161: 'Standard', 162: 'Standard', 163: 'Extra', 164: 'Standard', 165: 'Standard', 166: 'Extra', 167: 'Standard', 168: 'Standard', 169: 'Standard', 170: 'Standard', 171: 'Standard', 172: 'Standard', 173: 'Standard', 174: 'Standard', 175: 'Standard', 176: 'Standard', 177: 'Standard', 178: 'Standard', 179: 'Standard', 180: 'Standard', 181: 'Standard', 182: 'Standard', 183: 'Standard', 184: 'Standard', 185: 'Standard', 186: 'Standard', 187: 'Standard', 188: 'Standard', 189: 'Standard', 190: 'Standard', 191: 'Standard', 192: 'Standard', 193: 'Standard', 194: 'Standard', 195: 'Standard', 196: 'Standard', 197: 'Standard', 198: 'Standard', 199: 'Standard', 200: 'Standard', 201: 'Standard', 202: 'Standard', 203: 'Standard', 204: 'Standard', 205: 'Standard', 206: 'Standard', 207: 'Standard', 208: 'Standard', 209: 'Standard', 210: 'Standard', 211: 'Extra', 212: 'Standard', 213: 'Standard', 214: 'Standard', 215: 'Standard', 216: 'Standard', 217: 'Standard', 218: 'Standard', 219: 'Standard', 220: 'Standard', 221: 'Standard', 222: 'Standard', 223: 'Standard', 224: 'Standard', 225: 'Standard', 226: 'Standard', 227: 'Standard', 228: 'Standard', 229: 'Standard', 230: 'Standard', 231: 'Standard', 232: 'Standard', 233: 'Standard', 234: 'Standard', 235: 'Standard', 236: 'Standard', 237: 'Standard', 238: 'Standard', 239: 'Standard', 240: 'Standard', 241: 'Standard', 242: 'Standard', 243: 'Standard', 244: 'Standard', 245: 'Standard', 246: 'Standard', 247: 'Extra', 248: 'Standard', 249: 'Standard', 250: 'Standard', 251: 'Extra', 252: 'Extra', 253: 'Standard', 254: 'Extra', 255: 'Extra', 256: 'Extra', 257: 'Extra', 258: 'Extra', 259: 'Extra', 260: 'Extra', 261: 'Extra', 262: 'Extra', 263: 'Standard', 264: 'Extra', 265: 'Standard', 266: 'Extra', 267: 'Extra', 268: 'Standard', 269: 'Standard', 270: 'Extra', 271: 'Extra', 272: 'Extra', 273: 'Standard', 274: 'Extra', 275: 'Standard', 276: 'Extra', 277: 'Standard', 278: 'Standard', 279: 'Standard', 280: 'Standard', 281: 'Standard', 282: 'Standard', 283: 'Standard', 284: 'Extra', 285: 'Extra', 286: 'Standard', 287: 'Standard', 288: 'Extra', 289: 'Standard', 290: 'Standard', 291: 'Extra', 292: 'Extra', 293: 'Extra', 294: 'Extra', 295: 'Standard', 296: 'Standard', 297: 'Extra', 298: 'Extra', 299: 'Standard', 300: 'Standard', 301: 'Extra', 302: 'Standard', 303: 'Standard', 304: 'Standard', 305: 'Standard', 306: 'Standard', 307: 'Extra', 308: 'Standard', 309: 'Standard', 310: 'Standard', 311: 'Extra', 312: 'Extra', 313: 'Extra', 314: 'Standard', 315: 'Standard', 316: 'Standard', 317: 'Extra', 318: 'Standard', 319: 'Extra', 320: 'Standard', 321: 'Extra', 322: 'Standard', 323: 'Extra', 324: 'Standard', 325: 'Extra', 326: 'Standard', 327: 'Standard', 328: 'Standard', 329: 'Extra', 330: 'Standard', 331: 'Standard', 332: 'Standard', 333: 'Standard', 334: 'Standard', 335: 'Extra', 336: 'Standard', 337: 'Standard', 338: 'Standard', 339: 'Extra', 340: 'Extra', 341: 'Extra', 342: 'Standard', 343: 'Standard', 344: 'Extra', 345: 'Standard', 346: 'Extra', 347: 'Standard', 348: 'Extra', 349: 'Standard', 350: 'Extra', 351: 'Standard', 352: 'Standard', 353: 'Standard', 354: 'Standard', 355: 'Standard', 356: 'Standard', 357: 'Standard', 358: 'Standard', 359: 'Standard', 360: 'Standard', 361: 'Standard', 362: 'Standard', 363: 'Extra', 364: 'Standard', 365: 'Standard', 366: 'Standard', 367: 'Extra', 368: 'Standard', 369: 'Standard', 370: 'Standard', 371: 'Extra', 372: 'Standard', 373: 'Standard', 374: 'Standard', 375: 'Standard', 376: 'Standard', 377: 'Standard', 378: 'Standard', 379: 'Extra', 380: 'Standard', 381: 'Standard', 382: 'Standard', 383: 'Extra', 384: 'Standard', 385: 'Standard', 386: 'Standard', 387: 'Standard', 388: 'Standard', 389: 'Standard', 390: 'Standard', 391: 'Standard', 392: 'Standard', 393: 'Standard', 394: 'Standard', 395: 'Standard', 396: 'Standard', 397: 'Standard', 398: 'Standard', 399: 'Extra', 400: 'Standard', 401: 'Standard', 402: 'Standard', 403: 'Standard', 404: 'Standard', 405: 'Standard', 406: 'Standard', 407: 'Standard', 408: 'Standard', 409: 'Extra', 410: 'Standard', 411: 'Standard', 412: 'Standard', 413: 'Standard', 414: 'Standard', 415: 'Standard', 416: 'Standard', 417: 'Standard', 418: 'Extra', 419: 'Standard', 420: 'Standard', 421: 'Standard', 422: 'Standard', 423: 'Standard', 424: 'Standard', 425: 'Standard', 426: 'Standard', 427: 'Standard', 428: 'Standard', 429: 'Standard', 430: 'Standard', 431: 'Standard', 432: 'Standard', 433: 'Extra', 434: 'Standard', 435: 'Standard', 436: 'Standard', 437: 'Standard', 438: 'Standard', 439: 'Standard', 440: 'Standard', 441: 'Standard', 442: 'Standard', 443: 'Standard', 444: 'Standard', 445: 'Standard', 446: 'Standard', 447: 'Standard', 448: 'Standard', 449: 'Standard', 450: 'Standard', 451: 'Standard', 452: 'Standard', 453: 'Standard', 454: 'Standard', 455: 'Standard', 456: 'Standard', 457: 'Standard', 458: 'Extra', 459: 'Extra', 460: 'Extra', 461: 'Standard', 462: 'Standard', 463: 'Standard', 464: 'Standard', 465: 'Standard', 466: 'Standard', 467: 'Standard', 468: 'Standard', 469: 'Standard', 470: 'Standard', 471: 'Extra', 472: 'Standard', 473: 'Standard', 474: 'Standard', 475: 'Standard', 476: 'Standard', 477: 'Extra', 478: 'Standard', 479: 'Standard', 480: 'Standard', 481: 'Standard', 482: 'Standard', 483: 'Standard', 484: 'Standard', 485: 'Standard', 486: 'Standard', 487: 'Standard', 488: 'Extra', 489: 'Standard', 490: 'Standard', 491: 'Standard', 492: 'Standard', 493: 'Standard', 494: 'Standard', 495: 'Standard', 496: 'Standard', 497: 'Standard', 498: 'Standard', 499: 'Extra', 500: 'Standard', 501: 'Standard', 502: 'Standard', 503: 'Standard', 504: 'Extra', 505: 'Standard', 506: 'Extra', 507: 'Standard', 508: 'Standard', 509: 'Standard', 510: 'Standard', 511: 'Extra', 512: 'Standard', 513: 'Standard', 514: 'Standard', 515: 'Extra', 516: 'Standard', 517: 'Standard', 518: 'Standard', 519: 'Extra', 520: 'Extra', 521: 'Standard', 522: 'Standard', 523: 'Standard', 524: 'Extra', 525: 'Extra', 526: 'Extra', 527: 'Standard', 528: 'Standard', 529: 'Extra', 530: 'Extra', 531: 'Extra', 532: 'Extra', 533: 'Extra', 534: 'Standard', 535: 'Extra', 536: 'Standard', 537: 'Standard', 538: 'Standard', 539: 'Extra', 540: 'Extra', 541: 'Extra', 542: 'Extra', 543: 'Extra', 544: 'Extra', 545: 'Standard', 546: 'Extra', 547: 'Extra', 548: 'Extra', 549: 'Standard', 550: 'Extra', 551: 'Extra', 552: 'Standard', 553: 'Standard', 554: 'Extra', 555: 'Extra', 556: 'Standard', 557: 'Extra', 558: 'Extra', 559: 'Extra', 560: 'Extra', 561: 'Extra', 562: 'Extra', 563: 'Standard', 564: 'Standard', 565: 'Extra', 566: 'Extra', 567: 'Extra', 568: 'Extra', 569: 'Standard', 570: 'Standard', 571: 'Extra', 572: 'Extra', 573: 'Standard', 574: 'Extra', 575: 'Standard', 576: 'Extra', 577: 'Extra', 578: 'Extra', 579: 'Extra', 580: 'Extra', 581: 'Standard', 582: 'Extra', 583: 'Standard', 584: 'Standard', 585: 'Extra', 586: 'Standard', 587: 'Standard', 588: 'Extra', 589: 'Standard', 590: 'Standard', 591: 'Extra', 592: 'Standard', 593: 'Standard', 594: 'Standard', 595: 'Extra', 596: 'Extra', 597: 'Extra', 598: 'Standard', 599: 'Standard', 600: 'Standard', 601: 'Standard', 602: 'Extra', 603: 'Extra', 604: 'Extra', 605: 'Standard', 606: 'Standard', 607: 'Standard', 608: 'Standard', 609: 'Standard', 610: 'Extra', 611: 'Standard', 612: 'Standard', 613: 'Standard', 614: 'Standard', 615: 'Standard', 616: 'Extra', 617: 'Standard', 618: 'Standard', 619: 'Standard', 620: 'Standard', 621: 'Standard', 622: 'Extra', 623: 'Standard', 624: 'Standard', 625: 'Standard', 626: 'Extra', 627: 'Standard', 628: 'Standard', 629: 'Standard', 630: 'Extra', 631: 'Extra', 632: 'Standard', 633: 'Extra', 634: 'Standard', 635: 'Standard', 636: 'Standard', 637: 'Standard', 638: 'Standard', 639: 'Standard', 640: 'Standard', 641: 'Standard', 642: 'Standard', 643: 'Standard', 644: 'Standard', 645: 'Standard', 646: 'Extra', 647: 'Extra', 648: 'Extra', 649: 'Standard', 650: 'Standard', 651: 'Standard', 652: 'Extra', 653: 'Standard', 654: 'Standard', 655: 'Standard', 656: 'Standard', 657: 'Standard', 658: 'Standard', 659: 'Standard', 660: 'Standard', 661: 'Standard', 662: 'Standard', 663: 'Standard', 664: 'Standard', 665: 'Standard', 666: 'Standard', 667: 'Extra', 668: 'Standard', 669: 'Standard', 670: 'Standard', 671: 'Standard', 672: 'Extra', 673: 'Extra', 674: 'Standard', 675: 'Standard', 676: 'Standard', 677: 'Standard', 678: 'Standard', 679: 'Extra', 680: 'Standard', 681: 'Extra', 682: 'Standard', 683: 'Standard', 684: 'Standard', 685: 'Standard', 686: 'Standard', 687: 'Extra', 688: 'Standard', 689: 'Standard', 690: 'Standard', 691: 'Standard', 692: 'Standard', 693: 'Standard', 694: 'Standard', 695: 'Standard', 696: 'Standard', 697: 'Standard', 698: 'Standard', 699: 'Extra', 700: 'Standard', 701: 'Standard', 702: 'Standard', 703: 'Standard', 704: 'Standard', 705: 'Standard', 706: 'Standard', 707: 'Standard', 708: 'Standard', 709: 'Standard', 710: 'Standard', 711: 'Standard', 712: 'Extra', 713: 'Standard', 714: 'Standard', 715: 'Standard', 716: 'Standard', 717: 'Standard', 718: 'Standard', 719: 'Standard', 720: 'Standard', 721: 'Standard', 722: 'Extra', 723: 'Standard', 724: 'Standard', 725: 'Standard', 726: 'Standard', 727: 'Standard', 728: 'Standard', 729: 'Extra', 730: 'Standard', 731: 'Standard', 732: 'Standard', 733: 'Standard', 734: 'Standard', 735: 'Standard', 736: 'Standard', 737: 'Standard', 738: 'Standard', 739: 'Standard', 740: 'Standard', 741: 'Standard', 742: 'Standard', 743: 'Standard', 744: 'Extra', 745: 'Standard', 746: 'Standard', 747: 'Standard', 748: 'Standard', 749: 'Standard', 750: 'Standard', 751: 'Standard', 752: 'Standard', 753: 'Standard', 754: 'Standard', 755: 'Standard', 756: 'Extra', 757: 'Standard', 758: 'Standard', 759: 'Standard', 760: 'Extra', 761: 'Standard', 762: 'Standard', 763: 'Standard', 764: 'Standard', 765: 'Standard', 766: 'Standard', 767: 'Standard', 768: 'Standard', 769: 'Standard', 770: 'Standard', 771: 'Standard', 772: 'Extra', 773: 'Extra', 774: 'Standard', 775: 'Standard', 776: 'Standard', 777: 'Extra', 778: 'Standard'}
}
I'm trying to visualize as simple as possible the overall advantage of Extra vs Standard (I.E: 'What is the edge of Extra over Standard?)
df[['views_per_day', 'status']].groupby('status').quantile(0.85).plot.bar()
What about using a boxplot? (eventually with a log scale):
import seaborn as sns
ax = sns.boxplot(data=df, x='status', y='views_per_day')
ax.set_yscale("log")
output:
Or a violinplot:
ax = sns.violinplot(data=df, x='status', y='views_per_day')
Problem
I just started using R notebooks and was impressed with being able to use SQL chunks. However I have run into a bizarre problem.
My code within the notebook looks something like the following
```{r}
library(RSQLite)
library(plyr)
library(Matrix)
```
```{r}
sessionInfo()
```
```{r}
dbName = '/home/my_db.db'
db <- dbConnect(SQLite(), dbname=dbName)
```
```{sql connection=db, max.print=10}
SELECT * FROM EVENTS_ID
```
The error I get is
Error: C stack usage 7969396 is too close to the limit
Failed to execute SQL chunk
Now I have a further SQL query further in the notebook that when executed gives a similar error with a different number,
Error: C stack usage 7969604 is too close to the limit
Failed to execute SQL chunk
The most strange thing about this however is that the code was running fine previously and I've made no changes that I can think of.
Attempted Solutions/Debugging
1) Restarted computer. Still get the same errors.
2) Changed the code to the following to rule out database table error
```{sql connection=db}
SELECT 1
```
Still got the same error.
Current Workaround
I can workaround the issue by doing everything in R instead of the SQL chunk i.e.
```{r}
query <- gsub(pattern='\\s',replacement=" ",x="SELECT * FROM EVENTS_ID LIMIT 10")
dbGetQuery(db, query)
```
This works but I would like to use the SQL chunks if possible.
Further Info
When running traceback() after the error I get the following which may suggest there is some kind of as.vector recursion error
936: as.vector(x, mode)
935: as.vector(x, mode)
934: as.vector(x, mode)
933: as.vector(x, mode)
932: as.vector(x, mode)
931: as.vector(x, mode)
930: as.vector(x, mode)
929: as.vector(x, mode)
928: as.vector(x, mode)
927: as.vector(x, mode)
926: as.vector(x, mode)
925: as.vector(x, mode)
924: as.vector(x, mode)
923: as.vector(x, mode)
922: as.vector(x, mode)
921: as.vector(x, mode)
920: as.vector(x, mode)
919: as.vector(x, mode)
918: as.vector(x, mode)
917: as.vector(x, mode)
916: as.vector(x, mode)
915: as.vector(x, mode)
914: as.vector(x, mode)
913: as.vector(x, mode)
912: as.vector(x, mode)
911: as.vector(x, mode)
910: as.vector(x, mode)
909: as.vector(x, mode)
908: as.vector(x, mode)
907: as.vector(x, mode)
906: as.vector(x, mode)
905: as.vector(x, mode)
904: as.vector(x, mode)
903: as.vector(x, mode)
902: as.vector(x, mode)
901: as.vector(x, mode)
900: as.vector(x, mode)
899: as.vector(x, mode)
898: as.vector(x, mode)
897: as.vector(x, mode)
896: as.vector(x, mode)
895: as.vector(x, mode)
894: as.vector(x, mode)
893: as.vector(x, mode)
892: as.vector(x, mode)
891: as.vector(x, mode)
890: as.vector(x, mode)
889: as.vector(x, mode)
888: as.vector(x, mode)
887: as.vector(x, mode)
886: as.vector(x, mode)
885: as.vector(x, mode)
884: as.vector(x, mode)
883: as.vector(x, mode)
882: as.vector(x, mode)
881: as.vector(x, mode)
880: as.vector(x, mode)
879: as.vector(x, mode)
878: as.vector(x, mode)
877: as.vector(x, mode)
876: as.vector(x, mode)
875: as.vector(x, mode)
874: as.vector(x, mode)
873: as.vector(x, mode)
872: as.vector(x, mode)
871: as.vector(x, mode)
870: as.vector(x, mode)
869: as.vector(x, mode)
868: as.vector(x, mode)
867: as.vector(x, mode)
866: as.vector(x, mode)
865: as.vector(x, mode)
864: as.vector(x, mode)
863: as.vector(x, mode)
862: as.vector(x, mode)
861: as.vector(x, mode)
860: as.vector(x, mode)
859: as.vector(x, mode)
858: as.vector(x, mode)
857: as.vector(x, mode)
856: as.vector(x, mode)
855: as.vector(x, mode)
854: as.vector(x, mode)
853: as.vector(x, mode)
852: as.vector(x, mode)
851: as.vector(x, mode)
850: as.vector(x, mode)
849: as.vector(x, mode)
848: as.vector(x, mode)
847: as.vector(x, mode)
846: as.vector(x, mode)
845: as.vector(x, mode)
844: as.vector(x, mode)
843: as.vector(x, mode)
842: as.vector(x, mode)
841: as.vector(x, mode)
840: as.vector(x, mode)
839: as.vector(x, mode)
838: as.vector(x, mode)
837: as.vector(x, mode)
836: as.vector(x, mode)
835: as.vector(x, mode)
834: as.vector(x, mode)
833: as.vector(x, mode)
832: as.vector(x, mode)
831: as.vector(x, mode)
830: as.vector(x, mode)
829: as.vector(x, mode)
828: as.vector(x, mode)
827: as.vector(x, mode)
826: as.vector(x, mode)
825: as.vector(x, mode)
824: as.vector(x, mode)
823: as.vector(x, mode)
822: as.vector(x, mode)
821: as.vector(x, mode)
820: as.vector(x, mode)
819: as.vector(x, mode)
818: as.vector(x, mode)
817: as.vector(x, mode)
816: as.vector(x, mode)
815: as.vector(x, mode)
814: as.vector(x, mode)
813: as.vector(x, mode)
812: as.vector(x, mode)
811: as.vector(x, mode)
810: as.vector(x, mode)
809: as.vector(x, mode)
808: as.vector(x, mode)
807: as.vector(x, mode)
806: as.vector(x, mode)
805: as.vector(x, mode)
804: as.vector(x, mode)
803: as.vector(x, mode)
802: as.vector(x, mode)
801: as.vector(x, mode)
800: as.vector(x, mode)
799: as.vector(x, mode)
798: as.vector(x, mode)
797: as.vector(x, mode)
796: as.vector(x, mode)
795: as.vector(x, mode)
794: as.vector(x, mode)
793: as.vector(x, mode)
792: as.vector(x, mode)
791: as.vector(x, mode)
790: as.vector(x, mode)
789: as.vector(x, mode)
788: as.vector(x, mode)
787: as.vector(x, mode)
786: as.vector(x, mode)
785: as.vector(x, mode)
784: as.vector(x, mode)
783: as.vector(x, mode)
782: as.vector(x, mode)
781: as.vector(x, mode)
780: as.vector(x, mode)
779: as.vector(x, mode)
778: as.vector(x, mode)
777: as.vector(x, mode)
776: as.vector(x, mode)
775: as.vector(x, mode)
774: as.vector(x, mode)
773: as.vector(x, mode)
772: as.vector(x, mode)
771: as.vector(x, mode)
770: as.vector(x, mode)
769: as.vector(x, mode)
768: as.vector(x, mode)
767: as.vector(x, mode)
766: as.vector(x, mode)
765: as.vector(x, mode)
764: as.vector(x, mode)
763: as.vector(x, mode)
762: as.vector(x, mode)
761: as.vector(x, mode)
760: as.vector(x, mode)
759: as.vector(x, mode)
758: as.vector(x, mode)
757: as.vector(x, mode)
756: as.vector(x, mode)
755: as.vector(x, mode)
754: as.vector(x, mode)
753: as.vector(x, mode)
752: as.vector(x, mode)
751: as.vector(x, mode)
750: as.vector(x, mode)
749: as.vector(x, mode)
748: as.vector(x, mode)
747: as.vector(x, mode)
746: as.vector(x, mode)
745: as.vector(x, mode)
744: as.vector(x, mode)
743: as.vector(x, mode)
742: as.vector(x, mode)
741: as.vector(x, mode)
740: as.vector(x, mode)
739: as.vector(x, mode)
738: as.vector(x, mode)
737: as.vector(x, mode)
736: as.vector(x, mode)
735: as.vector(x, mode)
734: as.vector(x, mode)
733: as.vector(x, mode)
732: as.vector(x, mode)
731: as.vector(x, mode)
730: as.vector(x, mode)
729: as.vector(x, mode)
728: as.vector(x, mode)
727: as.vector(x, mode)
726: as.vector(x, mode)
725: as.vector(x, mode)
724: as.vector(x, mode)
723: as.vector(x, mode)
722: as.vector(x, mode)
721: as.vector(x, mode)
720: as.vector(x, mode)
719: as.vector(x, mode)
718: as.vector(x, mode)
717: as.vector(x, mode)
716: as.vector(x, mode)
715: as.vector(x, mode)
714: as.vector(x, mode)
713: as.vector(x, mode)
712: as.vector(x, mode)
711: as.vector(x, mode)
710: as.vector(x, mode)
709: as.vector(x, mode)
708: as.vector(x, mode)
707: as.vector(x, mode)
706: as.vector(x, mode)
705: as.vector(x, mode)
704: as.vector(x, mode)
703: as.vector(x, mode)
702: as.vector(x, mode)
701: as.vector(x, mode)
700: as.vector(x, mode)
699: as.vector(x, mode)
698: as.vector(x, mode)
697: as.vector(x, mode)
696: as.vector(x, mode)
695: as.vector(x, mode)
694: as.vector(x, mode)
693: as.vector(x, mode)
692: as.vector(x, mode)
691: as.vector(x, mode)
690: as.vector(x, mode)
689: as.vector(x, mode)
688: as.vector(x, mode)
687: as.vector(x, mode)
686: as.vector(x, mode)
685: as.vector(x, mode)
684: as.vector(x, mode)
683: as.vector(x, mode)
682: as.vector(x, mode)
681: as.vector(x, mode)
680: as.vector(x, mode)
679: as.vector(x, mode)
678: as.vector(x, mode)
677: as.vector(x, mode)
676: as.vector(x, mode)
675: as.vector(x, mode)
674: as.vector(x, mode)
673: as.vector(x, mode)
672: as.vector(x, mode)
671: as.vector(x, mode)
670: as.vector(x, mode)
669: as.vector(x, mode)
668: as.vector(x, mode)
667: as.vector(x, mode)
666: as.vector(x, mode)
665: as.vector(x, mode)
664: as.vector(x, mode)
663: as.vector(x, mode)
662: as.vector(x, mode)
661: as.vector(x, mode)
660: as.vector(x, mode)
659: as.vector(x, mode)
658: as.vector(x, mode)
657: as.vector(x, mode)
656: as.vector(x, mode)
655: as.vector(x, mode)
654: as.vector(x, mode)
653: as.vector(x, mode)
652: as.vector(x, mode)
651: as.vector(x, mode)
650: as.vector(x, mode)
649: as.vector(x, mode)
648: as.vector(x, mode)
647: as.vector(x, mode)
646: as.vector(x, mode)
645: as.vector(x, mode)
644: as.vector(x, mode)
643: as.vector(x, mode)
642: as.vector(x, mode)
641: as.vector(x, mode)
640: as.vector(x, mode)
639: as.vector(x, mode)
638: as.vector(x, mode)
637: as.vector(x, mode)
636: as.vector(x, mode)
635: as.vector(x, mode)
634: as.vector(x, mode)
633: as.vector(x, mode)
632: as.vector(x, mode)
631: as.vector(x, mode)
630: as.vector(x, mode)
629: as.vector(x, mode)
628: as.vector(x, mode)
627: as.vector(x, mode)
626: as.vector(x, mode)
625: as.vector(x, mode)
624: as.vector(x, mode)
623: as.vector(x, mode)
622: as.vector(x, mode)
621: as.vector(x, mode)
620: as.vector(x, mode)
619: as.vector(x, mode)
618: as.vector(x, mode)
617: as.vector(x, mode)
616: as.vector(x, mode)
615: as.vector(x, mode)
614: as.vector(x, mode)
613: as.vector(x, mode)
612: as.vector(x, mode)
611: as.vector(x, mode)
610: as.vector(x, mode)
609: as.vector(x, mode)
608: as.vector(x, mode)
607: as.vector(x, mode)
606: as.vector(x, mode)
605: as.vector(x, mode)
604: as.vector(x, mode)
603: as.vector(x, mode)
602: as.vector(x, mode)
601: as.vector(x, mode)
600: as.vector(x, mode)
599: as.vector(x, mode)
598: as.vector(x, mode)
597: as.vector(x, mode)
596: as.vector(x, mode)
595: as.vector(x, mode)
594: as.vector(x, mode)
593: as.vector(x, mode)
592: as.vector(x, mode)
591: as.vector(x, mode)
590: as.vector(x, mode)
589: as.vector(x, mode)
588: as.vector(x, mode)
587: as.vector(x, mode)
586: as.vector(x, mode)
585: as.vector(x, mode)
584: as.vector(x, mode)
583: as.vector(x, mode)
582: as.vector(x, mode)
581: as.vector(x, mode)
580: as.vector(x, mode)
579: as.vector(x, mode)
578: as.vector(x, mode)
577: as.vector(x, mode)
576: as.vector(x, mode)
575: as.vector(x, mode)
574: as.vector(x, mode)
573: as.vector(x, mode)
572: as.vector(x, mode)
571: as.vector(x, mode)
570: as.vector(x, mode)
569: as.vector(x, mode)
568: as.vector(x, mode)
567: as.vector(x, mode)
566: as.vector(x, mode)
565: as.vector(x, mode)
564: as.vector(x, mode)
563: as.vector(x, mode)
562: as.vector(x, mode)
561: as.vector(x, mode)
560: as.vector(x, mode)
559: as.vector(x, mode)
558: as.vector(x, mode)
557: as.vector(x, mode)
556: as.vector(x, mode)
555: as.vector(x, mode)
554: as.vector(x, mode)
553: as.vector(x, mode)
552: as.vector(x, mode)
551: as.vector(x, mode)
550: as.vector(x, mode)
549: as.vector(x, mode)
548: as.vector(x, mode)
547: as.vector(x, mode)
546: as.vector(x, mode)
545: as.vector(x, mode)
544: as.vector(x, mode)
543: as.vector(x, mode)
542: as.vector(x, mode)
541: as.vector(x, mode)
540: as.vector(x, mode)
539: as.vector(x, mode)
538: as.vector(x, mode)
537: as.vector(x, mode)
536: as.vector(x, mode)
535: as.vector(x, mode)
534: as.vector(x, mode)
533: as.vector(x, mode)
532: as.vector(x, mode)
531: as.vector(x, mode)
530: as.vector(x, mode)
529: as.vector(x, mode)
528: as.vector(x, mode)
527: as.vector(x, mode)
526: as.vector(x, mode)
525: as.vector(x, mode)
524: as.vector(x, mode)
523: as.vector(x, mode)
522: as.vector(x, mode)
521: as.vector(x, mode)
520: as.vector(x, mode)
519: as.vector(x, mode)
518: as.vector(x, mode)
517: as.vector(x, mode)
516: as.vector(x, mode)
515: as.vector(x, mode)
514: as.vector(x, mode)
513: as.vector(x, mode)
512: as.vector(x, mode)
511: as.vector(x, mode)
510: as.vector(x, mode)
509: as.vector(x, mode)
508: as.vector(x, mode)
507: as.vector(x, mode)
506: as.vector(x, mode)
505: as.vector(x, mode)
504: as.vector(x, mode)
503: as.vector(x, mode)
502: as.vector(x, mode)
501: as.vector(x, mode)
500: as.vector(x, mode)
499: as.vector(x, mode)
498: as.vector(x, mode)
497: as.vector(x, mode)
496: as.vector(x, mode)
495: as.vector(x, mode)
494: as.vector(x, mode)
493: as.vector(x, mode)
492: as.vector(x, mode)
491: as.vector(x, mode)
490: as.vector(x, mode)
489: as.vector(x, mode)
488: as.vector(x, mode)
487: as.vector(x, mode)
486: as.vector(x, mode)
485: as.vector(x, mode)
484: as.vector(x, mode)
483: as.vector(x, mode)
482: as.vector(x, mode)
481: as.vector(x, mode)
480: as.vector(x, mode)
479: as.vector(x, mode)
478: as.vector(x, mode)
477: as.vector(x, mode)
476: as.vector(x, mode)
475: as.vector(x, mode)
474: as.vector(x, mode)
473: as.vector(x, mode)
472: as.vector(x, mode)
471: as.vector(x, mode)
470: as.vector(x, mode)
469: as.vector(x, mode)
468: as.vector(x, mode)
467: as.vector(x, mode)
466: as.vector(x, mode)
465: as.vector(x, mode)
464: as.vector(x, mode)
463: as.vector(x, mode)
462: as.vector(x, mode)
461: as.vector(x, mode)
460: as.vector(x, mode)
459: as.vector(x, mode)
458: as.vector(x, mode)
457: as.vector(x, mode)
456: as.vector(x, mode)
455: as.vector(x, mode)
454: as.vector(x, mode)
453: as.vector(x, mode)
452: as.vector(x, mode)
451: as.vector(x, mode)
450: as.vector(x, mode)
449: as.vector(x, mode)
448: as.vector(x, mode)
447: as.vector(x, mode)
446: as.vector(x, mode)
445: as.vector(x, mode)
444: as.vector(x, mode)
443: as.vector(x, mode)
442: as.vector(x, mode)
441: as.vector(x, mode)
440: as.vector(x, mode)
439: as.vector(x, mode)
438: as.vector(x, mode)
437: as.vector(x, mode)
436: as.vector(x, mode)
435: as.vector(x, mode)
434: as.vector(x, mode)
433: as.vector(x, mode)
432: as.vector(x, mode)
431: as.vector(x, mode)
430: as.vector(x, mode)
429: as.vector(x, mode)
428: as.vector(x, mode)
427: as.vector(x, mode)
426: as.vector(x, mode)
425: as.vector(x, mode)
424: as.vector(x, mode)
423: as.vector(x, mode)
422: as.vector(x, mode)
421: as.vector(x, mode)
420: as.vector(x, mode)
419: as.vector(x, mode)
418: as.vector(x, mode)
417: as.vector(x, mode)
416: as.vector(x, mode)
415: as.vector(x, mode)
414: as.vector(x, mode)
413: as.vector(x, mode)
412: as.vector(x, mode)
411: as.vector(x, mode)
410: as.vector(x, mode)
409: as.vector(x, mode)
408: as.vector(x, mode)
407: as.vector(x, mode)
406: as.vector(x, mode)
405: as.vector(x, mode)
404: as.vector(x, mode)
403: as.vector(x, mode)
402: as.vector(x, mode)
401: as.vector(x, mode)
400: as.vector(x, mode)
399: as.vector(x, mode)
398: as.vector(x, mode)
397: as.vector(x, mode)
396: as.vector(x, mode)
395: as.vector(x, mode)
394: as.vector(x, mode)
393: as.vector(x, mode)
392: as.vector(x, mode)
391: as.vector(x, mode)
390: as.vector(x, mode)
389: as.vector(x, mode)
388: as.vector(x, mode)
387: as.vector(x, mode)
386: as.vector(x, mode)
385: as.vector(x, mode)
384: as.vector(x, mode)
383: as.vector(x, mode)
382: as.vector(x, mode)
381: as.vector(x, mode)
380: as.vector(x, mode)
379: as.vector(x, mode)
378: as.vector(x, mode)
377: as.vector(x, mode)
376: as.vector(x, mode)
375: as.vector(x, mode)
374: as.vector(x, mode)
373: as.vector(x, mode)
372: as.vector(x, mode)
371: as.vector(x, mode)
370: as.vector(x, mode)
369: as.vector(x, mode)
368: as.vector(x, mode)
367: as.vector(x, mode)
366: as.vector(x, mode)
365: as.vector(x, mode)
364: as.vector(x, mode)
363: as.vector(x, mode)
362: as.vector(x, mode)
361: as.vector(x, mode)
360: as.vector(x, mode)
359: as.vector(x, mode)
358: as.vector(x, mode)
357: as.vector(x, mode)
356: as.vector(x, mode)
355: as.vector(x, mode)
354: as.vector(x, mode)
353: as.vector(x, mode)
352: as.vector(x, mode)
351: as.vector(x, mode)
350: as.vector(x, mode)
349: as.vector(x, mode)
348: as.vector(x, mode)
347: as.vector(x, mode)
346: as.vector(x, mode)
345: as.vector(x, mode)
344: as.vector(x, mode)
343: as.vector(x, mode)
342: as.vector(x, mode)
341: as.vector(x, mode)
340: as.vector(x, mode)
339: as.vector(x, mode)
338: as.vector(x, mode)
337: as.vector(x, mode)
336: as.vector(x, mode)
335: as.vector(x, mode)
334: as.vector(x, mode)
333: as.vector(x, mode)
332: as.vector(x, mode)
331: as.vector(x, mode)
330: as.vector(x, mode)
329: as.vector(x, mode)
328: as.vector(x, mode)
327: as.vector(x, mode)
326: as.vector(x, mode)
325: as.vector(x, mode)
324: as.vector(x, mode)
323: as.vector(x, mode)
322: as.vector(x, mode)
321: as.vector(x, mode)
320: as.vector(x, mode)
319: as.vector(x, mode)
318: as.vector(x, mode)
317: as.vector(x, mode)
316: as.vector(x, mode)
315: as.vector(x, mode)
314: as.vector(x, mode)
313: as.vector(x, mode)
312: as.vector(x, mode)
311: as.vector(x, mode)
310: as.vector(x, mode)
309: as.vector(x, mode)
308: as.vector(x, mode)
307: as.vector(x, mode)
306: as.vector(x, mode)
305: as.vector(x, mode)
304: as.vector(x, mode)
303: as.vector(x, mode)
302: as.vector(x, mode)
301: as.vector(x, mode)
300: as.vector(x, mode)
299: as.vector(x, mode)
298: as.vector(x, mode)
297: as.vector(x, mode)
296: as.vector(x, mode)
295: as.vector(x, mode)
294: as.vector(x, mode)
293: as.vector(x, mode)
292: as.vector(x, mode)
291: as.vector(x, mode)
290: as.vector(x, mode)
289: as.vector(x, mode)
288: as.vector(x, mode)
287: as.vector(x, mode)
286: as.vector(x, mode)
285: as.vector(x, mode)
284: as.vector(x, mode)
283: as.vector(x, mode)
282: as.vector(x, mode)
281: as.vector(x, mode)
280: as.vector(x, mode)
279: as.vector(x, mode)
278: as.vector(x, mode)
277: as.vector(x, mode)
276: as.vector(x, mode)
275: as.vector(x, mode)
274: as.vector(x, mode)
273: as.vector(x, mode)
272: as.vector(x, mode)
271: as.vector(x, mode)
270: as.vector(x, mode)
269: as.vector(x, mode)
268: as.vector(x, mode)
267: as.vector(x, mode)
266: as.vector(x, mode)
265: as.vector(x, mode)
264: as.vector(x, mode)
263: as.vector(x, mode)
262: as.vector(x, mode)
261: as.vector(x, mode)
260: as.vector(x, mode)
259: as.vector(x, mode)
258: as.vector(x, mode)
257: as.vector(x, mode)
256: as.vector(x, mode)
255: as.vector(x, mode)
254: as.vector(x, mode)
253: as.vector(x, mode)
252: as.vector(x, mode)
251: as.vector(x, mode)
250: as.vector(x, mode)
249: as.vector(x, mode)
248: as.vector(x, mode)
247: as.vector(x, mode)
246: as.vector(x, mode)
245: as.vector(x, mode)
244: as.vector(x, mode)
243: as.vector(x, mode)
242: as.vector(x, mode)
241: as.vector(x, mode)
240: as.vector(x, mode)
239: as.vector(x, mode)
238: as.vector(x, mode)
237: as.vector(x, mode)
236: as.vector(x, mode)
235: as.vector(x, mode)
234: as.vector(x, mode)
233: as.vector(x, mode)
232: as.vector(x, mode)
231: as.vector(x, mode)
230: as.vector(x, mode)
229: as.vector(x, mode)
228: as.vector(x, mode)
227: as.vector(x, mode)
226: as.vector(x, mode)
225: as.vector(x, mode)
224: as.vector(x, mode)
223: as.vector(x, mode)
222: as.vector(x, mode)
221: as.vector(x, mode)
220: as.vector(x, mode)
219: as.vector(x, mode)
218: as.vector(x, mode)
217: as.vector(x, mode)
216: as.vector(x, mode)
215: as.vector(x, mode)
214: as.vector(x, mode)
213: as.vector(x, mode)
212: as.vector(x, mode)
211: as.vector(x, mode)
210: as.vector(x, mode)
209: as.vector(x, mode)
208: as.vector(x, mode)
207: as.vector(x, mode)
206: as.vector(x, mode)
205: as.vector(x, mode)
204: as.vector(x, mode)
203: as.vector(x, mode)
202: as.vector(x, mode)
201: as.vector(x, mode)
200: as.vector(x, mode)
199: as.vector(x, mode)
198: as.vector(x, mode)
197: as.vector(x, mode)
196: as.vector(x, mode)
195: as.vector(x, mode)
194: as.vector(x, mode)
193: as.vector(x, mode)
192: as.vector(x, mode)
191: as.vector(x, mode)
190: as.vector(x, mode)
189: as.vector(x, mode)
188: as.vector(x, mode)
187: as.vector(x, mode)
186: as.vector(x, mode)
185: as.vector(x, mode)
184: as.vector(x, mode)
183: as.vector(x, mode)
182: as.vector(x, mode)
181: as.vector(x, mode)
180: as.vector(x, mode)
179: as.vector(x, mode)
178: as.vector(x, mode)
177: as.vector(x, mode)
176: as.vector(x, mode)
175: as.vector(x, mode)
174: as.vector(x, mode)
173: as.vector(x, mode)
172: as.vector(x, mode)
171: as.vector(x, mode)
170: as.vector(x, mode)
169: as.vector(x, mode)
168: as.vector(x, mode)
167: as.vector(x, mode)
166: as.vector(x, mode)
165: as.vector(x, mode)
164: as.vector(x, mode)
163: as.vector(x, mode)
162: as.vector(x, mode)
161: as.vector(x, mode)
160: as.vector(x, mode)
159: as.vector(x, mode)
158: as.vector(x, mode)
157: as.vector(x, mode)
156: as.vector(x, mode)
155: as.vector(x, mode)
154: as.vector(x, mode)
153: as.vector(x, mode)
152: as.vector(x, mode)
151: as.vector(x, mode)
150: as.vector(x, mode)
149: as.vector(x, mode)
148: as.vector(x, mode)
147: as.vector(x, mode)
146: as.vector(x, mode)
145: as.vector(x, mode)
144: as.vector(x, mode)
143: as.vector(x, mode)
142: as.vector(x, mode)
141: as.vector(x, mode)
140: as.vector(x, mode)
139: as.vector(x, mode)
138: as.vector(x, mode)
137: as.vector(x, mode)
136: as.vector(x, mode)
135: as.vector(x, mode)
134: as.vector(x, mode)
133: as.vector(x, mode)
132: as.vector(x, mode)
131: as.vector(x, mode)
130: as.vector(x, mode)
129: as.vector(x, mode)
128: as.vector(x, mode)
127: as.vector(x, mode)
126: as.vector(x, mode)
125: as.vector(x, mode)
124: as.vector(x, mode)
123: as.vector(x, mode)
122: as.vector(x, mode)
121: as.vector(x, mode)
120: as.vector(x, mode)
119: as.vector(x, mode)
118: as.vector(x, mode)
117: as.vector(x, mode)
116: as.vector(x, mode)
115: as.vector(x, mode)
114: as.vector(x, mode)
113: as.vector(x, mode)
112: as.vector(x, mode)
111: as.vector(x, mode)
110: as.vector(x, mode)
109: as.vector(x, mode)
108: as.vector(x, mode)
107: as.vector(x, mode)
106: as.vector(x, mode)
105: as.vector(x, mode)
104: as.vector(x, mode)
103: as.vector(x, mode)
102: as.vector(x, mode)
101: as.vector(x, mode)
100: as.vector(x, mode)
99: as.vector(x, mode)
98: as.vector(x, mode)
97: as.vector(x, mode)
96: as.vector(x, mode)
95: as.vector(x, mode)
94: as.vector(x, mode)
93: as.vector(x, mode)
92: as.vector(x, mode)
91: as.vector(x, mode)
90: as.vector(x, mode)
89: as.vector(x, mode)
88: as.vector(x, mode)
87: as.vector(x, mode)
86: as.vector(x, mode)
85: as.vector(x, mode)
84: as.vector(x, mode)
83: as.vector(x, mode)
82: as.vector(x, mode)
81: as.vector(x, mode)
80: as.vector(x, mode)
79: as.vector(x, mode)
78: as.vector(x, mode)
77: as.vector(x, mode)
76: as.vector(x, mode)
75: as.vector(x, mode)
74: as.vector(x, mode)
73: as.vector(x, mode)
72: as.vector(x, mode)
71: as.vector(x, mode)
70: as.vector(x, mode)
69: as.vector(x, mode)
68: as.vector(x, mode)
67: as.vector(x, mode)
66: as.vector(x, mode)
65: as.vector(x, mode)
64: as.vector(x, mode)
63: as.vector(x, mode)
62: as.vector(x, mode)
61: as.vector(x, mode)
60: as.vector(x, mode)
59: as.vector(x, mode)
58: as.vector(x, mode)
57: as.vector(x, mode)
56: as.vector(x, mode)
55: as.vector(x, mode)
54: as.vector(x, mode)
53: as.vector(x, mode)
52: as.vector(x, mode)
51: as.vector(x, mode)
50: as.vector(x, mode)
49: as.vector(x, mode)
48: as.vector(x, mode)
47: as.vector(x, mode)
46: as.vector(x, mode)
45: as.vector(x, mode)
44: as.vector(x, mode)
43: as.vector(x, mode)
42: as.vector(x, mode)
41: as.vector(x, mode)
40: as.vector(x, mode)
39: as.vector(x, mode)
38: as.vector(x, mode)
37: as.vector(x, mode)
36: as.vector(x, mode)
35: as.vector(x, mode)
34: as.vector(x, mode)
33: as.vector(x, mode)
32: as.vector(x, mode)
31: as.vector(x, mode)
30: as.vector(x, mode)
29: as.vector(x, mode)
28: as.vector(x, mode)
27: as.vector(x, mode)
26: as.vector(x, mode)
25: as.vector(x, mode)
24: as.vector(x, mode)
23: as.vector(x, mode)
22: as.vector(x, mode)
21: as.vector(x, mode)
20: as.vector(x, mode)
19: as.vector(x, mode)
18: as.vector(x, mode)
17: as.vector(x, mode)
16: as.vector(x, mode)
15: as.vector(x, mode)
14: as.vector(x, mode)
13: as.vector(x, mode)
12: as.vector(x, mode)
11: as.vector(x, mode)
10: as.vector(x, mode)
9: as.vector(x, "character")
8: as.vector(x, "character")
7: as.character.default(statement)
6: as.character(statement)
5: sqliteSendQuery(conn, statement)
4: .local(conn, statement, ...)
3: DBI::dbSendQuery(conn, query)
2: DBI::dbSendQuery(conn, query)
1: (function (sql, outputFile, options)
{
is_sql_update_query <- function(query) {
query <- gsub("^\\s*--.*\n", "", query)
if (grepl("^\\s*\\/\\*.*", query)) {
query <- gsub(".*\\*\\/", "", query)
}
grepl("^\\s*(INSERT|UPDATE|DELETE|CREATE).*", query,
ignore.case = TRUE)
}
dir.create(dirname(outputFile), recursive = TRUE, showWarnings = FALSE)
max.print <- if (is.null(options$max.print))
getOption("max.print", 1000)
else as.numeric(options$max.print)
max.print <- if (is.null(options$sql.max.print))
max.print
else as.numeric(options$sql.max.print)
if (is.null(options$connection))
stop("The 'connection' option (DBI connection) is required for sql chunks.")
conn <- get(options$connection, envir = globalenv())
if (is.null(conn))
stop("The 'connection' option must be a valid DBI connection.")
varnames_from_sql <- function(conn, sql) {
varPos <- DBI::sqlParseVariables(conn, sql)
if (length(varPos$start) > 0) {
varNames <- substring(sql, varPos$start, varPos$end)
sub("^\\?", "", varNames)
}
}
mexists <- function(x, env = globalenv(), inherits = TRUE) {
vapply(x, exists, logical(1), where = env, inherits = inherits)
}
interpolate_from_env <- function(conn, sql, env = globalenv(),
inherits = TRUE) {
names <- unique(varnames_from_sql(conn, sql))
names_missing <- names[!mexists(names, env, inherits)]
if (length(names_missing) > 0) {
stop("Object(s) not found: ", paste("\"", names_missing,
"\"", collapse = ", "))
}
args <- if (length(names) > 0)
setNames(mget(names, envir = env, inherits = inherits),
names)
do.call(DBI::sqlInterpolate, c(list(conn, sql), args))
}
varname <- options$output.var
query <- interpolate_from_env(conn, sql)
if (is.null(varname) && max.print > 0 && !is_sql_update_query(query)) {
res <- DBI::dbSendQuery(conn, query)
data <- DBI::dbFetch(res, n = max.print)
DBI::dbClearResult(res)
}
else {
data <- DBI::dbGetQuery(conn, query)
}
if (!is.null(varname)) {
assign(varname, data, envir = globalenv())
}
else {
x <- data
save(x, file = outputFile)
}
})("SELECT * FROM EVENTS_ID", "/home/.rstudio-desktop/notebooks/567F01E3-Notebook/1/61A0FD15/csyikkfh4nozt/00006b.rdf",
list(connection = "db", engine = "sql", label = "unnamed-chunk-7",
max.print = 10))
If I run Cstack_info() after the error I get the following
size current direction eval_depth
7969177 15104 1 2
I have the following pandas DataFrame.
pandas.DataFrame({'C': {64: 128.0, 50: 32.0, 67: 128.0, 52: 32.0, 73: 512.0, 105: 32768.0, 42: 8.0, 47: 8.0, 76: 512.0, 79: 512.0}, 'gamma': {64: 0.0078125, 50: 3.0517578125e-05, 67: 0.5, 52: 0.00048828125, 73: 0.001953125, 105: 0.03125, 42: 0.00048828125, 47: 0.5, 76: 0.125, 79: 8.0}, 'kernel': {64: 'rbf', 50: 'rbf', 67: 'rbf', 52: 'rbf', 73: 'rbf', 105: 'rbf', 42: 'rbf', 47: 'rbf', 76: 'rbf', 79: 'rbf'}, 'std.dev': {64: 0.0063099999999999996, 50: 0.0077600000000000004, 67: 0.0071300000000000001, 52: 0.0066800000000000002, 73: 0.00611, 105: 0.0056100000000000004, 42: 0.0075399999999999998, 47: 0.0058100000000000001, 76: 0.0070000000000000001, 79: 0.0048799999999999998}, 'mean': {64: 0.97031000000000001, 50: 0.94882999999999995, 67: 0.96369000000000005, 52: 0.96518000000000004, 73: 0.96897999999999995, 105: 0.96455000000000002, 42: 0.96267999999999998, 47: 0.96825000000000006, 76: 0.96601999999999999, 79: 0.96560000000000001}})
Output:
C gamma kernel mean std.dev
42 8.0 0.000488 rbf 0.96268 0.00754
47 8.0 0.500000 rbf 0.96825 0.00581
50 32.0 0.000031 rbf 0.94883 0.00776
52 32.0 0.000488 rbf 0.96518 0.00668
64 128.0 0.007812 rbf 0.97031 0.00631
67 128.0 0.500000 rbf 0.96369 0.00713
73 512.0 0.001953 rbf 0.96898 0.00611
76 512.0 0.125000 rbf 0.96602 0.00700
79 512.0 8.000000 rbf 0.96560 0.00488
105 32768.0 0.031250 rbf 0.96455 0.00561
I need it into a format where the C column contains only unique values of C, and each unique value in the gamma column becomes a new column. For each such new column of gamma, I would like to show the mean and std.dev for the corresponding values of C and gamma.
Just for completeness you can use pivot_table directly.
df.pivot_table(index='C',
columns='gamma',
values=['mean','std.dev'])\
.swaplevel(0, 1, axis=1)\
.sort_index(level=0, axis=1)
use set_index and unstack
df.set_index(['C', 'gamma'])[['mean', 'std.dev']].unstack().swaplevel(0, 1, 1).sort_index(1)
Or equivalently with pivot
pd.concat(
[df.pivot(index='C', columns='gamma', values=c) for c in ['mean', 'std.dev']],
keys=['mean', 'std.dev']
).unstack(0)
I am trying to calculate linear regression of Y=C-A column, x = ['Plate X', 'Plate Y', 'Field X'] and group those values by Drum and Plate. Additional question - how to save results as a file, csv preferable.
Is pandas package is sufficient for this task or other package needed.
Thank you
There is my data set:
DF = {'A': {0: 305.03277000000003,
1: 304.42513500000001,
2: 305.119575,
3: 304.42513500000001,
4: 304.07791500000002,
5: 304.85916000000003,
6: 305.72721000000001,
7: 305.81401499999998,
8: 304.07791500000002,
9: 305.03277000000003,
10: 304.68554999999998,
11: 304.945965,
12: 303.38347499999998,
13: 304.945965,
14: 304.51193999999998,
15: 304.25152500000002,
16: 304.51193999999998,
17: 304.25152500000002,
18: 304.42513500000001,
19: 304.85916000000003,
20: 303.8175,
21: 305.119575,
22: 304.59874500000001,
23: 304.68554999999998,
24: 304.33832999999998,
25: 303.90430499999997,
26: 304.68554999999998,
27: 304.772355,
28: 304.59874500000001,
29: 304.772355,
30: 304.59874500000001,
31: 305.119575,
32: 305.37998999999996,
33: 304.59874500000001,
34: 304.42513500000001,
35: 304.33832999999998,
36: 304.51193999999998,
37: 305.46679499999999,
38: 304.59874500000001,
39: 305.29318499999999,
40: 304.85916000000003,
41: 305.29318499999999,
42: 305.119575,
43: 304.945965,
44: 305.29318499999999,
45: 304.85916000000003,
46: 305.72721000000001,
47: 306.16123500000003,
48: 305.37998999999996,
49: 305.03277000000003,
50: 305.20637999999997,
51: 304.51193999999998,
52: 308.33136000000002,
53: 305.81401499999998,
54: 305.55360000000002,
55: 306.42165,
56: 305.64040499999999,
57: 305.29318499999999,
58: 305.37998999999996,
59: 304.772355,
60: 305.37998999999996,
61: 305.72721000000001,
62: 305.90082000000001,
63: 305.64040499999999,
64: 305.81401499999998,
65: 304.85916000000003,
66: 305.20637999999997,
67: 306.42165,
68: 305.64040499999999,
69: 305.55360000000002,
70: 304.59874500000001,
71: 305.55360000000002,
72: 306.07443000000001,
73: 306.42165,
74: 305.98762499999998,
75: 306.68206499999997,
76: 305.03277000000003,
77: 305.46679499999999,
78: 306.42165,
79: 304.85916000000003,
80: 304.51193999999998,
81: 303.8175,
82: 304.51193999999998,
83: 304.16472000000005,
84: 304.51193999999998,
85: 303.73069500000003,
86: 303.29667000000001,
87: 304.68554999999998,
88: 303.73069500000003,
89: 304.42513500000001,
90: 304.51193999999998,
91: 304.16472000000005,
92: 304.945965,
93: 304.772355,
94: 304.42513500000001,
95: 304.16472000000005,
96: 305.119575,
97: 304.16472000000005,
98: 304.25152500000002,
99: 305.20637999999997},
'B': {0: 311.10912000000002,
1: 310.93551000000002,
2: 313.279245,
3: 313.19243999999998,
4: 309.11260499999997,
5: 309.0258,
6: 309.72023999999999,
7: 313.279245,
8: 311.89036499999997,
9: 311.19592499999999,
10: 308.76538500000004,
11: 309.72023999999999,
12: 312.15078,
13: 309.19941,
14: 308.50497000000001,
15: 308.33136000000002,
16: 309.89384999999999,
17: 310.848705,
18: 312.23758500000002,
19: 313.53966000000003,
20: 309.72023999999999,
21: 309.11260499999997,
22: 311.89036499999997,
23: 309.98065499999996,
24: 309.19941,
25: 310.41467999999998,
26: 311.62995000000001,
27: 311.02231499999999,
28: 310.32787500000001,
29: 310.06745999999998,
30: 311.89036499999997,
31: 311.89036499999997,
32: 309.98065499999996,
33: 312.06397500000003,
34: 306.85567500000002,
35: 309.98065499999996,
36: 311.80356,
37: 309.19941,
38: 312.41119500000002,
39: 310.848705,
40: 311.10912000000002,
41: 310.501485,
42: 313.80007499999999,
43: 308.24455499999999,
44: 312.49799999999999,
45: 313.10563500000001,
46: 313.19243999999998,
47: 309.63343500000002,
48: 311.10912000000002,
49: 310.501485,
50: 310.58828999999997,
51: 314.23410000000001,
52: 312.41119500000002,
53: 313.01882999999998,
54: 311.19592499999999,
55: 311.54314500000004,
56: 313.279245,
57: 311.54314500000004,
58: 311.45634000000001,
59: 313.19243999999998,
60: 312.15078,
61: 312.15078,
62: 313.452855,
63: 311.02231499999999,
64: 311.02231499999999,
65: 311.28272999999996,
66: 311.02231499999999,
67: 307.897335,
68: 313.19243999999998,
69: 311.97717,
70: 311.10912000000002,
71: 312.58480499999996,
72: 312.58480499999996,
73: 315.01534500000002,
74: 311.97717,
75: 313.452855,
76: 311.80356,
77: 308.67857999999995,
78: 311.71675499999998,
79: 311.36953499999998,
80: 310.501485,
81: 308.85219000000001,
82: 311.10912000000002,
83: 309.37302,
84: 307.98413999999997,
85: 311.10912000000002,
86: 311.28272999999996,
87: 310.93551000000002,
88: 310.24107000000004,
89: 307.11608999999999,
90: 307.55011500000001,
91: 308.76538500000004,
92: 310.848705,
93: 307.02928500000002,
94: 309.89384999999999,
95: 311.28272999999996,
96: 307.81052999999997,
97: 309.72023999999999,
98: 311.54314500000004,
99: 310.32787500000001},
'C': {0: 305.72721000000001,
1: 306.00498599999997,
2: 306.49109399999998,
3: 306.59526,
4: 305.48415599999998,
5: 305.24110200000001,
6: 306.28276199999999,
7: 306.97720199999998,
8: 306.80359199999998,
9: 307.081368,
10: 306.10915199999999,
11: 304.47721799999999,
12: 305.24110200000001,
13: 304.68554999999998,
14: 306.35220600000002,
15: 305.17165799999998,
16: 306.45637200000004,
17: 305.86609800000002,
18: 306.734148,
19: 306.28276199999999,
20: 305.51887799999997,
21: 308.053584,
22: 306.52581600000002,
23: 305.935542,
24: 306.56053800000001,
25: 306.10915199999999,
26: 306.56053800000001,
27: 305.79665399999999,
28: 305.761932,
29: 304.75499400000001,
30: 306.07443000000001,
31: 306.35220600000002,
32: 305.86609800000002,
33: 307.01192400000002,
34: 306.28276199999999,
35: 305.55360000000002,
36: 306.35220600000002,
37: 306.80359199999998,
38: 305.90082000000001,
39: 306.03970800000002,
40: 307.18553399999996,
41: 304.82443799999999,
42: 305.83137599999998,
43: 306.97720199999998,
44: 306.38692799999995,
45: 306.49109399999998,
46: 306.38692799999995,
47: 306.52581600000002,
48: 305.06749200000002,
49: 306.07443000000001,
50: 306.56053800000001,
51: 305.48415599999998,
52: 305.69248799999997,
53: 307.63692000000003,
54: 307.28969999999998,
55: 305.62304399999999,
56: 306.38692799999995,
57: 305.86609800000002,
58: 306.56053800000001,
59: 305.55360000000002,
60: 306.07443000000001,
61: 306.52581600000002,
62: 306.56053800000001,
63: 305.34526800000003,
64: 305.24110200000001,
65: 304.58138399999996,
66: 307.04664600000001,
67: 306.00498599999997,
68: 305.79665399999999,
69: 306.49109399999998,
70: 305.51887799999997,
71: 305.72721000000001,
72: 306.31748399999998,
73: 306.03970800000002,
74: 307.15081200000003,
75: 307.60219799999999,
76: 304.92860400000001,
77: 304.68554999999998,
78: 305.58832200000001,
79: 305.449434,
80: 306.83831400000003,
81: 306.49109399999998,
82: 306.94247999999999,
83: 304.963326,
84: 307.25497799999999,
85: 305.97026399999999,
86: 306.07443000000001,
87: 305.761932,
88: 305.90082000000001,
89: 306.31748399999998,
90: 306.69942599999996,
91: 306.07443000000001,
92: 305.449434,
93: 304.789716,
94: 304.72027200000002,
95: 306.10915199999999,
96: 305.449434,
97: 305.31054599999999,
98: 305.31054599999999,
99: 306.45637200000004},
'C-A': {0: 0.69443999999999995,
1: 1.5798510000000001,
2: 1.3715190000000002,
3: 2.1701250000000001,
4: 1.4062410000000001,
5: 0.381942,
6: 0.55555200000000005,
7: 1.163187,
8: 2.7256770000000001,
9: 2.0485980000000001,
10: 1.423602,
11: -0.46874700000000002,
12: 1.8576270000000001,
13: -0.26041500000000001,
14: 1.840266,
15: 0.92013299999999998,
16: 1.9444319999999999,
17: 1.614573,
18: 2.3090130000000002,
19: 1.423602,
20: 1.7013779999999998,
21: 2.9340090000000001,
22: 1.927071,
23: 1.249992,
24: 2.2222080000000002,
25: 2.204847,
26: 1.8749880000000001,
27: 1.0242990000000001,
28: 1.163187,
29: -0.017361000000000001,
30: 1.4756850000000001,
31: 1.232631,
32: 0.48610799999999998,
33: 2.413179,
34: 1.8576270000000001,
35: 1.2152700000000001,
36: 1.840266,
37: 1.336797,
38: 1.3020750000000001,
39: 0.74652299999999994,
40: 2.3263739999999999,
41: -0.46874700000000002,
42: 0.71180100000000002,
43: 2.031237,
44: 1.0937430000000001,
45: 1.631934,
46: 0.65971800000000003,
47: 0.36458099999999999,
48: -0.312498,
49: 1.04166,
50: 1.354158,
51: 0.97221599999999997,
52: -2.6388720000000001,
53: 1.822905,
54: 1.7361,
55: -0.79860600000000004,
56: 0.74652299999999994,
57: 0.57291300000000001,
58: 1.1805479999999999,
59: 0.78124499999999997,
60: 0.69443999999999995,
61: 0.79860600000000004,
62: 0.65971800000000003,
63: -0.29513699999999998,
64: -0.57291300000000001,
65: -0.27777600000000002,
66: 1.840266,
67: -0.41666400000000003,
68: 0.156249,
69: 0.93749400000000005,
70: 0.92013299999999998,
71: 0.17360999999999999,
72: 0.24305399999999999,
73: -0.381942,
74: 1.163187,
75: 0.92013299999999998,
76: -0.10416600000000001,
77: -0.78124499999999997,
78: -0.83332800000000007,
79: 0.59027399999999997,
80: 2.3263739999999999,
81: 2.673594,
82: 2.4305400000000001,
83: 0.79860600000000004,
84: 2.7430380000000003,
85: 2.2395689999999999,
86: 2.7777599999999998,
87: 1.0763819999999999,
88: 2.1701250000000001,
89: 1.8923490000000001,
90: 2.1874860000000003,
91: 1.9097099999999998,
92: 0.50346899999999994,
93: 0.017361000000000001,
94: 0.29513699999999998,
95: 1.9444319999999999,
96: 0.32985900000000001,
97: 1.145826,
98: 1.059021,
99: 1.249992},
'Drum': {0: 'LAAA',
1: 'LAAA',
2: 'LAAA',
3: 'LAAA',
4: 'LAAA',
5: 'LAAA',
6: 'LAAA',
7: 'LAAA',
8: 'LAAA',
9: 'LAAA',
10: 'LAAA',
11: 'LAAA',
12: 'LAAA',
13: 'LAAA',
14: 'LAAA',
15: 'LAAA',
16: 'LAAA',
17: 'LAAA',
18: 'LAAA',
19: 'LAAA',
20: 'LAAA',
21: 'LAAA',
22: 'LAAA',
23: 'LAAA',
24: 'LAAA',
25: 'LAAA',
26: 'LAAA',
27: 'LAAA',
28: 'LAAA',
29: 'LAAA',
30: 'LAAA',
31: 'LAAA',
32: 'LAAA',
33: 'LAAA',
34: 'LAAA',
35: 'LAAA',
36: 'LAAA',
37: 'LAAA',
38: 'LAAA',
39: 'LAAA',
40: 'LAAA',
41: 'LAAA',
42: 'LAAA',
43: 'LAAA',
44: 'LAAA',
45: 'LAAA',
46: 'LAAA',
47: 'LAAA',
48: 'LAAA',
49: 'LAAA',
50: 'LAAA',
51: 'LAAA',
52: 'LAAA',
53: 'LAAA',
54: 'LAAA',
55: 'LAAA',
56: 'LAAA',
57: 'LAAA',
58: 'LAAA',
59: 'LAAA',
60: 'LAAA',
61: 'LAAA',
62: 'LAAA',
63: 'LAAA',
64: 'LAAA',
65: 'LAAA',
66: 'LAAA',
67: 'LAAA',
68: 'LAAA',
69: 'LAAA',
70: 'LAAA',
71: 'LAAA',
72: 'LAAA',
73: 'LAAA',
74: 'LAAA',
75: 'LAAA',
76: 'LAAA',
77: 'LAAA',
78: 'LAAA',
79: 'LAAA',
80: 'LAAA',
81: 'LAAA',
82: 'LAAA',
83: 'LAAA',
84: 'LAAA',
85: 'LAAA',
86: 'LAAA',
87: 'LAAA',
88: 'LAAA',
89: 'LAAA',
90: 'LAAA',
91: 'LAAA',
92: 'LAAA',
93: 'LAAA',
94: 'LAAA',
95: 'LAAA',
96: 'LAAA',
97: 'LAAA',
98: 'LAAA',
99: 'LAAA'},
'FIELD X': {0: 4.7949800000000007,
1: -5.5198839999999993,
2: 4.7949800000000007,
3: 4.7949800000000007,
4: -5.5198839999999993,
5: 4.7949800000000007,
6: -5.5198839999999993,
7: 4.7949800000000007,
8: 4.7949800000000007,
9: -5.5198839999999993,
10: -5.5198839999999993,
11: 4.7949800000000007,
12: 4.7949800000000007,
13: -5.5198839999999993,
14: 4.7949800000000007,
15: -5.5198839999999993,
16: 4.7949800000000007,
17: -5.5198839999999993,
18: 4.7949800000000007,
19: 4.7949800000000007,
20: -5.5198839999999993,
21: 4.7949800000000007,
22: -5.5198839999999993,
23: 4.7949800000000007,
24: 4.7949800000000007,
25: -5.5198839999999993,
26: 4.7949800000000007,
27: -5.5198839999999993,
28: -5.5198839999999993,
29: 4.7949800000000007,
30: -5.5198839999999993,
31: 4.7949800000000007,
32: 4.7949800000000007,
33: -5.5198839999999993,
34: 4.7949800000000007,
35: -5.5198839999999993,
36: 4.7949800000000007,
37: -5.5198839999999993,
38: 4.7949800000000007,
39: -5.5198839999999993,
40: 4.7949800000000007,
41: -5.5198839999999993,
42: 4.7949800000000007,
43: -5.5198839999999993,
44: 4.7949800000000007,
45: -5.5198839999999993,
46: 4.7949800000000007,
47: -5.5198839999999993,
48: 4.7949800000000007,
49: -5.5198839999999993,
50: -5.5198839999999993,
51: 4.7949800000000007,
52: -5.5198839999999993,
53: 4.7949800000000007,
54: 4.7949800000000007,
55: -5.5198839999999993,
56: 4.7949800000000007,
57: -5.5198839999999993,
58: 4.7949800000000007,
59: -5.5198839999999993,
60: 4.7949800000000007,
61: 4.7949800000000007,
62: -5.5198839999999993,
63: 4.7949800000000007,
64: -5.5198839999999993,
65: 4.7949800000000007,
66: 4.7949800000000007,
67: -5.5198839999999993,
68: 4.7949800000000007,
69: -5.5198839999999993,
70: -5.5198839999999993,
71: 4.7949800000000007,
72: -5.5198839999999993,
73: 4.7949800000000007,
74: -5.5198839999999993,
75: 4.7949800000000007,
76: -5.5198839999999993,
77: -5.5198839999999993,
78: 4.7949800000000007,
79: -5.5198839999999993,
80: 4.7949800000000007,
81: -5.5198839999999993,
82: 4.7949800000000007,
83: 4.7949800000000007,
84: -5.5198839999999993,
85: 4.7949800000000007,
86: -5.5198839999999993,
87: 4.7949800000000007,
88: 4.7949800000000007,
89: -5.5198839999999993,
90: -5.5198839999999993,
91: 4.7949800000000007,
92: 4.7949800000000007,
93: -5.5198839999999993,
94: 4.7949800000000007,
95: -5.5198839999999993,
96: 4.7949800000000007,
97: -5.5198839999999993,
98: 4.7949800000000007,
99: 4.7949800000000007},
'FIELD Y': {0: 1.8893500000000001,
1: 1.8893500000000001,
2: 1.8893500000000001,
3: 1.8893500000000001,
4: 1.8893500000000001,
5: 1.8893500000000001,
6: 1.8893500000000001,
7: 1.8893500000000001,
8: 1.8893500000000001,
9: 1.8893500000000001,
10: 1.8893500000000001,
11: 1.8893500000000001,
12: 1.8893500000000001,
13: 1.8893500000000001,
14: 1.8893500000000001,
15: 1.8893500000000001,
16: 1.8893500000000001,
17: 1.8893500000000001,
18: 1.8893500000000001,
19: 1.8893500000000001,
20: 1.8893500000000001,
21: 1.8893500000000001,
22: 1.8893500000000001,
23: 1.8893500000000001,
24: 1.8893500000000001,
25: 1.8893500000000001,
26: 1.8893500000000001,
27: 1.8893500000000001,
28: 1.8893500000000001,
29: 1.8893500000000001,
30: 1.8893500000000001,
31: 1.8893500000000001,
32: 1.8893500000000001,
33: 1.8893500000000001,
34: 1.8893500000000001,
35: 1.8893500000000001,
36: 1.8893500000000001,
37: 1.8893500000000001,
38: 1.8893500000000001,
39: 1.8893500000000001,
40: 1.8893500000000001,
41: 1.8893500000000001,
42: 1.8893500000000001,
43: 1.8893500000000001,
44: 1.8893500000000001,
45: 1.8893500000000001,
46: 1.8893500000000001,
47: 1.8893500000000001,
48: 1.8893500000000001,
49: 1.8893500000000001,
50: 1.8893500000000001,
51: 1.8893500000000001,
52: 1.8893500000000001,
53: 1.8893500000000001,
54: 1.8893500000000001,
55: 1.8893500000000001,
56: 1.8893500000000001,
57: 1.8893500000000001,
58: 1.8893500000000001,
59: 1.8893500000000001,
60: 1.8893500000000001,
61: 1.8893500000000001,
62: 1.8893500000000001,
63: 1.8893500000000001,
64: 1.8893500000000001,
65: 1.8893500000000001,
66: 1.8893500000000001,
67: 1.8893500000000001,
68: 1.8893500000000001,
69: 1.8893500000000001,
70: 1.8893500000000001,
71: 1.8893500000000001,
72: 1.8893500000000001,
73: 1.8893500000000001,
74: 1.8893500000000001,
75: 1.8893500000000001,
76: 1.8893500000000001,
77: 1.8893500000000001,
78: 1.8893500000000001,
79: 1.8893500000000001,
80: 1.8893500000000001,
81: 1.8893500000000001,
82: 1.8893500000000001,
83: 1.8893500000000001,
84: 1.8893500000000001,
85: 1.8893500000000001,
86: 1.8893500000000001,
87: 1.8893500000000001,
88: 1.8893500000000001,
89: 1.8893500000000001,
90: 1.8893500000000001,
91: 1.8893500000000001,
92: 1.8893500000000001,
93: 1.8893500000000001,
94: 1.8893500000000001,
95: 1.8893500000000001,
96: 1.8893500000000001,
97: 1.8893500000000001,
98: 1.8893500000000001,
99: 1.8893500000000001},
'Plate': {0: 72,
1: 72,
2: 72,
3: 72,
4: 72,
5: 72,
6: 72,
7: 72,
8: 72,
9: 72,
10: 72,
11: 72,
12: 72,
13: 72,
14: 72,
15: 72,
16: 72,
17: 72,
18: 72,
19: 72,
20: 72,
21: 72,
22: 72,
23: 72,
24: 72,
25: 72,
26: 72,
27: 72,
28: 72,
29: 72,
30: 72,
31: 72,
32: 72,
33: 72,
34: 72,
35: 72,
36: 72,
37: 72,
38: 72,
39: 72,
40: 72,
41: 72,
42: 72,
43: 72,
44: 72,
45: 72,
46: 72,
47: 72,
48: 72,
49: 72,
50: 72,
51: 72,
52: 72,
53: 72,
54: 72,
55: 72,
56: 72,
57: 72,
58: 72,
59: 72,
60: 72,
61: 72,
62: 72,
63: 72,
64: 72,
65: 72,
66: 72,
67: 72,
68: 72,
69: 72,
70: 72,
71: 72,
72: 72,
73: 72,
74: 72,
75: 72,
76: 72,
77: 72,
78: 72,
79: 72,
80: 131,
81: 131,
82: 131,
83: 131,
84: 131,
85: 131,
86: 131,
87: 131,
88: 131,
89: 131,
90: 131,
91: 131,
92: 131,
93: 131,
94: 131,
95: 131,
96: 131,
97: 131,
98: 131,
99: 131},
'Plate X': {0: -134.13406000000001,
1: -134.13406000000001,
2: -134.13406000000001,
3: -113.50433200000001,
4: -113.50433200000001,
5: -113.50433200000001,
6: -113.50433200000001,
7: -113.50433200000001,
8: -92.874604000000005,
9: -92.874604000000005,
10: -92.874604000000005,
11: -92.874604000000005,
12: -72.244876000000005,
13: -72.244876000000005,
14: -72.244876000000005,
15: -72.244876000000005,
16: -72.244876000000005,
17: -72.244876000000005,
18: -72.244876000000005,
19: -51.615147999999998,
20: -51.615147999999998,
21: -51.615147999999998,
22: -51.615147999999998,
23: -51.615147999999998,
24: -30.985420000000001,
25: -30.985420000000001,
26: -30.985420000000001,
27: -30.985420000000001,
28: -30.985420000000001,
29: -30.985420000000001,
30: -30.985420000000001,
31: -30.985420000000001,
32: -10.355691999999999,
33: -10.355691999999999,
34: -10.355691999999999,
35: -10.355691999999999,
36: -10.355691999999999,
37: -10.355691999999999,
38: -10.355691999999999,
39: 10.274036000000001,
40: 10.274036000000001,
41: 10.274036000000001,
42: 10.274036000000001,
43: 10.274036000000001,
44: 10.274036000000001,
45: 10.274036000000001,
46: 30.903764000000002,
47: 30.903764000000002,
48: 30.903764000000002,
49: 30.903764000000002,
50: 30.903764000000002,
51: 30.903764000000002,
52: 30.903764000000002,
53: 30.903764000000002,
54: 51.533491999999995,
55: 51.533491999999995,
56: 51.533491999999995,
57: 51.533491999999995,
58: 51.533491999999995,
59: 51.533491999999995,
60: 51.533491999999995,
61: 72.163219999999995,
62: 72.163219999999995,
63: 72.163219999999995,
64: 72.163219999999995,
65: 72.163219999999995,
66: 72.163219999999995,
67: 92.792947999999996,
68: 92.792947999999996,
69: 92.792947999999996,
70: 92.792947999999996,
71: 92.792947999999996,
72: 113.422676,
73: 113.422676,
74: 113.422676,
75: 113.422676,
76: 113.422676,
77: 134.052404,
78: 134.052404,
79: 134.052404,
80: -134.13406000000001,
81: -134.13406000000001,
82: -134.13406000000001,
83: -113.50433200000001,
84: -113.50433200000001,
85: -113.50433200000001,
86: -113.50433200000001,
87: -113.50433200000001,
88: -92.874604000000005,
89: -92.874604000000005,
90: -92.874604000000005,
91: -92.874604000000005,
92: -72.244876000000005,
93: -72.244876000000005,
94: -72.244876000000005,
95: -72.244876000000005,
96: -72.244876000000005,
97: -72.244876000000005,
98: -72.244876000000005,
99: -51.615147999999998},
'Plate Y': {0: -27.0123,
1: 0.039899999999999998,
2: 27.092099999999999,
3: -81.116699999999994,
4: -54.064500000000002,
5: 0.039899999999999998,
6: 54.144300000000001,
7: 81.1965,
8: -54.064500000000002,
9: -27.0123,
10: 27.092099999999999,
11: 54.144300000000001,
12: -108.16889999999999,
13: -81.116699999999994,
14: -27.0123,
15: 0.039899999999999998,
16: 27.092099999999999,
17: 81.1965,
18: 108.2487,
19: -81.116699999999994,
20: -54.064500000000002,
21: 0.039899999999999998,
22: 54.144300000000001,
23: 81.1965,
24: -135.22110000000001,
25: -108.16889999999999,
26: -54.064500000000002,
27: -27.0123,
28: 27.092099999999999,
29: 54.144300000000001,
30: 108.2487,
31: 135.30090000000001,
32: -108.16889999999999,
33: -81.116699999999994,
34: -27.0123,
35: 0.039899999999999998,
36: 27.092099999999999,
37: 81.1965,
38: 108.2487,
39: -135.22110000000001,
40: -81.116699999999994,
41: -54.064500000000002,
42: 0.039899999999999998,
43: 54.144300000000001,
44: 81.1965,
45: 135.30090000000001,
46: -135.22110000000001,
47: -108.16889999999999,
48: -54.064500000000002,
49: -27.0123,
50: 27.092099999999999,
51: 54.144300000000001,
52: 108.2487,
53: 135.30090000000001,
54: -108.16889999999999,
55: -81.116699999999994,
56: -27.0123,
57: 0.039899999999999998,
58: 27.092099999999999,
59: 81.1965,
60: 108.2487,
61: -81.116699999999994,
62: -54.064500000000002,
63: 0.039899999999999998,
64: 54.144300000000001,
65: 81.1965,
66: 108.2487,
67: -108.16889999999999,
68: -54.064500000000002,
69: -27.0123,
70: 27.092099999999999,
71: 54.144300000000001,
72: -81.116699999999994,
73: -27.0123,
74: 0.039899999999999998,
75: 27.092099999999999,
76: 81.1965,
77: -54.064500000000002,
78: 0.039899999999999998,
79: 54.144300000000001,
80: -27.0123,
81: 0.039899999999999998,
82: 27.092099999999999,
83: -81.116699999999994,
84: -54.064500000000002,
85: 0.039899999999999998,
86: 54.144300000000001,
87: 81.1965,
88: -54.064500000000002,
89: -27.0123,
90: 27.092099999999999,
91: 54.144300000000001,
92: -108.16889999999999,
93: -81.116699999999994,
94: -27.0123,
95: 0.039899999999999998,
96: 27.092099999999999,
97: 81.1965,
98: 108.2487,
99: -81.116699999999994},
'Unnamed: 0': {0: 0,
1: 1,
2: 2,
3: 3,
4: 4,
5: 5,
6: 6,
7: 7,
8: 8,
9: 9,
10: 10,
11: 11,
12: 12,
13: 13,
14: 14,
15: 15,
16: 16,
17: 17,
18: 18,
19: 19,
20: 20,
21: 21,
22: 22,
23: 23,
24: 24,
25: 25,
26: 26,
27: 27,
28: 28,
29: 29,
30: 30,
31: 31,
32: 32,
33: 33,
34: 34,
35: 35,
36: 36,
37: 37,
38: 38,
39: 39,
40: 40,
41: 41,
42: 42,
43: 43,
44: 44,
45: 45,
46: 46,
47: 47,
48: 48,
49: 49,
50: 50,
51: 51,
52: 52,
53: 53,
54: 54,
55: 55,
56: 56,
57: 57,
58: 58,
59: 59,
60: 60,
61: 61,
62: 62,
63: 63,
64: 64,
65: 65,
66: 66,
67: 67,
68: 68,
69: 69,
70: 70,
71: 71,
72: 72,
73: 73,
74: 74,
75: 75,
76: 76,
77: 77,
78: 78,
79: 79,
80: 80,
81: 81,
82: 82,
83: 83,
84: 84,
85: 85,
86: 86,
87: 87,
88: 88,
89: 89,
90: 90,
91: 91,
92: 92,
93: 93,
94: 94,
95: 95,
96: 96,
97: 97,
98: 98,
99: 99}}
From your question it doesnt sound like you want a multivariate regression (i.e. multiple Y's). If you're just predicting a single Y from multiple X's, you can do it like this with pandas, then save the results to a txt file:
import pandas as pd
df = pd.DataFrame(DF)
res = pd.stats.api.ols(y=df['C-A'], x=df[['Plate X','Plate Y','FIELD X']])
file = open("C:/Users/Simon/Desktop/results.txt", "w")
file.write(str(res))
file.close()
You mentioned in the question that you want to group the analyses by Drum and Plate. However, every value is the same for the Drum rows. If you want to group by Plate, however, and then run OLS on each subgroup, you can do something like this:
import pandas as pd
df = pd.DataFrame(DF)
results = []
def ols_res(df):
results.append( pd.stats.api.ols(y=df['C-A'], x=df[['Plate X','Plate Y','FIELD X']]))
df.groupby('Plate').apply(lambda newdf: ols_res(newdf))
file = open("C:/Users/Simon/Desktop/results.txt", "w")
for el in results:
file.write(str(el))
file.close()
If you want to also group by Drum, and note which drum/plate combination each analysis is for, you can do something like this and just add some extra txt to the results file:
import pandas as pd
df = pd.DataFrame(DF)
results = []
def ols_res(df):
curCombo = "plate:" + str(df["Plate"].mean()) + ", drum:" + str(df["Drum"].unique())
regression_results = pd.stats.api.ols(y=df['C-A'], x=df[['Plate X','Plate Y','FIELD X']])
results.append([curCombo, regression_results])
df.groupby(['Plate', 'Drum']).apply(lambda newdf: ols_res(newdf))
file = open("C:/Users/Simon/Desktop/results.txt", "w")
for el in results:
file.write(str(el))
file.write("\n\n")
file.close()
Help! My apache processes are all using 115MB of memory on startup.
Relevant information:
Linux version (uname -a)
Linux 2.6.31-14-generic-pae #48-Ubuntu SMP Fri Oct 16 15:22:42 UTC 2009 i686 GNU/Linux
Apache version (/usr/sbin/apache2 -v)
Server version: Apache/2.2.8 (Ubuntu)
Server built: Mar 9 2010 20:45:36
Top display (top -u www-data)
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
23377 www-data 20 0 115m 94m 3908 S 28 1.6 0:04.59 apache2
23375 www-data 20 0 119m 99m 5892 S 9 1.6 0:05.04 apache2
23324 www-data 20 0 116m 96m 5144 S 2 1.6 0:04.73 apache2
23283 www-data 20 0 115m 95m 4480 S 1 1.6 0:04.89 apache2
23259 www-data 20 0 116m 96m 5380 S 0 1.6 0:05.55 apache2
23370 www-data 20 0 115m 94m 4396 S 0 1.6 0:04.75 apache2
23229 www-data 20 0 116m 96m 6096 S 0 1.6 0:05.43 apache2
... and so on ...
Memory map (pmap $(pidof apache2)) (actually, just one apache2 process)
Most of the memory is [anon], see line 5
23324: /usr/sbin/apache2 -k start
08048000 332K r-x-- /usr/sbin/apache2
0809b000 8K rw--- /usr/sbin/apache2
0809d000 12K rw--- [ anon ]
093a0000 92812K rw--- [ anon ]
b5b6c000 4K rw--- [ anon ]
b5b6d000 512K rw-s- [ shmid=0x13528003 ]
b5fa8000 16K r-x-- /lib/tls/i686/cmov/libnss_dns-2.7.so
b5fac000 8K rw--- /lib/tls/i686/cmov/libnss_dns-2.7.so
b5fae000 120K r-x-- /usr/lib/php5/20060613+lfs/suhosin.so
b5fcc000 16K rw--- /usr/lib/php5/20060613+lfs/suhosin.so
b5fd0000 4K rw--- [ anon ]
b5fd1000 76K r-x-- /usr/lib/php5/20060613+lfs/pdo.so
b5fe4000 8K rw--- /usr/lib/php5/20060613+lfs/pdo.so
b5fe6000 92K r-x-- /usr/lib/php5/20060613+lfs/mysqli.so
b5ffd000 8K rw--- /usr/lib/php5/20060613+lfs/mysqli.so
b5fff000 1648K r-x-- /usr/lib/libmysqlclient.so.15.0.0
b619b000 268K rw--- /usr/lib/libmysqlclient.so.15.0.0
b61de000 4K rw--- [ anon ]
b61f0000 92K r-x-- /usr/lib/libxcb.so.1.0.0
b6207000 4K rw--- /usr/lib/libxcb.so.1.0.0
b6208000 164K r-x-- /usr/lib/libfontconfig.so.1.3.0
b6231000 4K rw--- /usr/lib/libfontconfig.so.1.3.0
b6232000 124K r-x-- /usr/lib/libjpeg.so.62.0.0
b6251000 4K rw--- /usr/lib/libjpeg.so.62.0.0
b6252000 136K r-x-- /usr/lib/libpng12.so.0.15.0
b6274000 4K rw--- /usr/lib/libpng12.so.0.15.0
b6275000 60K r-x-- /usr/lib/libXpm.so.4.11.0
b6284000 4K rw--- /usr/lib/libXpm.so.4.11.0
b6285000 912K r-x-- /usr/lib/libX11.so.6.2.0
b6369000 12K rw--- /usr/lib/libX11.so.6.2.0
b636c000 424K r-x-- /usr/lib/libfreetype.so.6.3.16
b63d6000 12K rw--- /usr/lib/libfreetype.so.6.3.16
b63d9000 236K r-x-- /usr/lib/libt1.so.5.1.1
b6414000 12K rw--- /usr/lib/libt1.so.5.1.1
b6417000 84K rw--- [ anon ]
b642c000 116K r-x-- /usr/lib/libgd.so.2.0.0
b6449000 128K rw--- /usr/lib/libgd.so.2.0.0
b6469000 16K rw--- [ anon ]
b646d000 88K r-x-- /usr/lib/php5/20060613+lfs/gd.so
b6483000 16K rw--- /usr/lib/php5/20060613+lfs/gd.so
b6487000 192K r-x-- /usr/lib/libidn.so.11.5.30
b64b7000 4K rw--- /usr/lib/libidn.so.11.5.30
b64b8000 232K r-x-- /usr/lib/libcurl.so.4.0.1
b64f2000 4K rw--- /usr/lib/libcurl.so.4.0.1
b64f8000 44K r-x-- /usr/lib/php5/20060613+lfs/mysql.so
b6503000 4K rw--- /usr/lib/php5/20060613+lfs/mysql.so
b6504000 268K r-x-- /usr/lib/libgmp.so.3.4.2
b6547000 4K rw--- /usr/lib/libgmp.so.3.4.2
b6548000 648K r-x-- /usr/lib/libclamav.so.5.0.4
b65ea000 44K rw--- /usr/lib/libclamav.so.5.0.4
b65f8000 52K r-x-- /usr/lib/php5/20060613+lfs/curl.so
b6605000 4K rw--- /usr/lib/php5/20060613+lfs/curl.so
b6606000 148K r-x-- /usr/lib/libmcrypt.so.4.4.7
b662b000 8K rw--- /usr/lib/libmcrypt.so.4.4.7
b662d000 28K rw--- [ anon ]
b6634000 24K r-x-- /usr/lib/php5/20060613+lfs/pdo_mysql.so
b663a000 4K rw--- /usr/lib/php5/20060613+lfs/pdo_mysql.so
b663b000 16K r-x-- /usr/lib/libXdmcp.so.6.0.0
b663f000 4K rw--- /usr/lib/libXdmcp.so.6.0.0
b6640000 12K r-x-- /usr/lib/php5/20060613+lfs/clamav.so
b6643000 4K rw--- /usr/lib/php5/20060613+lfs/clamav.so
b6644000 1036K r-x-- /usr/lib/libc-client.so.2007.0
b6747000 28K rw--- /usr/lib/libc-client.so.2007.0
b674e000 4K rw--- [ anon ]
b6750000 24K r-x-- /usr/lib/libltdl.so.3.1.6
b6756000 4K rw--- /usr/lib/libltdl.so.3.1.6
b6757000 32K r-x-- /usr/lib/php5/20060613+lfs/mcrypt.so
b675f000 4K rw--- /usr/lib/php5/20060613+lfs/mcrypt.so
b6760000 88K r-x-- /usr/lib/php5/20060613+lfs/imap.so
b6776000 4K rw--- /usr/lib/php5/20060613+lfs/imap.so
b6777000 104K r-x-- /usr/local/lib/libssh2.so
b6791000 4K rw--- /usr/local/lib/libssh2.so
b6792000 1324K r-x-- /usr/lib/ZendOptimizer.so
b68dd000 68K rw--- /usr/lib/ZendOptimizer.so
b68ee000 20K rw--- [ anon ]
b68f3000 8K r-x-- /usr/lib/libXau.so.6.0.0
b68f5000 4K rw--- /usr/lib/libXau.so.6.0.0
b68f6000 52K r-x-- /usr/lib/php5/20060613+lfs/ssh2.so
b6903000 4K rw--- /usr/lib/php5/20060613+lfs/ssh2.so
b6904000 252K r---- /usr/lib/locale/en_US.utf8/LC_CTYPE
b6974000 64K rw-s- /dev/zero (deleted)
b6984000 36K r-x-- /lib/tls/i686/cmov/libnss_files-2.7.so
b698d000 8K rw--- /lib/tls/i686/cmov/libnss_files-2.7.so
b698f000 32K r-x-- /lib/tls/i686/cmov/libnss_nis-2.7.so
b6997000 8K rw--- /lib/tls/i686/cmov/libnss_nis-2.7.so
b6999000 28K r-x-- /lib/tls/i686/cmov/libnss_compat-2.7.so
b69a0000 8K rw--- /lib/tls/i686/cmov/libnss_compat-2.7.so
b69a2000 36K r-x-- /lib/libpam.so.0.81.6
b69ab000 4K rw--- /lib/libpam.so.0.81.6
b69ac000 28K r--s- /usr/lib/gconv/gconv-modules.cache
b69b3000 8K r-x-- /usr/lib/apache2/modules/mod_userdir.so
b69b5000 4K rw--- /usr/lib/apache2/modules/mod_userdir.so
b69b6000 148K r-x-- /usr/lib/apache2/modules/mod_ssl.so
b69db000 8K rw--- /usr/lib/apache2/modules/mod_ssl.so
b69dd000 8K rw--- [ anon ]
b69df000 8K r-x-- /usr/lib/apache2/modules/mod_setenvif.so
b69e1000 4K rw--- /usr/lib/apache2/modules/mod_setenvif.so
b69e2000 1128K r-x-- /usr/lib/libxml2.so.2.6.31
b6afc000 20K rw--- /usr/lib/libxml2.so.2.6.31
b6b01000 4K rw--- [ anon ]
b6b02000 80K r-x-- /lib/tls/i686/cmov/libnsl-2.7.so
b6b16000 8K rw--- /lib/tls/i686/cmov/libnsl-2.7.so
b6b18000 8K rw--- [ anon ]
b6b1a000 140K r-x-- /lib/tls/i686/cmov/libm-2.7.so
b6b3d000 8K rw--- /lib/tls/i686/cmov/libm-2.7.so
b6b3f000 60K r-x-- /lib/libbz2.so.1.0.4
b6b4e000 4K rw--- /lib/libbz2.so.1.0.4
b6b4f000 4K r-x-- /usr/lib/libxcb-xlib.so.0.0.0
b6b50000 4K rw--- /usr/lib/libxcb-xlib.so.0.0.0
b6b51000 56K r-x-- /usr/lib/apache2/modules/mod_rewrite.so
b6b5f000 4K rw--- /usr/lib/apache2/modules/mod_rewrite.so
b6b60000 5060K r-x-- /usr/lib/apache2/modules/libphp5.so
b7051000 208K rw--- /usr/lib/apache2/modules/libphp5.so
b7085000 20K rw--- [ anon ]
b708a000 28K r-x-- /usr/lib/apache2/modules/mod_negotiation.so
b7091000 4K rw--- /usr/lib/apache2/modules/mod_negotiation.so
b7092000 12K r-x-- /usr/lib/apache2/modules/mod_mime.so
b7095000 4K rw--- /usr/lib/apache2/modules/mod_mime.so
b7096000 36K r-x-- /usr/lib/apache2/modules/mod_include.so
b709f000 4K rw--- /usr/lib/apache2/modules/mod_include.so
b70a0000 4K r-x-- /usr/lib/apache2/modules/mod_env.so
b70a1000 4K rw--- /usr/lib/apache2/modules/mod_env.so
b70a2000 4K r-x-- /usr/lib/apache2/modules/mod_dir.so
b70a3000 4K rw--- /usr/lib/apache2/modules/mod_dir.so
b70a4000 20K r-x-- /usr/lib/apache2/modules/mod_cgi.so
b70a9000 4K rw--- /usr/lib/apache2/modules/mod_cgi.so
b70aa000 28K r-x-- /usr/lib/apache2/modules/mod_autoindex.so
b70b1000 4K rw--- /usr/lib/apache2/modules/mod_autoindex.so
b70b2000 4K r-x-- /usr/lib/apache2/modules/mod_authz_user.so
b70b3000 4K rw--- /usr/lib/apache2/modules/mod_authz_user.so
b70b4000 8K r-x-- /usr/lib/apache2/modules/mod_authz_host.so
b70b6000 4K rw--- /usr/lib/apache2/modules/mod_authz_host.so
b70b7000 8K r-x-- /usr/lib/apache2/modules/mod_authz_groupfile.so
b70b9000 4K rw--- /usr/lib/apache2/modules/mod_authz_groupfile.so
b70ba000 8K rw--- [ anon ]
b70bc000 12K r-x-- /lib/libgpg-error.so.0.3.0
b70bf000 4K rw--- /lib/libgpg-error.so.0.3.0
b70c0000 4K rw--- [ anon ]
b70c1000 8K r-x-- /lib/libkeyutils-1.2.so
b70c3000 4K rw--- /lib/libkeyutils-1.2.so
b70c4000 28K r-x-- /usr/lib/libkrb5support.so.0.1
b70cb000 4K rw--- /usr/lib/libkrb5support.so.0.1
b70cc000 136K r-x-- /usr/lib/libk5crypto.so.3.1
b70ee000 4K rw--- /usr/lib/libk5crypto.so.3.1
b70ef000 300K r-x-- /lib/libgcrypt.so.11.2.3
b713a000 8K rw--- /lib/libgcrypt.so.11.2.3
b713c000 80K r-x-- /usr/lib/libz.so.1.2.3.3
b7150000 4K rw--- /usr/lib/libz.so.1.2.3.3
b7151000 4K rw--- [ anon ]
b7152000 60K r-x-- /usr/lib/libtasn1.so.3.0.12
b7161000 4K rw--- /usr/lib/libtasn1.so.3.0.12
b7162000 160K r-x-- /usr/lib/libgssapi_krb5.so.2.2
b718a000 4K rw--- /usr/lib/libgssapi_krb5.so.2.2
b718b000 8K r-x-- /lib/libcom_err.so.2.1
b718d000 4K rw--- /lib/libcom_err.so.2.1
b718e000 556K r-x-- /usr/lib/libkrb5.so.3.3
b7219000 8K rw--- /usr/lib/libkrb5.so.3.3
b721b000 1192K r-x-- /usr/lib/i686/cmov/libcrypto.so.0.9.8
b7345000 84K rw--- /usr/lib/i686/cmov/libcrypto.so.0.9.8
b735a000 16K rw--- [ anon ]
b735e000 248K r-x-- /usr/lib/i686/cmov/libssl.so.0.9.8
b739c000 16K rw--- /usr/lib/i686/cmov/libssl.so.0.9.8
b73a0000 452K r-x-- /usr/lib/libgnutls.so.13.9.1
b7411000 20K rw--- /usr/lib/libgnutls.so.13.9.1
b7416000 88K r-x-- /usr/lib/libsasl2.so.2.0.22
b742c000 4K rw--- /usr/lib/libsasl2.so.2.0.22
b742d000 60K r-x-- /lib/tls/i686/cmov/libresolv-2.7.so
b743c000 8K rw--- /lib/tls/i686/cmov/libresolv-2.7.so
b743e000 8K rw--- [ anon ]
b7440000 8K r-x-- /lib/tls/i686/cmov/libdl-2.7.so
b7442000 8K rw--- /lib/tls/i686/cmov/libdl-2.7.so
b7444000 36K r-x-- /lib/tls/i686/cmov/libcrypt-2.7.so
b744d000 8K rw--- /lib/tls/i686/cmov/libcrypt-2.7.so
b744f000 160K rw--- [ anon ]
b7477000 28K r-x-- /lib/tls/i686/cmov/librt-2.7.so
b747e000 8K rw--- /lib/tls/i686/cmov/librt-2.7.so
b7480000 12K r-x-- /lib/libuuid.so.1.2
b7483000 4K rw--- /lib/libuuid.so.1.2
b7484000 124K r-x-- /usr/lib/libexpat.so.1.5.2
b74a3000 8K rw--- /usr/lib/libexpat.so.1.5.2
b74a5000 396K r-x-- /usr/lib/libsqlite3.so.0.8.6
b7508000 8K rw--- /usr/lib/libsqlite3.so.0.8.6
b750a000 120K r-x-- /usr/lib/libpq.so.5.1
b7528000 4K rw--- /usr/lib/libpq.so.5.1
b7529000 1172K r-x-- /usr/lib/libdb-4.6.so
b764e000 8K rw--- /usr/lib/libdb-4.6.so
b7650000 4K rw--- [ anon ]
b7651000 48K r-x-- /usr/lib/liblber-2.4.so.2.0.5
b765d000 4K rw--- /usr/lib/liblber-2.4.so.2.0.5
b765e000 244K r-x-- /usr/lib/libldap_r-2.4.so.2.0.5
b769b000 4K rw--- /usr/lib/libldap_r-2.4.so.2.0.5
b769c000 8K rw--- [ anon ]
b769e000 1316K r-x-- /lib/tls/i686/cmov/libc-2.7.so
b77e7000 4K r---- /lib/tls/i686/cmov/libc-2.7.so
b77e8000 8K rw--- /lib/tls/i686/cmov/libc-2.7.so
b77ea000 12K rw--- [ anon ]
b77ed000 80K r-x-- /lib/tls/i686/cmov/libpthread-2.7.so
b7801000 8K rw--- /lib/tls/i686/cmov/libpthread-2.7.so
b7803000 8K rw--- [ anon ]
b7805000 136K r-x-- /usr/lib/libapr-1.so.0.2.11
b7827000 4K rw--- /usr/lib/libapr-1.so.0.2.11
b7828000 4K rw--- [ anon ]
b7829000 100K r-x-- /usr/lib/libaprutil-1.so.0.2.11
b7842000 4K rw--- /usr/lib/libaprutil-1.so.0.2.11
b7843000 152K r-x-- /usr/lib/libpcre.so.3.12.1
b7869000 4K rw--- /usr/lib/libpcre.so.3.12.1
b786a000 4K r-x-- /usr/lib/apache2/modules/mod_authz_default.so
b786b000 4K rw--- /usr/lib/apache2/modules/mod_authz_default.so
b786c000 4K r-x-- /usr/lib/apache2/modules/mod_authn_file.so
b786d000 4K rw--- /usr/lib/apache2/modules/mod_authn_file.so
b786e000 24K r-x-- /usr/lib/apache2/modules/mod_auth_digest.so
b7874000 4K rw--- /usr/lib/apache2/modules/mod_auth_digest.so
b7875000 8K r-x-- /usr/lib/apache2/modules/mod_auth_basic.so
b7877000 4K rw--- /usr/lib/apache2/modules/mod_auth_basic.so
b7878000 8K r-x-- /usr/lib/apache2/modules/mod_alias.so
b787a000 4K rw--- /usr/lib/apache2/modules/mod_alias.so
b787b000 8K rw--- [ anon ]
b787d000 4K r-x-- [ anon ]
b787e000 104K r-x-- /lib/ld-2.7.so
b7898000 8K rw--- /lib/ld-2.7.so
bfd68000 76K rwx-- [ stack ]
bfd7b000 8K rw--- [ anon ]
total 119008K
I have no idea what's going on. I've tried adjusting the usual parameters (MaxClients, MaxRequestsPerClient, etc, but those don't do anything.) Note, also, that this is memory usage on startup - it doesn't grow, it just starts like this and then stays more or less constant.
Here are values:
Timeout 300
KeepAlive On
MaxKeepAliveRequests 500
KeepAliveTimeout 5
StartServers 1
MinSpareServers 1
MaxSpareServers 5
MaxClients 50
MaxRequestsPerChild 0
We also have the following modules loaded (not compiled in):
alias auth_basic auth_digest authn_file authz_default authz_groupfile authz_host authz_user autoindex cgi dir env include mime negotiation php5 rewrite setenvif ssl userdir
Ideas?
It turned out that the problem was actually not Apache's fault, but ClamAV's. (The virus scanner). It was loading it's database of viruses into memory everywhere, instead of where it was needed.
It's kind of a specific case, but check to make sure ClamAV isn't loading an 80-Mb database of viruses. If you need ClamAV, use dlopen and the like to load it from PHP, instead of having Apache load it.