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
23
24
25
26
27
28
29
30
31
32
33
34
35
U
¬ý°dÄã@sxdZddlmZddlZddlZddlZddlmZddl    Z
ddl m Z Gdd„dƒZ Gdd    „d    ƒZd
d d œd d„ZdS)zE
Utility functions and objects for implementing the interchange API.
é)Ú annotationsN)ÚDtypeObj)Úis_datetime64_dtypec@s\eZdZdZdZdZdZdZdZdZ    dZ
d    Z d
Z d Z d Zd ZdZdZdZdZdZdZdZdS)Ú ArrowCTypesz¹
    Enum for Apache Arrow C type format strings.
 
    The Arrow C data interface:
    https://arrow.apache.org/docs/format/CDataInterface.html#data-type-description-format-strings
    ÚnÚbÚcÚCÚsÚSÚiÚIÚlÚLÚeÚfÚgÚuÚUZtdDZtdmzts{resolution}:{tz}ztt{resolution}N)Ú__name__Ú
__module__Ú __qualname__Ú__doc__ÚNULLÚBOOLZINT8ZUINT8ZINT16ZUINT16ZINT32ZUINT32ÚINT64ZUINT64ZFLOAT16ZFLOAT32ZFLOAT64ÚSTRINGZ LARGE_STRINGZDATE32ZDATE64Ú    TIMESTAMPZTIME©rrúTd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\pandas/core/interchange/utils.pyrs(rc@s eZdZdZdZdZdZdZdS)Ú
Endiannessz.Enum indicating the byte-order of a data-type.ú<ú>ú=ú|N)rrrrZLITTLEZBIGZNATIVEZNArrrrr 4s
r rÚstr)ÚdtypeÚreturncCs”t|tjƒrtjS|t d¡kr&tjStt|j     
¡dƒ}|dk    rD|St |ƒr€t   dt tj|¡j¡ddd…}tjj|ddStd|›d    ƒ‚dS)
a 
    Represent pandas `dtype` as a format string in Apache Arrow C notation.
 
    Parameters
    ----------
    dtype : np.dtype
        Datatype of pandas DataFrame to represent.
 
    Returns
    -------
    str
        Format string in Apache Arrow C notation of the given `dtype`.
    ÚONz\[(.*)\]réÚ)Ú
resolutionÚtzzConversion of z- to Arrow C format string is not implemented.)Ú
isinstanceÚpdZCategoricalDtyperrÚnpr&rÚgetattrÚnameÚupperrÚreÚfindallÚtypingÚcastr%rÚformatÚNotImplementedError)r&Z
format_strr+rrrÚdtype_to_arrow_c_fmt=s $
ÿr9)rÚ
__future__rr3r5Únumpyr/Zpandas._typingrZpandasr.Zpandas.api.typesrrr r9rrrrÚ<module>s   "