python中numpy?常用操作總結(jié)
前言:
NumPy 是 Python 語(yǔ)言的一個(gè)擴(kuò)充程序庫(kù),支持大量高維度數(shù)組與矩陣運(yùn)算,此外也針對(duì)數(shù)組運(yùn)算提供大量的數(shù)學(xué)函數(shù)庫(kù)。同時(shí)NumPy 是機(jī)器學(xué)習(xí)必不可少的工具之一。
常用操作主要有:
- 創(chuàng)建數(shù)組
- 數(shù)組運(yùn)算
- 數(shù)學(xué)函數(shù)
- 數(shù)組切片和索引
- 數(shù)組形狀操作
- 數(shù)組排序
- 數(shù)組統(tǒng)計(jì)
環(huán)境
- Python 3.6
- NumPy: 1.14.2
1、導(dǎo)包
import numpy as np
2、通過(guò)列表創(chuàng)建數(shù)組 array()
np.array([1, 2, 3]) #一維數(shù)組 np.array([(1, 2, 3), (4, 5, 6)]) #二維數(shù)組
3、0/1數(shù)組 zeros()、ones()
np.zeros((3, 3)) #3行3列 np.ones((2, 3, 4))
4、等差數(shù)組 arange() reshape()
#一維等差 np.arange(5) #array([0, 1, 2, 3, 4]) # 二維等差 np.arange(6).reshape(2, 3) 結(jié)果: array([[0, 1, 2], [3, 4, 5]])
5、單位矩陣 eye()
np.eye(3) 結(jié)果: array([[1., 0., 0.], [0., 1., 0.], [0., 0., 1.]])
7、等間隔數(shù)組
#一維 np.linspace(1, 10, num=6) #array([ 1. , 2.8, 4.6, 6.4, 8.2, 10. ])
8、隨機(jī)數(shù)組
np.random.rand(2, 3) array([[0.40360777, 0.74141574, 0.32018331], [0.15261484, 0.18692149, 0.19351765]])
9、隨機(jī)整數(shù)數(shù)組
np.random.randint(10, size=(2, 3)) #數(shù)值小于10 array([[2, 1, 0], [2, 7, 5]])
10、依據(jù)函數(shù)創(chuàng)建數(shù)組
np.fromfunction(lambda i, j: i + j, (3, 6)) array([[0., 1., 2., 3., 4., 5.], [1., 2., 3., 4., 5., 6.], [2., 3., 4., 5., 6., 7.]])
數(shù)組運(yùn)算
+-*/ 加減乘除,對(duì)應(yīng)位置元素
# 矩陣乘法 np.dot(A, B) # 如果使用 np.mat 將二維數(shù)組準(zhǔn)確定義為矩陣,就可以直接使用 * 完成矩陣乘法計(jì)算 np.mat(A) * np.mat(B)
轉(zhuǎn)置:
A.T
矩陣求逆:
np.linalg.inv(A)
e^x
np.exp(a)
平方根:
np.sqrt(a)
三次方:
np.power(a, 3)
數(shù)組的切皮與索引
一維數(shù)組:
a = np.array([1, 2, 3, 4, 5]) # 一維數(shù)組索引 a[0], a[-1] # 一維數(shù)組切片 a[0:2], a[:-1]
二維數(shù)組;
a = np.array([(1, 2, 3), (4, 5, 6), (7, 8, 9)]) # 索引 a[0], a[-1] ######## 切片 # 取第二列 a[:, 1] #取第 2,3 行 a[1:3, :]
數(shù)組形狀
形狀(行列數(shù))
a.shape
更改行列數(shù)
a.reshape(2, 3) #指向新對(duì)象, reshape 并不改變?cè)紨?shù)組 # resize 會(huì)改變?cè)紨?shù)組 a.resize(2, 3)
展平數(shù)組
a.ravel()
垂直拼合數(shù)組,摞起來(lái)
np.vstack((a, b))
水平拼合數(shù)組,挨著擺
np.hstack((a, b))
分割數(shù)組:
array([[5, 0, 2], [4, 2, 4], [4, 7, 9]]) # 沿橫軸分割數(shù)組 np.hsplit(a, 3) [array([[5], [4], [4]]), array([[0], [2], [7]]), array([[2], [4], [9]])] # 沿縱軸分割數(shù)組 np.vsplit(a, 3) [array([[5, 0, 2]]), array([[4, 2, 4]]), array([[4, 7, 9]])]
數(shù)組排序:
# 生成示例數(shù)組 a = np.array(([1, 4, 3], [6, 2, 9], [4, 7, 2])) # #### 返回每列最大值 np.max(a, axis=0) # #### 返回每行最小值 np.min(a, axis=1) # #### 返回每列最大值索引 np.argmax(a, axis=0) # #### 返回每行最小值索引 np.argmin(a, axis=1)
數(shù)組統(tǒng)計(jì):
# 繼續(xù)使用上面的 a 數(shù)組 np.median(a, axis=0) # #### 統(tǒng)計(jì)數(shù)組各行的算術(shù)平均值 np.mean(a, axis=1) # #### 統(tǒng)計(jì)數(shù)組各列的加權(quán)平均值 np.average(a, axis=0) # #### 統(tǒng)計(jì)數(shù)組各行的方差 np.var(a, axis=1) # #### 統(tǒng)計(jì)數(shù)組各列的標(biāo)準(zhǔn)偏差 np.std(a, axis=0)
進(jìn)階:
# #### 51. 創(chuàng)建一個(gè) 5x5 的二維數(shù)組,其中邊界值為1,其余值為0
# In[60]:
Z = np.ones((5,5))
Z[1:-1,1:-1] = 0
Z
# #### 52. 使用數(shù)字 0 將一個(gè)全為 1 的 5x5 二維數(shù)組包圍
# In[61]:
Z = np.ones((5,5))
Z = np.pad(Z, pad_width=1, mode='constant', constant_values=0)
Z
# #### 53. 創(chuàng)建一個(gè) 5x5 的二維數(shù)組,并設(shè)置值 1, 2, 3, 4 落在其對(duì)角線下方
# In[62]:
Z = np.diag(1+np.arange(4),k=-1)
Z
# #### 54. 創(chuàng)建一個(gè) 10x10 的二維數(shù)組,并使得 1 和 0 沿對(duì)角線間隔放置
# In[63]:
Z = np.zeros((10,10),dtype=int)
Z[1::2,::2] = 1
Z[::2,1::2] = 1
Z
# #### 55. 創(chuàng)建一個(gè) 0-10 的一維數(shù)組,并將 (1, 9] 之間的數(shù)全部反轉(zhuǎn)成負(fù)數(shù)
# In[64]:
Z = np.arange(11)
Z[(1 < Z) & (Z <= 9)] *= -1
Z
# #### 56. 找出兩個(gè)一維數(shù)組中相同的元
# In[65]:
Z1 = np.random.randint(0,10,10)
Z2 = np.random.randint(0,10,10)
print("Z1:", Z1)
print("Z2:", Z2)
np.intersect1d(Z1,Z2)
# #### 57. 使用 NumPy 打印昨天、今天、明天的日期
# In[66]:
yesterday = np.datetime64('today', 'D') - np.timedelta64(1, 'D')
today = np.datetime64('today', 'D')
tomorrow = np.datetime64('today', 'D') + np.timedelta64(1, 'D')
print("yesterday: ", yesterday)
print("today: ", today)
print("tomorrow: ", tomorrow)
# #### 58. 使用五種不同的方法去提取一個(gè)隨機(jī)數(shù)組的整數(shù)部分
# In[67]:
Z = np.random.uniform(0,10,10)
print("原始值: ", Z)
print ("方法 1: ", Z - Z%1)
print ("方法 2: ", np.floor(Z))
print ("方法 3: ", np.ceil(Z)-1)
print ("方法 4: ", Z.astype(int))
print ("方法 5: ", np.trunc(Z))
# #### 59. 創(chuàng)建一個(gè) 5x5 的矩陣,其中每行的數(shù)值范圍從 1 到 5
# In[68]:
Z = np.zeros((5,5))
Z += np.arange(1,6)
Z
# #### 60. 創(chuàng)建一個(gè)長(zhǎng)度為 5 的等間隔一維數(shù)組,其值域范圍從 0 到 1,但是不包括 0 和 1
# In[69]:
Z = np.linspace(0,1,6,endpoint=False)[1:]
Z
# #### 61. 創(chuàng)建一個(gè)長(zhǎng)度為10的隨機(jī)一維數(shù)組,并將其按升序排序
# In[70]:
Z = np.random.random(10)
Z.sort()
Z
# #### 62. 創(chuàng)建一個(gè) 3x3 的二維數(shù)組,并將列按升序排序
# In[71]:
Z = np.array([[7,4,3],[3,1,2],[4,2,6]])
print("原始數(shù)組: \n", Z)
Z.sort(axis=0)
Z
# #### 63. 創(chuàng)建一個(gè)長(zhǎng)度為 5 的一維數(shù)組,并將其中最大值替換成 0
# In[72]:
Z = np.random.random(5)
print("原數(shù)組: ",Z)
Z[Z.argmax()] = 0
Z
# #### 64. 打印每個(gè) NumPy 標(biāo)量類型的最小值和最大值
# In[73]:
for dtype in [np.int8, np.int32, np.int64]:
print("The minimum value of {}: ".format(dtype), np.iinfo(dtype).min)
print("The maximum value of {}: ".format(dtype),np.iinfo(dtype).max)
for dtype in [np.float32, np.float64]:
print("The minimum value of {}: ".format(dtype),np.finfo(dtype).min)
print("The maximum value of {}: ".format(dtype),np.finfo(dtype).max)
# #### 65. 將 `float32` 轉(zhuǎn)換為整型
# In[74]:
Z = np.arange(10, dtype=np.float32)
print(Z)
Z = Z.astype(np.int32, copy=False)
Z
# #### 66. 將隨機(jī)二維數(shù)組按照第 3 列從上到下進(jìn)行升序排列
# In[75]:
Z = np.random.randint(0,10,(5,5))
print("排序前:\n",Z)
Z[Z[:,2].argsort()]
# #### 67. 從隨機(jī)一維數(shù)組中找出距離給定數(shù)值(0.5)最近的數(shù)
# In[76]:
Z = np.random.uniform(0,1,20)
print("隨機(jī)數(shù)組: \n", Z)
z = 0.5
m = Z.flat[np.abs(Z - z).argmin()]
m
# #### 68. 將二維數(shù)組的前兩行進(jìn)行順序交換
# In[77]:
A = np.arange(25).reshape(5,5)
print(A)
A[[0,1]] = A[[1,0]]
print(A)
# #### 69. 找出隨機(jī)一維數(shù)組中出現(xiàn)頻率最高的值
# In[78]:
Z = np.random.randint(0,10,50)
print("隨機(jī)一維數(shù)組:", Z)
np.bincount(Z).argmax()
# #### 70. 找出給定一維數(shù)組中非 0 元素的位置索引
# In[79]:
Z = np.nonzero([1,0,2,0,1,0,4,0])
Z
# #### 71. 對(duì)于給定的 5x5 二維數(shù)組,在其內(nèi)部隨機(jī)放置 p 個(gè)值為 1 的數(shù)
# In[80]:
p = 3
Z = np.zeros((5,5))
np.put(Z, np.random.choice(range(5*5), p, replace=False),1)
Z
# #### 72. 對(duì)于隨機(jī)的 3x3 二維數(shù)組,減去數(shù)組每一行的平均值
# In[81]:
X = np.random.rand(3, 3)
print(X)
Y = X - X.mean(axis=1, keepdims=True)
Y
# #### 73. 獲得二維數(shù)組點(diǎn)積結(jié)果的對(duì)角線數(shù)組
# In[82]:
A = np.random.uniform(0,1,(3,3))
B = np.random.uniform(0,1,(3,3))
print(np.dot(A, B))
# 較慢的方法
np.diag(np.dot(A, B))
# In[83]:
# 較快的方法
np.sum(A * B.T, axis=1)
# In[84]:
# 更快的方法
np.einsum("ij, ji->i", A, B)
# #### 74. 找到隨機(jī)一維數(shù)組中前 p 個(gè)最大值
# In[85]:
Z = np.random.randint(1,100,100)
print(Z)
p = 5
Z[np.argsort(Z)[-p:]]
# #### 75. 計(jì)算隨機(jī)一維數(shù)組中每個(gè)元素的 4 次方數(shù)值
# In[86]:
x = np.random.randint(2,5,5)
print(x)
np.power(x,4)
# #### 76. 對(duì)于二維隨機(jī)數(shù)組中各元素,保留其 2 位小數(shù)
# In[87]:
Z = np.random.random((5,5))
print(Z)
np.set_printoptions(precision=2)
Z
# #### 77. 使用科學(xué)記數(shù)法輸出 NumPy 數(shù)組
# In[88]:
Z = np.random.random([5,5])
print(Z)
Z/1e3
# #### 78. 使用 NumPy 找出百分位數(shù)(25%,50%,75%)
# In[89]:
a = np.arange(15)
print(a)
np.percentile(a, q=[25, 50, 75])
# #### 79. 找出數(shù)組中缺失值的總數(shù)及所在位
# In[90]:
# 生成含缺失值的 2 維數(shù)組
Z = np.random.rand(10,10)
Z[np.random.randint(10, size=5), np.random.randint(10, size=5)] = np.nan
Z
# In[91]:
print("缺失值總數(shù): \n", np.isnan(Z).sum())
print("缺失值索引: \n", np.where(np.isnan(Z)))
# #### 80. 從隨機(jī)數(shù)組中刪除包含缺失值的行
# In[92]:
# 沿用 79 題中的含缺失值的 2 維數(shù)組
Z[np.sum(np.isnan(Z), axis=1) == 0]
# #### 81. 統(tǒng)計(jì)隨機(jī)數(shù)組中的各元素的數(shù)量
# In[93]:
Z = np.random.randint(0,100,25).reshape(5,5)
print(Z)
np.unique(Z, return_counts=True) # 返回值中,第 2 個(gè)數(shù)組對(duì)應(yīng)第 1 個(gè)數(shù)組元素的數(shù)量
# #### 82. 將數(shù)組中各元素按指定分類轉(zhuǎn)換為文本值
# In[94]:
# 指定類別如下
# 1 → 汽車
# 2 → 公交車
# 3 → 火車
Z = np.random.randint(1,4,10)
print(Z)
label_map = {1: "汽車", 2: "公交車", 3: "火車"}
[label_map[x] for x in Z]
# #### 83. 將多個(gè) 1 維數(shù)組拼合為單個(gè) Ndarray
# In[95]:
Z1 = np.arange(3)
Z2 = np.arange(3,7)
Z3 = np.arange(7,10)
Z = np.array([Z1, Z2, Z3])
print(Z)
np.concatenate(Z)
# #### 84. 打印各元素在數(shù)組中升序排列的索引
# In[96]:
a = np.random.randint(100, size=10)
print('Array: ', a)
a.argsort()
# #### 85. 得到二維隨機(jī)數(shù)組各行的最大值
# In[97]:
Z = np.random.randint(1,100, [5,5])
print(Z)
np.amax(Z, axis=1)
# #### 86. 得到二維隨機(jī)數(shù)組各行的最小值(區(qū)別上面的方法)
# In[98]:
Z = np.random.randint(1,100, [5,5])
print(Z)
np.apply_along_axis(np.min, arr=Z, axis=1)
# #### 87. 計(jì)算兩個(gè)數(shù)組之間的歐氏距離
# In[99]:
a = np.array([1, 2])
b = np.array([7, 8])
# 數(shù)學(xué)計(jì)算方法
print(np.sqrt(np.power((8-2), 2) + np.power((7-1), 2)))
# NumPy 計(jì)算
np.linalg.norm(b-a)
# #### 88. 打印復(fù)數(shù)的實(shí)部和虛部
# In[100]:
a = np.array([1 + 2j, 3 + 4j, 5 + 6j])
print("實(shí)部:", a.real)
print("虛部:", a.imag)
# #### 89. 求解給出矩陣的逆矩陣并驗(yàn)證
# In[101]:
matrix = np.array([[1., 2.], [3., 4.]])
inverse_matrix = np.linalg.inv(matrix)
# 驗(yàn)證原矩陣和逆矩陣的點(diǎn)積是否為單位矩陣
assert np.allclose(np.dot(matrix, inverse_matrix), np.eye(2))
inverse_matrix
# #### 90. 使用 Z-Score 標(biāo)準(zhǔn)化算法對(duì)數(shù)據(jù)進(jìn)行標(biāo)準(zhǔn)化處理
# Z-Score 標(biāo)準(zhǔn)化公式:
# $$Z = \frac{X-\mathrm{mean}(X)}{\mathrm{sd}(X)}$$
# In[102]:
# 根據(jù)公式定義函數(shù)
def zscore(x, axis = None):
xmean = x.mean(axis=axis, keepdims=True)
xstd = np.std(x, axis=axis, keepdims=True)
zscore = (x-xmean)/xstd
return zscore
# 生成隨機(jī)數(shù)據(jù)
Z = np.random.randint(10, size=(5,5))
print(Z)
zscore(Z)
# #### 91. 使用 Min-Max 標(biāo)準(zhǔn)化算法對(duì)數(shù)據(jù)進(jìn)行標(biāo)準(zhǔn)化處理
# Min-Max 標(biāo)準(zhǔn)化公式:
# $$Y = \frac{Z-\min(Z)}{\max(Z)-\min(Z)}$$
# In[103]:
# 根據(jù)公式定義函數(shù)
def min_max(x, axis=None):
min = x.min(axis=axis, keepdims=True)
max = x.max(axis=axis, keepdims=True)
result = (x-min)/(max-min)
return result
# 生成隨機(jī)數(shù)據(jù)
Z = np.random.randint(10, size=(5,5))
print(Z)
min_max(Z)
# #### 92. 使用 L2 范數(shù)對(duì)數(shù)據(jù)進(jìn)行標(biāo)準(zhǔn)化處理
# L2 范數(shù)計(jì)算公式:
# $$L_2 = \sqrt{x_1^2 + x_2^2 + \ldots + x_i^2}$$
# In[104]:
# 根據(jù)公式定義函數(shù)
def l2_normalize(v, axis=-1, order=2):
l2 = np.linalg.norm(v, ord = order, axis=axis, keepdims=True)
l2[l2==0] = 1
return v/l2
# 生成隨機(jī)數(shù)據(jù)
Z = np.random.randint(10, size=(5,5))
print(Z)
l2_normalize(Z)
# #### 93. 使用 NumPy 計(jì)算變量直接的相關(guān)性系數(shù)
# In[105]:
Z = np.array([
[1, 2, 1, 9, 10, 3, 2, 6, 7], # 特征 A
[2, 1, 8, 3, 7, 5, 10, 7, 2], # 特征 B
[2, 1, 1, 8, 9, 4, 3, 5, 7]]) # 特征 C
np.corrcoef(Z)
# 相關(guān)性系數(shù)取值從 `[-1, 1]` 變換,靠近 1 則代表正相關(guān)性較強(qiáng),-1 則代表負(fù)相關(guān)性較強(qiáng)。結(jié)果如下所示,變量 A 與變量 A 直接的相關(guān)性系數(shù)為 `1`,因?yàn)槭峭粋€(gè)變量。變量 A 與變量 C 之間的相關(guān)性系數(shù)為 `0.97`,說(shuō)明相關(guān)性較強(qiáng)。
# ```
# [A] [B] [C]
# array([[ 1. , -0.06, 0.97] [A]
# [-0.06, 1. , -0.01], [B]
# [ 0.97, -0.01, 1. ]]) [C]
# ```
# #### 94. 使用 NumPy 計(jì)算矩陣的特征值和特征向量
# In[106]:
M = np.matrix([[1,2,3], [4,5,6], [7,8,9]])
w, v = np.linalg.eig(M)
# w 對(duì)應(yīng)特征值,v 對(duì)應(yīng)特征向量
w, v
# 我們可以通過(guò) `P'AP=M` 公式反算,驗(yàn)證是否能得到原矩陣。
# In[107]:
v * np.diag(w) * np.linalg.inv(v)
# #### 95. 使用 NumPy 計(jì)算 Ndarray 兩相鄰元素差值
# In[108]:
Z = np.random.randint(1,10,10)
print(Z)
# 計(jì)算 Z 兩相鄰元素差值
print(np.diff(Z, n=1))
# 重復(fù)計(jì)算 2 次
print(np.diff(Z, n=2))
# 重復(fù)計(jì)算 3 次
print(np.diff(Z, n=3))
# #### 96. 使用 NumPy 將 Ndarray 相鄰元素依次累加
# In[109]:
Z = np.random.randint(1,10,10)
print(Z)
"""
[第一個(gè)元素, 第一個(gè)元素 + 第二個(gè)元素, 第一個(gè)元素 + 第二個(gè)元素 + 第三個(gè)元素, ...]
"""
np.cumsum(Z)
# #### 97. 使用 NumPy 按列連接兩個(gè)數(shù)組
# In[110]:
M1 = np.array([1, 2, 3])
M2 = np.array([4, 5, 6])
np.c_[M1, M2]
# #### 98. 使用 NumPy 按行連接兩個(gè)數(shù)組
# In[111]:
M1 = np.array([1, 2, 3])
M2 = np.array([4, 5, 6])
np.r_[M1, M2]
# #### 99. 使用 NumPy 打印九九乘法表
# In[112]:
np.fromfunction(lambda i, j: (i + 1) * (j + 1), (9, 9))
# #### 100. 使用 NumPy 將實(shí)驗(yàn)樓 LOGO 轉(zhuǎn)換為 Ndarray 數(shù)組
# In[113]:
from io import BytesIO
from PIL import Image
import PIL, requests
# 通過(guò)鏈接下載圖像
URL = 'https://static.shiyanlou.com/img/logo-black.png'
response = requests.get(URL)
# 將內(nèi)容讀取為圖像
I = Image.open(BytesIO(response.content))
# 將圖像轉(zhuǎn)換為 Ndarray
shiyanlou = np.asarray(I)
shiyanlou
# In[114]:
# 將轉(zhuǎn)換后的 Ndarray 重新繪制成圖像
from matplotlib import pyplot as plt
get_ipython().run_line_magic('matplotlib', 'inline')
plt.imshow(shiyanlou)
plt.show()到此這篇關(guān)于python中numpy 常用操作總結(jié)的文章就介紹到這了,更多相關(guān)python numpy內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
Python 中的字符串基礎(chǔ)與應(yīng)用小結(jié)
在Python中,字符串可以用單引號(hào)或雙引號(hào)括起來(lái),'hello' 與 "hello" 是相同的,這篇文章主要介紹了Python 中的字符串基礎(chǔ)與應(yīng)用,需要的朋友可以參考下2023-09-09
pycharm 2021.3最新激活碼有效期至2100年(親測(cè)可用)
這篇文章主要介紹了pycharm 2021.3最新激活碼有效期至2100年(親測(cè)可用)2021-02-02
玩轉(zhuǎn)python selenium鼠標(biāo)鍵盤(pán)操作(ActionChains)
這篇文章主要為大家詳細(xì)介紹了python selenium鼠標(biāo)鍵盤(pán)操作(ActionChains),教大家如何玩轉(zhuǎn)selenium鼠標(biāo)鍵盤(pán),感興趣的小伙伴們可以參考一下2016-09-09
python反轉(zhuǎn)字符串的七種解法總結(jié)
這篇文章主要介紹了反轉(zhuǎn)字符串的多種方法,包括雙指針、棧結(jié)構(gòu)、range函數(shù)、reversed函數(shù)、切片、列表推導(dǎo)和reverse()函數(shù),每種方法都有其特點(diǎn)和適用場(chǎng)景,需要的朋友可以參考下2025-01-01
Python集合union()函數(shù)使用實(shí)例詳解
union()方法的工作原理是:返回多個(gè)集合(集合的數(shù)量大于等于2)的并集,即結(jié)果集合包含了所有被合并集合中的所有元素,因?yàn)榧现械脑夭豢芍貜?fù),所以各個(gè)集合中重復(fù)的元素在結(jié)果集合中只會(huì)出現(xiàn)一次,本文將簡(jiǎn)單介紹一下Python union()函數(shù)使用方法2023-07-07
Qt自定義Plot實(shí)現(xiàn)曲線繪制的詳細(xì)過(guò)程
這篇文章主要介紹了Qt自定義Plot實(shí)現(xiàn)曲線繪制,包含arm觸摸屏多點(diǎn)觸控縮放(只支持兩點(diǎn)),實(shí)時(shí)曲線繪制,數(shù)據(jù)點(diǎn)根據(jù)繪制寬度優(yōu)化,跟蹤點(diǎn)數(shù)據(jù)獲取,雙坐標(biāo)等功能,需要的朋友可以參考下2021-11-11
Python使用captcha制作驗(yàn)證碼的實(shí)現(xiàn)示例
本文主要介紹了Python使用captcha制作驗(yàn)證碼的實(shí)現(xiàn)示例,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2022-08-08
跟老齊學(xué)Python之總結(jié)參數(shù)的傳遞
這篇文章主要介紹了Python參數(shù)的傳遞的總結(jié),非常的實(shí)用,有需要的朋友可以參考下2014-10-10

