1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"id": "daa13044",
"metadata": {
"id": "daa13044",
"outputId": "4d440aaa-1ee7-4771-c526-f55e9458ca8a",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 614
},
"ExecuteTime": {
"end_time": "2024-02-16T00:28:29.748265Z",
"start_time": "2024-02-16T00:28:29.708379Z"
}
},
"outputs": [
{
"data": {
"text/plain": " Timestamp What gender do you identify as? \\\n0 2/9/2024 20:12:14 Male \n1 2/9/2024 20:16:34 Female \n2 2/9/2024 20:18:55 Female \n3 2/9/2024 20:24:00 Male \n4 2/9/2024 20:26:16 Male \n.. ... ... \n255 2/14/2024 19:46:28 Male \n256 2/15/2024 0:28:38 Male \n257 2/15/2024 8:33:45 Male \n258 2/15/2024 16:10:40 Female \n259 2/15/2024 16:14:11 Female \n\n Who do you live with? How many people live in your household? \n0 Neither 6 \n1 Both 4 \n2 Friends 4 \n3 Neither 1 \n4 Neither 1 \n.. ... ... \n255 Friends 5 \n256 Family North District 4 bed 2 bath \n257 Family 9 \n258 Family 4 \n259 Friends 3 (room), 8 (hall), ~70 (building) \n\n[260 rows x 4 columns]",
"text/html": "<div>\n<style scoped>\n .dataframe tbody tr th:only-of-type {\n vertical-align: middle;\n }\n\n .dataframe tbody tr th {\n vertical-align: top;\n }\n\n .dataframe thead th {\n text-align: right;\n }\n</style>\n<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: right;\">\n <th></th>\n <th>Timestamp</th>\n <th>What gender do you identify as?</th>\n <th>Who do you live with?</th>\n <th>How many people live in your household?</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>0</th>\n <td>2/9/2024 20:12:14</td>\n <td>Male</td>\n <td>Neither</td>\n <td>6</td>\n </tr>\n <tr>\n <th>1</th>\n <td>2/9/2024 20:16:34</td>\n <td>Female</td>\n <td>Both</td>\n <td>4</td>\n </tr>\n <tr>\n <th>2</th>\n <td>2/9/2024 20:18:55</td>\n <td>Female</td>\n <td>Friends</td>\n <td>4</td>\n </tr>\n <tr>\n <th>3</th>\n <td>2/9/2024 20:24:00</td>\n <td>Male</td>\n <td>Neither</td>\n <td>1</td>\n </tr>\n <tr>\n <th>4</th>\n <td>2/9/2024 20:26:16</td>\n <td>Male</td>\n <td>Neither</td>\n <td>1</td>\n </tr>\n <tr>\n <th>...</th>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n </tr>\n <tr>\n <th>255</th>\n <td>2/14/2024 19:46:28</td>\n <td>Male</td>\n <td>Friends</td>\n <td>5</td>\n </tr>\n <tr>\n <th>256</th>\n <td>2/15/2024 0:28:38</td>\n <td>Male</td>\n <td>Family</td>\n <td>North District 4 bed 2 bath</td>\n </tr>\n <tr>\n <th>257</th>\n <td>2/15/2024 8:33:45</td>\n <td>Male</td>\n <td>Family</td>\n <td>9</td>\n </tr>\n <tr>\n <th>258</th>\n <td>2/15/2024 16:10:40</td>\n <td>Female</td>\n <td>Family</td>\n <td>4</td>\n </tr>\n <tr>\n <th>259</th>\n <td>2/15/2024 16:14:11</td>\n <td>Female</td>\n <td>Friends</td>\n <td>3 (room), 8 (hall), ~70 (building)</td>\n </tr>\n </tbody>\n</table>\n<p>260 rows × 4 columns</p>\n</div>"
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"%matplotlib inline\n",
"import pandas as pd\n",
"import numpy as np\n",
"\n",
"df = pd.read_csv(\"data.csv\")\n",
"#df\n",
"df2 = df.iloc[:, [0, 5, 7, 9]]\n",
"df2"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "29889175",
"metadata": {
"id": "29889175"
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"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.11.5"
},
"colab": {
"provenance": []
}
},
"nbformat": 4,
"nbformat_minor": 5
}
|