Skip to content

Commit ab170fe

Browse files
committed
notebook
1 parent 063f116 commit ab170fe

3 files changed

+448
-5
lines changed

Lecture07_Sub_Pandas.ipynb

+135
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# Quiz 1"
8+
]
9+
},
10+
{
11+
"cell_type": "markdown",
12+
"metadata": {},
13+
"source": [
14+
"### 1. 데이터 셋을 아래의 주소에서 읽어온다.\n",
15+
"https://raw.githubusercontent.com/justmarkham/DAT8/master/data/u.user"
16+
]
17+
},
18+
{
19+
"cell_type": "code",
20+
"execution_count": 3,
21+
"metadata": {},
22+
"outputs": [],
23+
"source": [
24+
"import pandas as pd\n",
25+
"users = pd.read_table('https://raw.githubusercontent.com/justmarkham/DAT8/master/data/u.user', \n",
26+
" sep='|', index_col='user_id')"
27+
]
28+
},
29+
{
30+
"cell_type": "markdown",
31+
"metadata": {},
32+
"source": [
33+
"### 2. 25 entries 까지 읽어온다."
34+
]
35+
},
36+
{
37+
"cell_type": "markdown",
38+
"metadata": {},
39+
"source": [
40+
"### 3. column 이름은 무엇인가?"
41+
]
42+
},
43+
{
44+
"cell_type": "markdown",
45+
"metadata": {},
46+
"source": [
47+
"### 4. users dataframe의 모든 column을 통계적으로 요약하여라."
48+
]
49+
},
50+
{
51+
"cell_type": "markdown",
52+
"metadata": {},
53+
"source": [
54+
"### 5. occupation(직업)별 평균 나이(age)는? "
55+
]
56+
},
57+
{
58+
"cell_type": "markdown",
59+
"metadata": {},
60+
"source": [
61+
"### 6. occupation(직업)별로, 나이(age)의 최소값, 최대값을 구하여라."
62+
]
63+
},
64+
{
65+
"cell_type": "markdown",
66+
"metadata": {},
67+
"source": [
68+
"### 7. 직업(occupation)과 성별(gender)에 따른 평균 나이(age)를 구하여라. "
69+
]
70+
},
71+
{
72+
"cell_type": "markdown",
73+
"metadata": {},
74+
"source": [
75+
"# Quiz 2"
76+
]
77+
},
78+
{
79+
"cell_type": "markdown",
80+
"metadata": {},
81+
"source": [
82+
"### 1. 아래의 Series 3개를 생성하라.\n",
83+
" - 1 ~ 4(4포함)에서 임의의 정수를 100개를 data로 가지고 있는 s1\n",
84+
" - 1 ~ 3(3포함)에서 임의의 정수를 100개를 data로 가지고 있는 s2\n",
85+
" - 10000 ~ 30000(30000포함)에서 임의의 정수를 100개를 data로 가지고 있는 s3"
86+
]
87+
},
88+
{
89+
"cell_type": "markdown",
90+
"metadata": {},
91+
"source": [
92+
"### 2. 3개의 Series를 컬럼으로 가지는 DataFrame을 생성하라.\n",
93+
" - column의 이름은 각각\n",
94+
" - beds\n",
95+
" - baths\n",
96+
" - price_per_meter"
97+
]
98+
},
99+
{
100+
"cell_type": "markdown",
101+
"metadata": {},
102+
"source": [
103+
"### 3. 3개의 column을 합친 후, 1개의 column을 가진 DataFrame을 생성하라. (Series가 아닌 DataFrame)"
104+
]
105+
},
106+
{
107+
"cell_type": "markdown",
108+
"metadata": {},
109+
"source": [
110+
"### 4. 위에서 생성한 dataframe의 index는 0~99 가 3번 등장한다. 0~299로 변경하여라."
111+
]
112+
}
113+
],
114+
"metadata": {
115+
"kernelspec": {
116+
"display_name": "Python 3",
117+
"language": "python",
118+
"name": "python3"
119+
},
120+
"language_info": {
121+
"codemirror_mode": {
122+
"name": "ipython",
123+
"version": 3
124+
},
125+
"file_extension": ".py",
126+
"mimetype": "text/x-python",
127+
"name": "python",
128+
"nbconvert_exporter": "python",
129+
"pygments_lexer": "ipython3",
130+
"version": "3.6.6"
131+
}
132+
},
133+
"nbformat": 4,
134+
"nbformat_minor": 1
135+
}

0 commit comments

Comments
 (0)