I participated in a programming event for the first time on August 23, and another person told me that output is important, so I will write it here.
A summary of libraries that are useful mainly around ipython and when operating operations research.
A discipline that solves problems using mathematics.
The library used this time is as follows.
| Library | function |
|---|---|
| pandas | Mainly pre-processing such as cross tabulation. A child who can be unexpected |
| matplotlib | Graph drawing library. It can be pretty clean. |
| scikit-learn | Machine learning library. Most of the methods are included. |
| pulp | Optimization calculation library. This is for light optimization. |
| simpy | Library for simulation. Queue model, etc. |
| networkX | Graph drawing library. This is the graph theory. |
| sympy | Symbol calculation library. It solves the character expression as it is. |
I also dealt with a library for AWS called boto, but this time I will omit it.
IPython is like a normal Interactive Shell, A very convenient guy who can set up a server and program from a browser (notebook).
For installation etc., I think that you should refer to other sites.
At the seminar, I used the command ʻipython notebook --pylab inline, but it seems that something is not good. ʻIpython notebook --matplotlib inline seems to be a good idea.
By the way, it seems that it can be done even after executing with % matplotlib (inline).
ʻInline` selects whether to draw a graph or figure in the browser or in a separate window.
Press the Tab key to complete it.
Add ? to an object or function to get information.
You can see the source code by adding ??.
>>> %pylab
>>> prob?
Type: function
String form: <function prod at 0x10bfeb398>
File: /usr/local/lib/python2.7/site-packages/numpy/core/fromnumeric.py
Definition: prod(a, axis=None, dtype=None, out=None, keepdims=False)
Docstring:
Return the product of array elements over a given axis.
Parameters
----------
a : array_like
Input data.
axis : None or int or tuple of ints, optional...
>>> prob??
Type: function
String form: <function prod at 0x10bfeb398>
File: /usr/local/lib/python2.7/site-packages/numpy/core/fromnumeric.py
Definition: prod(a, axis=None, dtype=None, out=None, keepdims=False)
Source:
def prod(a, axis=None, dtype=None, out=None, keepdims=False):
"""
Return the product of array elements over a given axis.
Parameters
----------
a : array_like...
Basically, you can do anything by prefixing the shell command with !.
As you know, you can use cd, ls, mv, cp, rm, less, and cat as they are. vim must be ! vim.
Some useful ones.
% time: Measure the time once.
% timeit: Measure the average time multiple times. (Is it better to use this one)
% run python_file: Execute python_file. (! Python is also acceptable)
% paste: Paste (only when running terminal)
Other than those listed here, you should refer to Cheat Sheets.
scikit-learn
pulp in preparation....
simpy in preparation....
networkX in preparation....
sympy in preparation....
Recommended Posts