Python
From YYiki
Python is a very useful programming language in many occasions except when you need really fast program.
IPython provides very nice functionalities such as IPython notebook.
There are several implementations of Python. CPython is currently the official implementation, but PyPy (written in Python, see also RPython) is catching up very fast and it is now the fastest implementation of Python.
You may want to install pre-packaged scientific python distribution such as enthought python because it is a pain to install all scientific packages.
Contents |
Modules & Libraries
- http://pythonpackages.com/ - What is your favorite Python package?
- perky:파이썬 모듈 관광 1회: ezpyinline
- pip
Database
- SQLAlchemy
- atbr - large-scale in-memory key-value pair store for Python
Documentation
Time stamps
File system
- http://packages.python.org/watchdog/ - monitor file system events. can be used for automatic testing
Etc
Profiling
Option parser
- https://github.com/halst/docopt - generating option parser from the docstring.
Parallel computing
plotting
Social media
Data analysis and Machine learning
- Machine Learning Libraries in Python
- http://fonnesbeck.github.com/ScipySuperpack/ - numpy + scipy + matplotlib + ipython + pandas + pyMC
- numpy
- Python/Pandas
- StatsModel
- Orange (python)
- http://pybrain.org/
- scikit-learn
- mlpy
- pyml
- Shogun - A Large Scale Machine Learning Toolbox
- Modular toolkit for data processing
- MILK: MACHINE LEARNING TOOLKIT
Location data
Etc
- DendroPy - Python library for phylogenetic computing.
Web mining
Web application framework
Testing
- Python/nose
- Tox - http://tox.readthedocs.org/en/latest/index.html
- attest - Modern Test Automation for Python
Topics and tips
- general:
- defaultdict: http://docs.python.org/library/collections.html#defaultdict-examples Large defaultdict is slow. Using defaultdict is sometimes dangerous.
- flatten:
from Tkinter import _flattenor http://rightfootin.blogspot.com/2006/09/more-on-python-flatten.html
- Information visualization:
- vpython - 3d drawing
- JSON: If JSON string is simple and contains only ascii characters, you can simply do following:
a = eval(somejson)If your JSON contains unicode characters, you should use json module.json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]')
- low-level:
- main(): Python main() functions
- Optimization:
- 혀나미:Python과 C
- 파이썬 속도에 절망감을 느끼면서
보여주신 코드는 대량의 계산이 발생하는 부분인데 그런 것은 numpy같은 것으로 행렬연산으로 처리하지 않는 한은 C 속도의 500분의 1정도 밖에 나오지 않습니다. 행렬연산으로 처리하면 거의 같은 속도가 나오니까 별 걱정하실 필요는 없습니다. 행렬로 처리가 안 되는 경우에는 보통 pyrex, cython 같은 것으로 C 자료형으로 확장하거나, C로 일부분을 짠 다음에 SWIG, ctypes 등으로 불러다가 쓰는 방법이 많이 쓰입니다. 파이썬은 모든것을 다 최적으로 할 수 있는 언어가 아니라 특정 일부 작업을 빨리 처리할 수 있는 언어입니다. 파이썬 초창기에 모든 작업을 파이썬으로 해야한다는 순혈주의(?)가 종종 일부 극단적인 분들에게 있었지만, 파이썬은 종교가 아닙니다. 적재적소에 필요한 만큼 쓰는게 중요합니다. 특히 수치연산은 numpy나 scipy같은 수치처리 모듈이나 C와 파이썬을 같이 쓰는 방법을 알아두시면 매우 도움이 됩니다. --perky
- psyco: "Psyco is a Python extension module which can greatly speed up the execution of any Python code."
- Packaging & distribution: easy_install and .egg were used as python package installer and package format respectively. Pip replaces easy_install.
- Parallel programming and GlL (Global Interpreter Lock):
- type: 변수가 정수인지 리스트인지 알고 싶습니다.
- Universal newline support: the newline character differs in Windows/Unix. Regardless of newline character type, you can open files with 'U' or 'rU'.
sample = open(filename, 'rU')
- Web server
-
python -m SimpleHTTPServer
-
Links
Python guides
- python by example
- guido's 파이썬 자습서
- alan gould:파이썬 프로그래밍 연습
- 컴퓨터 과학자 같이 생각하는 법
- 파이썬에 뛰어들기
- Learn Python The Hard Way
- http://www.pythontutor.com - LEARN programming by visualizing code execution
- http://www.pythonforbeginners.com