zmc
2023-08-08 e792e9a60d958b93aef96050644f369feb25d61b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
U
­ý°d.ã@s`dZddlZddlZddlmZddlmZddl    m
Z
dd„Z ej   dejdg¡dd    „ƒZdS)
zg
Though Index.fillna and Series.fillna has separate impl,
test here to confirm these works as the same
éN)Ú
MultiIndex)Ú allow_na_opsc    Csz|}t|tƒr:d}tjt|d| d¡W5QRXdSt|ƒdkrP|jdnd}| |¡}t     ||¡||k    svt
‚dS)Nz"isna is not defined for MultiIndex)Úmatchr) Ú
isinstancerÚpytestZraisesÚNotImplementedErrorÚfillnaÚlenÚvaluesÚtmÚ assert_equalÚAssertionError)Úindex_or_series_objÚobjÚmsgÚ
fill_valueÚresult©rúTd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\pandas/tests/base/test_fillna.pyÚ test_fillnas
 
 rÚnull_objcCs¾|}t|ƒ}t|ƒs&t |›d¡n4t|ƒdkr>t d¡nt|tƒrZt d|›d¡|j}|d}| ¡}||dd…<||dd…<||ƒ}||ƒ}|     |¡}t
  ||¡||k    sºt ‚dS)Nz  doesn't allow for NA operationséz%Test doesn't make sense on empty datazMultiIndex can't hold 'ú'ré) ÚtyperrÚskipr    rrZ_valuesÚcopyrr r r )rrrÚklassr
rÚexpectedrrrrÚtest_fillna_null"s$  
 
 r)Ú__doc__ÚnumpyÚnprZpandasrZpandas._testingZ_testingr Zpandas.tests.base.commonrrÚmarkZ parametrizeÚnanrrrrrÚ<module>s