zmc
2023-08-08 e792e9a60d958b93aef96050644f369feb25d61b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
U
­ý°du ã@sJddlZddlZddlZddlmZmZmZddlm    Z
Gdd„dƒZ dS)éN)Ú    DataFrameÚIndexÚSeriesc@seZdZdd„Zdd„ZdS)Ú
TestMatMulc    Cspttj dd¡dddgdddd    gd
}ttj dd ¡dddd    gd d gd
}t ||¡}tt |j|j¡dddgd d gd
}t     ||¡t ||j
¡}t t |j|j
j¡dddgd}t  ||¡t |j|¡}t |tƒsÜt‚|j |j¡sît‚|j ttdƒƒ¡st‚t |j|j¡}t |j|¡t |j ¡|¡}tt |j|j¡dddgd d gd
}t |j|j¡|j ¡ t¡|d<t ||¡}tt |j|j¡dddgd d gd
}t     ||¡| t¡}t ||¡}tt |j|j¡dddgd d gd
}t     ||¡ttj dd¡dd dgtdƒd
}ttj dd¡tdƒdd dgd
}tjtddt ||¡W5QRXdS)NééÚaÚbÚcÚpÚqÚrÚs)ÚindexÚcolumnséÚoneZtwo)rééZaligned©Úmatch)rÚnpÚrandomZrandnÚoperatorÚmatmulÚdotÚvaluesÚtmZassert_frame_equalrrZassert_series_equalÚ
isinstanceÚAssertionErrorrÚequalsrrÚrangeZassert_almost_equalÚtolistr ÚroundZastypeÚintÚpytestÚraisesÚ
ValueError)Úselfrr    ÚresultÚexpectedÚdfZdf2©r,ú]d:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\pandas/tests/frame/methods/test_matmul.pyÚ test_matmulsj 
ÿ
ÿ ÿ   ÿ ÿ 
 ÿ ""zTestMatMul.test_matmulc    Csttj dd¡}tj dd¡}t|ƒ}d}tjt|d||W5QRXtjt|d| ¡|W5QRXdS)Né
rrrz)shapes \(10, 4\) and \(5, 3\) not alignedr)rrZrandrr%r&r'r")r(rr    r+Úmsgr,r,r-Útest_matmul_message_shapesJsz%TestMatMul.test_matmul_message_shapesN)Ú__name__Ú
__module__Ú __qualname__r.r1r,r,r,r-rs;r) rÚnumpyrr%ZpandasrrrZpandas._testingZ_testingrrr,r,r,r-Ú<module>s