zmc
2023-12-22 9fdbf60165db0400c2e8e6be2dc6e88138ac719a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
U
­ý°d¤ã@s°ddlZddlZddlmZmZejdd„ƒZejdd„ƒZejdd„ƒZejd    d
„ƒZ    ejdd
gd d d „ƒZ
ejdd„ƒZ ejdd„ƒZ ejdd„ƒZ ejdd„ƒZejdd„ƒZejdd„ƒZejddgd dd„ƒZejdd„d d„d!d„d"d„gd#d$d%d&gd'd(d)„ƒZejddgd d*d+„ƒZejddgd d,d-„ƒZejddgd d.d/„ƒZejd0d1gd d2d3„ƒZejddgd d4d5„ƒZejd6d7„ƒZejed8œd9d:„ƒZdS);éN)ÚSeriesÚoptionscCst‚dS)z3A fixture providing the ExtensionDtype to validate.N©ÚNotImplementedError©rrúVd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\pandas/tests/extension/conftest.pyÚdtype srcCst‚dS)z
    Length-100 array for this type.
 
    * data[0] and data[1] should both be non missing
    * data[0] and data[1] should not be equal
    NrrrrrÚdatasr    cCst‚dS)z3Length-100 array in which all the elements are two.NrrrrrÚ data_for_twossr
cCst‚dS)zLength-2 array with [NA, Valid]NrrrrrÚ data_missing"sr )ÚparamscCs |jdkr|S|jdkr|SdS)z5Parametrized fixture giving 'data' and 'data_missing'r    r N©Úparam)Úrequestr    r rrrÚall_data(s
 
rcs‡fdd„}|S)a 
    Generate many datasets.
 
    Parameters
    ----------
    data : fixture implementing `data`
 
    Returns
    -------
    Callable[[int], Generator]:
        A callable that takes a `count` argument and
        returns a generator yielding `count` datasets.
    c3st|ƒD]
}ˆVqdS©N)Úrange)ÚcountÚ_©r    rrÚgenAs zdata_repeated.<locals>.genr)r    rrrrÚ data_repeated1s rcCst‚dS)zn
    Length-3 array with a known sort order.
 
    This should be three items [B, C, A] with
    A < B < C
    NrrrrrÚdata_for_sortingHsrcCst‚dS)z{
    Length-3 array with a known sort order.
 
    This should be three items [B, NA, A] with
    A < B and NA missing.
    NrrrrrÚdata_missing_for_sortingSsrcCstjS)zÏ
    Binary operator for comparing NA values.
 
    Should return a function of two arguments that returns
    True if both arguments are (scalar) NA for your type.
 
    By default, uses ``operator.is_``
    )ÚoperatorÚis_rrrrÚna_cmp^s
rcCsdS)z6The scalar missing value for this type. Default 'None'NrrrrrÚna_valueksrcCst‚dS)z˜
    Data for factorization, grouping, and unique tests.
 
    Expected to be like [B, B, NA, NA, A, A, B, C]
 
    Where A < B < C and NA is missing
    NrrrrrÚdata_for_groupingqs    rTFcCs|jS)z#Whether to box the data in a Seriesr ©rrrrÚ box_in_series}sr cCsdS©Nér©ÚxrrrÚ<lambda>…ór%cCsdgt|ƒSr!)Úlenr#rrrr%†r&cCstdgt|ƒƒSr!)rr'r#rrrr%‡r&cCs|Srrr#rrrr%ˆr&ZscalarÚlistZseriesÚobject)r ÚidscCs|jS)z,
    Functions to test groupby.apply().
    r rrrrÚgroupby_apply_opƒs r+cCs|jS)zU
    Boolean fixture to support Series and Series.to_frame() comparison testing.
    r rrrrÚas_frame“sr,cCs|jS)zL
    Boolean fixture to support arr and Series(arr) comparison testing.
    r rrrrÚ    as_series›sr-cCs|jS)zd
    Boolean fixture to support comparison testing of ExtensionDtype array
    and numpy array.
    r rrrrÚ    use_numpy£sr.ZffillZbfillcCs|jS)z{
    Parametrized fixture giving method parameters 'ffill' and 'bfill' for
    Series.fillna(method=<method>) testing.
    r rrrrÚ fillna_method¬sr/cCs|jS)zR
    Boolean fixture to support ExtensionDtype _from_sequence method testing.
    r rrrrÚas_arrayµsr0cCs
t t¡S)zØ
    A scalar that *cannot* be held by this ExtensionArray.
 
    The default should work for most subclasses, but is not guaranteed.
 
    If the array can hold any item (i.e. object dtype), then use pytest.skip.
    )r)Ú__new__rrrrÚinvalid_scalar½s    r2)ÚreturncCstjjotjjdkS)z7
    Fixture to check if Copy-on-Write is enabled.
    Úblock)rÚmodeZ copy_on_writeZ data_managerrrrrÚusing_copy_on_writeÉsr6)rZpytestZpandasrrZfixturerr    r
r rrrrrrrr r+r,r-r.r/r0r2Úboolr6rrrrÚ<module>sb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ü
ù