Skip to content

Instantly share code, notes, and snippets.

@wesm
Created December 7, 2012 23:25
Show Gist options
  • Save wesm/4237496 to your computer and use it in GitHub Desktop.
Save wesm/4237496 to your computer and use it in GitHub Desktop.
Wide DataFrame repr
Display the source blob
Display the rendered blob
Raw
{
"metadata": {
"name": "ReprTest"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "code",
"collapsed": false,
"input": [
"import pandas as pd\n",
"pd.set_option('repr_html', False)\n",
"pd.set_option('line_width', 120)\n",
"\n",
"fec = pd.read_csv('../ch09/P00000001-ALL.csv')\n",
"fec[:20]"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "pyout",
"prompt_number": 2,
"text": [
" cmte_id cand_id cand_nm contbr_nm contbr_city contbr_st contbr_zip \\\n",
"0 C00410118 P20002978 Bachmann, Michelle HARVEY, WILLIAM MOBILE AL 3.660103e+08 \n",
"1 C00410118 P20002978 Bachmann, Michelle HARVEY, WILLIAM MOBILE AL 3.660103e+08 \n",
"2 C00410118 P20002978 Bachmann, Michelle SMITH, LANIER LANETT AL 3.686334e+08 \n",
"3 C00410118 P20002978 Bachmann, Michelle BLEVINS, DARONDA PIGGOTT AR 7.245483e+08 \n",
"4 C00410118 P20002978 Bachmann, Michelle WARDENBURG, HAROLD HOT SPRINGS NATION AR 7.190165e+08 \n",
"5 C00410118 P20002978 Bachmann, Michelle BECKMAN, JAMES SPRINGDALE AR 7.276472e+08 \n",
"6 C00410118 P20002978 Bachmann, Michelle BLEVINS, DARONDA PIGGOTT AR 7.245483e+08 \n",
"7 C00410118 P20002978 Bachmann, Michelle BLEVINS, DARONDA PIGGOTT AR 7.245483e+08 \n",
"8 C00410118 P20002978 Bachmann, Michelle COLLINS, SARAH MESA AZ 8.521067e+08 \n",
"9 C00410118 P20002978 Bachmann, Michelle COLEMAN, RONALD TUCSON AZ 8.574989e+08 \n",
"10 C00410118 P20002978 Bachmann, Michelle ATCHLEY, JR, KEITH MESA AZ 85215 \n",
"11 C00410118 P20002978 Bachmann, Michelle FARNSWORTH, ROSS MESA AZ 8.520621e+08 \n",
"12 C00410118 P20002978 Bachmann, Michelle PRESTON, CLIFFORD ORO VALLEY AZ 8.573791e+08 \n",
"13 C00410118 P20002978 Bachmann, Michelle PETERSEN, W GILBERT AZ 85295 \n",
"14 C00410118 P20002978 Bachmann, Michelle MILLER, WILLIAM SCOTTSDALE AZ 8.525131e+08 \n",
"15 C00410118 P20002978 Bachmann, Michelle DOLAN, WILLIAM PHOENIX AZ 8.501452e+08 \n",
"16 C00410118 P20002978 Bachmann, Michelle WILSON, RICHARD FLAGSTAFF AZ 8.600107e+08 \n",
"17 C00410118 P20002978 Bachmann, Michelle REULING, RICHARD GREEN VALLEY AZ 8.562254e+08 \n",
"18 C00410118 P20002978 Bachmann, Michelle ALLUMBAUGH, KATHY SANTA ANA CA 9.270514e+08 \n",
"19 C00410118 P20002978 Bachmann, Michelle DEL POZO, JOSE DEL MAR CA 9.201429e+08 \n",
"\n",
" contbr_employer contbr_occupation contb_receipt_amt contb_receipt_dt receipt_desc memo_cd memo_text form_tp \\\n",
"0 RETIRED RETIRED 250 20-JUN-11 NaN NaN NaN SA17A \n",
"1 RETIRED RETIRED 50 23-JUN-11 NaN NaN NaN SA17A \n",
"2 INFORMATION REQUESTED INFORMATION REQUESTED 250 05-JUL-11 NaN NaN NaN SA17A \n",
"3 NONE RETIRED 250 01-AUG-11 NaN NaN NaN SA17A \n",
"4 NONE RETIRED 300 20-JUN-11 NaN NaN NaN SA17A \n",
"5 NONE RETIRED 500 23-JUN-11 NaN NaN NaN SA17A \n",
"6 INFORMATION REQUESTED INFORMATION REQUESTED 250 21-JUN-11 NaN NaN NaN SA17A \n",
"7 NONE RETIRED 250 05-JUL-11 NaN NaN NaN SA17A \n",
"8 ST. JOSEPH HOSPITAL RN 250 21-JUN-11 NaN NaN NaN SA17A \n",
"9 RAYTHEON ELECTRICAL ENGINEER 250 20-JUN-11 NaN NaN NaN SA17A \n",
"10 NONE RETIRED 250 22-JUN-11 NaN NaN NaN SA17A \n",
"11 FARNSWORTH COMPANIES LAND DEVELOPER 500 22-JUN-11 NaN NaN NaN SA17A \n",
"12 INFORMATION REQUESTED INFORMATION REQUESTED 250 21-JUN-11 NaN NaN NaN SA17A \n",
"13 INFORMATION REQUESTED INFORMATION REQUESTED 250 27-JUN-11 NaN NaN NaN SA17A \n",
"14 INFORMATION REQUESTED INFORMATION REQUESTED 250 11-JUL-11 NaN NaN NaN SA17A \n",
"15 VA MEDICAL CENTER PHYSICIAN 300 08-JUL-11 NaN NaN NaN SA17A \n",
"16 NONE RETIRED 500 17-JUN-11 NaN NaN NaN SA17A \n",
"17 NONE RETIRED 1000 05-JUL-11 NaN NaN NaN SA17A \n",
"18 NONE RETIRED 250 13-JUN-11 NaN NaN NaN SA17A \n",
"19 RETIRES RETIRED 300 16-JUN-11 NaN NaN NaN SA17A "
]
}
],
"prompt_number": 2
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"language": "python",
"metadata": {},
"outputs": []
}
],
"metadata": {}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment