Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
226 changes: 226 additions & 0 deletions Tatsuki_Koga/.ipynb_checkpoints/Tatsuki_Koga-checkpoint.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# 課題1"
]
},
{
"cell_type": "code",
"execution_count": 44,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]"
]
},
"execution_count": 44,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"list(range(1,11))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# 課題2"
]
},
{
"cell_type": "code",
"execution_count": 43,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"[2, 4, 6, 8, 10]"
]
},
"execution_count": 43,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"list(range(2,11,2))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# 課題3"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"{0: 'a', 1: 'b', 2: 'c', 3: 'd', 4: 'e', 5: 'f'}"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"alph_list = [\"a\",\"b\",\"c\",\"d\",\"e\",\"f\"]\n",
"dict(enumerate(alph_list))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# 課題4"
]
},
{
"cell_type": "code",
"execution_count": 37,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"名前: 山田, 年齢: 23歳, 性別: 男, 身長: 170.3cm, 体重: 60.2kg\n",
"名前: 高橋, 年齢: 30歳, 性別: 女, 身長: 165.2cm, 体重: 46.2kg\n",
"名前: 山田, 年齢: 24歳, 性別: 男, 身長: 170.3cm, 体重: 60.2kg\n",
"2\n"
]
}
],
"source": [
"instance_count = 0\n",
"class Human:\n",
" def __init__(self, name, age, sex, height, weight):\n",
" self.name = name\n",
" self.age = age\n",
" self.sex = sex\n",
" self.height = height\n",
" self.weight = weight\n",
" global instance_count\n",
" instance_count += 1\n",
" \n",
" def __str__(self):\n",
" return '名前: %s, 年齢: %d歳, 性別: %s, 身長: %.1fcm, 体重: %.1fkg' %(self.name,self.age,self.sex,self.height,self.weight)\n",
" \n",
" def inc_age(self):\n",
" self.age += 1\n",
" \n",
" def instance_count(self):\n",
" return count\n",
" \n",
"\n",
"# インスタンスの作成\n",
"yamada = Human('山田', 23, '男', 170.3, 60.2)\n",
"takahashi = Human(\"高橋\", 30, '女', 165.2, 46.2)\n",
"print(yamada)\n",
"print(takahashi)\n",
"# 年齢をインクリメント\n",
"yamada.inc_age()\n",
"print(yamada)\n",
"# インスタンスをカウントした結果\n",
"print(instance_count)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# 課題5"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import numpy as np\n",
"a = np.array([[1,2,3],[4,5,6]])\n",
"b = np.array([1,1,1])\n",
"np.matmul(a,b.T)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# 課題6"
]
},
{
"cell_type": "code",
"execution_count": 52,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"0.96886393162696616"
]
},
"execution_count": 52,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import numpy as np\n",
"a = np.array([1,2,3,4])\n",
"b = np.array([5,6,7,8])\n",
"np.matmul(a,b.T) / (np.linalg.norm(a)*np.linalg.norm(b))"
]
}
],
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Python [conda root]",
"language": "python",
"name": "conda-root-py"
},
"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.2"
}
},
"nbformat": 4,
"nbformat_minor": 1
}
5 changes: 5 additions & 0 deletions Tatsuki_Koga/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
名前: 古賀樹
大学名: 東京大学
専攻: 現在教養学部のためなし
今までの開発経験: iOSアプリ開発、Pythonでの機械学習、Deep Learningの実装、GoでのWebアプリバックエンド開発
中期的な目標: サービスに機械学習、Deep Learningを組み込むこと
Loading