Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c6b95af

Browse files
Add files via upload
1 parent 6f67352 commit c6b95af

File tree

2 files changed

+406
-0
lines changed

2 files changed

+406
-0
lines changed

‎Numpy-specific_help_functions.ipynb‎

Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 1,
6+
"metadata": {
7+
"collapsed": true
8+
},
9+
"outputs": [],
10+
"source": [
11+
"import numpy as np"
12+
]
13+
},
14+
{
15+
"cell_type": "code",
16+
"execution_count": 2,
17+
"metadata": {
18+
"collapsed": false
19+
},
20+
"outputs": [
21+
{
22+
"data": {
23+
"text/plain": [
24+
"'1.11.2'"
25+
]
26+
},
27+
"execution_count": 2,
28+
"metadata": {},
29+
"output_type": "execute_result"
30+
}
31+
],
32+
"source": [
33+
"np.__version__"
34+
]
35+
},
36+
{
37+
"cell_type": "markdown",
38+
"metadata": {},
39+
"source": [
40+
"Q1. Search for docstrings of the numpy functions on linear algebra."
41+
]
42+
},
43+
{
44+
"cell_type": "code",
45+
"execution_count": 4,
46+
"metadata": {
47+
"collapsed": false
48+
},
49+
"outputs": [
50+
{
51+
"name": "stdout",
52+
"output_type": "stream",
53+
"text": [
54+
"Search results for 'linear algebra'\n",
55+
"-----------------------------------\n",
56+
"numpy.linalg.solve\n",
57+
" Solve a linear matrix equation, or system of linear scalar equations.\n",
58+
"numpy.poly\n",
59+
" Find the coefficients of a polynomial with the given sequence of roots.\n",
60+
"numpy.restoredot\n",
61+
" Restore `dot`, `vdot`, and `innerproduct` to the default non-BLAS\n",
62+
"numpy.linalg.eig\n",
63+
" Compute the eigenvalues and right eigenvectors of a square array.\n",
64+
"numpy.linalg.cond\n",
65+
" Compute the condition number of a matrix.\n",
66+
"numpy.linalg.eigh\n",
67+
" Return the eigenvalues and eigenvectors of a Hermitian or symmetric matrix.\n",
68+
"numpy.linalg.pinv\n",
69+
" Compute the (Moore-Penrose) pseudo-inverse of a matrix.\n",
70+
"numpy.linalg.LinAlgError\n",
71+
" Generic Python-exception-derived object raised by linalg functions.\n"
72+
]
73+
}
74+
],
75+
"source": []
76+
},
77+
{
78+
"cell_type": "markdown",
79+
"metadata": {},
80+
"source": [
81+
"Q2. Get help information for numpy dot function."
82+
]
83+
},
84+
{
85+
"cell_type": "code",
86+
"execution_count": 9,
87+
"metadata": {
88+
"collapsed": false
89+
},
90+
"outputs": [
91+
{
92+
"name": "stdout",
93+
"output_type": "stream",
94+
"text": [
95+
"dot(a, b, out=None)\n",
96+
"\n",
97+
"Dot product of two arrays.\n",
98+
"\n",
99+
"For 2-D arrays it is equivalent to matrix multiplication, and for 1-D\n",
100+
"arrays to inner product of vectors (without complex conjugation). For\n",
101+
"N dimensions it is a sum product over the last axis of `a` and\n",
102+
"the second-to-last of `b`::\n",
103+
"\n",
104+
" dot(a, b)[i,j,k,m] = sum(a[i,j,:] * b[k,:,m])\n",
105+
"\n",
106+
"Parameters\n",
107+
"----------\n",
108+
"a : array_like\n",
109+
" First argument.\n",
110+
"b : array_like\n",
111+
" Second argument.\n",
112+
"out : ndarray, optional\n",
113+
" Output argument. This must have the exact kind that would be returned\n",
114+
" if it was not used. In particular, it must have the right type, must be\n",
115+
" C-contiguous, and its dtype must be the dtype that would be returned\n",
116+
" for `dot(a,b)`. This is a performance feature. Therefore, if these\n",
117+
" conditions are not met, an exception is raised, instead of attempting\n",
118+
" to be flexible.\n",
119+
"\n",
120+
"Returns\n",
121+
"-------\n",
122+
"output : ndarray\n",
123+
" Returns the dot product of `a` and `b`. If `a` and `b` are both\n",
124+
" scalars or both 1-D arrays then a scalar is returned; otherwise\n",
125+
" an array is returned.\n",
126+
" If `out` is given, then it is returned.\n",
127+
"\n",
128+
"Raises\n",
129+
"------\n",
130+
"ValueError\n",
131+
" If the last dimension of `a` is not the same size as\n",
132+
" the second-to-last dimension of `b`.\n",
133+
"\n",
134+
"See Also\n",
135+
"--------\n",
136+
"vdot : Complex-conjugating dot product.\n",
137+
"tensordot : Sum products over arbitrary axes.\n",
138+
"einsum : Einstein summation convention.\n",
139+
"matmul : '@' operator as method with out parameter.\n",
140+
"\n",
141+
"Examples\n",
142+
"--------\n",
143+
">>> np.dot(3, 4)\n",
144+
"12\n",
145+
"\n",
146+
"Neither argument is complex-conjugated:\n",
147+
"\n",
148+
">>> np.dot([2j, 3j], [2j, 3j])\n",
149+
"(-13+0j)\n",
150+
"\n",
151+
"For 2-D arrays it is the matrix product:\n",
152+
"\n",
153+
">>> a = [[1, 0], [0, 1]]\n",
154+
">>> b = [[4, 1], [2, 2]]\n",
155+
">>> np.dot(a, b)\n",
156+
"array([[4, 1],\n",
157+
" [2, 2]])\n",
158+
"\n",
159+
">>> a = np.arange(3*4*5*6).reshape((3,4,5,6))\n",
160+
">>> b = np.arange(3*4*5*6)[::-1].reshape((5,4,6,3))\n",
161+
">>> np.dot(a, b)[2,3,2,1,2,2]\n",
162+
"499128\n",
163+
">>> sum(a[2,3,2,:] * b[1,2,:,2])\n",
164+
"499128\n"
165+
]
166+
}
167+
],
168+
"source": []
169+
},
170+
{
171+
"cell_type": "code",
172+
"execution_count": null,
173+
"metadata": {
174+
"collapsed": true
175+
},
176+
"outputs": [],
177+
"source": []
178+
}
179+
],
180+
"metadata": {
181+
"kernelspec": {
182+
"display_name": "Python 2",
183+
"language": "python",
184+
"name": "python2"
185+
},
186+
"language_info": {
187+
"codemirror_mode": {
188+
"name": "ipython",
189+
"version": 2
190+
},
191+
"file_extension": ".py",
192+
"mimetype": "text/x-python",
193+
"name": "python",
194+
"nbconvert_exporter": "python",
195+
"pygments_lexer": "ipython2",
196+
"version": "2.7.10"
197+
}
198+
},
199+
"nbformat": 4,
200+
"nbformat_minor": 0
201+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /