当前位置:网站首页>6.23 warehouse operation on Thursday
6.23 warehouse operation on Thursday
2022-07-03 05:18:00 【Good good good】
6.23 Thursday warehouse operation
List of articles
Numpy practice
Exercise one : Create from 0 To 9 One dimensional array of numbers
import numpy as np
arr = np.arange(10)
print(arr)

Exercise 2 : Create an element all for True Of 3×3 Array
import numpy as np
arr = np.full([3, 3], True, dtype=np.bool)
print(arr)

Practice three : Create a 2D array , Where the boundary value is 1, The rest are 0
import numpy as np
Z = np.ones((10,10))
Z[1:-1,1:-1] = 0
print(Z)

Pandas practice
Exercise one : Write matrix multiplication using list derivation
The general matrix multiplication is based on the formula , It can be written by a triple loop , Please rewrite it in the form of list derivation .
M1 = np.random.rand(2,3)
M2 = np.random.rand(3,4)
res = np.empty((M1.shape[0],M2.shape[1]))
for i in range(M1.shape[0]):
for j in range(M2.shape[1]):
item = 0
for k in range(M1.shape[1]):
item += M1[i][k] * M2[k][j]
res[i][j] = item
(np.abs(([email protected] - res) < 1e-15)).all() # Eliminate numerical errors
The form of list derivation
import numpy as np
M1 = np.random.rand(2,3)
M2 = np.random.rand(3,4)
res = [[sum([M1[i][k] * M2[k][j] for k in range(M1.shape[1])]) for j in range(M2.shape[1])] for i in range(M1.shape[0])]
(np.abs(([email protected] - res) < 1e-15)).all()

Matplotlib practice
Exercise one : Two drawing interfaces
matplotlib Provides two of the most commonly used drawing interfaces
- Create explicitly figure and axes, Call the drawing method above , Also known as OO Pattern (object-oriented style)
- rely on pyplot Automatically create figure and axes, And draw
Using the first drawing interface , That's true :
x = np.linspace(0, 2, 100)
fig, ax = plt.subplots()
ax.plot(x, x, label='linear')
ax.plot(x, x**2, label='quadratic')
ax.plot(x, x**3, label='cubic')
ax.set_xlabel('x label')
ax.set_ylabel('y label')
ax.set_title("Simple Plot")
ax.legend()

The second drawing interface
x = np.linspace(0, 2, 100)
plt.plot(x, x, label='linear')
plt.plot(x, x**2, label='quadratic')
plt.plot(x, x**3, label='cubic')
plt.xlabel('x label')
plt.ylabel('y label')
plt.title("Simple Plot")
plt.legend()

边栏推荐
- Based on RFC 3986 (unified resource descriptor (URI): general syntax)
- Deploy crawl detection network using tensorrt (I)
- appium1.22.x 版本后的 appium inspector 需单独安装
- 1094 the largest generation (25 points)
- Introduction to deep learning (II) -- univariate linear regression
- Redis 击穿穿透雪崩
- @Autowired 导致空指针报错 解决方式
- Common interview questions of microservice
- Go practice -- gorilla/rpc (gorilla/rpc/json) used by gorilla web Toolkit
- Maximum continuous sub segment sum (dynamic programming, recursive, recursive)
猜你喜欢

Audio Focus Series: write a demo to understand audio focus and audiomananger
![[research materials] 2022q1 game preferred casual game distribution circular - Download attached](/img/13/5a67c5d08131745759fdc70a71cf0f.jpg)
[research materials] 2022q1 game preferred casual game distribution circular - Download attached

Intégration profonde et alignement des séquences de protéines Google

leetcode860. Lemonade change

Pessimistic lock and optimistic lock of multithreading
![[set theory] relationship properties (common relationship properties | relationship properties examples | relationship operation properties)](/img/af/8dfa783c87363a9d75c52e7680d508.jpg)
[set theory] relationship properties (common relationship properties | relationship properties examples | relationship operation properties)

Hotel public broadcasting background music - Design of hotel IP network broadcasting system based on Internet +
![[batch dos-cmd command - summary and summary] - CMD window setting and operation command - close CMD window and exit CMD environment (exit, exit /b, goto: EOF)](/img/ce/d6f4fb30727e7436b6443537429ad4.png)
[batch dos-cmd command - summary and summary] - CMD window setting and operation command - close CMD window and exit CMD environment (exit, exit /b, goto: EOF)

Go practice -- design patterns in golang's singleton

Introduction to deep learning (II) -- univariate linear regression
随机推荐
Pan details of deep learning
Online VR model display - 3D visual display solution
乾元通多卡聚合路由器的技术解析
ES7 easy mistakes in index creation
Appium 1.22. L'Inspecteur appium après la version X doit être installé séparément
[basic grammar] C language uses for loop to print Pentagram
Shallow and first code
XML配置文件
Principles of BTC cryptography
[backtrader source code analysis 5] rewrite several time number conversion functions in utils with Python
JS string and array methods
Deep embedding and alignment of Google | protein sequences
ROS Compilation Principle
Why should we rewrite hashcode when we rewrite the equals method?
How to connect the network: Chapter 1 CSDN creation punch in
The IntelliJ platform completely disables the log4j component
Pessimistic lock and optimistic lock of multithreading
Interview question -- output the same characters in two character arrays
"Hands on deep learning" pytorch edition Chapter II exercise
College campus IP network broadcasting - manufacturer's design guide for college campus IP broadcasting scheme based on campus LAN