Python ( ) Anaconda 2 3 Python Python IDLE Python NumPy 6 5 matpl

Similar documents
Python (Anaconda ) Anaconda 2 3 Python Python IDLE Python NumPy 6

1 matplotlib matplotlib Python matplotlib numpy matplotlib Installing A 2 pyplot matplotlib 1 matplotlib.pyplot matplotlib.pyplot plt import import nu

Visual Python, Numpy, Matplotlib

Visual Python, Numpy, Matplotlib

Anaconda x86_64 版バージョン の インストールとパッケージの追加 最終更新 : 2018 年 2 月 10 日 URL: Anaconda は,Py

たのしいプログラミング Pythonではじめよう!

2.2 Sage I 11 factor Sage Sage exit quit 1 sage : exit 2 Exiting Sage ( CPU time 0m0.06s, Wall time 2m8.71 s). 2.2 Sage Python Sage 1. Sage.sage 2. sa

2 I I / 61

ユレシス社アプリケ-ション

Ipython Notebook の紹介

nakao

quattro.PDF

JNOD32OPE_1.book

Python による科学技術計算の概要

MRS-series File Manager

Sage for Mathematics : a Primer ‚æ1Łfl - Sage ‡ð™m‡é

Python Speed Learning

untitled

untitled

GNU Emacs GNU Emacs

Actual ESS Adapterの使用について

2 1 Mathematica Mathematica Mathematica Mathematica Windows Mac * Mathematica 9-1 Expand[(x + y)^7] (x + y) 7 x y Shift *1 Mathematica 1.12

4 (TA:, ) 2018 (Ver2.2) Python Python anaconda hello world

MAP2496.PDF

Cleaner XL 1.5 クイックインストールガイド

Python を用いた人工衛星 (MODIS) データの解析手引書 担当 : 植山雅仁 1. 新規プロジェクトの立ち上げと準備 Jupyter Notebook を立ち上げる Hello World! という文字が表示されるプログラムを実行する >> print('hello World!') [C

programmingII2019-v01

Copyright 2008 QSR International Pty Ltd. ABN All rights reserved. NVivo QSR ( ) QSR International Pty Ltd. Microsoft.NET SQL Server W

BIT -2-

X Window System X X &

LSM5Pascal Ver 3.2 GFP 4D Image VisArt Carl Zeiss Co.,Ltd.

Nios II 簡易チュートリアル

Rによる計量分析:データ解析と可視化 - 第2回 セットアップ

Q&A目次.PDF

<4D F736F F D B B83578B6594BB2D834A836F815B82D082C88C60202E646F63>

Configuring_01

untitled

LiveCode初心者開発入門サンプル

TeraTerm Pro V.2.32の利用法

C-720 Ultra Zoom 取扱説明書

情報活用資料

HD でブロードキャストするための Adobe Media Live Encoder のインストールおよび設定方法 Adobe Media Live Encoder のダウンロード : 手順 1 へ行く 画面下にある Downlo

Microsoft Word - GPM_read_program_guide_forPython_V5.1.docx

1 I EViews View Proc Freeze

Microsoft Word - PrivateAccess_UM.docx

Anaconda (2019/7/3)

HP ThinUpdateを使用したWESシンクライアントイメージリストア手順書

: Shift-Return evaluate 2.3 Sage? Shift-Return abs 2 abs? 2: abs 3: fac

13 Student Software TI-Nspire CX CAS TI Web TI-Nspire CX CAS Student Software ( ) 1 Student Software 37 Student Software Nspire Nspire Nspir

SHOBI_Portal_Manual

チュートリアル XP Embedded 入門編

8-7th

Debian での数学ことはじめ。 - gnuplot, Octave, R 入門

help gem gem gem my help

Rの基本操作

Android Studioセットアップガイド

2 3


Gmech08.dvi

Python Speed Learning

フリーセルプロの使い方

PYTHON 資料 電脳梁山泊烏賊塾 PYTHON 入門 ダウンロードとインストール ダウンロード 下記のサイトより最新版 (Python 年 8 月 13 日現在 ) のインストーラ (Windows x86-64 executable installer) をダウンロードす

Microsoft Word - PSB導入ガイド_ docx

Python (2) 1 (random number) MVP[1] MCNP[2] Python 1. π Python Python (random number generator) ( ) (pseudorandom number) Lehmer (l

untitled

untitled


ドライバインストールガイド

 

Add-onアプリケーション開発 - 環境構築マニュアル -

自動シャットタ<3099>ウンクイックインストールカ<3099>イト<3099>.indb

28 TCG SURF Card recognition using SURF in TCG play video

¥¤¥ó¥¿¡¼¥Í¥Ã¥È·×¬¤È¥Ç¡¼¥¿²òÀÏ Âè2²ó

ActivKey v3.0 ActivKey v3.0 ActivKey v Copyright KDDI Corporation All Rights Reserved. 1/37

Transcription:

Python ( ) 2017. 11. 21. 1 1 2 Anaconda 2 3 Python 3 3.1 Python.......................... 3 3.2 IDLE Python....................... 5 4 NumPy 6 5 matplotlib 7 5.1.................................. 7 5.2.................................. 7 5.3...................... 9 6 Scipy 11 7 Sympy 12 7.1 Sympy.................................... 12 7.2 Sympy................................... 12 8 scikit-learn 14 A Anaconda 15 A.1 Python.................................. 15 A.2............................. 15 1 Anaconda( ) Python 1 Windows PC Mac OS Linux Anaconda 1 Python( ): http://www.python.jp/ 1

2 Anaconda Anaconda 2 ( ) (numpy, matplotlib, scipy, scikit-learn ) Anaconda python3 64bit PC 64bit 32bit 1. Anadonda https://www.continuum.io/downloads Windows Python 3 64bit NO THANKS 2. (400MB ) 3. ( ) Anaconda3-x.x.x-Windows_x86_64.exe ( x 4. Setup Next, I Agree( ), Next(Just Me ) 5. ( ) Destination Folder( ) C:\Anaconda3 ( or 2 ) C 6. Advanced Options 2 Install 7. Completed Next, Finish 8. Anaconda3 (64-bit) Anaconda IPython Jupyter Spyder 2 Anaconda python windows 2

3 Python Python OS 3.1 Python PC Windows python python Python C:\Anaconda3 python python python 1: Python Enter >>> print("hello") Hello Python 2: Enter 3

>>> exit() Enter 4

3.2 IDLE Python IDLE PC Windows idle idle Python C:\Anaconda3\Script python idle IDLE python 3: IDLE File New File Python sample 1.py print("hello") File Save Save as 4: Run Run Module IDLE Hello 5: 5

4 NumPy NumPy 3 IDLE Python (Sec. 3.2 ) π >>> import numpy >>> numpy.pi 6: 3 NumPy( ):http://www.numpy.org/ 6

5 matplotlib 5.1 matplotlib 4 IDLE Python (Sec. 3.2 ) File New File Python sample test.py import numpy as np import matplotlib.pyplot as plt x=np.arange(-3,3,0.1) y= np.sin(x) plt.plot(x,y) plt.show() Run Run Module 7: ( ) 5.2 Python sample 2.py from pylab import * subplot(111, axisbg= darkslategray ) #subplot(111, axisbg #ababab ) t = arange(0.0, 2.0, 0.01) s = sin(2*pi*t) plot(t, s, y ) xlabel( time (s), color= r ) ylabel( voltage (mv), color= 0.5 ) # grayscale color title( About as silly as it gets, folks, color= #afeeee ) show() 4 matplotlib( ) http://matplotlib.org/ 7

[1] sample_2.py sample 2.py Run Run Module 8: 5 5 http://matplotlib.org/gallery.html 8

5.3 ( ) 1 1.1 2 1.2 3 1.6 1 x 2 y [1] plot_graph_data.txt import matplotlib.pyplot as plt x=[] y=[] fp = open( plot_graph_data.txt, r ) for i, line in enumerate(fp): data=line.split() x.append(data[0]) y.append(data[1]) plt.plot(x,y, ro ) # red circle plt.title( My graph ) plt.xlabel( time (s) ) plt.ylabel( hight (m) ) plt.text(1.2, 1.2, Hello Hello, rotation=45) plt.xlim(0.0, 4.0) plt.ylim(0.0, 2.0) plt.show() [1] plot_graph.py 9: 9

plt.title( My graph ) 10

6 Scipy Scipy 6 IDLE Python (Sec. 3.2 ) π >>> import scipy >>> scipy.pi 10: 6 Scipy.org( ): http://www.scipy.org/ 11

7 Sympy 7.1 Sympy Sympy 7 IDLE Python (Sec. 3.2 ) π >>> from sympy import * >>> pi.evalf() 3.14159265358979 7.2 Sympy sympy Maxima Scipy Lecture Note Sec. 3.2 Sympy : Python 8 1( ) (1/2) + (1/3) = (5/6) >>> a = Rational(1,2) >>> b = Rational(1,3) >>> a+b 5/6 2( ) (x + y) 2 = x 2 + 2xy + y 2 >>> x = Symbol( x ) >>> y = Symbol( y ) >>> expand((x+y)**2) x**2 + 2*x*y + y**2 3( ) >>> x = Symbol( x ) >>> diff(x**2,x) 2*x 4( ) >>> x = Symbol( x ) >>> integrate(x**2, (x,0,1)) 1/3 5( ) x 2 1 = 0 7 Sympy( ): http://www.sympy.org/ 8 http://www.turbare.net/transl/scipy-lecture-notes/packages/sympy.html 12

>>> x = Symbol( x ) >>> solve(x**2-1) [-1, 1] 13

8 scikit-learn ( ) scikit-learn 9 IDLE Python (Sec. 3.2 ) >>> import sklearn scikit-learn [1] sample 4.py ( ) import numpy as np import matplotlib.pyplot as plt from sklearn.linear_model import LinearRegression # create samples sample_size = 30 err_sigma = 0.1 x = np.random.rand(sample_size, 1) err = err_sigma * np.random.randn(sample_size, 1) y = 3 * x + 1 + err # train a linear regression model regr = LinearRegression () regr.fit(x, y) # make predictions xt = np.linspace (0.0, 1.0, num = 1000).reshape((1000, 1)) yt = regr.predict (xt) # plot samples and regression result plt.plot(x, y, o ) plt.plot(xt, yt) plt.show() scikit-learn 11: 9 scikit learn( ): http://scikit-learn.org 14

A Anaconda Python Python2.7 Anaconda (Sec. 2) A.1 Python 1. Python https://www.python.org/downloads/windows/ Python 2.7 (2.7.x) Windows x86 MSI installer 2. ( ) python-2.7.x.msi ( x 3. (R) C:\Python2 C 4. Python (Sec. 3) A.2 NumPy, Scipy, matplotlib, scikit-learn 15

[1] http://www.damp.tottori-u.ac.jp/~hoshi/py.html 16