From d48926d377a11a861088b4de7ba79df7ae538be3 Mon Sep 17 00:00:00 2001 From: Shaun Verch Date: Wed, 12 Jan 2022 17:36:06 -0500 Subject: [PATCH] Added examples of what this type is It's not pd.nan. --- .../notebooks/float-to-int-missing-data.ipynb | 125 +++++++++++++++--- 1 file changed, 110 insertions(+), 15 deletions(-) diff --git a/data/data-pipeline/notebooks/float-to-int-missing-data.ipynb b/data/data-pipeline/notebooks/float-to-int-missing-data.ipynb index b493c4e2..fa5529d4 100644 --- a/data/data-pipeline/notebooks/float-to-int-missing-data.ipynb +++ b/data/data-pipeline/notebooks/float-to-int-missing-data.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 18, + "execution_count": 2, "id": "cd5233fd-8ace-43c8-98c0-7db75447d7d9", "metadata": {}, "outputs": [], @@ -13,7 +13,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 3, "id": "1e478534-dabf-4f6d-a9fd-9553c2c3ad5c", "metadata": {}, "outputs": [], @@ -25,7 +25,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 4, "id": "88d362e7-d0e6-4ac8-9795-6db75f367099", "metadata": {}, "outputs": [ @@ -92,7 +92,7 @@ "d NaN NaN NaN" ] }, - "execution_count": 20, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -103,7 +103,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 5, "id": "b63a77da-3ede-4997-a374-10cb74d93df5", "metadata": {}, "outputs": [ @@ -170,7 +170,7 @@ "d NaN NaN" ] }, - "execution_count": 21, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -182,33 +182,128 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 11, "id": "99958e76-edcf-4e3e-aee8-2bfd3c1213d6", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "a 1\n", - "b 1\n", - "c 1\n", - "d \n", - "Name: X, dtype: Int64" + "True" ] }, - "execution_count": 22, + "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "df[\"X\"]" + "df[\"X\"][\"d\"] is pd.NA" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "id": "029f3277-af92-48b6-83bf-7dd16bbbec40", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df[\"X\"][\"c\"] is pd.NA" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "id": "b111b0dc-efe5-4a0c-95b7-e29108c43432", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
XYZ
a12.03.0
b12.03.0
c12.03.0
d00.00.0
\n", + "
" + ], + "text/plain": [ + " X Y Z\n", + "a 1 2.0 3.0\n", + "b 1 2.0 3.0\n", + "c 1 2.0 3.0\n", + "d 0 0.0 0.0" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df.fillna(0)" ] }, { "cell_type": "code", "execution_count": null, - "id": "029f3277-af92-48b6-83bf-7dd16bbbec40", + "id": "bb796b5f-37b4-4ea8-9d79-54157bfadce4", "metadata": {}, "outputs": [], "source": []