SlideShare a Scribd company logo
1 of 14
9/25の続き
環境情報学部4年 たんたん
9月25日の続き
• macの人はpyenvが正常に機
能していると思います。
• windowsの人はAnacondaを
インストールできたと思いま
す。
• ここまでできてない人は
tantanまで連絡ください。
• 次のページから当日終わらな
かった部分を実行してくださ
い。
Macの人がやること
• 2つのコマンドを叩いて結果の番号を覚える。
$ python –V {python(space)-V(大文字)}
python2.7.X →①
Python3.X.X :: anaconda3-X.X.X(x86_64) →②
$ pyenv version {pyenv(space)version}
system(XXXXXXXXXXX) →③
anaconda3-X.X.X →④
※これ以外の反応だったらtantanまで連絡すること
• ①③ → ★ pyenvが入ってanacondaが入ってない
• ①④ → ◆ anacondaが入って、動かす状態でない
• ②③ → tantanまで連絡を入れること
• ②④ → ● 正常にjupyterが動作する。
上から順番にマークがついたもの
を実行
• ★
$pyenv install anaconda3-3.4.0
• ★,◆
$pyenv global anaconda3-X.X.X
(④で確認したもの)
• ★,◆,●
• $jupyter notebook
• これでwebページが開かなかっ
たらtantanまで連絡すること
Windowsの人がやること
• 以下のコマンドを叩く
• >jupyter notebook
10秒くらいしてwebペー
ジが表示されたらOK
webページが表示されな
かったらtantanに連絡す
ること
Jupyter[ipython]を開く
• Mac
1. ターミナルを開く
2. jupyterを開きたいフォルダ
に移動
3. “jupyter notebook”と叩く
• Windows
1. コマンドプロンプトを開く
2. jupyterを開きたいフォルダ
に移動
3. “jupyter notebook”と叩く
• その他
1. スタート画面からjupyterを
選択して開く。
Jupyerで書いてみる
開きかた
1. 開きたいフォルダ
(home/desktop/
XX)まで行く
2. New→NotebooksP
ython 3
閉じ方
1. webタブとターミ
ナルを消す。
Jupyter で書いてみる
基本的なコマンド
• Enter → 改行
• Shift + Enter →実行
• Alt + Enter → 枠追加
下線を入力してください
in[1]: 3*6
Out[1]: 18
in[2]: a = 2
b = a
in[3]: b
Out[3]: 2
計算ができる
変数が書ける
変数を持ち越せる
返す値がない場合
返り値はない
Jupyter で書いてみる
• コマンドモード(ペンが消えた
状態)で”h”を押すとショート
カットが出てくる
• Untitledの名前を変えよう
• Untitledクリックで変えられる
• 基本的に実行の度に保存され
る
※jupyterを開く時、〇〇.ipynb
はファイルを直接選んでも開か
ない
宿題(~10/16)
• FizzBuzz 301まで実装
• 1~301までの数字を順次出力
• 3の倍数で,“Fizz”5の倍数で”Buzz”,3
かつ5の倍数で”FizzBuzz”と出力
• Jupyterで16日に見せてください
• paizaでCランク以上になる
• https://paiza.jp/challenges/info
• Python3で書いてください
目標
コード書くことに慣れる
for文を書けるようにする
参考:paiza 標準入力・出力方法
• 入力方法が難しい
• http://codegeekboy.hateblo.
jp/entry/paiza-input-
python3
• 一行に複数の値を含む問題は
捨てるのがpoint
• 出力方法はprint(変数)
• 10月16日からはCランク程度
のコードを辞書があれば書け
るという前提で話を進めます。
• プログラミングは自分で入
力・検索・経験しないと、書
けるようになりません。
• メディアにたくさん本がある
ので借りて学ぶと良いです。
おすすめ勉強サイト
• https://tech-
camp.in/note/231/
(勉強できるサイトのまとめ)
• Pythonスタートブック
• データサイエンティスト養成
読本シリーズ
条件
• 2014年以降に発売
• Python3であること
• Jupyterのことが載っていると
なお良い
おすすめ勉強本
Macの人のコマンドの例
• tan:~ tan$ pyenv version
system(…………)
• tan:~ tan$ pyenv install anaconda3-4.4.0
Downloading Anaconda3-4.4.0-MacOSX-x86_64.sh...->
https://repo.continuum.io/archive/Anaconda3-4.4.0-MacOSX-x86_64.shInstalling Anaconda3-4.4.0-
MacOSX-x86_64...Installed Anaconda3-4.4.0-MacOSX-x86_64 to /Users/名前
/.pyenv/versions/anaconda3-4.4.0
• tan:~ tan$ pyenv global anaconda3-4.4.0
• tan:~ tan$ python –V
Python 3.6.1 :: Anaconda 4.4.0 (x86_64)
• tan:~ tan$ jupyter notebook
[I 18:41:13.557 NotebookApp] Writing notebook server cookie secret to /Users/hoge
[I 18:41:13.587 NotebookApp] Serving notebooks from local directory: /Users/hoge
[I 18:41:13.587 NotebookApp] 0 active kernels
[I 18:41:13.587 NotebookApp] The Jupyter Notebook is running at:
http://localhost:8888/?token=hogehoge
[I 18:41:13.587 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to
skip confirmation).
[C 18:41:13.591 NotebookApp] Copy/paste this URL into your browser when you connect for
the first time, to login with a token: http://localhost:8888/?token=hogehoge
[I 18:41:14.335 NotebookApp] Accepting one-time-token-authenticated connection from ::1
[I 18:41:36.566 NotebookApp] Creating new notebook in /Desktop/hoge
つまったら調べるコツ
• 1年以上前の話は基本信じな
いこと
• 特に2013年より前の情報は参
考にしない。Python2の話に
なっている。
具体的な方法
1. エラー値 をコピペ検索
2. 分解して何がしたいかをま
とめる
3. 現状の範囲でもっとインス
トールさせることはない。
インストールを求めて来た
らそれは危ないサイト。
2日目の予定(10/16)
• 3日目で使うデータの整形
• csvファイルの操作方法
• pandas(Excel拡張)
• matplotlib+seaborn(視覚化)
話したいこと
• データサイズ
• データ形式
• csv
• JSON
• オープンデータ

More Related Content

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

170930 厳研プログラ2