U
    āĒ-eū  ć                   @   sL   d dl mZ d dlmZmZ d dlZd dlZd dl	Z
d	ddZd
ddZdS )é    )ŚOrderedDict)ŚdateŚtimeNFc                 C   s¢  dt  ” fdt  ” fdt  ” fdt  ” fdt  ” fdt  ” fdt  ” fdt  ” fd	t  	” fd
t  
” fg
}t }g }|D ]N\}}| t  |t  |””” tjd|dtjd|ddtjd|dg||< qv| t  dt  t  ” ””” tjddgdddtjdgddtjdddgddg|d< | t  dt  t  d”””” tjdddgddddtjdddgddg|d< | r| t  dt  ” ”” t |”}t  |”}||fS )zå
    Dataframe with numpy arrays columns of every possible primitive type.

    Returns
    -------
    df: pandas.DataFrame
    schema: pyarrow.Schema
        Arrow schema definition that is in line with the constructed df.
    Śi1Śi2Śi4Śi8Śu1Śu2Zu4Śu8Zf4Zf8é
   ©Śdtypeé   Né   ŚstrŚ1õ   Ć¤ŚobjectŚ2Ś3Z
datetime64Śmsz2007-07-13T01:23:34.123456789z2010-08-13T05:46:57.437699912zdatetime64[ms]z2007-07-13T02Ś__index_level_0__)ŚpaZint8Zint16Zint32Śint64Zuint8Zuint16Zuint32Zuint64Zfloat32Śfloat64r   ŚappendŚfieldŚlist_ŚnpZarangeŚstringŚarrayŚ	timestampŚpdŚ	DataFrameŚschema)Śinclude_indexZdtypesŚarraysŚfieldsr   Zarrow_dtypeŚdfr%   © r*   ś^/var/www/html/Darija-Ai-Train/env/lib/python3.8/site-packages/pyarrow/tests/pandas_examples.pyŚdataframe_with_arrays   s\    

 

 

 

 
üü
üžżžżł

r,   c                 C   sŠ  t  }g }| t dt t ” ””” dddddddd	d
dg
dddddgdg tjdddddddd	d
dg
d tjdddd g|d< | t dt t ” ””” ddddddddddg
dddddgdg t ddddddddddg
d ”ddd g|d< | t dt t 	” ””” ddgddgdddgg g|d< | t dt t 
” ””” dd gddgdd!d"gg g|d< g td#ddtd$d%d&gtd'dd	gdtd(ddtd)d	dgg}td*d+d+tdddtd*d,d,gg td-dd,gdtdddtd.ddtd%d	dgg}t ” |ft ” |ft d/”|ft d0”|ft d1”|fg}|sV|t d2”|fg7 }|D ]<\}}d3 |”}	t |”}
t |	|
”}| |” |||	< qZ| r“| t d4t ” ”” t |”}t |”}||fS )5a)  
    Dataframe with list columns of every possible primitive type.

    Returns
    -------
    df: pandas.DataFrame
    schema: pyarrow.Schema
        Arrow schema definition that is in line with the constructed df.
    parquet_compatible: bool
        Exclude types not supported by parquet
    r   r   r   é   é   é   r   é   é   é   é	   Nr   Śdoubleg        g      š?g       @g      @g      @g      @g      @g      @g       @g      "@Z
bytes_listó   1ó   fó   2ó   3Zstr_listr   r   r   r   iā  iš  é   é   iŠ  i±  i“  é   é   é;   é   é   Śsr   ŚusŚnsz{}_listr   )r   r   r   r   r   r   r   r!   r   Śbinaryr    r   r   Zdate32Zdate64Ztime32Ztime64Śformatr#   r$   r%   )r&   Zparquet_compatibler'   r(   Z	date_dataZ	time_dataZtemporal_pairsZ
value_typeŚdataŚ
field_nameZ
field_typer   r)   r%   r*   r*   r+   Śdataframe_with_listsS   s    ’’ū*ūūū	ū  ū	

ū’




rG   )F)FF)Ścollectionsr   Śdatetimer   r   Śnumpyr   Zpandasr#   Zpyarrowr   r,   rG   r*   r*   r*   r+   Ś<module>   s   
9