{ "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": [], "source": [ "df = nsfg3.ReadFemResp2002()" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "4126" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sum(df.evrmarry)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "7643" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(df[(df.cmbirth >= 301) & (df.cmbirth <= 1164)])" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "2928" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(df[(df.cmmarrhx >= 301) & (df.cmmarrhx <= 1164)])" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "3554" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(df[(df.cmmarrhx.isnull())])" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "1225 1\n", "1227 155\n", "1228 625\n", "1229 531\n", "1230 478\n", "1231 888\n", "1232 824\n", "1233 918\n", "1234 954\n", "1235 778\n", "1236 449\n", "1237 545\n", "1238 455\n", "1239 42\n", "Name: cmintvw, dtype: int64" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.cmintvw.value_counts().sort_index()" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "118.656790 1\n", "149.179094 1\n", "260.900498 1\n", "267.935135 1\n", "374.737005 1\n", "398.852225 1\n", "411.453026 1\n", "579.500779 1\n", "604.847445 1\n", "610.200501 1\n", "610.638556 1\n", "649.341376 1\n", "727.850012 1\n", "804.935269 1\n", "807.567661 1\n", "944.952181 1\n", "970.180387 1\n", "977.586647 1\n", "1067.636070 1\n", "1093.033956 1\n", "1102.001039 1\n", "1112.184547 1\n", "1131.645848 1\n", "1143.983665 1\n", "1158.805974 1\n", "1238.519553 1\n", "1264.292128 1\n", "1340.710511 1\n", "1354.303784 1\n", "1366.499601 1\n", " ..\n", "50541.818273 1\n", "51702.824860 1\n", "51840.354621 1\n", "52849.068802 1\n", "52882.262360 1\n", "52885.250453 1\n", "53159.806737 1\n", "54130.405297 1\n", "54733.175009 1\n", "56717.972209 1\n", "57623.969745 1\n", "58712.920736 1\n", "59616.730305 1\n", "59955.527127 1\n", "60473.286527 1\n", "60541.339661 1\n", "61959.225611 1\n", "63141.591804 1\n", "63633.129525 1\n", "64180.462924 1\n", "65152.308279 1\n", "65502.800561 1\n", "68375.710204 1\n", "76356.689648 1\n", "76712.967321 1\n", "78196.162962 1\n", "82311.946129 1\n", "89086.582781 1\n", "101214.074562 1\n", "261879.953864 1\n", "Name: finalwgt, dtype: int64" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.finalwgt.value_counts().sort_index()" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "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 }