From 4e9b475c62fe5e053b4ae1ede9985dbe25e50630 Mon Sep 17 00:00:00 2001 From: s223 Date: Mon, 5 Jun 2017 14:11:52 +0900 Subject: [PATCH 01/11] Create TSUTSUMI_SOichiro.ipynb --- TSUTSUMI_Soichiro/TSUTSUMI_SOichiro.ipynb | 1 + 1 file changed, 1 insertion(+) create mode 100644 TSUTSUMI_Soichiro/TSUTSUMI_SOichiro.ipynb diff --git a/TSUTSUMI_Soichiro/TSUTSUMI_SOichiro.ipynb b/TSUTSUMI_Soichiro/TSUTSUMI_SOichiro.ipynb new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/TSUTSUMI_Soichiro/TSUTSUMI_SOichiro.ipynb @@ -0,0 +1 @@ + From 1be72b3c2e146d3d694202b8ae7a937868a17fee Mon Sep 17 00:00:00 2001 From: s223 Date: Mon, 5 Jun 2017 14:12:49 +0900 Subject: [PATCH 02/11] Rename TSUTSUMI_SOichiro.ipynb to TSUTSUMI_Soichiro.ipynb --- .../{TSUTSUMI_SOichiro.ipynb => TSUTSUMI_Soichiro.ipynb} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename TSUTSUMI_Soichiro/{TSUTSUMI_SOichiro.ipynb => TSUTSUMI_Soichiro.ipynb} (100%) diff --git a/TSUTSUMI_Soichiro/TSUTSUMI_SOichiro.ipynb b/TSUTSUMI_Soichiro/TSUTSUMI_Soichiro.ipynb similarity index 100% rename from TSUTSUMI_Soichiro/TSUTSUMI_SOichiro.ipynb rename to TSUTSUMI_Soichiro/TSUTSUMI_Soichiro.ipynb From cf62b6165b93e3cc837c5125a762f2ef1d3dd80a Mon Sep 17 00:00:00 2001 From: s223 Date: Mon, 5 Jun 2017 14:33:36 +0900 Subject: [PATCH 03/11] Create README.md --- TSUTSUMI_Soichiro/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 TSUTSUMI_Soichiro/README.md diff --git a/TSUTSUMI_Soichiro/README.md b/TSUTSUMI_Soichiro/README.md new file mode 100644 index 0000000..54ce68f --- /dev/null +++ b/TSUTSUMI_Soichiro/README.md @@ -0,0 +1,10 @@ +名前: + +大学名: + +専攻: +          +今までの開発経験: +     +中期的な目標: +     From 3888fe0397e72374c858f1fe07ffb10067e39ed7 Mon Sep 17 00:00:00 2001 From: s223 Date: Tue, 6 Jun 2017 02:04:59 +0900 Subject: [PATCH 04/11] Update README.md --- TSUTSUMI_Soichiro/README.md | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/TSUTSUMI_Soichiro/README.md b/TSUTSUMI_Soichiro/README.md index 54ce68f..2687d56 100644 --- a/TSUTSUMI_Soichiro/README.md +++ b/TSUTSUMI_Soichiro/README.md @@ -1,10 +1,20 @@ 名前: - +    堤 創一朗 大学名: - +    東京都市大学 専攻: -          +    情報学 今までの開発経験: -     +    8年前くらいから C,Java,Perl,Python,JavaScriptなどで小さなプログラムをちょこちょこ書いてきました。 +  Perl,Python,JavaScriptではチャットなどのWebアプリケーションや、スクレイピング用のスクリプトを書いたり、 + Javaではアプレットを使って、クリックとドラッグでピエトモンドリアンっぽい絵を生成するアプリケーションを作りました。 +  それからCUIアプリケーションが好きなので、Pythonからcursesライブラリを使って簡単なツールをよく作ります。 + 最近だとC言語で遺伝的アルゴリズムやアプリオリアリゴリズムを実装してみました。 +  機械学習は本を読みながら、例題のコードを参考に試してみている最中です。 中期的な目標: -     +    やりがいを感じている課題がいくつも在るのですが、それらの解決を通じて +    卒論を書くこと +    名刺がわりになるような成果をあげること +  を達成したいです。 +  そのために、機械学習で一体どんなことができて、どんなことはできないのかを見極め、 +  今自分の手で一定の成果をあげられる課題を見つけたいです。 From 96b966dcd2fd43aea14d278bf46c900b31910ee4 Mon Sep 17 00:00:00 2001 From: s223 Date: Tue, 6 Jun 2017 02:13:17 +0900 Subject: [PATCH 05/11] Update README.md --- TSUTSUMI_Soichiro/README.md | 55 +++++++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 20 deletions(-) diff --git a/TSUTSUMI_Soichiro/README.md b/TSUTSUMI_Soichiro/README.md index 2687d56..66e65ec 100644 --- a/TSUTSUMI_Soichiro/README.md +++ b/TSUTSUMI_Soichiro/README.md @@ -1,20 +1,35 @@ -名前: -    堤 創一朗 -大学名: -    東京都市大学 -専攻: -    情報学 -今までの開発経験: -    8年前くらいから C,Java,Perl,Python,JavaScriptなどで小さなプログラムをちょこちょこ書いてきました。 -  Perl,Python,JavaScriptではチャットなどのWebアプリケーションや、スクレイピング用のスクリプトを書いたり、 - Javaではアプレットを使って、クリックとドラッグでピエトモンドリアンっぽい絵を生成するアプリケーションを作りました。 -  それからCUIアプリケーションが好きなので、Pythonからcursesライブラリを使って簡単なツールをよく作ります。 - 最近だとC言語で遺伝的アルゴリズムやアプリオリアリゴリズムを実装してみました。 -  機械学習は本を読みながら、例題のコードを参考に試してみている最中です。 -中期的な目標: -    やりがいを感じている課題がいくつも在るのですが、それらの解決を通じて -    卒論を書くこと -    名刺がわりになるような成果をあげること -  を達成したいです。 -  そのために、機械学習で一体どんなことができて、どんなことはできないのかを見極め、 -  今自分の手で一定の成果をあげられる課題を見つけたいです。 +## 名前: +堤 創一朗 + +## 大学名: +東京都市大学 + +## 専攻: +情報学 + +## 今までの開発経験: +8年前くらいから C,Java,Perl,Python,JavaScriptなどで小さなプログラムをちょこちょこ書いてきました。 + +Perl,Python,JavaScriptではチャットなどのWebアプリケーションや、スクレイピング用のスクリプトを書いたり、 + +Javaではアプレットを使って、クリックとドラッグでピエトモンドリアンっぽい絵を生成するアプリケーションを作りました。 + +それからCUIアプリケーションが好きなので、Pythonからcursesライブラリを使って簡単なツールをよく作ります。 + +最近だとC言語で遺伝的アルゴリズムやアプリオリアリゴリズムを実装してみました。 + +機械学習は本を読みながら、例題のコードを参考に試してみている最中です。 + +## 中期的な目標: + +やりがいを感じている課題がいくつも在るのですが、それらの解決を通じて + +    卒論を書くこと + +    名刺がわりになるような成果をあげること + +を達成したいです。 + +そのために、機械学習で一体どんなことができて、どんなことはできないのかを見極め、 + +今、自分の手で一定の成果をあげられる課題を見つけたいです。 From 7da9873fad213c1609adddc6fbf7c1267ec1ec31 Mon Sep 17 00:00:00 2001 From: s223 Date: Tue, 6 Jun 2017 02:14:21 +0900 Subject: [PATCH 06/11] Add files via upload --- TSUTSUMI_Soichiro/TSUTSUMI_Soichiro.ipynb | 183 +++++++++++++++++++++- 1 file changed, 182 insertions(+), 1 deletion(-) diff --git a/TSUTSUMI_Soichiro/TSUTSUMI_Soichiro.ipynb b/TSUTSUMI_Soichiro/TSUTSUMI_Soichiro.ipynb index 8b13789..db85821 100644 --- a/TSUTSUMI_Soichiro/TSUTSUMI_Soichiro.ipynb +++ b/TSUTSUMI_Soichiro/TSUTSUMI_Soichiro.ipynb @@ -1 +1,182 @@ - +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 38, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]" + ] + }, + "execution_count": 38, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#課題1\n", + "\n", + "#1から11未満の整数のリストnumを作成\n", + "num = list(range(1,11))\n", + "num" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[2, 4, 6, 8, 10]" + ] + }, + "execution_count": 44, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#課題2\n", + "\n", + "#上で作った1〜10の数字を含むリストnumを利用してスライスで、\n", + "#num[1] から順に evenを作成\n", + "even = num[1::2]\n", + "even" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{0: 'a', 1: 'b', 2: 'c', 3: 'd', 4: 'e', 5: 'f'}" + ] + }, + "execution_count": 41, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#課題3\n", + "\n", + "#在る前提のリスト\n", + "atof = [\"a\",\"b\",\"c\",\"d\",\"e\",\"f\"]\n", + "\n", + "#0〜5の整数をキー、前提となるリストのアルファベット一文字づつの文字列を値とする、\n", + "#辞書型のオブジェクトを作成せよという課題だと解釈しました。\n", + "#辞書型の内包表記を使って、リストの値を値とし、\n", + "#そのindexをキーとする辞書型のオブジェクトdを作成\n", + "d = {i:atof[i] for i in range(len(atof))}\n", + "d" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "#課題4\n", + "\n", + "class Human:\n", + " \"\"\"個人につての情報を扱うクラス\"\"\"\n", + " ctr = 0\n", + " def __init__(self, name, year, sex, length, weight):\n", + " \"\"\"\n", + " コンストラクタではインスタンス変数を初期化し、\n", + " 作成したインスタンスの数を数えるクラスメソッド count_instance を呼び出す。\n", + " \"\"\"\n", + " #引数をインスタンス変数に代入\n", + " self.name = name\n", + " self.year = year\n", + " self.sex = sex\n", + " self.length = length\n", + " self.weight = weight\n", + " #作成したインスタンスを作成する。\n", + " Human.count_instance()\n", + " def pass_a_year(self):\n", + " \"\"\"年齢をインクリメントするインスタンスメソッド\"\"\"\n", + " self.year += 1\n", + " @classmethod\n", + " def count_instance(cls):\n", + " \"\"\"作成したインスタンスをカウントするクラスメソッド\"\"\"\n", + " cls.ctr += 1\n", + "yamada = Human(\"山田\", 23, \"M\", 170.3, 60.2)\n", + "takahashi = Human(\"高橋\", 30, \"F\", 165.2, 46.2)\n", + "yamada.pass_a_year()" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "('山田', 24, 'M', 170.3, 60.2)" + ] + }, + "execution_count": 49, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "yamada.name, yamada.year, yamada.sex, yamada.length, yamada.weight" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "('高橋', 30, 'F', 165.2, 46.2)" + ] + }, + "execution_count": 50, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "takahashi.name, takahashi.year, takahashi.sex, takahashi.length, takahashi.weight" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "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.6.1" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} From 25cc27db2e3188adf6ee0ff1f263cd1ca5fc9106 Mon Sep 17 00:00:00 2001 From: s223 Date: Tue, 6 Jun 2017 02:22:03 +0900 Subject: [PATCH 07/11] Add files via upload --- TSUTSUMI_Soichiro/TSUTSUMI_Soichiro.ipynb | 53 +++++++++++++++++------ 1 file changed, 39 insertions(+), 14 deletions(-) diff --git a/TSUTSUMI_Soichiro/TSUTSUMI_Soichiro.ipynb b/TSUTSUMI_Soichiro/TSUTSUMI_Soichiro.ipynb index db85821..699d4d7 100644 --- a/TSUTSUMI_Soichiro/TSUTSUMI_Soichiro.ipynb +++ b/TSUTSUMI_Soichiro/TSUTSUMI_Soichiro.ipynb @@ -81,7 +81,7 @@ }, { "cell_type": "code", - "execution_count": 48, + "execution_count": 2, "metadata": { "collapsed": true }, @@ -92,7 +92,8 @@ "class Human:\n", " \"\"\"個人につての情報を扱うクラス\"\"\"\n", " ctr = 0\n", - " def __init__(self, name, year, sex, length, weight):\n", + " \n", + " def __init__(self, name, year, sex, height, weight):\n", " \"\"\"\n", " コンストラクタではインスタンス変数を初期化し、\n", " 作成したインスタンスの数を数えるクラスメソッド count_instance を呼び出す。\n", @@ -101,60 +102,84 @@ " self.name = name\n", " self.year = year\n", " self.sex = sex\n", - " self.length = length\n", + " self.height = height\n", " self.weight = weight\n", + " \n", " #作成したインスタンスを作成する。\n", " Human.count_instance()\n", + " \n", " def pass_a_year(self):\n", " \"\"\"年齢をインクリメントするインスタンスメソッド\"\"\"\n", " self.year += 1\n", + " \n", " @classmethod\n", " def count_instance(cls):\n", " \"\"\"作成したインスタンスをカウントするクラスメソッド\"\"\"\n", " cls.ctr += 1\n", - "yamada = Human(\"山田\", 23, \"M\", 170.3, 60.2)\n", - "takahashi = Human(\"高橋\", 30, \"F\", 165.2, 46.2)\n", - "yamada.pass_a_year()" + " \n", + "yamada = Human(\"山田\", 23, \"男\", 170.3, 60.2)\n", + "takahashi = Human(\"高橋\", 30, \"女\", 165.2, 46.2)\n" ] }, { "cell_type": "code", - "execution_count": 49, + "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "('山田', 24, 'M', 170.3, 60.2)" + "('山田', 23, '男', 170.3, 60.2)" ] }, - "execution_count": 49, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "yamada.name, yamada.year, yamada.sex, yamada.length, yamada.weight" + "yamada.name, yamada.year, yamada.sex, yamada.height, yamada.weight" ] }, { "cell_type": "code", - "execution_count": 50, + "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "('高橋', 30, 'F', 165.2, 46.2)" + "('高橋', 30, '女', 165.2, 46.2)" ] }, - "execution_count": 50, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "takahashi.name, takahashi.year, takahashi.sex, takahashi.length, takahashi.weight" + "takahashi.name, takahashi.year, takahashi.sex, takahashi.height, takahashi.weight" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "('山田', 24, '男', 170.3, 60.2)" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "yamada.pass_a_year()\n", + "yamada.name, yamada.year, yamada.sex, yamada.height, yamada.weight" ] } ], From 22b0224f10e6bda436594e761f94140a39b6f553 Mon Sep 17 00:00:00 2001 From: s223 Date: Tue, 6 Jun 2017 02:38:43 +0900 Subject: [PATCH 08/11] Add files via upload --- TSUTSUMI_Soichiro/TSUTSUMI_Soichiro.ipynb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/TSUTSUMI_Soichiro/TSUTSUMI_Soichiro.ipynb b/TSUTSUMI_Soichiro/TSUTSUMI_Soichiro.ipynb index 699d4d7..213bf55 100644 --- a/TSUTSUMI_Soichiro/TSUTSUMI_Soichiro.ipynb +++ b/TSUTSUMI_Soichiro/TSUTSUMI_Soichiro.ipynb @@ -93,14 +93,14 @@ " \"\"\"個人につての情報を扱うクラス\"\"\"\n", " ctr = 0\n", " \n", - " def __init__(self, name, year, sex, height, weight):\n", + " def __init__(self, name, age, sex, height, weight):\n", " \"\"\"\n", " コンストラクタではインスタンス変数を初期化し、\n", " 作成したインスタンスの数を数えるクラスメソッド count_instance を呼び出す。\n", " \"\"\"\n", " #引数をインスタンス変数に代入\n", " self.name = name\n", - " self.year = year\n", + " self.age = age\n", " self.sex = sex\n", " self.height = height\n", " self.weight = weight\n", @@ -138,7 +138,7 @@ } ], "source": [ - "yamada.name, yamada.year, yamada.sex, yamada.height, yamada.weight" + "yamada.name, yamada.age, yamada.sex, yamada.height, yamada.weight" ] }, { @@ -158,7 +158,7 @@ } ], "source": [ - "takahashi.name, takahashi.year, takahashi.sex, takahashi.height, takahashi.weight" + "takahashi.name, takahashi.age, takahashi.sex, takahashi.height, takahashi.weight" ] }, { @@ -179,7 +179,7 @@ ], "source": [ "yamada.pass_a_year()\n", - "yamada.name, yamada.year, yamada.sex, yamada.height, yamada.weight" + "yamada.name, yamada.age, yamada.sex, yamada.height, yamada.weight" ] } ], From 95004c4ba983071a86f81528db241eb7b0349d44 Mon Sep 17 00:00:00 2001 From: s223 Date: Wed, 7 Jun 2017 21:31:13 +0900 Subject: [PATCH 09/11] Add files via upload --- TSUTSUMI_Soichiro.ipynb | 265 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 265 insertions(+) create mode 100644 TSUTSUMI_Soichiro.ipynb diff --git a/TSUTSUMI_Soichiro.ipynb b/TSUTSUMI_Soichiro.ipynb new file mode 100644 index 0000000..40bc9e9 --- /dev/null +++ b/TSUTSUMI_Soichiro.ipynb @@ -0,0 +1,265 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#課題1\n", + "\n", + "#1から11未満の整数のリストnumを作成\n", + "num = list(range(1,11))\n", + "num" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[2, 4, 6, 8, 10]" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#課題2\n", + "\n", + "#上で作った1〜10の数字を含むリストnumを利用してスライスで、\n", + "#num[1] から順に evenを作成\n", + "even = num[1::2]\n", + "even" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{0: 'a', 1: 'b', 2: 'c', 3: 'd', 4: 'e', 5: 'f'}" + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#課題3\n", + "\n", + "#在る前提のリスト\n", + "atof = [\"a\",\"b\",\"c\",\"d\",\"e\",\"f\"]\n", + "\n", + "#0〜5の整数をキー、前提となるリストのアルファベット一文字づつの文字列を値とする、\n", + "#辞書型のオブジェクトを作成せよという課題だと解釈しました。\n", + "#辞書型の内包表記を使って、リストの値を値とし、\n", + "#そのindexをキーとする辞書型のオブジェクトdを作成\n", + "d = {i:atof[i] for i in range(len(atof))}\n", + "d" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "#課題4\n", + "\n", + "class Human:\n", + " \"\"\"個人につての情報を扱うクラス\"\"\"\n", + " ctr = 0\n", + " \n", + " def __init__(self, name, age, sex, height, weight):\n", + " \"\"\"\n", + " コンストラクタではインスタンス変数を初期化し、\n", + " 作成したインスタンスの数を数えるクラスメソッド count_instance を呼び出す。\n", + " \"\"\"\n", + " #引数をインスタンス変数に代入\n", + " self.name = name\n", + " self.age = age\n", + " self.sex = sex\n", + " self.height = height\n", + " self.weight = weight\n", + " \n", + " #作成したインスタンスを作成する。\n", + " Human.count_instance()\n", + " \n", + " def pass_a_year(self):\n", + " \"\"\"年齢をインクリメントするインスタンスメソッド\"\"\"\n", + " self.age += 1\n", + " \n", + " @classmethod\n", + " def count_instance(cls):\n", + " \"\"\"作成したインスタンスをカウントするクラスメソッド\"\"\"\n", + " cls.ctr += 1\n", + " \n", + "yamada = Human(\"山田\", 23, \"男\", 170.3, 60.2)\n", + "takahashi = Human(\"高橋\", 30, \"女\", 165.2, 46.2)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "('山田', 23, '男', 170.3, 60.2)" + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "yamada.name, yamada.age, yamada.sex, yamada.height, yamada.weight" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "('高橋', 30, '女', 165.2, 46.2)" + ] + }, + "execution_count": 22, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "takahashi.name, takahashi.age, takahashi.sex, takahashi.height, takahashi.weight" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "('山田', 24, '男', 170.3, 60.2)" + ] + }, + "execution_count": 23, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "yamada.pass_a_year()\n", + "yamada.name, yamada.age, yamada.sex, yamada.height, yamada.weight" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "matrix([[19, 22],\n", + " [43, 50]])" + ] + }, + "execution_count": 24, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#課題5\n", + "import numpy as np\n", + "m1 = np.matrix([[1,2],[3,4]])\n", + "m2 = np.matrix([[5,6],[7,8]])\n", + "np.dot(m1, m2)" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1.4142135623730951" + ] + }, + "execution_count": 25, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#課題6\n", + "v1 = np.array([0,1])\n", + "v2 = np.array([1,1])\n", + "#ベクトルv1とv2がなす角の余弦\n", + "np.dot(v1, v2) / np.linalg.norm(v1) * np.linalg.norm(v2)\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "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.6.1" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} From 8fab154caee84e9ccd91d8aa1c96832141191a50 Mon Sep 17 00:00:00 2001 From: s223 Date: Wed, 7 Jun 2017 21:32:01 +0900 Subject: [PATCH 10/11] Add files via upload --- TSUTSUMI_Soichiro/TSUTSUMI_Soichiro.ipynb | 86 +++++++++++++++++++---- 1 file changed, 72 insertions(+), 14 deletions(-) diff --git a/TSUTSUMI_Soichiro/TSUTSUMI_Soichiro.ipynb b/TSUTSUMI_Soichiro/TSUTSUMI_Soichiro.ipynb index 213bf55..40bc9e9 100644 --- a/TSUTSUMI_Soichiro/TSUTSUMI_Soichiro.ipynb +++ b/TSUTSUMI_Soichiro/TSUTSUMI_Soichiro.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 38, + "execution_count": 17, "metadata": {}, "outputs": [ { @@ -11,7 +11,7 @@ "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]" ] }, - "execution_count": 38, + "execution_count": 17, "metadata": {}, "output_type": "execute_result" } @@ -26,7 +26,7 @@ }, { "cell_type": "code", - "execution_count": 44, + "execution_count": 18, "metadata": {}, "outputs": [ { @@ -35,7 +35,7 @@ "[2, 4, 6, 8, 10]" ] }, - "execution_count": 44, + "execution_count": 18, "metadata": {}, "output_type": "execute_result" } @@ -51,7 +51,7 @@ }, { "cell_type": "code", - "execution_count": 41, + "execution_count": 19, "metadata": {}, "outputs": [ { @@ -60,7 +60,7 @@ "{0: 'a', 1: 'b', 2: 'c', 3: 'd', 4: 'e', 5: 'f'}" ] }, - "execution_count": 41, + "execution_count": 19, "metadata": {}, "output_type": "execute_result" } @@ -81,7 +81,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 20, "metadata": { "collapsed": true }, @@ -110,7 +110,7 @@ " \n", " def pass_a_year(self):\n", " \"\"\"年齢をインクリメントするインスタンスメソッド\"\"\"\n", - " self.year += 1\n", + " self.age += 1\n", " \n", " @classmethod\n", " def count_instance(cls):\n", @@ -123,7 +123,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 21, "metadata": {}, "outputs": [ { @@ -132,7 +132,7 @@ "('山田', 23, '男', 170.3, 60.2)" ] }, - "execution_count": 3, + "execution_count": 21, "metadata": {}, "output_type": "execute_result" } @@ -143,7 +143,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 22, "metadata": {}, "outputs": [ { @@ -152,7 +152,7 @@ "('高橋', 30, '女', 165.2, 46.2)" ] }, - "execution_count": 4, + "execution_count": 22, "metadata": {}, "output_type": "execute_result" } @@ -163,7 +163,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 23, "metadata": {}, "outputs": [ { @@ -172,7 +172,7 @@ "('山田', 24, '男', 170.3, 60.2)" ] }, - "execution_count": 5, + "execution_count": 23, "metadata": {}, "output_type": "execute_result" } @@ -181,6 +181,64 @@ "yamada.pass_a_year()\n", "yamada.name, yamada.age, yamada.sex, yamada.height, yamada.weight" ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "matrix([[19, 22],\n", + " [43, 50]])" + ] + }, + "execution_count": 24, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#課題5\n", + "import numpy as np\n", + "m1 = np.matrix([[1,2],[3,4]])\n", + "m2 = np.matrix([[5,6],[7,8]])\n", + "np.dot(m1, m2)" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1.4142135623730951" + ] + }, + "execution_count": 25, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#課題6\n", + "v1 = np.array([0,1])\n", + "v2 = np.array([1,1])\n", + "#ベクトルv1とv2がなす角の余弦\n", + "np.dot(v1, v2) / np.linalg.norm(v1) * np.linalg.norm(v2)\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] } ], "metadata": { From bdb2e629af5f516d669fec0a98854cb084f4f35c Mon Sep 17 00:00:00 2001 From: s223 Date: Wed, 7 Jun 2017 21:37:28 +0900 Subject: [PATCH 11/11] Delete TSUTSUMI_Soichiro.ipynb --- TSUTSUMI_Soichiro.ipynb | 265 ---------------------------------------- 1 file changed, 265 deletions(-) delete mode 100644 TSUTSUMI_Soichiro.ipynb diff --git a/TSUTSUMI_Soichiro.ipynb b/TSUTSUMI_Soichiro.ipynb deleted file mode 100644 index 40bc9e9..0000000 --- a/TSUTSUMI_Soichiro.ipynb +++ /dev/null @@ -1,265 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 17, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]" - ] - }, - "execution_count": 17, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "#課題1\n", - "\n", - "#1から11未満の整数のリストnumを作成\n", - "num = list(range(1,11))\n", - "num" - ] - }, - { - "cell_type": "code", - "execution_count": 18, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "[2, 4, 6, 8, 10]" - ] - }, - "execution_count": 18, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "#課題2\n", - "\n", - "#上で作った1〜10の数字を含むリストnumを利用してスライスで、\n", - "#num[1] から順に evenを作成\n", - "even = num[1::2]\n", - "even" - ] - }, - { - "cell_type": "code", - "execution_count": 19, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "{0: 'a', 1: 'b', 2: 'c', 3: 'd', 4: 'e', 5: 'f'}" - ] - }, - "execution_count": 19, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "#課題3\n", - "\n", - "#在る前提のリスト\n", - "atof = [\"a\",\"b\",\"c\",\"d\",\"e\",\"f\"]\n", - "\n", - "#0〜5の整数をキー、前提となるリストのアルファベット一文字づつの文字列を値とする、\n", - "#辞書型のオブジェクトを作成せよという課題だと解釈しました。\n", - "#辞書型の内包表記を使って、リストの値を値とし、\n", - "#そのindexをキーとする辞書型のオブジェクトdを作成\n", - "d = {i:atof[i] for i in range(len(atof))}\n", - "d" - ] - }, - { - "cell_type": "code", - "execution_count": 20, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "#課題4\n", - "\n", - "class Human:\n", - " \"\"\"個人につての情報を扱うクラス\"\"\"\n", - " ctr = 0\n", - " \n", - " def __init__(self, name, age, sex, height, weight):\n", - " \"\"\"\n", - " コンストラクタではインスタンス変数を初期化し、\n", - " 作成したインスタンスの数を数えるクラスメソッド count_instance を呼び出す。\n", - " \"\"\"\n", - " #引数をインスタンス変数に代入\n", - " self.name = name\n", - " self.age = age\n", - " self.sex = sex\n", - " self.height = height\n", - " self.weight = weight\n", - " \n", - " #作成したインスタンスを作成する。\n", - " Human.count_instance()\n", - " \n", - " def pass_a_year(self):\n", - " \"\"\"年齢をインクリメントするインスタンスメソッド\"\"\"\n", - " self.age += 1\n", - " \n", - " @classmethod\n", - " def count_instance(cls):\n", - " \"\"\"作成したインスタンスをカウントするクラスメソッド\"\"\"\n", - " cls.ctr += 1\n", - " \n", - "yamada = Human(\"山田\", 23, \"男\", 170.3, 60.2)\n", - "takahashi = Human(\"高橋\", 30, \"女\", 165.2, 46.2)\n" - ] - }, - { - "cell_type": "code", - "execution_count": 21, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "('山田', 23, '男', 170.3, 60.2)" - ] - }, - "execution_count": 21, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "yamada.name, yamada.age, yamada.sex, yamada.height, yamada.weight" - ] - }, - { - "cell_type": "code", - "execution_count": 22, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "('高橋', 30, '女', 165.2, 46.2)" - ] - }, - "execution_count": 22, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "takahashi.name, takahashi.age, takahashi.sex, takahashi.height, takahashi.weight" - ] - }, - { - "cell_type": "code", - "execution_count": 23, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "('山田', 24, '男', 170.3, 60.2)" - ] - }, - "execution_count": 23, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "yamada.pass_a_year()\n", - "yamada.name, yamada.age, yamada.sex, yamada.height, yamada.weight" - ] - }, - { - "cell_type": "code", - "execution_count": 24, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "matrix([[19, 22],\n", - " [43, 50]])" - ] - }, - "execution_count": 24, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "#課題5\n", - "import numpy as np\n", - "m1 = np.matrix([[1,2],[3,4]])\n", - "m2 = np.matrix([[5,6],[7,8]])\n", - "np.dot(m1, m2)" - ] - }, - { - "cell_type": "code", - "execution_count": 25, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "1.4142135623730951" - ] - }, - "execution_count": 25, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "#課題6\n", - "v1 = np.array([0,1])\n", - "v2 = np.array([1,1])\n", - "#ベクトルv1とv2がなす角の余弦\n", - "np.dot(v1, v2) / np.linalg.norm(v1) * np.linalg.norm(v2)\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "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.6.1" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -}