当前位置:网站首页>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()

边栏推荐
- Transferring images using flask
- 在PyCharm中配置使用Anaconda环境
- College campus IP network broadcasting - manufacturer's design guide for college campus IP broadcasting scheme based on campus LAN
- Bluebridge cup real topic 2020 palindrome date simulation construction provincial competition
- Explanation of several points needing attention in final (tested by the author)
- Celebrate the new year together
- Pessimistic lock and optimistic lock of multithreading
- 50 practical applications of R language (36) - data visualization from basic to advanced
- Yolov5 model construction source code details | CSDN creation punch in
- MySQL master-slave configuration
猜你喜欢

"250000 a year is just the price of cabbage" has become a thing of the past. The annual salary of AI posts has decreased by 8.9%, and the latest salary report has been released

Class loading mechanism (detailed explanation of the whole process)

Audio Focus Series: write a demo to understand audio focus and audiomananger

appium1.22.x 版本後的 appium inspector 需單獨安裝

Gan network thought
![[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)

2022-02-12 daily clock in: problem fine brush

6.23星期四库作业

Detailed explanation of the output end (head) of yolov5 | CSDN creation punch in

Use posture of sudo right raising vulnerability in actual combat (cve-2021-3156)
随机推荐
编译GCC遇到的“pthread.h” not found问题
Shallow and first code
JS scope
Objects. Requirenonnull method description
[basic grammar] C language uses for loop to print Pentagram
Basic introduction of redis and explanation of eight types and transactions
1111 online map (30 points)
ninja: build stopped: subcommand failed.
study hard and make progress every day
Basic knowledge of reflection (detailed explanation)
Actual combat 8051 drives 8-bit nixie tube
Force GCC to compile 32-bit programs on 64 bit platform
Configure and use Anaconda environment in pycharm
Go practice -- gorilla/rpc (gorilla/rpc/json) used by gorilla web Toolkit
"Hands on deep learning" pytorch edition Chapter II exercise
Why is go language particularly popular in China
appium1.22.x 版本後的 appium inspector 需單獨安裝
Webrtc native M96 version opening trip -- a reading code download and compilation (Ninja GN depot_tools)
leetcode435. Non overlapping interval
获取并监控远程服务器日志