numpy.matmul (ary1, ary2):

import numpy as np
list1 = [1,2,3]
list2 = [
[3],
[2],
[1]]
a1 = np.array(list1)
a2 = np.array(list2)
print(“對list做矩陣乘法np.matmul():”,
np.matmul(list1,list2))
print(“對array做矩陣乘法np.matmul():”,
np.matmul(a1,a2))
print(“只有array能用@做矩陣乘法:”,a1 @ a2)
print(“矩陣乘法@:”,list1 @ list2)

numpy.dot()

推薦hahow線上學習python: https://igrape.net/30afN


![Python: pandas.Series如何只保留str,去除重複值?#isinstance(x:Any, str) -> bool #.drop_duplicates() #Series.apply( function )逐元素應用function運算 #DataFrame.apply( function )逐Series應用function運算 .drop_duplicates() 跟.unique()有何差別? df.drop_duplicates() 等效於 df[~df.duplicated()] Python: pandas.Series如何只保留str,去除重複值?#isinstance(x:Any, str) -> bool #.drop_duplicates() #Series.apply( function )逐元素應用function運算 #DataFrame.apply( function )逐Series應用function運算 .drop_duplicates() 跟.unique()有何差別? df.drop_duplicates() 等效於 df[~df.duplicated()]](https://i2.wp.com/savingking.com.tw/wp-content/uploads/2024/11/20241123194900_0_5218de.png?quality=90&zoom=2&ssl=1&resize=350%2C233)
![Python: 如何在pandas.read_csv() or pandas.read_excel() 中使用keep_default_na =False , na_values =[] 保留文件中的原始“NA”? Python: 如何在pandas.read_csv() or pandas.read_excel() 中使用keep_default_na =False , na_values =[] 保留文件中的原始“NA”?](https://i2.wp.com/savingking.com.tw/wp-content/uploads/2024/05/20240530215737_0.png?quality=90&zoom=2&ssl=1&resize=350%2C233)






近期留言