「Python」の版間の差分
提供: MacWiki
行1: | 行1: | ||
== Pythonとは? == | == Pythonとは? == | ||
スクリプト言語の1つ。([[MacOSX|Mac OS X]] に標準搭載されている。) | スクリプト言語の1つ。([[MacOSX|Mac OS X]] に標準搭載されている。) | ||
− | * | + | * 豊富なライブラリモジュールが魅力? |
詳しい情報は, | 詳しい情報は, | ||
行14: | 行14: | ||
== インストール == | == インストール == | ||
− | * | + | *python本体とモジュールの整合に注意が必要 |
− | ** | + | **architecture:MacOSX 10.6 標準では, 64 bit (x86_64) の Python 2.6.1 と NumPy 1.3.0 がインストールされるとのこと. |
− | * | + | *インストール済みモジュールを調べる |
− | ** | + | **バージョン(例 numpy) |
$ python -c "import numpy;print numpy.__version__" | $ python -c "import numpy;print numpy.__version__" | ||
1.3.0 | 1.3.0 | ||
+ | **architecture(例 math) | ||
+ | $ python -c "import math;print dir(math);import os;print os.system('file ' + math.__file__)" | ||
+ | **調べ方が統一されているわけではない | ||
+ | |||
*標準搭載版でないpythonをインストール | *標準搭載版でないpythonをインストール | ||
http://www.python.org/download | http://www.python.org/download | ||
− | + | ** python-3.1.x.dmg | |
− | * python-3.1.x.dmg | + | ** python-2.6.x.dmg |
− | * python-2.6.x.dmg | + | ** python-2.5.x.dmg |
− | * python-2.5.x.dmg | + | |
=== Python 3.x === | === Python 3.x === | ||
行42: | 行45: | ||
== setuptools== | == setuptools== | ||
− | + | 一部のモジュールに対して管理機能を提供(インストール等) | |
http://pypi.python.org/pypi/setuptools | http://pypi.python.org/pypi/setuptools | ||
行49: | 行52: | ||
− | == SciPy == | + | ==モジュール== |
− | + | ||
+ | === SciPy === | ||
+ | 科学技術計算関数を提供。 | ||
*macports からもインストール可能。 | *macports からもインストール可能。 | ||
行58: | 行63: | ||
*http://scipy.dip.jp/index.php?SciPy | *http://scipy.dip.jp/index.php?SciPy | ||
− | Mac OS X 10.5.7 | + | Mac OS X 10.5.7 Leopardへのインストール:http://d.hatena.ne.jp/yamato-y/20090608 |
− | + | ||
− | + | ||
* SciPy 0.7 は Python 2.6 をサポート | * SciPy 0.7 は Python 2.6 をサポート | ||
− | == NumPy == | + | === NumPy === |
− | + | 数値計算向け環境 | |
http://docs.scipy.org/doc/numpy/reference/routines.html | http://docs.scipy.org/doc/numpy/reference/routines.html | ||
行73: | 行76: | ||
*Mac標準搭載Pythonで利用する場合のnumpy http://radpy.blogspot.com/2009/06/numpymac.html | *Mac標準搭載Pythonで利用する場合のnumpy http://radpy.blogspot.com/2009/06/numpymac.html | ||
− | == Matplotlib == | + | === Matplotlib === |
− | + | 2Dプロット環境 | |
*http://matplotlib.sourceforge.net/index.html | *http://matplotlib.sourceforge.net/index.html | ||
− | ===Matplotlib Basemap Toolkit=== | + | =====Matplotlib Basemap Toolkit===== |
地図とデータをプロット | 地図とデータをプロット | ||
http://matplotlib.sourceforge.net/basemap/doc/html/ | http://matplotlib.sourceforge.net/basemap/doc/html/ |
2009年11月28日 (土) 18:00時点における版
目次
Pythonとは?
スクリプト言語の1つ。(Mac OS X に標準搭載されている。)
- 豊富なライブラリモジュールが魅力?
詳しい情報は,
- http://www.python.org/
- Wikipedia:Python
- http://jp.rubyist.net/magazine/?0008-Legwork
- 日本Pythonユーザ会 (PyJUG)
- Pythonのお勉強
- Python でアルゴリズム
- Python programing
インストール
- python本体とモジュールの整合に注意が必要
- architecture:MacOSX 10.6 標準では, 64 bit (x86_64) の Python 2.6.1 と NumPy 1.3.0 がインストールされるとのこと.
- インストール済みモジュールを調べる
- バージョン(例 numpy)
$ python -c "import numpy;print numpy.__version__" 1.3.0
- architecture(例 math)
$ python -c "import math;print dir(math);import os;print os.system('file ' + math.__file__)"
- 調べ方が統一されているわけではない
- 標準搭載版でないpythonをインストール
http://www.python.org/download
- python-3.1.x.dmg
- python-2.6.x.dmg
- python-2.5.x.dmg
Python 3.x
http://www.r-styles.net/mt-archives/weblog/development/python30-on-leopard.html
IPython
python用の対話型シェル環境
- Python標準シェルに比べて高機能
setuptools
一部のモジュールに対して管理機能を提供(インストール等) http://pypi.python.org/pypi/setuptools
インストール例
$ sh setuptools-0.6c11-py2.5.egg
モジュール
SciPy
科学技術計算関数を提供。
- macports からもインストール可能。
SciPyについての説明その他:
- http://ja.wikipedia.org/wiki/SciPy
- http://alias.dip.jp/blog/archives/category/research/scipy
- http://scipy.dip.jp/index.php?SciPy
Mac OS X 10.5.7 Leopardへのインストール:http://d.hatena.ne.jp/yamato-y/20090608
- SciPy 0.7 は Python 2.6 をサポート
NumPy
数値計算向け環境 http://docs.scipy.org/doc/numpy/reference/routines.html
- 関数抜粋とMATLAB比較: http://mathesaurus.sourceforge.net/matlab-numpy.html
- NumPy 1.3 は Python 2.6 をサポート
- Mac標準搭載Pythonで利用する場合のnumpy http://radpy.blogspot.com/2009/06/numpymac.html
Matplotlib
2Dプロット環境
Matplotlib Basemap Toolkit
地図とデータをプロット http://matplotlib.sourceforge.net/basemap/doc/html/ http://www.scipy.org/Cookbook/Matplotlib/Maps
coastline データは GSHHS のもの.(http://www.soest.hawaii.edu/wessel/gshhs/gshhs.html) state, country, river データは GMT のもの.(http://gmt.soest.hawaii.edu)
- 関連→ リスト/地球科学系
Wiki内の関連ページ
- PythonTips
- リスト/開発ツール
- リスト/UNIXパッケージ/Python
- 共有コード