{"cells": [{"cell_type": "markdown", "metadata": {"papermill": {"exception": false, "start_time": "2020-10-29T02:55:11.198106", "end_time": "2020-10-29T02:55:11.211127", "duration": 0.013021, "status": "completed"}, "tags": []}, "source": "# Distributions"}, {"cell_type": "code", "execution_count": 1, "metadata": {"execution": {"iopub.execute_input": "2020-10-29T02:55:11.243122Z", "iopub.status.busy": "2020-10-29T02:55:11.243122Z", "iopub.status.idle": "2020-10-29T02:55:13.619126Z", "shell.execute_reply": "2020-10-29T02:55:13.619126Z"}, "papermill": {"exception": false, "start_time": "2020-10-29T02:55:11.225091", "end_time": "2020-10-29T02:55:13.620127", "duration": 2.395036, "status": "completed"}, "tags": []}, "outputs": [], "source": "import pandas as pd\nimport data_describe as dd"}, {"cell_type": "code", "execution_count": 2, "metadata": {"execution": {"iopub.execute_input": "2020-10-29T02:55:13.649135Z", "iopub.status.busy": "2020-10-29T02:55:13.648128Z", "iopub.status.idle": "2020-10-29T02:55:13.850124Z", "shell.execute_reply": "2020-10-29T02:55:13.849121Z"}, "papermill": {"exception": false, "start_time": "2020-10-29T02:55:13.630094", "end_time": "2020-10-29T02:55:13.850124", "duration": 0.22003, "status": "completed"}, "tags": []}, "outputs": [], "source": "from sklearn.datasets import load_boston\ndata = load_boston()\ndf = pd.DataFrame(data.data, columns=list(data.feature_names))\ndf['target'] = data.target\n\n# Create categorical (bin) features to demonstrate count plots\ndf['AGE'] = df['AGE'].map(lambda x: \"young\" if x < 29 else \"old\")\ndf['CRIM'] = df['CRIM'].map(lambda x: \"low\" if x < df.CRIM.median() else \"high\")"}, {"cell_type": "code", "execution_count": 3, "metadata": {"execution": {"iopub.execute_input": "2020-10-29T02:55:13.888092Z", "iopub.status.busy": "2020-10-29T02:55:13.887095Z", "iopub.status.idle": "2020-10-29T02:55:13.903120Z", "shell.execute_reply": "2020-10-29T02:55:13.902092Z"}, "papermill": {"exception": false, "start_time": "2020-10-29T02:55:13.861120", "end_time": "2020-10-29T02:55:13.903120", "duration": 0.042, "status": "completed"}, "tags": []}, "outputs": [{"output_type": "execute_result", "metadata": {}, "data": {"text/plain": " CRIM ZN INDUS CHAS NOX RM AGE DIS RAD TAX PTRATIO \\\n0 low 18.0 2.31 0.0 0.538 6.575 old 4.0900 1.0 296.0 15.3 \n1 low 0.0 7.07 0.0 0.469 6.421 old 4.9671 2.0 242.0 17.8 \n\n B LSTAT target \n0 396.9 4.98 24.0 \n1 396.9 9.14 21.6 ", "text/html": "
\n | CRIM | \nZN | \nINDUS | \nCHAS | \nNOX | \nRM | \nAGE | \nDIS | \nRAD | \nTAX | \nPTRATIO | \nB | \nLSTAT | \ntarget | \n
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \nlow | \n18.0 | \n2.31 | \n0.0 | \n0.538 | \n6.575 | \nold | \n4.0900 | \n1.0 | \n296.0 | \n15.3 | \n396.9 | \n4.98 | \n24.0 | \n
1 | \nlow | \n0.0 | \n7.07 | \n0.0 | \n0.469 | \n6.421 | \nold | \n4.9671 | \n2.0 | \n242.0 | \n17.8 | \n396.9 | \n9.14 | \n21.6 | \n