{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [], "source": [ "from __future__ import print_function, division\n", "\n", "import nsfg3" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "12279" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df = nsfg3.ReadFemResp2010()\n", "len(df)" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "0 6745\n", "1 5534\n", "Name: evrmarry, dtype: int64" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.evrmarry.value_counts()" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "12279" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(df[(df.cmbirth >= 522) & (df.cmbirth <= 1278)])" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "4988" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(df[(df.cmmarrhx >= 522) & (df.cmmarrhx <= 1278)])" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "6759" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(df[(df.cmmarrhx.isnull())])" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "1278 52\n", "1279 332\n", "1280 266\n", "1281 194\n", "1282 367\n", "1283 356\n", "1284 74\n", "1285 289\n", "1286 283\n", "1287 199\n", "1288 280\n", "1289 317\n", "1290 97\n", "1291 244\n", "1292 311\n", "1293 198\n", "1294 289\n", "1295 243\n", "1296 60\n", "1297 243\n", "1298 249\n", "1299 195\n", "1300 275\n", "1301 303\n", "1302 151\n", "1303 328\n", "1304 257\n", "1305 197\n", "1306 285\n", "1307 296\n", "1308 126\n", "1309 270\n", "1310 307\n", "1311 269\n", "1312 302\n", "1313 342\n", "1314 163\n", "1315 239\n", "1316 290\n", "1317 255\n", "1318 306\n", "1319 345\n", "1320 145\n", "1321 329\n", "1322 266\n", "1323 255\n", "1324 339\n", "1325 356\n", "1326 145\n", "Name: cmintvw, dtype: int64" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.cmintvw.value_counts().sort_index()" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "41.084436 1\n", "44.023984 1\n", "49.264753 1\n", "50.253080 1\n", "51.762820 1\n", "54.007121 1\n", "54.326404 1\n", "54.787230 1\n", "55.641206 1\n", "57.502150 1\n", "58.094969 1\n", "58.097193 1\n", "58.918388 1\n", "59.728322 1\n", "63.288633 1\n", "64.839626 1\n", "64.976180 1\n", "65.381502 1\n", "65.816954 1\n", "66.207563 1\n", "67.406247 1\n", "68.378722 1\n", "69.122460 1\n", "69.272292 1\n", "72.566655 1\n", "73.265318 1\n", "73.550226 1\n", "73.822704 1\n", "73.907262 1\n", "73.957456 1\n", " ..\n", "26045.499512 50\n", "26123.574277 1\n", "26218.172271 1\n", "26285.859569 1\n", "26306.399047 1\n", "26315.507259 1\n", "26410.855828 1\n", "26449.973578 1\n", "26557.324114 1\n", "26618.050695 1\n", "26635.647358 1\n", "26652.286657 1\n", "26718.649136 1\n", "26825.183831 1\n", "26951.040017 1\n", "27069.679720 1\n", "27141.949282 6\n", "27141.949282 47\n", "27141.949282 2\n", "27142.397101 44\n", "27324.994998 1\n", "27745.599707 1\n", "27928.880798 1\n", "28202.105357 1\n", "28213.094904 1\n", "28420.871454 1\n", "29007.582235 1\n", "29455.053780 1\n", "30226.354508 38\n", "30226.354508 17\n", "Name: finalwgt, dtype: int64" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.finalwgt.value_counts().sort_index()" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.5.1" } }, "nbformat": 4, "nbformat_minor": 0 }