� B�gW�� ��UdZddlmZddlmZddlZddlmZmZddl Z ddl Z ddl Z ddl m Z ddlmZmZmZmZmZmZmZddlZddlZddlmZmZmZmZdd lmZm Z!dd l"m#Z#dd l$m%Z%dd l&m'Z'dd l(m)Z)ddl*m+Z+m,Z,m-Z-m.Z.m/Z/ddl0m1Z1ddl2m3Z3ddl4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z:ddl;m<Z<m=Z=m>Z>m?Z?ddl@mAZAddlBmCZCmDZDmEZEmFZFmGZGmHZHmIZImJZJmKZKmLZLddlMmNZNmOZOmPZPddlQmRcmSZTddlUmVZVmWZWddlXmYZYddlZm[Z[ddl\m]Z]m^Z^ddl_m`Z`ddlambZbmcZcer4ddldmeZemfZfmgZgddlhmiZiddljmkZkmlZlmmZmddlnmoZompZpmqZqmrZrmsZsmtZtmuZumvZvdd l\mwZwd!Zxd"Zyd#�Zzd�d(�Z{d)�Z|eVZ}d�d,�Z~d-Zd.e�d/<d0Z�d.e�d1<d2Z�d.e�d3<d4d4d5d5d6�Z�eCdgiZ�d7Z�d.e�d8<d9Z�d.e�d:<ej�d;��5ej�d<d=e�ej��>��ej�d?de�ej�gd@����>��ddd��n #1swxYwYda�d=a�dA�Z� d�d�dZ�Z� d�d�dd�Z�d�dh�Z�Gdi�dj��Z�Gdk�dl��Z�Gdm�dn��Z�Gdo�dpe���Z�Gdq�dre���Z�Gds�dte���Z�Gdu�dve���Z�Gdw�dx��Z�Gdy�dze���Z�Gd{�d|e���Z�Gd}�d~e���Z�Gd�d�e���Z�Gd��d�e���Z�Gd��d�e���Z�Gd��d�e���Z�Gd��d�e���Z�Gd��d�e���Z�Gd��d�e���Z�Gd��d�e���Z�Gd��d�e���Z� d�d�d��Z�d�d��Z�e d�d�d����Z�ed�d�d����Z� d�d�d��Z�d�d��Z�d�d��Z�d�d��Z�d�d��Z�d�d��Z�d�d��Z�d�d��Z�d�d��Z�d�d��Z�d�d��Z�d�d��Z�Gd��d���Z�dS)�zY High level interface to PyTables for reading and writing pandas data structures to disk �)� annotations)�suppressN)�date�tzinfo)�dedent)� TYPE_CHECKING�Any�Callable�Final�Literal�cast�overload)�config� get_option�using_copy_on_write�using_pyarrow_string_dtype)�lib�writers)�is_string_array)� timezones)�import_optional_dependency)� patch_pickle)�AttributeConflictWarning�ClosedFileError�IncompatibilityWarning�PerformanceWarning�PossibleDataLossError)�cache_readonly)�find_stack_level)� ensure_object� is_bool_dtype�is_complex_dtype� is_list_like�is_string_dtype�needs_i8_conversion)�CategoricalDtype�DatetimeTZDtype�ExtensionDtype� PeriodDtype)�array_equivalent) � DataFrame� DatetimeIndex�Index� MultiIndex� PeriodIndex� RangeIndex�Series�TimedeltaIndex�concat�isna)� Categorical� DatetimeArray� PeriodArray)� PyTablesExpr�maybe_expression)� extract_array)� ensure_index)� ArrayManager� BlockManager)�stringify_path)�adjoin� pprint_thing)�Hashable�Iterator�Sequence)� TracebackType)�Col�File�Node)� AnyArrayLike� ArrayLike�AxisInt�DtypeArg�FilePath�Self�Shape�npt)�Blockz0.15.2�UTF-8c�d�t|tj��r|�d��}|S)z(if we have bytes, decode them to unicoderQ)� isinstance�np�bytes_�decode)�ss �b/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/pandas/io/pytables.py�_ensure_decodedrY�s,���!�R�Y���� �H�H�W� � �� �H��encoding� str | None�return�strc��|�t}|S�N)�_default_encoding�r[s rX�_ensure_encodingrc�s����$�� �OrZc�N�t|t��rt|��}|S)z� Ensure that an index / column name is a str (python 3); otherwise they may be np.string dtype. Non-string dtypes are passed through unchanged. https://github.com/pandas-dev/pandas/issues/13492 )rSr^��names rX� _ensure_strrg�s&���$������4�y�y�� �KrZ� scope_level�intc����|dz�t|ttf��r�fd�|D��}n t|��rt |����}|�t |��r|ndS)z� Ensure that the where is a Term or a list of Term. This makes sure that we are capturing the scope of variables that are passed create the terms here with a frame_level=2 (we are 2 levels down) �c�^��g|])}|�t|��rt|�dz���n|��*S)Nrk�rh)r9�Term)�.0�term�levels �rX� <listcomp>z _ensure_term.<locals>.<listcomp>�sM��� � � ����2B�$�1G�1G� Q�D��5�1�9� -� -� -� -�T���rZrmN)rS�list�tupler9rn�len)�whererhrqs @rX� _ensure_termrw�s���� �!�O�E��%�$���'�'�/� � � � �� � � ��� �%� � �/��U��.�.�.���M�S��Z�Z�M�5�5�T�9rZz� where criteria is being ignored as this version [%s] is too old (or not-defined), read the file in and write it out to a new file to upgrade (with the copy_to method) r �incompatibility_doczu the [%s] attribute of the existing index is [%s] which conflicts with the new [%s], resetting the attribute to None �attribute_conflict_docz� your performance may suffer as PyTables will pickle object types that it cannot map directly to c-types [inferred_type->%s,key->%s] [items->%s] �performance_doc�fixed�table)�fr{�tr|z; : boolean drop ALL nan rows when appending to a table � dropna_docz~ : format default format writing format, if None, then put will default to 'fixed' and append will default to 'table' � format_doczio.hdf� dropna_tableF)� validator�default_format)r{r|Nc��t�Bddl}|att��5|jjdkaddd��n #1swxYwYtS)Nr�strict)� _table_mod�tablesr�AttributeError�file�_FILE_OPEN_POLICY�!_table_file_open_policy_is_strict)r�s rX�_tablesr��s������ � � �� � �n� %� %� � �� �-��9� .� � � � � � � � � � � ���� � � � � �s�?�A�A�aTr�� path_or_buf�FilePath | HDFStore�key�value�DataFrame | Series�mode� complevel� int | None�complib�append�bool�format�index� min_itemsize�int | dict[str, int] | None�dropna� bool | None� data_columns� Literal[True] | list[str] | None�errors�Nonec �(����� � � � � ��|r� � �� ���� � �f d�}n� � �� ���� � �f d�}t|��}t|t��r9t||||���5}||��ddd��dS#1swxYwYdS||��dS)z+store this object, close it if we opened itc �B� �|��� ���� ������ � S)N)r�r�r��nan_repr�r�r�r[)r�� �storer�r�r[r�r�r�r�r�r�r�s ����������rX�<lambda>zto_hdf.<locals>.<lambda>s8���%�,�,� � ���%���%���'�  �  �rZc �B� �|��� ���� ������ � S)N)r�r�r�r�r�r�r[r���putr�s ����������rXr�zto_hdf.<locals>.<lambda>%s8���%�)�)� � ���%��%����$�  �  �rZ)r�r�r�N)r>rSr^�HDFStore)r�r�r�r�r�r�r�r�r�r�r�r�r�r�r[r}r�s `` ```````` rX�to_hdfr�s_������������$� � � � � � � � � � � � � � ��� � � � � � � � � � � � � ��!��-�-�K��+�s�#�#�� � �d�i�� � � � � � �A�e�H�H�H� � � � � � � � � � � � ���� � � � � � � ��+�����s�! A:�:A>�A>�rrv�str | list | None�start�stop�columns�list[str] | None�iterator� chunksizec ���|dvrtd|�d����|�t|d���}t|t��r|jst d���|} d} n�t |��}t|t��std ��� tj � |��} n#ttf$rd} YnwxYw| std |�d ����t|f||d �| ��} d } |�q| ���}t|��dkrtd���|d}|dd�D]!}t!||��std����"|j}| �||||||| | ���S#ttt&f$rWt|t��s@t)t*��5| ���ddd��n #1swxYwY�wxYw)a" Read from the store, close it if we opened it. Retrieve pandas object stored in file, optionally based on where criteria. .. warning:: Pandas uses PyTables for reading and writing HDF5 files, which allows serializing object-dtype data with pickle when using the "fixed" format. Loading pickled data received from untrusted sources can be unsafe. See: https://docs.python.org/3/library/pickle.html for more. Parameters ---------- path_or_buf : str, path object, pandas.HDFStore Any valid string path is acceptable. Only supports the local file system, remote URLs and file-like objects are not supported. If you want to pass in a path object, pandas accepts any ``os.PathLike``. Alternatively, pandas accepts an open :class:`pandas.HDFStore` object. key : object, optional The group identifier in the store. Can be omitted if the HDF file contains a single pandas object. mode : {'r', 'r+', 'a'}, default 'r' Mode to use when opening the file. Ignored if path_or_buf is a :class:`pandas.HDFStore`. Default is 'r'. errors : str, default 'strict' Specifies how encoding and decoding errors are to be handled. See the errors argument for :func:`open` for a full list of options. where : list, optional A list of Term (or convertible) objects. start : int, optional Row number to start selection. stop : int, optional Row number to stop selection. columns : list, optional A list of columns names to return. iterator : bool, optional Return an iterator object. chunksize : int, optional Number of rows to include in an iteration when using an iterator. **kwargs Additional keyword arguments passed to HDFStore. Returns ------- object The selected object. Return type depends on the object stored. See Also -------- DataFrame.to_hdf : Write a HDF file from a DataFrame. HDFStore : Low-level access to HDF files. Examples -------- >>> df = pd.DataFrame([[1, 1.0, 'a']], columns=['x', 'y', 'z']) # doctest: +SKIP >>> df.to_hdf('./store.h5', 'data') # doctest: +SKIP >>> reread = pd.read_hdf('./store.h5') # doctest: +SKIP )r��r+r�zmode zG is not allowed while performing a read. Allowed modes are r, r+ and a.Nrkrmz&The HDFStore must be open for reading.Fz5Support for generic buffers has not been implemented.zFile z does not exist)r�r�Trz]Dataset(s) incompatible with Pandas data types, not table, or no datasets found in HDF5 file.z?key must be provided when HDF5 file contains multiple datasets.)rvr�r�r�r�r�� auto_close)� ValueErrorrwrSr��is_open�OSErrorr>r^�NotImplementedError�os�path�exists� TypeError�FileNotFoundError�groupsru�_is_metadata_of� _v_pathname�select� LookupErrorrr��close)r�r�r�r�rvr�r�r�r�r��kwargsr�r�r�r��candidate_only_group�group_to_checks rX�read_hdfr�<s���^ �#�#�#�� .�D� .� .� .� � � �  ���U��2�2�2���+�x�(�(���"� D��B�C�C� C���� � �$�[�1�1� ��+�s�+�+� �%�G��� � ��W�^�^�K�0�0�F�F���:�&� � � ��F�F�F� ����� J�#�$H�K�$H�$H�$H�I�I� I���I�4��I�I�&�I�I��� �%� �;��\�\�^�^�F��6�{�{�a��� �D����$*�!�9� � #)����*� � ��&�~�7K�L�L��$�;����� '�2�C��|�|� �������!��  �  � �� � �;� /�����+�x�0�0� ��.�)�)� � �� � � � � � � � � � � � � � � � ���� � � � � � ���sD�B/�/C�C�0BF�AG.�G!� G.�!G% �%G.�(G% �)G.�grouprG� parent_groupc��|j|jkrdS|}|jdkr,|j}||kr |jdkrdS|j}|jdk�,dS)zDCheck if a given group is a metadata group for a given parent_group.Frk�metaT)�_v_depth� _v_parent�_v_name)r�r��current�parents rXr�r��sm�� �~��.�.�.��u��G� � �Q� � ��"�� �\� !� !�g�o��&?�&?��4��#�� � �Q� � � �5rZc�v�eZdZUdZded<ded< dtdud�Zdvd�Zed���Zedvd���Z dwd�Z dxd�Z dxd�Z dyd�Z dzd�Zd{d�Zdvd�Zd|d�Zd}d&�Zd~dd*�Zd�d,�Zd�d.�Zd�d�d/�Zd�d0�Zed�d1���Zd�d�d3�Zdwd4�Z d�d�d8�Z d�d�d;�Z d�d�d=�Z d�d�d>�Z d�d�dL�Zd�dxdM�Z d�d�dP�Z! d�d�dS�Z" d�d�dW�Z#d�dY�Z$d�d�d]�Z%d�d_�Z&d�da�Z' d�d�de�Z(dvdf�Z)d�dg�Z*d�di�Z+ d�d�dm�Z, d�d�dn�Z-d�dq�Z.d�dr�Z/d�ds�Z0dS)�r�aS Dict-like IO interface for storing pandas objects in PyTables. Either Fixed or Table format. .. warning:: Pandas uses PyTables for reading and writing HDF5 files, which allows serializing object-dtype data with pickle when using the "fixed" format. Loading pickled data received from untrusted sources can be unsafe. See: https://docs.python.org/3/library/pickle.html for more. Parameters ---------- path : str File path to HDF5 file. mode : {'a', 'w', 'r', 'r+'}, default 'a' ``'r'`` Read-only; no data can be modified. ``'w'`` Write; a new file is created (an existing file with the same name would be deleted). ``'a'`` Append; an existing file is opened for reading and writing, and if the file does not exist it is created. ``'r+'`` It is similar to ``'a'``, but the file must already exist. complevel : int, 0-9, default None Specifies a compression level for data. A value of 0 or None disables compression. complib : {'zlib', 'lzo', 'bzip2', 'blosc'}, default 'zlib' Specifies the compression library to be used. These additional compressors for Blosc are supported (default if no compressor specified: 'blosc:blosclz'): {'blosc:blosclz', 'blosc:lz4', 'blosc:lz4hc', 'blosc:snappy', 'blosc:zlib', 'blosc:zstd'}. Specifying a compression library which is not available issues a ValueError. fletcher32 : bool, default False If applying compression use the fletcher32 checksum. **kwargs These parameters will be passed to the PyTables open_file method. Examples -------- >>> bar = pd.DataFrame(np.random.randn(10, 4)) >>> store = pd.HDFStore('test.h5') >>> store['foo'] = bar # write to HDF5 >>> bar = store['foo'] # retrieve >>> store.close() **Create or load HDF5 file in-memory** When passing the `driver` option to the PyTables open_file method through **kwargs, the HDF5 file is loaded or created in-memory and will only be written when closed: >>> bar = pd.DataFrame(np.random.randn(10, 4)) >>> store = pd.HDFStore('test.h5', driver='H5FD_CORE') >>> store['foo'] = bar >>> store.close() # only now, data is written to disk z File | None�_handler^�_moder�NFr�r�r�� fletcher32r�r]r�c �n�d|vrtd���td��}|�+||jjvrtd|jj�d����|�|� |jj}t |��|_|�d}||_d|_|r|nd|_ ||_ ||_ d|_ |j d d|i|��dS) Nr�z-format is not a defined argument for HDFStorer�zcomplib only supports z compression.r�rr��)r�r�filters� all_complibs�default_complibr>�_pathr�r�� _complevel�_complib� _fletcher32�_filters�open)�selfr�r�r�r�r�r�r�s rX�__init__zHDFStore.__init__*s��� �v� � ��L�M�M� M�+�H�5�5�� � �7�&�.�2M�#M�#M��S���)D�S�S�S��� � �?�y�4��n�4�G�#�D�)�)�� � �<��D��� ��� �'0�7�)�)�a����� �%����� ��� �&�&�t�&�v�&�&�&�&�&rZc��|jSr`�r��r�s rX� __fspath__zHDFStore.__fspath__Ks ���z�rZc�T�|���|j�J�|jjS)zreturn the root node)�_check_if_openr��rootr�s rXr�z HDFStore.rootNs/�� �������|�'�'�'��|� � rZc��|jSr`r�r�s rX�filenamezHDFStore.filenameU� ���z�rZr�c�,�|�|��Sr`)�get�r�r�s rX� __getitem__zHDFStore.__getitem__Ys���x�x��}�}�rZc�2�|�||��dSr`r�)r�r�r�s rX� __setitem__zHDFStore.__setitem__\s�� ����e�����rZc�,�|�|��Sr`)�remover�s rX� __delitem__zHDFStore.__delitem___s���{�{�3���rZrfc�� |�|��S#ttf$rYnwxYwtdt |��j�d|�d����)z$allow attribute access to get stores�'z' object has no attribute ')r��KeyErrorrr��type�__name__)r�rfs rX� __getattr__zHDFStore.__getattr__bsm�� ��8�8�D�>�>� !���/�*� � � � �D� ����� G��T� � �#� G� G�� G� G� G� � � s ��+�+c�b�|�|��}|�|j}|||dd�fvrdSdS)zx check for existence of this key can match the exact pathname or the pathnm w/o the leading '/' NrkTF)�get_noder�)r�r��noderfs rX� __contains__zHDFStore.__contains__lsE�� �}�}�S�!�!�� � ��#�D��t�T�!�"�"�X�&�&�&��t��urZric�D�t|�����Sr`)rur�r�s rX�__len__zHDFStore.__len__xs���4�;�;�=�=�!�!�!rZc�T�t|j��}t|���d|�d�S)N� File path: � )r@r�r�)r��pstrs rX�__repr__zHDFStore.__repr__{s.���D�J�'�'���t�*�*�3�3�4�3�3�3�3rZrMc��|Sr`r�r�s rX� __enter__zHDFStore.__enter__s��� rZ�exc_type�type[BaseException] | None� exc_value�BaseException | None� traceback�TracebackType | Nonec�.�|���dSr`)r�)r�r rrs rX�__exit__zHDFStore.__exit__�s�� � � � � � � � rZ�pandas�include� list[str]c���|dkrd�|���D��S|dkr/|j�J�d�|j�dd���D��Std |�d ����) a� Return a list of keys corresponding to objects stored in HDFStore. Parameters ---------- include : str, default 'pandas' When kind equals 'pandas' return pandas objects. When kind equals 'native' return native HDF5 Table objects. Returns ------- list List of ABSOLUTE path-names (e.g. have the leading '/'). Raises ------ raises ValueError if kind has an illegal value Examples -------- >>> df = pd.DataFrame([[1, 2], [3, 4]], columns=['A', 'B']) >>> store = pd.HDFStore("store.h5", 'w') # doctest: +SKIP >>> store.put('data', df) # doctest: +SKIP >>> store.get('data') # doctest: +SKIP >>> print(store.keys()) # doctest: +SKIP ['/data1', '/data2'] >>> store.close() # doctest: +SKIP rc��g|] }|j�� Sr��r��ro�ns rXrrz!HDFStore.keys.<locals>.<listcomp>�s��9�9�9�a�A�M�9�9�9rZ�nativeNc��g|] }|j�� Sr�rrs rXrrz!HDFStore.keys.<locals>.<listcomp>�s'�����"#�� ���rZ�/�Table)� classnamez8`include` should be either 'pandas' or 'native' but is 'r�)r�r�� walk_nodesr�)r�rs rX�keysz HDFStore.keys�s���< �h� � �9�9�4�;�;�=�=�9�9�9� 9� �� � ��<�+�+�+���'+�|�'>�'>�s�g�'>�'V�'V���� �� Q�w� Q� Q� Q� � � rZ� Iterator[str]c�D�t|�����Sr`)�iterr"r�s rX�__iter__zHDFStore.__iter__�s���D�I�I�K�K� � � rZ�Iterator[tuple[str, list]]c#�NK�|���D] }|j|fV��dS)z' iterate on key->group N)r�r�)r��gs rX�itemszHDFStore.items�s?��������� #� #�A��-��"� "� "� "� "� #� #rZc ���t��}|j|kr@|jdvr|dvrn+|dvr'|jr td|j�d|j�d����||_|jr|���|jrC|jdkr8t���|j|j|j ���|_ tr|jrd }t|���|j |j|jfi|��|_d S) a9 Open the file in the specified mode Parameters ---------- mode : {'a', 'w', 'r', 'r+'}, default 'a' See HDFStore docstring or tables.open_file for info about modes **kwargs These parameters will be passed to the PyTables open_file method. )r��w)r�r�)r,zRe-opening the file [z ] with mode [z] will delete the current file!r)r�zGCannot open HDF5 file, which is already opened, even in read-only mode.N)r�r�r�rr�r�r��Filtersr�r�r�r�r�� open_filer�)r�r�r�r��msgs rXr�z HDFStore.open�s6������ �:�� � ��z�Z�'�'�D�K�,?�,?�������<��/�8�� �8�8���8�8�8���� �D�J� �<� � �J�J�L�L�L� �?� �t���2�2�#�I�I�-�-�����4�;K�.���D�M� -� "��� "�*� ��S�/�/� !�'�v�'�� �D�J�I�I�&�I�I�� � � rZc�T�|j�|j���d|_dS)z0 Close the PyTables file handle N)r�r�r�s rXr�zHDFStore.close�s+�� �<� #� �L� � � � � ��� � � rZc�F�|j�dSt|jj��S)zF return a boolean indicating whether the file is open NF)r�r��isopenr�s rXr�zHDFStore.is_open�s$�� �<� ��5��D�L�'�(�(�(rZ�fsyncc��|j�u|j���|r\tt��5t j|j�����ddd��dS#1swxYwYdSdSdS)a� Force all buffered modifications to be written to disk. Parameters ---------- fsync : bool (default False) call ``os.fsync()`` on the file handle to force writing to disk. Notes ----- Without ``fsync=True``, flushing may not guarantee that the OS writes to disk. With fsync, the operation will block until the OS claims the file has been written; however, other caching layers may still interfere. N)r��flushrr�r�r3�fileno)r�r3s rXr5zHDFStore.flush�s��� �<� #� �L� � � � � �� 4��g�&�&�4�4��H�T�\�0�0�2�2�3�3�3�4�4�4�4�4�4�4�4�4�4�4�4����4�4�4�4�4�4� $� #� 4� 4s�,A0�0A4�7A4c���t��5|�|��}|�td|�d����|�|��cddd��S#1swxYwYdS)a  Retrieve pandas object stored in file. Parameters ---------- key : str Returns ------- object Same type as object stored in file. Examples -------- >>> df = pd.DataFrame([[1, 2], [3, 4]], columns=['A', 'B']) >>> store = pd.HDFStore("store.h5", 'w') # doctest: +SKIP >>> store.put('data', df) # doctest: +SKIP >>> store.get('data') # doctest: +SKIP >>> store.close() # doctest: +SKIP N�No object named � in the file)rrr�� _read_group�r�r�r�s rXr�z HDFStore.gets���*�^�^� +� +��M�M�#�&�&�E��}��C�#�C�C�C�D�D�D��#�#�E�*�*�  +� +� +� +� +� +� +� +� +� +� +� +���� +� +� +� +� +� +s�?A�A�"Ar�r�r�c �>�� �|�|��} | �td|�d����t|d���}|�| ��� � ����� fd�} t |� | |� j|||||�� � } | ���S)a6 Retrieve pandas object stored in file, optionally based on where criteria. .. warning:: Pandas uses PyTables for reading and writing HDF5 files, which allows serializing object-dtype data with pickle when using the "fixed" format. Loading pickled data received from untrusted sources can be unsafe. See: https://docs.python.org/3/library/pickle.html for more. Parameters ---------- key : str Object being retrieved from file. where : list or None List of Term (or convertible) objects, optional. start : int or None Row number to start selection. stop : int, default None Row number to stop selection. columns : list or None A list of columns that if not None, will limit the return columns. iterator : bool or False Returns an iterator. chunksize : int or None Number or rows to include in iteration, return an iterator. auto_close : bool or False Should automatically close the store when finished. Returns ------- object Retrieved object from file. Examples -------- >>> df = pd.DataFrame([[1, 2], [3, 4]], columns=['A', 'B']) >>> store = pd.HDFStore("store.h5", 'w') # doctest: +SKIP >>> store.put('data', df) # doctest: +SKIP >>> store.get('data') # doctest: +SKIP >>> print(store.keys()) # doctest: +SKIP ['/data1', '/data2'] >>> store.select('/data1') # doctest: +SKIP A B 0 1 2 1 3 4 >>> store.select('/data1', where='columns == A') # doctest: +SKIP A 0 1 1 3 >>> store.close() # doctest: +SKIP Nr8r9rkrmc�6����|||����S)N)r�r�rvr���read)�_start�_stop�_wherer�rWs ��rX�funczHDFStore.select.<locals>.funcys����6�6��U�&�'�6�R�R� RrZ�rv�nrowsr�r�r�r�r�)rr�rw�_create_storer� infer_axes� TableIteratorrE� get_result) r�r�rvr�r�r�r�r�r�r�rC�itrWs ` @rXr�zHDFStore.select/s�����@� � �c�"�"�� �=��?�c�?�?�?�@�@� @��U��2�2�2�� � � �� &� &�� � � ���� S� S� S� S� S� S�� � � ���'�����!�  �  �  ���}�}���rZr�r�c���t|d���}|�|��}t|t��st d���|�|||���S)a� return the selection as an Index .. warning:: Pandas uses PyTables for reading and writing HDF5 files, which allows serializing object-dtype data with pickle when using the "fixed" format. Loading pickled data received from untrusted sources can be unsafe. See: https://docs.python.org/3/library/pickle.html for more. Parameters ---------- key : str where : list of Term (or convertible) objects, optional start : integer (defaults to None), row number to start selection stop : integer (defaults to None), row number to stop selection rkrmz&can only read_coordinates with a table�rvr�r�)rw� get_storerrSrr��read_coordinates)r�r�rvr�r��tbls rX�select_as_coordinateszHDFStore.select_as_coordinates�sd��4�U��2�2�2���o�o�c�"�"���#�u�%�%� F��D�E�E� E��#�#�%�u�4�#�H�H�HrZ�columnc��|�|��}t|t��std���|�|||���S)a~ return a single column from the table. This is generally only useful to select an indexable .. warning:: Pandas uses PyTables for reading and writing HDF5 files, which allows serializing object-dtype data with pickle when using the "fixed" format. Loading pickled data received from untrusted sources can be unsafe. See: https://docs.python.org/3/library/pickle.html for more. Parameters ---------- key : str column : str The column of interest. start : int or None, default None stop : int or None, default None Raises ------ raises KeyError if the column is not found (or key is not a valid store) raises ValueError if the column can not be extracted individually (it is part of a data block) z!can only read_column with a table)rQr�r�)rMrSrr�� read_column)r�r�rQr�r�rOs rX� select_columnzHDFStore.select_column�sP��F�o�o�c�"�"���#�u�%�%� A��?�@�@� @����f�E���E�E�ErZc ������t|d���}t|ttf��rt |��dkr|d}t|t ��r��||�||||| ���St|ttf��std���t |��std���|�|d}�fd�|D����� |��} d} tj | |fgt�|����D]]\} } | �td | �d ����| jstd | j�d ����| �| j} �C| j| krtd ����^d��D��}d�|D���������fd�}t%�| ||| ||||| �� � }|�d���S)a� Retrieve pandas objects from multiple tables. .. warning:: Pandas uses PyTables for reading and writing HDF5 files, which allows serializing object-dtype data with pickle when using the "fixed" format. Loading pickled data received from untrusted sources can be unsafe. See: https://docs.python.org/3/library/pickle.html for more. Parameters ---------- keys : a list of the tables selector : the table to apply the where criteria (defaults to keys[0] if not supplied) columns : the columns I want back start : integer (defaults to None), row number to start selection stop : integer (defaults to None), row number to stop selection iterator : bool, return an iterator, default False chunksize : nrows to include in iteration, return an iterator auto_close : bool, default False Should automatically close the store when finished. Raises ------ raises KeyError if keys or selector is not found or keys is empty raises TypeError if keys is not a list or tuple raises ValueError if the tables are not ALL THE SAME DIMENSIONS rkrmr)r�rvr�r�r�r�r�r�zkeys must be a list/tuplez keys must have a non-zero lengthNc�:��g|]}��|����Sr�)rM)ro�kr�s �rXrrz/HDFStore.select_as_multiple.<locals>.<listcomp>s%���1�1�1�q�����"�"�1�1�1rZzInvalid table [�]zobject [z>] is not a table, and cannot be used in all select as multiplez,all tables must have exactly the same nrows!c�<�g|]}t|t���|��Sr�)rSr�ro�xs rXrrz/HDFStore.select_as_multiple.<locals>.<listcomp>-s'��9�9�9�q�J�q�%�$8�$8�9��9�9�9rZc�4�h|]}|jdd��S�r)�non_index_axes)ror~s rX� <setcomp>z.HDFStore.select_as_multiple.<locals>.<setcomp>0s%��6�6�6�1�� ��#�A�&�6�6�6rZc�t���������fd��D��}t|�d������S)Nc�B��g|]}|����������S)�rvr�r�r�r>)ror~r@rArBr�s ����rXrrz=HDFStore.select_as_multiple.<locals>.func.<locals>.<listcomp>5s=����������V�W�F���O�O���rZF)�axis�verify_integrity)r3� _consolidate)r@rArB�objsrcr��tblss``` ���rXrCz)HDFStore.select_as_multiple.<locals>.func2s`�����������������D� �$�T�E�B�B�B�O�O�Q�Q� QrZrDT)� coordinates)rwrSrsrtrur^r�r�r�rM� itertools�chain�zipr��is_table�pathnamerE�poprHrI)r�r"rv�selectorr�r�r�r�r�r�rWrEr~rW�_tblsrCrJrcrgs` ` @@rX�select_as_multiplezHDFStore.select_as_multiple�sq������V�U��2�2�2�� �d�T�5�M� *� *� �s�4�y�y�A�~�~���7�D� �d�C� � � ��;�;������!�#�%�� � � ��$��u� �.�.� 9��7�8�8� 8��4�y�y� A��?�@�@� @� � ��A�w�H�2�1�1�1�D�1�1�1�� �O�O�H� %� %�����O�a��]�O�S��t�_�_�E�E� Q� Q�D�A�q��y��5��5�5�5�6�6�6��:� ��)�q�z�)�)�)���� �}�������E�!�!� �!O�P�P�P�"� :�9�D�9�9�9��7�6��6�6�6�:�:�<�<�� R� R� R� R� R� R� R�� � � �������!�  �  �  ���}�}��}�.�.�.rZTr�r�r�r�r�r�r�r�r�r�� track_timesr�c��|�td��pd}|�|��}|�||||||||| | | | | |���dS)a� Store object in HDFStore. Parameters ---------- key : str value : {Series, DataFrame} format : 'fixed(f)|table(t)', default is 'fixed' Format to use when storing object in HDFStore. Value can be one of: ``'fixed'`` Fixed format. Fast writing/reading. Not-appendable, nor searchable. ``'table'`` Table format. Write as a PyTables Table structure which may perform worse but allow more flexible operations like searching / selecting subsets of the data. index : bool, default True Write DataFrame index as a column. append : bool, default False This will force Table format, append the input data to the existing. data_columns : list of columns or True, default None List of columns to create as data columns, or True to use all columns. See `here <https://pandas.pydata.org/pandas-docs/stable/user_guide/io.html#query-via-data-columns>`__. encoding : str, default None Provide an encoding for strings. track_times : bool, default True Parameter is propagated to 'create_table' method of 'PyTables'. If set to False it enables to have the same h5 files (same hashes) independent on creation time. dropna : bool, default False, optional Remove missing values. Examples -------- >>> df = pd.DataFrame([[1, 2], [3, 4]], columns=['A', 'B']) >>> store = pd.HDFStore("store.h5", 'w') # doctest: +SKIP >>> store.put('data', df) # doctest: +SKIP N�io.hdf.default_formatr{) r�r�r�r�r�r�r�r�r[r�rrr�)r�_validate_format�_write_to_group)r�r�r�r�r�r�r�r�r�r�r�r[r�rrr�s rXr�z HDFStore.putMs���p �>�� 7�8�8�C�G�F��&�&�v�.�.�� ��� � ������%��%���#�� � � � � � rZc���t|d���} |�|��}np#t$r�t$r�t$rO}|�t d��|�|�|��}|�|�d���Yd}~dSYd}~nd}~wwxYwtj |||��r|j �d���dS|j st d���|� |||���S) a: Remove pandas object partially by specifying the where condition Parameters ---------- key : str Node to remove or delete rows from where : list of Term (or convertible) objects, optional start : integer (defaults to None), row number to start selection stop : integer (defaults to None), row number to stop selection Returns ------- number of rows removed (or None if not a Table) Raises ------ raises KeyError if key is not a valid store rkrmNz5trying to remove a node with a non-None where clause!T�� recursivez7can only remove with where on objects written as tablesrL) rwrMr��AssertionError� Exceptionr�r� _f_remove�com�all_noner�rl�delete)r�r�rvr�r�rW�errrs rXr�zHDFStore.remove�sU��*�U��2�2�2�� �����$�$�A�A��� � � � �� � � � �� � � �� � �K����� �=�=��%�%�D��������.�.�.��t�t�t�t�t� ��������� ���� �<��u�d� +� +� A� �G� � �� � -� -� -� -� -��:� � �M�����8�8�%�u�4�8�@�@� @s�)�B�?B�B�bool | list[str]r�c���| �td���|�td��}|�td��pd}|�|��}|�||||||||| | | | ||||���dS)a| Append to Table in file. Node must already exist and be Table format. Parameters ---------- key : str value : {Series, DataFrame} format : 'table' is the default Format to use when storing object in HDFStore. Value can be one of: ``'table'`` Table format. Write as a PyTables Table structure which may perform worse but allow more flexible operations like searching / selecting subsets of the data. index : bool, default True Write DataFrame index as a column. append : bool, default True Append the input data to the existing. data_columns : list of columns, or True, default None List of columns to create as indexed data columns for on-disk queries, or True to use all columns. By default only the axes of the object are indexed. See `here <https://pandas.pydata.org/pandas-docs/stable/user_guide/io.html#query-via-data-columns>`__. min_itemsize : dict of columns that specify minimum str sizes nan_rep : str to use as str nan representation chunksize : size to chunk the writing expectedrows : expected TOTAL row size of this table encoding : default None, provide an encoding for str dropna : bool, default False, optional Do not write an ALL nan row to the store settable by the option 'io.hdf.dropna_table'. Notes ----- Does *not* check if data being appended overlaps with existing data in the table, so be careful Examples -------- >>> df1 = pd.DataFrame([[1, 2], [3, 4]], columns=['A', 'B']) >>> store = pd.HDFStore("store.h5", 'w') # doctest: +SKIP >>> store.put('data', df1, format='table') # doctest: +SKIP >>> df2 = pd.DataFrame([[5, 6], [7, 8]], columns=['A', 'B']) >>> store.append('data', df2) # doctest: +SKIP >>> store.close() # doctest: +SKIP A B 0 1 2 1 3 4 0 5 6 1 7 8 Nz>columns is not a supported keyword in append, try data_columnszio.hdf.dropna_tablertr|)r��axesr�r�r�r�r�r�r�� expectedrowsr�r�r[r�)r�rrurv)r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r[r�s rXr�zHDFStore.append�s���R � ��P��� � �>�� 5�6�6�F� �>�� 7�8�8�C�G�F��&�&�v�.�.�� ��� � �������%���%��%���! � � � � � rZ�d�dictc ����|�td���t|t��std���||vrtd���t t t t�j����t tt�����z ����}d} g} |� ��D]0\} ���| �td���| } �| � ����1| �i�j |} | �t| ����} t!| �| ����} | �| ��|| <|�||}|rV�fd�|���D��}t |��}|D]}|�|��}��j|�|�dd��}|� ��D]\\} �| |kr|nd}���|���}|� �fd �|� ��D��nd}|j| |f||d �|���]dS) a Append to multiple tables Parameters ---------- d : a dict of table_name to table_columns, None is acceptable as the values of one node (this will get all the remaining columns) value : a pandas object selector : a string that designates the indexable table; all of its columns will be designed as data_columns, unless data_columns is passed, in which case these are used data_columns : list of columns to create as data columns, or True to use all columns dropna : if evaluates to True, drop rows from all tables if any single row in each table has all NaN. Default False. Notes ----- axes parameter is currently not accepted Nztaxes is currently not accepted as a parameter to append_to_multiple; you can create the tables independently insteadzQappend_to_multiple must have a dictionary specified as the way to split the valuez=append_to_multiple requires a selector that is in passed dictz<append_to_multiple can only have one value in d that is Nonec3�Z�K�|]%}�|�d���jV��&dS)�all)�howN)r�r�)ro�colsr�s �rX� <genexpr>z.HDFStore.append_to_multiple.<locals>.<genexpr>�s;�����O�O�D�E�$�K�&�&�5�&�1�1�7�O�O�O�O�O�OrZr��rcc�$��i|] \}}|�v� ||�� Sr�r�)ror�r��vs �rX� <dictcomp>z/HDFStore.append_to_multiple.<locals>.<dictcomp>�s$���Q�Q�Q� ��e��q����e���rZ)r�r�)r�rSr�r��nextr%�set�range�ndim� _AXES_MAPr�r*�extendr�� differencer-�sorted� get_indexer�take�values� intersection�locrn�reindexr�)r�r�r�ror�r�r�r�rc� remain_key� remain_valuesrW�ordered�ordd�idxs� valid_indexr�r��dc�val�filteredr�s ` @rX�append_to_multiplezHDFStore.append_to_multiple8s�����> � ��B��� � �!�T�"�"� ��)��� � �1� � ��O��� � �D��U�5�:�.�.�/�/�#�i��U� � �6L�2M�2M�M�N�N�O�O��� � � ��G�G�I�I� (� (�D�A�q��y��)�$�V����� � ��$�$�Q�'�'�'�'� � !��j��&�G��%�%�e�M�&:�&:�;�;�D��'�-�-�d�3�3�4�4�D�#�L�L��.�.�A�j�M� � ��X�;�L� � +�O�O�O�O�A�H�H�J�J�O�O�O�D��t�*�*�K�� >� >��)�6�6�u�=�=� � ��I�k�*�E��z�z�.�$�7�7� ��G�G�I�I� R� R�D�A�q�!"�h�����D�B��-�-���-�-�-�C� �+�R�Q�Q�Q� �0B�0B�0D�0D�Q�Q�Q�Q�� � �D�K��3� Q�R�h� Q� Q�&� Q� Q� Q� Q� R� RrZ�optlevel�kindr\c���t��|�|��}|�dSt|t��st d���|�|||���dS)a� Create a pytables index on the table. Parameters ---------- key : str columns : None, bool, or listlike[str] Indicate which columns to create an index on. * False : Do not create any indexes. * True : Create indexes on all columns. * None : Create indexes on all columns. * listlike : Create indexes on the given columns. optlevel : int or None, default None Optimization level, if None, pytables defaults to 6. kind : str or None, default None Kind of index, if None, pytables defaults to "medium". Raises ------ TypeError: raises if the node is not a table Nz1cannot create table index on a Fixed format store)r�r�r�)r�rMrSrr�� create_index)r�r�r�r�r�rWs rX�create_table_indexzHDFStore.create_table_index�sh��> � � � � �O�O�C� � �� �9� �F��!�U�#�#� Q��O�P�P� P� ���w����E�E�E�E�ErZrsc��t��|���|j�J�t�J�d�|j���D��S)a� Return a list of all the top-level nodes. Each node returned is not a pandas storage object. Returns ------- list List of objects. Examples -------- >>> df = pd.DataFrame([[1, 2], [3, 4]], columns=['A', 'B']) >>> store = pd.HDFStore("store.h5", 'w') # doctest: +SKIP >>> store.put('data', df) # doctest: +SKIP >>> print(store.groups()) # doctest: +SKIP >>> store.close() # doctest: +SKIP [/data (Group) '' children := ['axis0' (Array), 'axis1' (Array), 'block0_values' (Array), 'block0_items' (Array)]] Nc���g|]t}t|tjj��sSt |jdd��s;t |dd��s*t|tjj��r |jdk�r|��uS)� pandas_typeNr|) rSr��link�Link�getattr�_v_attrsr|rr�)ror)s rXrrz#HDFStore.groups.<locals>.<listcomp>�s���  �  �  ���q�*�/�"6�7�7�  � �A�J� �t�<�<�  ��q�'�4�0�0�  �#�1�j�&6�&<�=�=�  �CD�)�w�BV�BV� �CW�BV�BVrZ)r�r�r�r�� walk_groupsr�s rXr�zHDFStore.groups�sh��, � � � � �������|�'�'�'��%�%�%�  �  ��\�-�-�/�/�  �  �  � rZrrv�*Iterator[tuple[str, list[str], list[str]]]c#�0K�t��|���|j�J�t�J�|j�|��D]�}t |jdd����g}g}|j���D]n}t |jdd��}|�:t|tj j ��r|� |j ���T|� |j ���o|j�d��||fV���dS)a� Walk the pytables group hierarchy for pandas objects. This generator will yield the group path, subgroups and pandas object names for each group. Any non-pandas PyTables objects that are not a group will be ignored. The `where` group itself is listed first (preorder), then each of its child groups (following an alphanumerical order) is also traversed, following the same procedure. Parameters ---------- where : str, default "/" Group where to start walking. Yields ------ path : str Full path to a group (without trailing '/'). groups : list Names (strings) of the groups contained in `path`. leaves : list Names (strings) of the pandas objects contained in `path`. Examples -------- >>> df1 = pd.DataFrame([[1, 2], [3, 4]], columns=['A', 'B']) >>> store = pd.HDFStore("store.h5", 'w') # doctest: +SKIP >>> store.put('data', df1, format='table') # doctest: +SKIP >>> df2 = pd.DataFrame([[5, 6], [7, 8]], columns=['A', 'B']) >>> store.append('data', df2) # doctest: +SKIP >>> store.close() # doctest: +SKIP >>> for group in store.walk(): # doctest: +SKIP ... print(group) # doctest: +SKIP >>> store.close() # doctest: +SKIP Nr�r)r�r�r�r�r�r�r�� _v_childrenr�rSr��Groupr�r�r��rstrip)r�rvr)r��leaves�childr�s rX�walkz HDFStore.walk�s(����N � � � � �������|�'�'�'��%�%�%���)�)�%�0�0� >� >�A��q�z�=�$�7�7�C���F��F���-�-�/�/� 1� 1��%�e�n�m�T�J�J� ��&�!�%��)9�)?�@�@�5�� � �e�m�4�4�4���M�M�%�-�0�0�0�0��=�'�'��,�,�f�f�=� =� =� =� =� >� >rZ� Node | Nonec�b�|���|�d��sd|z}|j�J�t�J� |j�|j|��}n#tjj$rYdSwxYwt|tj ��sJt|�����|S)z9return the node with the key or None if it does not existrN) r�� startswithr�r�rr�� exceptions�NoSuchNodeErrorrSrGr�)r�r�rs rXrzHDFStore.get_node$s��� �������~�~�c�"�"� ���)�C��|�'�'�'��%�%�%� ��<�(�(���C�8�8�D�D���$�4� � � ��4�4� �����$� ��0�0�<�<�$�t�*�*�<�<�0�� s� A#�#A;�:A;�GenericFixed | Tablec��|�|��}|�td|�d����|�|��}|���|S)z<return the storer object for a key, raise if not in the fileNr8r9)rr�rFrG)r�r�r�rWs rXrMzHDFStore.get_storer4sW��� � �c�"�"�� �=��?�c�?�?�?�@�@� @� � � �� &� &�� � � �����rZr,� propindexes� overwritec �6�t|||||���} |�!t|�����}t|ttf��s|g}|D]�} |�| ��} | ��| | vr|r| �| ��|�| ��} t| t��rDd} |rd�| j D��} | � | | | t| dd��| j �����| � | | | j �����| S)a; Copy the existing store to a new file, updating in place. Parameters ---------- propindexes : bool, default True Restore indexes in copied file. keys : list, optional List of keys to include in the copy (defaults to all). overwrite : bool, default True Whether to overwrite (remove and replace) existing nodes in the new store. mode, complib, complevel, fletcher32 same as in HDFStore.__init__ Returns ------- open file handle of the new store )r�r�r�r�NFc�*�g|]}|j� |j��Sr�)� is_indexedrf�ror�s rXrrz!HDFStore.copy.<locals>.<listcomp>ls!�� H� H� H�A�1�<� H��� H� H� HrZr�)r�r�r[rb)r�rsr"rSrtrMr�r�rr�r�r�r[r�)r�r�r�r�r"r�r�r�r�� new_storerWrW�datar�s rX�copyz HDFStore.copy>sO��8� �t�W� �j� � � � � �<��� � � � �$�$�D��$��� �.�.� ��6�D�� @� @�A�����"�"�A��}�� �>�>� �,�!�(�(��+�+�+��{�{�1�~�~���a��'�'� @�.3�E�"�I� H� H��� H� H� H���$�$���#�%,�Q���%E�%E�!"�� %������M�M�!�T�A�J�M�?�?�?���rZc��t|j��}t|���d|�d�}|j�rt |�����}t |��r�g}g}|D]�} |�|��}|�M|�t|j p|����|�t|pd�����h#t$r�t$rG}|�|��t|��} |�d| �d���Yd}~��d}~wwxYw|td||��z }n |dz }n|d z }|S) a Print detailed information on the store. Returns ------- str Examples -------- >>> df = pd.DataFrame([[1, 2], [3, 4]], columns=['A', 'B']) >>> store = pd.HDFStore("store.h5", 'w') # doctest: +SKIP >>> store.put('data', df) # doctest: +SKIP >>> print(store.info()) # doctest: +SKIP >>> store.close() # doctest: +SKIP <class 'pandas.io.pytables.HDFStore'> File path: store.h5 /data frame (shape->[2,2]) rrNzinvalid_HDFStore nodez[invalid_HDFStore node: rX� �EmptyzFile is CLOSED) r@r�r�r�r�r"rurMr�rmrzr{r?) r�r��output�lkeysr"r�rWrW�detail�dstrs rX�infoz HDFStore.infoys���&�D�J�'�'����J�J�5�5�T�5�5�5�� �<� '��4�9�9�;�;�'�'�E��5�z�z� "������ J� J�A� J� �O�O�A�.�.���=� �K�K� �Q�Z�_�1�(E�(E�F�F�F�"�M�M�,�q�7S�<S�*T�*T�U�U�U���)�����$�J�J�J�� � �A����+�F�3�3��� � �&H��&H�&H�&H�I�I�I�I�I�I�I�I�����J���� �&��T�6�2�2�2����'�!��� �&� &�F�� s�+A$C�D+�$=D&�&D+c�B�|jst|j�d����dS)Nz file is not open!)r�rr�r�s rXr�zHDFStore._check_if_open�s2���|� E�!�T�Z�"C�"C�"C�D�D� D� E� ErZr�c�� t|���}n&#t$r}td|�d���|�d}~wwxYw|S)zvalidate / deprecate formatsz#invalid HDFStore format specified [rXN)� _FORMAT_MAP�lowerr�r�)r�r�r�s rXruzHDFStore._validate_format�sc�� V� ������0�F�F��� V� V� V��K�&�K�K�K�L�L�RU� U����� V����� s�"� A�A�ArQ�DataFrame | Series | Noner[c ��|�+t|ttf��std���t t |jdd����}t t |jdd����}|��|�[t��t�J�t |dd��st|tj j ��rd}d}n4td���t|t��rd }nd }|dkr|d z }d|vr`ttd �} ||} n8#t$r+} td |�dt|���d|����| �d} ~ wwxYw| ||||���S|�k|�i|dkr/t |dd��} | �| jdkrd}nB| jdkrd}n4|dkr.t |dd��} | �| jdkrd}n | jdkrd}t t"t$t&t(t*d�} | |} n8#t$r+} td|�dt|���d|����| �d} ~ wwxYw| ||||���S)z"return a suitable class to operateNz(value must be None, Series, or DataFramer�� table_typer|� frame_table� generic_tablezKcannot create a storer if the object is not existing nor a value are passed�series�frame�_table)r�r�z=cannot properly create the storer for: [_STORER_MAP] [group->�,value->z ,format->�r[r�� series_tabler�rk�appendable_series�appendable_multiseries�appendable_frame�appendable_multiframe)r�r�r�r�r��wormz<cannot properly create the storer for: [_TABLE_MAP] [group->)rSr1r+r�rYr�r�r�r�r|r� SeriesFixed� FrameFixedr�r��nlevels� GenericTable�AppendableSeriesTable�AppendableMultiSeriesTable�AppendableFrameTable�AppendableMultiFrameTable� WORMTable) r�r�r�r�r[r��pt�tt� _STORER_MAP�clsr�r�� _TABLE_MAPs rXrFzHDFStore._create_storer�s�� � �Z��� �7J�%K�%K� ��F�G�G� G� �W�U�^�]�D�I�I� J� J�� �W�U�^�\�4�H�H� I� I�� �:��}�� � � �!�-�-�-��5�'�4�0�0� �J��:�+�1�5�5� �'�B�(�B�B�#�1���� �e�V�,�,�!�!�B�B� �B��W�$�$��(�N�B� �"� � �%0�:�F�F�K� �!�"�o����� � � ��E��E�E�&*�5�k�k�E�E�<B�E�E��������� ���� �3�t�U�X�f�E�E�E� E� �:�� ���'�'�#�E�7�D�9�9�E��(� �=�A�-�-�!4�B�B�"�]�Q�.�.�!9�B���=�(�(�#�E�7�D�9�9�E��(� �=�A�-�-�!3�B�B�"�]�Q�.�.�!8�B�*�!6�&@� 4�%>��  � � � ��R�.�C�C��� � � ��A��A�A�"&�u�+�+�A�A�8>�A�A���� ����� ���� �s�4���&�A�A�A�As0� D� E �&E�E �1G:�: H/�&H*�*H/c�*�t|dd��r |dks|rdS|�||��}|�|||||���}|rF|jr|jr|dkr|jrt d���|js|���n|���|js|rt d���|�|||||| | | | | |||�� � t|t��r|r|� |���dSdSdS) N�emptyr|r�r{zCan only append to Tablesz0Compression not supported on Fixed format stores) �objr�r�r�r�r�r�r�r�r�r�r�rr)r�) r��_identify_grouprFrl� is_existsr��set_object_info�writerSrr�)r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r[r�rrr�rWs rXrvzHDFStore._write_to_groups{��. �5�'�4� (� (� �f��.?�.?�6�.?� �F��$�$�S�&�1�1�� � � ��v�u�x�PV� � W� W�� � ��:� >�!�*� >��7�1B�1B�q�{�1B� �!<�=�=�=��;� $��!�!�#�#�#�� � � � � � ��z� Q�g� Q��O�P�P� P� ��������!�%��%���%�#� � � � � �a�� � � *�E� *� �N�N�5�N� )� )� )� )� )� *� *� *� *rZr�rGc�|�|�|��}|���|���Sr`)rFrGr?)r�r�rWs rXr:zHDFStore._read_groupUs/�� � � �� &� &�� � � �����v�v�x�x�rZc��|�|��}|j�J�|� |s|j�|d���d}|�|�|��}|S)z@Identify HDF5 group based on key, delete/create group if needed.NTrx)rr�� remove_node�_create_nodes_and_group)r�r�r�r�s rXr�zHDFStore._identify_groupZsm��� � �c�"�"���|�'�'�'� � �V� � �L� $� $�U�d� $� ;� ;� ;��E� �=��0�0��5�5�E�� rZc��|j�J�|�d��}d}|D]g}t|��s�|}|�d��s|dz }||z }|�|��}|�|j�||��}|}�h|S)z,Create nodes from key and return group name.Nr)r��splitru�endswithr� create_group)r�r��pathsr��p�new_pathr�s rXrz HDFStore._create_nodes_and_groupls����|�'�'�'�� � �#������� � �A��q�6�6� ���H��=�=��%�%� ��C��� ��M�H��M�M�(�+�+�E��}�� �1�1�$��:�:���D�D�� rZ)r�NNF)r�r^r�r�r�r�r]r��r]r^�r�r^)r�r^r]r�)rfr^)r�r^r]r��r]ri)r]rM)r r rrrrr]r�)r)rr^r]r)r]r#)r]r')r�)r�r^r]r��r]r��r]r��F)r3r�r]r�)NNNNFNF)r�r^r�r�r�r�r�r��NNN�r�r^r�r�r�r��NN)r�r^rQr^r�r�r�r�)NNNNNFNF)r�r�r�r�r�r�) NTFNNNNNNr�TF)r�r^r�r�r�r�r�r�r�r�r�r�r�r�r�r^rrr�r�r�r]r�)NNTTNNNNNNNNNNr�)r�r^r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r^r]r�)NNF)r�r�r�r�r]r�)r�r^r�r�r�r\r]r�)r]rs)r)rvr^r]r�)r�r^r]r�)r�r^r]r�)r,TNNNFT) r�r^r�r�r�r�r�r�r�r�r]r�)r�r^r]r^)NNrQr�)r�r�r[r^r�r^r]r�)NTFNNNNNNFNNNr�T)r�r^r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r^rrr�r]r�)r�rG)r�r^r�r�r]rG)r�r^r]rG)1r�� __module__� __qualname__�__doc__�__annotations__r�r��propertyr�r�r�r�r�r�rrr r rr"r&r*r�r�r�r5r�r�rPrTrqr�r�r�r�r�r�r�rrMr�r�r�rurFrvr:r�rr�rZrXr�r��sq�������?�?�B�����J�J�J� � $�� � '�'�'�'�'�B�����!�!��X�!� �����X���������� � � � � � � � � � � � �"�"�"�"�4�4�4�4���������( �( �( �( �( �T!�!�!�!�#�#�#�#�+J�+J�+J�+J�+J�Z�����)�)�)��X�)�4�4�4�4�4�,+�+�+�+�@�� ��� $� �[�[�[�[�[�@� �� I�I�I�I�I�H!�� &F�&F�&F�&F�&F�V���� �� $� �w/�w/�w/�w/�w/�z���� $�48��9=��� ��J �J �J �J �J �X7A�7A�7A�7A�7A�z� �"&��� $��48�� $��"�9=���%d �d �d �d �d �V� ��_R�_R�_R�_R�_R�H�#�� &F�&F�&F�&F�&F�P% �% �% �% �N:>�:>�:>�:>�:>�x���� ����� � �� $� ��9�9�9�9�9�v0�0�0�0�jE�E�E�E������+/��� YB�YB�YB�YB�YB�@�"&��� $��48� $������� �'<*�<*�<*�<*�<*�|���� ����$�����rZr�c�`�eZdZUdZded<ded<ded< ddd�Zdd�Zdd�Zddd�ZdS)rHaa Define the iteration interface on a table Parameters ---------- store : HDFStore s : the referred storer func : the function to execute the query where : the where of the query nrows : the rows to iterate on start : the passed start value (default is None) stop : the passed stop value (default is None) iterator : bool, default False Whether to use the default iterator. chunksize : the passed chunking value (default is 100000) auto_close : bool, default False Whether to automatically close the store at the end of iteration. r�r�r�r�r�rWNFr�r�r�r]r�c ��||_||_||_||_|jjr|�d}|�d}|�|}t ||��}||_||_||_d|_ |s| �| �d} t| ��|_ nd|_ | |_ dS)Nr順) r�rWrCrvrl�minrEr�r�rhrir�r�) r�r�rWrCrvrEr�r�r�r�r�s rXr�zTableIterator.__init__�s����� ������ ��� � �6�?� $��}����}����|����u�d�#�#�D��� ��� ��� ���� � "�y�,�� �"� � ��^�^�D�N�N�!�D�N�$����rZrBc#�JK�|j}|j�td���||jkrdt ||jz|j��}|�dd|j||���}|}|�t|��s�`|V�||jk�d|���dS)Nz*Cannot iterate until get_result is called.) r�rhr�r�rr�rCrur�)r�r�r�r�s rXr&zTableIterator.__iter__�s������*�� � � #��I�J�J� J��� �!�!��w���/���;�;�D��I�I�d�D�$�*:�7�4�<�*H�I�I�E��G��}�C��J�J�}���K�K�K��� �!�!� � � � � � � � rZc�J�|jr|j���dSdSr`)r�r�r�r�s rXr�zTableIterator.close�s0�� �?� � �J� � � � � � � � � rZrhc���|j�Pt|jt��st d���|j�|j���|_|S|rVt|jt��st d���|j�|j|j|j ���}n|j}|� |j|j |��}|� ��|S)Nz0can only use an iterator or chunksize on a table)rvz$can only read_coordinates on a tablerL) r�rSrWrr�rNrvrhr�r�rCr�)r�rhrv�resultss rXrIzTableIterator.get_result�s��� �>� %��d�f�e�,�,� T�� R�S�S�S�#�v�6�6�T�Z�6�H�H�D� ��K� � ��d�f�e�,�,� H�� F�G�G�G��F�+�+��j�� ���,���E�E��J�E��)�)�D�J�� �5�9�9�� � � � � � ��rZ)NNFNF) r�r�rWr�r�r�r�r�r�r�r]r��r]rBr r)rhr�) r�rrrrr�r&r�rIr�rZrXrHrH�s����������&�����O�O�O������ �� $� �(%�(%�(%�(%�(%�T���� ����������rZrHc��eZdZUdZdZded<dZded<gd�Z d4d5d�Ze d6d���Z e d7d���Z d8d�Z d7d�Z d9d�Zd:d�Ze d:d���Zd;d�Zd �Ze d!���Ze d"���Ze d#���Ze d$���Zd<d&�Zd=d>d'�Zd>d(�Zd?d,�Zd=d-�Zd@d.�Zd>d/�Zd>d0�Zd>d1�ZdAd2�Z dAd3�Z!dS)B�IndexCola an index column description class Parameters ---------- axis : axis which I reference values : the ndarray like converted values kind : a string description of this type typ : the pytables type pos : the position in the pytables Tr��is_an_indexable�is_data_indexable)�freq�tz� index_nameNrfr^�cnamer\r]r�c��t|t��std���||_||_||_||_|p||_||_||_ ||_ | |_ | |_ | |_ | |_| |_||_|�|�|��t|jt��sJ�t|jt��sJ�dS)Nz`name` must be a str.)rSr^r�r�r��typrfr(rc�posr%r&r'r�r|r��metadata�set_pos)r�rfr�r�r*r(rcr+r%r&r'r�r|r�r,s rXr�zIndexCol.__init__s���"�$��$�$� 6��4�5�5� 5��� ��� ������ ��]�d�� ��� ������ ����$����� ��� ��� � �� � �?� �L�L�� � � ��$�)�S�)�)�)�)�)��$�*�c�*�*�*�*�*�*�*rZric��|jjSr`)r*�itemsizer�s rXr/zIndexCol.itemsize/s���x� � rZc��|j�d�S)N�_kindrer�s rX� kind_attrzIndexCol.kind_attr4����)�"�"�"�"rZr+c�F�||_|�|j�||j_dSdSdS)z,set the position of this column in the TableN)r+r*�_v_pos)r�r+s rXr-zIndexCol.set_pos8s/����� �?�t�x�3�!�D�H�O�O�O� �?�3�3rZc ���ttt|j|j|j|j|jf����}d�d�tgd�|��D����S)N�,c�"�g|] \}}|�d|���� S�z->r��ror�r�s rXrrz%IndexCol.__repr__.<locals>.<listcomp>C�:�� � � ��C���!�!�%�!�!� � � rZ)rfr(rcr+r�) rt�mapr@rfr(rcr+r��joinrk�r��temps rXr zIndexCol.__repr__>sy��� � �t�y�$�*�d�i���4�9�U� V� V� � ���x�x� � �"%�&N�&N�&N�PT�"U�"U� � � � � � rZ�other�objectc�>���t��fd�dD����S)�compare 2 col itemsc3�`�K�|](}t�|d��t�|d��kV��)dSr`�r��ror�r@r�s ��rXr�z"IndexCol.__eq__.<locals>.<genexpr>K�T����� � �� �D�!�T� "� "�g�e�Q��&=�&=� =� � � � � � rZ)rfr(rcr+�r��r�r@s``rX�__eq__zIndexCol.__eq__IsA����� � � � � �5� � � � � � rZc�.�|�|�� Sr`)rJrIs rX�__ne__zIndexCol.__ne__Ps���;�;�u�%�%�%�%rZc�x�t|jd��sdSt|jj|j��jS)z%return whether I am an indexed columnr�F)�hasattrr|r�r�r(r�r�s rXr�zIndexCol.is_indexedSs6���t�z�6�*�*� ��5��t�z��� �3�3�>�>rZr�� np.ndarrayr[r��3tuple[np.ndarray, np.ndarray] | tuple[Index, Index]c��t|tj��sJt|�����|jj�||j���}t|j ��}t||||��}i}t|j ��|d<|j �t|j ��|d<t}tj|jd��st|jt ��rt"}n|jdkrd|vrd�} ||fi|��}n"#t$$rd|vrd|d<||fi|��}YnwxYwt'||j��} | | fS)zV Convert the data from this selection to the appropriate pandas type. Nrfr%�M�i8c��tj||�dd������|d��S)Nr%)r%rf)r/� from_ordinalsr��_rename)r[�kwdss rXr�z"IndexCol.convert.<locals>.<lambda>{sD�� �(A�������.�.�)�)�)��g��V� ���rZ)rSrT�ndarrayr��dtype�fieldsr(r�rYr��_maybe_convertr'r%r-r� is_np_dtyper'r,r��_set_tzr&) r�r�r�r[r��val_kindr��factory� new_pd_index�final_pd_indexs rX�convertzIndexCol.convert[s��� �&�"�*�-�-�;�;�t�F�|�|�;�;�-� �<� � *��D�J�'�,�,�.�.�F�"�4�9�-�-�����(�F�C�C����(���9�9��v�� �9� �,�T�Y�7�7�F�6�N�/4�� �?�6�<�� -� -� �� �L�/�2 �2 � �$�G�G� �\�T� !� !�f��&6�&6� ��G� 5�"�7�6�4�4�V�4�4�L�L��� 5� 5� 5�����!%��v��"�7�6�4�4�V�4�4�L�L�L�  5���� !��t�w�7�7���~�-�-s� D�D9�8D9c��|jS)zreturn the values�r�r�s rX� take_datazIndexCol.take_data�s ���{�rZc��|jjSr`)r|r�r�s rX�attrszIndexCol.attrs�� ���z�"�"rZc��|jjSr`�r|� descriptionr�s rXrkzIndexCol.description�� ���z�%�%rZc�8�t|j|jd��S)z!return my current col descriptionN)r�rkr(r�s rX�colz IndexCol.col�s���t�'���T�:�:�:rZc��|jS�zreturn my cython valuesrdr�s rX�cvalueszIndexCol.cvalues�s ���{�rZrBc�*�t|j��Sr`)r%r�r�s rXr&zIndexCol.__iter__�s���D�K� � � rZc��t|j��dkrpt|t��r|�|j��}|�A|jj|kr3t��� ||j ���|_dSdSdSdS)z� maybe set a string col itemsize: min_itemsize can be an integer or a dict with this columns name with an integer size �stringN)r/r+) rYr�rSr�r�rfr*r/r�� StringColr+)r�r�s rX�maybe_set_sizezIndexCol.maybe_set_size�s��� �4�9� %� %�� 1� 1��,��-�-� ;�+�/�/�� �:�:� ��'�D�H�,=� �,L�,L�"�9�9�.�.� �$�(�.�S�S����� 2� 1�(�'�,L�,LrZc��dSr`r�r�s rX�validate_nameszIndexCol.validate_names���� �rZ�handler�AppendableTabler�c���|j|_|���|�|��|�|��|�|��|���dSr`)r|� validate_col� validate_attr�validate_metadata�write_metadata�set_attr)r�rzr�s rX�validate_and_setzIndexCol.validate_and_set�sj���]�� � ������ ���6�"�"�"� ���w�'�'�'� ���G�$�$�$� � � �����rZc ���t|j��dkrG|j}|�>|�|j}|j|kr#t d|�d|j�d|j�d����|jSdS)z:validate this column: return the compared against itemsizertNz#Trying to store a string with len [z] in [z)] column but this column has a limit of [zC]! Consider using min_itemsize to preset the sizes on these columns)rYr�rnr/r�r()r�r/�cs rXr}zIndexCol.validate_col�s��� �4�9� %� %�� 1� 1���A��}��#�#�}�H��:��(�(�$�<�h�<�<� �J�<�<��J�<�<�<���� �z�!��trZc��|rCt|j|jd��}|�(||jkrt d|�d|j�d����dSdSdS)Nzincompatible kind in col [� - rX)r�rgr2r�r�)r�r�� existing_kinds rXr~zIndexCol.validate_attr�sq�� � �#�D�J����E�E�M��(�]�d�i�-G�-G��O��O�O�4�9�O�O�O���� � �(�(�-G�-GrZc ��|jD]�}t||d��}|�|ji��}|�|��}||vry|�w||krq|dvrLt |||fz}t j|tt�����d||<t||d����td|j�d|�d|�d|�d� ���|�|�|||<��dS) z set/update the info for this indexable with the key/value if there is a conflict raise/warn as needed N)r%r'�� stacklevelzinvalid info for [z] for [z], existing_value [z] conflicts with new value [rX) � _info_fieldsr�� setdefaultrfr�ry�warnings�warnrr�setattrr�)r�r�r�r��idx�existing_value�wss rX� update_infozIndexCol.update_info�s;�� �$� !� !�C��D�#�t�,�,�E��/�/�$�)�R�0�0�C� �W�W�S�\�\�N��c�z�z�e�/�N�e�4K�4K��0�0�0�/�3���2N�N�B��M��4�AQ�AS�AS����� $�C��H��D�#�t�,�,�,�,�%�/�T�Y�/�/�s�/�/�+9�/�/�&+�/�/�/���� �"�n�&@� ��C���1 !� !rZc�v�|�|j��}|�|j�|��dSdS)z!set my state from the passed infoN)r�rf�__dict__�update)r�r�r�s rX�set_infozIndexCol.set_info�s=���h�h�t�y�!�!�� �?� �M� � �� %� %� %� %� %� �?rZc�F�t|j|j|j��dS)zset the kind for this columnN)r�rgr2r�r�s rXr�zIndexCol.set_attr�s ���� �D�N�D�I�6�6�6�6�6rZc��|jdkrG|j}|�|j��}|�&|�&t ||dd���st d���dSdSdSdS)z:validate that kind=category does not change the categories�categoryNT�� strict_nan� dtype_equalzEcannot append a categorical with different categories to the existing)r�r,� read_metadatar(r*r�)r�rz� new_metadata� cur_metadatas rXrzIndexCol.validate_metadata s��� �9� � "� "��=�L�"�0�0���<�<�L��(� �,�(� �,�4�T����-� !�;���� #� "�)�(�,�,�,�,rZc�X�|j�"|�|j|j��dSdS)zset the meta dataN)r,r�r()r�rzs rXr�zIndexCol.write_metadata s2�� �=� $� � "� "�4�:�t�}� =� =� =� =� =� %� $rZ) NNNNNNNNNNNNN)rfr^r(r\r]r�r r )r+rir]r��r@rAr]r�r)r�rOr[r^r�r^r]rPr r`r )rzr{r�r�r]r�)r�r�r]r�)rzr{r]r�)"r�rrrr#rr$r�r�rr/r2r-r rJrLr�rbrergrkrnrqr&rvrxr�r}r~r�r�r�rr�r�rZrXr"r"�s�������� � �!�O� � � � �"��"�"�"�"�/�/�/�L� � � � � � � � ���� ��)+�)+�)+�)+�)+�V�!�!�!��X�!��#�#�#��X�#�"�"�"�"�  �  �  �  � � � � �&�&�&�&��?�?�?��X�?�0.�0.�0.�0.�d����#�#��X�#��&�&��X�&��;�;��X�;�����X��!�!�!�!� T� T� T� T� T� � � � ���������&����!�!�!�!�>&�&�&�&� 7�7�7�7�����">�>�>�>�>�>rZr"c�:�eZdZdZedd���Zdd �Zdd �ZdS)�GenericIndexColz:an index which is not represented in the data of the tabler]r�c��dS�NFr�r�s rXr�zGenericIndexCol.is_indexed ����urZr�rOr[r^r��tuple[Index, Index]c��t|tj��sJt|�����t t |����}||fS)z� Convert the data from this selection to the appropriate pandas type. Parameters ---------- values : np.ndarray nan_rep : str encoding : str errors : str )rSrTrXr�r0ru)r�r�r�r[r�r�s rXrbzGenericIndexCol.convert! sG���&�"�*�-�-�;�;�t�F�|�|�;�;�-��3�v�;�;�'�'���e�|�rZr�c��dSr`r�r�s rXr�zGenericIndexCol.set_attr3 ryrZNr)r�rOr[r^r�r^r]r�r )r�rrrrr�rbr�r�rZrXr�r� s`������D�D� �����X������$ � � � � � rZr�c�j��eZdZdZdZdZddgZ d,d-�fd� Zed.d���Z ed.d���Z d.d�Z d/d�Z d0d�Z d�Zed1d���Zed���Zed2d ���Zed3d!���Zed"���Zed#���Zed$���Zed%���Zd4d&�Zd5d*�Zd4d+�Z�xZS)6�DataCola3 a data holding column, by definition this is not indexable Parameters ---------- data : the actual data cname : the column name in the table to hold the data (typically values) meta : a string description of the metadata metadata : the actual metadata Fr&r�Nrfr^r(r\rY�DtypeArg | Noner]r�c �|��t���||||||||| | | �� � | |_| |_dS)N) rfr�r�r*r+r(r&r�r|r�r,)�superr�rYr�)r�rfr�r�r*r(r+r&r�r|r�r,rYr�� __class__s �rXr�zDataCol.__init__H s[��� ���������������� � � � ��� ��� � � rZc��|j�d�S)N�_dtyperer�s rX� dtype_attrzDataCol.dtype_attrh s���)�#�#�#�#rZc��|j�d�S)N�_metarer�s rX� meta_attrzDataCol.meta_attrl r3rZc ���ttt|j|j|j|j|jf����}d�d�tgd�|��D����S)Nr7c�"�g|] \}}|�d|���� Sr9r�r:s rXrrz$DataCol.__repr__.<locals>.<listcomp>w r;rZ)rfr(rYr��shape) rtr<r@rfr(rYr�r�r=rkr>s rXr zDataCol.__repr__p s~��� ��t�y�$�*�d�j�$�)�T�Z�X� � � � �� �x�x� � �"%�&Q�&Q�&Q�SW�"X�"X� � � � � � rZr@rAr�c�>���t��fd�dD����S)rCc3�`�K�|](}t�|d��t�|d��kV��)dSr`rErFs ��rXr�z!DataCol.__eq__.<locals>.<genexpr> rGrZ)rfr(rYr+rHrIs``rXrJzDataCol.__eq__} sA����� � � � � �6� � � � � � rZr�rIc��|�J�|j�J�t|��\}}||_||_t|��|_dSr`)rY�_get_data_and_dtype_namer��_dtype_to_kindr�)r�r�� dtype_names rX�set_datazDataCol.set_data� sO�������z�!�!�!�3�D�9�9���j��� ��� �"�:�.�.�� � � rZc��|jS)zreturn the data�r�r�s rXrezDataCol.take_data� s ���y�rZr�rEc��|j}|j}|j}|jdkr d|jf}t |t ��r)|j}|�||jj ���}n�tj |d��st |t��r|� |��}n�tj |d��r|�|��}n{t|��r*t!���||d���}nBt%|��r|�||��}n|�||j ���}|S)zW Get an appropriately typed and shaped pytables.Col object for values. rk�r�rR�mr�r/r�)rYr/r�r��sizerSr5�codes� get_atom_datarfrr\r'�get_atom_datetime64�get_atom_timedelta64r"r�� ComplexColr$�get_atom_string)r�r�rYr/r�r��atoms rX� _get_atomzDataCol._get_atom� sI�� � ���>��� �� �;�!� � ��� �$�E� �f�k� *� *� =��L�E��$�$�U���1A�$�B�B�D�D� �_�U�C� (� (� =�J�u�o�,N�,N� =��*�*�5�1�1�D�D� �_�U�C� (� (� =��+�+�E�2�2�D�D� �e� $� $� =��9�9�'�'���q��'�J�J�D�D� �U� #� #� =��&�&�u�h�7�7�D�D��$�$�U���$�<�<�D�� rZc�T�t���||d���S)Nrr��r�ru�r�r�r/s rXr�zDataCol.get_atom_string� s#���y�y�"�"�H�E�!�H�"�E�E�ErZr�� type[Col]c���|�d��r|dd�}d|�d�}n1|�d��rd}n|���}|�d�}tt��|��S)z0return the PyTables column class for this column�uint�N�UIntrE�period�Int64Col)r�� capitalizer�r�)r�r��k4�col_name�kcaps rX�get_atom_coltypezDataCol.get_atom_coltype� s}�� �?�?�6� "� "� $��a�b�b��B�%�b�~�~�~�H�H� �_�_�X� &� &� $�!�H�H��?�?�$�$�D��|�|�|�H��w�y�y�(�+�+�+rZc�N�|�|���|d���S)Nr�r�r��r��r�r�r�s rXr�zDataCol.get_atom_data� s*��.�s�#�#��#�.�.�U�1�X�>�>�>�>rZc�R�t���|d���S�Nrr��r�r��r�r�s rXr�zDataCol.get_atom_datetime64� �!���y�y�!�!��a��!�1�1�1rZc�R�t���|d���Sr�r�r�s rXr�zDataCol.get_atom_timedelta64� r�rZc�.�t|jdd��S)Nr�)r�r�r�s rXr�z DataCol.shape� s���t�y�'�4�0�0�0rZc��|jSrpr�r�s rXrqzDataCol.cvalues� s ���y�rZc��|r{t|j|jd��}|�'|t|j��krt d���t|j|jd��}|�||jkrt d���dSdSdS)zAvalidate that we have the same order as the existing & same dtypeNz4appended items do not match existing items in table!z@appended items dtype do not match existing items dtype in table!)r�rgr2rsr�r�r�rY)r�r��existing_fields�existing_dtypes rXr~zDataCol.validate_attr� s��� � �%�d�j�$�.�$�G�G�O��*��$�t�{�BS�BS�/S�/S� �!W�X�X�X�$�T�Z���$�G�G�N��)�n�� �.J�.J� �V���� � � *�)�.J�.JrZrOr[r�c��t|tj��sJt|�����|jj� ||j}|j�J�|j�"t|��\}}t|��}n|}|j}|j }t|tj��sJ�t|j ��}|j } |j} |j} |�J�t|��} | �d��rt#|| d���}�n�| dkrtj|d���}�nf| dkr^ tjd �|D��t&���}�n8#t($r)tjd �|D��t&���}Y�nwxYw|d kr�| } |���}| �t-gtj���} not1| ��}|���rL| |} ||d kxx|�t6�����jzcc<t=j|| | d ���}n@ |�| d ���}n'#t@$r|�dd ���}YnwxYwt|��dkrtC||||���}|j"|fS)aR Convert the data from this selection to the appropriate pandas type. Parameters ---------- values : np.ndarray nan_rep : encoding : str errors : str Returns ------- index : listlike to become an Index data : ndarraylike to become a column N� datetime64T��coerce� timedelta64�m8[ns]�rYrc�6�g|]}tj|����Sr��r� fromordinal�ror�s rXrrz#DataCol.convert.<locals>.<listcomp> s#��<�<�<�Q�T�%�a�(�(�<�<�<rZc�6�g|]}tj|����Sr��r� fromtimestampr�s rXrrz#DataCol.convert.<locals>.<listcomp>" s#��>�>�>�q�T�'��*�*�>�>�>rZr������F)� categoriesr��validate�r��Ort�r�r[r�)#rSrTrXr�rYrZr(r*r�r�r�rYr�r,r�r&r�r]�asarrayrAr��ravelr-�float64r4�any�astyperi�cumsum�_valuesr5� from_codesr��_unconvert_string_arrayr�)r�r�r�r[r�� convertedr�r�r�r,r�r&rYr�r��masks rXrbzDataCol.convert� s�� �&�"�*�-�-�;�;�t�F�|�|�;�;�-� �<� � *��D�J�'�F��x�#�#�#� �:� �%=�V�$D�$D� !�I�z�!�*�-�-�D�D��I���J��9�D��)�R�Z�0�0�0�0�0��t�y�)�)���=���,�� �W���%�%�%�� �+�+�� � � �L� )� )�, >�� �2�d�;�;�;�I�I� �m� #� #�� �9�H�=�=�=�I�I� �f�_�_� ��J�<�<�)�<�<�<�F���� � ��� � � ��J�>�>�I�>�>�>�f���� � � � ���� �Z� � �!�J��O�O�%�%�E� �!� #�2�R�Z�8�8�8� � ��J�'�'���8�8�:�:�L�!+�T�E�!2�J��%�2�+�&�&�&�$�+�+�c�*:�*:�*A�*A�*C�*C�*K�K�&�&�&�#�.��*�g�����I�I�  >�%�,�,�U��,�?�?� � ��� >� >� >�%�,�,�S�u�,�=�=� � � � >���� �4� � �H� ,� ,�/��7�X�f����I��{�I�%�%s$�3%E�/F � F �I+�+!J�Jc���t|j|j|j��t|j|j|j��|j�J�t|j|j|j��dS)zset the data for this columnN)r�rgr2r�r�r�rYr�r�s rXr�zDataCol.set_attrK s^���� �D�N�D�K�8�8�8��� �D�N�D�I�6�6�6��z�%�%�%��� �D�O�T�Z�8�8�8�8�8rZ) NNNNNNNNNNNN)rfr^r(r\rYr�r]r�r r�)r�rIr]r�)r�rIr]rE)r�r^r]r��r�r^r]rEr )r�rOr[r^r�r^)r�rrrr#r$r�r�rr�r�r rJr�re� classmethodr�r�r�r�r�r�r�rqr~rbr�� __classcell__�r�s@rXr�r�7 s@������� � ��O����)�$�L� � � � � � ��� ��!%� ��������@�$�$�$��X�$��#�#�#��X�#�  �  �  �  � � � � �/�/�/�/���������[��>�F�F��[�F�� ,� ,� ,��[� ,��?�?�?��[�?��2�2��[�2��2�2��[�2��1�1��X�1�����X�� � � � �b&�b&�b&�b&�H9�9�9�9�9�9�9�9rZr�c�x�eZdZdZdZdd�Zed���Zedd ���Zed ���Z ed ���Z d S)�DataIndexableColz+represent a data column that can be indexedTr]r�c�p�tt|j��j��st d���dS)N�-cannot have non-object label DataIndexableCol)r$r-r�rYr�r�s rXrxzDataIndexableCol.validate_namesX s;���u�T�[�1�1�7�8�8� N��L�M�M� M� N� NrZc�F�t���|���S)N)r/r�r�s rXr�z DataIndexableCol.get_atom_string] s���y�y�"�"�H�"�5�5�5rZr�r^rEc�>�|�|�����S)Nr�r�r�s rXr�zDataIndexableCol.get_atom_dataa s!��.�s�#�#��#�.�.�0�0�0rZc�B�t�����Sr`r�r�s rXr�z$DataIndexableCol.get_atom_datetime64e ����y�y�!�!�#�#�#rZc�B�t�����Sr`r�r�s rXr�z%DataIndexableCol.get_atom_timedelta64i rrZNr r) r�rrrr$rxrr�r�r�r�r�rZrXrrS s�������5�5���N�N�N�N� �6�6��[�6��1�1�1��[�1��$�$��[�$��$�$��[�$�$�$rZrc��eZdZdZdS)�GenericDataIndexableColz(represent a generic pytables data columnN)r�rrrr�rZrXrrn s������2�2�2�2rZrc���eZdZUdZded<dZded<ded<ded <d ed <d Zd ed< d7d8d�Zed9d���Z ed:d���Z ed���Z d;d�Z d<d�Z d=d�Zed ���Zed!���Zed"���Zed#���Zed>d$���Zed9d%���Zed&���Zd<d'�Zd<d(�Zed)���Zed9d*���Zed+���Zd?d-�Zd@d<d/�Zd9d0�Z dAdBd4�Zd<d5�Z dCdDd6�Z d.S)E�Fixedz� represent an object in my store facilitate read/write of various types of objects this is an abstract base class Parameters ---------- parent : HDFStore group : Node The group node where the table resides. r^� pandas_kindr{� format_type�type[DataFrame | Series]�obj_typerir�r�r�Fr�rlrQr�r�rGr[r\r�r]r�c�$�t|t��sJt|�����t�J�t|tj��sJt|�����||_||_t|��|_||_ dSr`) rSr�r�r�rGr�r�rcr[r�)r�r�r�r[r�s rXr�zFixed.__init__� s����&�(�+�+�9�9�T�&�\�\�9�9�+��%�%�%��%���1�1�>�>�4��;�;�>�>�1��� ��� �(��2�2�� ��� � � rZc�h�|jddko!|jddko|jddkS)Nrrk� �)�versionr�s rX�is_old_versionzFixed.is_old_version� s4���|�A��!�#�U�� �Q��2�(=�U�$�,�q�/�TU�BU�UrZ�tuple[int, int, int]c��tt|jjdd����} t d�|�d��D����}t |��dkr|dz}n#t$rd}YnwxYw|S)zcompute and set our version�pandas_versionNc3�4K�|]}t|��V��dSr`�rirZs rXr�z Fixed.version.<locals>.<genexpr>� s(����?�?�q�C��F�F�?�?�?�?�?�?rZ�.r&r])rrr)rYr�r�r�rtrrur�)r�r's rXr'z Fixed.version� s���"�'�$�*�*=�?O�QU�"V�"V�W�W�� ��?�?�G�M�M�#�,>�,>�?�?�?�?�?�G��7�|�|�q� � �!�D�.����� � � ��G�G�G� �����s�AA/�/ A>�=A>c�R�tt|jjdd����S)Nr�)rYr�r�r�r�s rXr�zFixed.pandas_type� s!���w�t�z�':�M�4�P�P�Q�Q�QrZc���|���|j}|�Ot|ttf��r%d�d�|D����}d|�d�}|jd�d|�d�S|jS) �(return a pretty representation of myselfNr7c�,�g|]}t|����Sr��r@rZs rXrrz"Fixed.__repr__.<locals>.<listcomp>� s��">�">�">�q�<��?�?�">�">�">rZ�[rX�12.12z (shape->�))rGr�rSrsrtr=r�)r�rW�jshapes rXr zFixed.__repr__� s��� ������ �J�� �=��!�d�E�]�+�+� "����">�">�A�">�">�">�?�?��!��M�M�M���&�;�;�;�q�;�;�;� ;���rZc�~�t|j��|j_tt��|j_dS)zset my pandas type & versionN)r^rrgr��_versionr+r�s rXr�zFixed.set_object_info� s-��!$�T�%5�!6�!6�� ��$'��M�M�� �!�!�!rZc�.�tj|��}|Sr`r�)r��new_selfs rXr�z Fixed.copy� s���9�T�?�?���rZc��|jSr`)rEr�s rXr�z Fixed.shape� r�rZc��|jjSr`�r�r�r�s rXrmzFixed.pathname� rlrZc��|jjSr`)r�r�r�s rXr�z Fixed._handle� s ���{�"�"rZc��|jjSr`)r�r�r�s rXr�zFixed._filters� s ���{�#�#rZc��|jjSr`)r�r�r�s rXr�zFixed._complevel� s ���{�%�%rZc��|jjSr`)r�r�r�s rXr�zFixed._fletcher32� s ���{�&�&rZc��|jjSr`)r�r�r�s rXrgz Fixed.attrs� rhrZc��dS�zset our object attributesNr�r�s rX� set_attrszFixed.set_attrs� ����rZc��dS)zget our object attributesNr�r�s rX� get_attrszFixed.get_attrs� rGrZc��|jS)zreturn my storable�r�r�s rX�storablezFixed.storable� s ���z�rZc��dSr�r�r�s rXr�zFixed.is_exists� r�rZc�.�t|jdd��S)NrE)r�rLr�s rXrEz Fixed.nrows� s���t�}�g�t�4�4�4rZ�Literal[True] | Nonec��|�dSdS)z%validate against an existing storableNTr�rIs rXr�zFixed.validate� s�� �=��4��trZNc��dS)�+are we trying to operate on an old version?Nr�)r�rvs rX�validate_versionzFixed.validate_version� rGrZc�D�|j}|�dS|���dS)zr infer the axes of my storer return a boolean indicating if we have a valid storer or not NFT)rLrI)r�rWs rXrGzFixed.infer_axes� s*�� �M�� �9��5� �������trZr�r�r�c� �td���)Nz>cannot read on an abstract storer: subclasses should implement�r��r�rvr�r�r�s rXr?z Fixed.read s��"� L� � � rZc � �td���)Nz?cannot write on an abstract storer: subclasses should implementrV�r�r�r�s rXr�z Fixed.write s��!� M� � � rZc��tj|||��r#|j�|jd���dSt d���)zs support fully deleting the node in its entirety (only) - where specification must be None TrxNz#cannot delete on an abstract storer)r}r~r�rr�r�)r�rvr�r�s rXrz Fixed.delete sK�� �<��u�d� +� +� � �L� $� $�T�Z�4� $� @� @� @��4��=�>�>�>rZ)rQr�) r�r�r�rGr[r\r�r^r]r�r)r]r)r r )r]rr )r]rOr`�NNNN�r�r�r�r�r)r�r�r�r�r]r�)!r�rrrrr rlr�rr(r'r�r r�r�r�rmr�r�r�r�rgrFrIrLr�rEr�rSrGr?r�rr�rZrXrrr s������� � ������K�����&�&�&�&� �I�I�I������H����� '�� � � � � ��V�V�V��X�V�� � � ��X� ��R�R��X�R�  �  �  �  �2�2�2�2� ��������X���&�&��X�&��#�#��X�#��$�$��X�$��&�&�&��X�&��'�'�'��X�'��#�#��X�#�(�(�(�(�(�(�(�(�����X�������X���5�5��X�5����� :�:�:�:�:� � � � ��� ��  �  �  �  �  � � � � � HL� ?� ?� ?� ?� ?� ?� ?rZrc��eZdZUdZedediZd�e���D��ZgZ de d<d+d �Z d �Z d �Z d,d �Zed-d���Zd,d�Zd,d�Zd,d�Zd.d/d�Z d.d0d�Zd1d�Zd2d�Z d.d3d�Z d.d4d"�Zd5d%�Z d6d7d*�ZdS)8� GenericFixedza generified fixed version�datetimer�c��i|]\}}||�� Sr�r�)rorWr�s rXr�zGenericFixed.<dictcomp>" s��C�C�C�4�1�a�!�Q�C�C�CrZr� attributesr]r^c�8�|j�|d��S)N�)�_index_type_mapr�)r�r�s rX�_class_to_aliaszGenericFixed._class_to_alias& s���#�'�'��R�0�0�0rZc�p�t|t��r|S|j�|t��Sr`)rSr��_reverse_index_mapr�r-)r��aliass rX�_alias_to_classzGenericFixed._alias_to_class) s2�� �e�T� "� "� ��L��&�*�*�5�%�8�8�8rZc ��|�tt|dd������}|tkrdd�}|}n|tkrdd�}|}n|}i}d|vr|d|d<|t urt }d|vrPt|dt��r|d� d��|d<n |d|d<|tusJ�||fS) N� index_classrcc���tj|j|j|���}t j|d���}|�(|�d���|��}|S)N)rYr%re�UTC)r6� _simple_newr�rYr,� tz_localize� tz_convert)r�r%r&�dta�results rXr}z*GenericFixed._get_index_factory.<locals>.f8 sf��#�/��M���D�����'�2�3�T�B�B�B���>�#�/�/��6�6�A�A�"�E�E�F�� rZc�x�t|��}tj||���}tj|d���S)Nr�re)r)r7rnr/)r�r%r&rY�parrs rXr}z*GenericFixed._get_index_factory.<locals>.fE s:��#�D�)�)��"�.�v�U�C�C�C��"�.�t�$�?�?�?�?rZr%r&zutf-8r) rirYr�r,r/r-r2rS�bytesrV)r�rgrkr}r_r�s rX�_get_index_factoryzGenericFixed._get_index_factory/ s���*�*� �G�E�=�"�=�=� >� >� � � � �-� '� '� � � � ��G�G� �K� '� '� @� @� @� @� �G�G�!�G��� �U�?�?�"�6�]�F�6�N��e�#�#�(�� �5�=�=��%��+�u�-�-� +�$�T�{�1�1�'�:�:��t� � � %�T�{��t� ��-�/�/�/�/����rZr�c�J�|�td���|�td���dS)zE raise if any keywords are passed which are not-None Nzqcannot pass a column specification when reading a Fixed format store. this store must be selected in its entiretyzucannot pass a where specification when reading from a Fixed format store. this store must be selected in its entirety)r�)r�r�rvs rX� validate_readzGenericFixed.validate_read` sJ�� � ��T��� � � ��Y��� � � rZr�c��dS)NTr�r�s rXr�zGenericFixed.is_existso s���trZc�J�|j|j_|j|j_dSrE)r[rgr�r�s rXrFzGenericFixed.set_attrss s ��"�m�� �� �K�� ���rZc ��tt|jdd����|_t t|jdd����|_|jD]4}t||t t|j|d�������5dS)�retrieve our attributesr[Nr�r�)rcr�rgr[rYr�rar�)r�rs rXrIzGenericFixed.get_attrsx s���(����Z��)N�)N�O�O�� �%�g�d�j�(�H�&M�&M�N�N�� ��� L� L�A� �D�!�_�W�T�Z��D�-I�-I�J�J� K� K� K� K� L� LrZc �.�|���dSr`)rFrYs rXr�zGenericFixed.write s�� �������rZNr�r�r�r�c��ddl}t|j|��}|j}t|dd��}t ||j��r|d||�}n�t t|dd����} t|dd��} | �tj| | ���}n |||�}| r9| � d��r$t|d d��} t|| d � ��}n| d krtj |d ���}|r|j S|S)z2read an array for the specified node (off of grouprN� transposedF� value_typer�r�r�r&Tr�r�r�) r�r�r�r�rS�VLArrayrYrTr�r�r]r�T) r�r�r�r�r�rrgr�retrYr�r&s rX� read_arrayzGenericFixed.read_array� s'��� � � ��t�z�3�'�'��� ���U�L�%�8�8� � �d�F�N� +� +� 6��q�'�%��*�%�C�C�#�G�E�<��$F�$F�G�G�E��E�7�D�1�1�E�� ��h�u�E�2�2�2����5��:�&��� 6��)�)�,�7�7� 6��U�D�$�/�/���c�2�d�3�3�3����-�'�'��j��H�5�5�5�� � ��5�L��JrZr-c��tt|j|�d�����}|dkr|�|||���S|dkr/t|j|��}|�|||���}|St d|�����)N�_variety�multi�r�r��regularzunrecognized index variety: )rYr�rg�read_multi_indexr��read_index_noder�)r�r�r�r��varietyrr�s rX� read_indexzGenericFixed.read_index� s���"�'�$�*��6F�6F�6F�"G�"G�H�H�� �g� � ��(�(��E��(�E�E� E� � � !� !��4�:�s�+�+�D��(�(��U��(�F�F�E��L��D�7�D�D�E�E� ErZr�c��t|t��r1t|j|�d�d��|�||��dSt|j|�d�d��t d||j|j��}|�||j ��t|j |��}|j |j _ |j|j _t|tt f��r,|�t%|����|j _t|tt t(f��r|j|j _t|t��r'|j�"t/|j��|j _dSdSdS)Nr�r�r�r�)rSr.r�rg�write_multi_index�_convert_indexr[r�� write_arrayr�r�r�r�r�rfr,r/rer�rkr2r%r&�_get_tz)r�r�r�r rs rX� write_indexzGenericFixed.write_index� sa�� �e�Z� (� (� 5� �D�J�3� 0� 0� 0�'� :� :� :� � "� "�3�� .� .� .� .� .� �D�J�3� 0� 0� 0�)� <� <� <�&�w��t�}�d�k�R�R�I� � � �S�)�"2� 3� 3� 3��4�:�s�+�+�D�!*��D�M� �!&��D�M� ��%�-��!=�>�>� N�,0�,@�,@��e���,M�,M�� �)��%�-��n�!M�N�N� 0�%*�Z�� �"��%��/�/� 5�E�H�4H�#*�5�8�#4�#4�� � � � � 5� 5�4H�4HrZr.c�R�t|j|�d�|j��tt |j|j|j����D]�\}\}}}t|j t��rtd���|�d|��}t|||j |j��}|�||j��t#|j|��} |j| j_|| j_t| j|�d|��|��|�d|��} |�| |����dS)N�_nlevelsz=Saving a MultiIndex with an extension dtype is not supported.�_level�_name�_label)r�rgr�� enumeraterk�levelsr��namesrSrYr(r�r�r[r�r�r�r�r�r�r�rf) r�r�r��i�lev� level_codesrf� level_key� conv_levelr� label_keys rXr�zGenericFixed.write_multi_index� sN���� �s�,�,�,�e�m�<�<�<�+4� �� �e�k�5�;� 7� 7�, �, � 5� 5� '�A�'��[�$��#�)�^�4�4� �)�S�����)�)�a�)�)�I�'� �3�� �t�{�S�S�J� � � �Y� �(9� :� :� :��4�:�y�1�1�D�!+��D�M� �!%�D�M� � �D�M�c�#6�#6��#6�#6�� =� =� =��)�)�a�)�)�I� � � �Y� � 4� 4� 4� 4�) 5� 5rZc��t|j|�d���}g}g}g}t|��D]�}|�d|��} t|j| ��} |�| ||���} |�| ��|�| j��|�d|��} |�| ||���} |�| ����t|||d���S)Nr�r�r�r�T)r�r�r�rd) r�rgr�r�r�r�rfr�r.)r�r�r�r�r�r�r�r�r�r�rr�r�r�s rXr�zGenericFixed.read_multi_index� s���$�*��&6�&6�&6�7�7������ "���w��� &� &�A��)�)�a�)�)�I��4�:�y�1�1�D��&�&�t�5�t�&�D�D�C� �M�M�#� � � � �L�L��� "� "� "��)�)�a�)�)�I��/�/�)�5�t�/�L�L�K� �L�L�� %� %� %� %����e�d� � � � rZrrGc�P�|||�}d|jvrLtj|jj��dkr*tj|jj|jj���}t |jj��}d}d|jvr(t|jj ��}t |��}|j}|� |��\}} |dvr,|t|||j |j ���fdti| ��} n$|t|||j |j ���fi| ��} || _ | S)Nr�rr�rf)rrAr�rY)r�rT�prodr�r�r�rYr�rgrfrv�_unconvert_indexr[r�rA) r�rr�r�r�r�rfrgr_r�r�s rXr�zGenericFixed.read_index_node� s_���E�$�J��� �d�m� #� #���� �0C�(D�(D��(I�(I��8�D�M�/�t�}�7O�P�P�P�D��t�}�1�2�2���� �T�]� "� "��t�}�1�2�2�D�"�4�(�(�D�� ���1�1�%�8�8���� �%� %� %��G� ��$���t�{������� � � ��E�E��G� ��$���t�{������� ��E��� �� rZr�rIc��tjd|jz��}|j�|j||��t |j|��}t|j��|j _ |j |j _ dS)zwrite a 0-len array�rkN) rTr�r�r�� create_arrayr�r�r^rYr�r�r�)r�r�r��arrrs rX�write_array_emptyzGenericFixed.write_array_empty sm���h�t�e�j�(�)�)�� � �!�!�$�*�c�3�7�7�7��t�z�3�'�'��#&�u�{�#3�#3�� � �#�k�� ���rZr�rHr*� Index | Nonec��t|d���}||jvr |j�|j|��|jdk}d}t |jt��rtd���|st|d��r |j }d}d}|j �Wtt��5t��j�|j��}ddd��n #1swxYwY|�Q|s7|j�|j|||j|j ���}||dd�<�n�|�||���n||jjt*jkr�t/j|d���} |rn<| d krn5t2| ||fz} t5j| t8t;��� ��|j�|j|t�������} | � |���n�t/j!|jd ��rg|j�"|j||�#d ����tI|j��tK|j|��j&_'�n6t |jtP��rt|j�"|j||j)��tK|j|��} tU|j+��| j&_+d |jj,�d�| j&_'n�t/j!|jd��rT|j�"|j||�#d ����dtK|j|��j&_'n:|r|�||��n!|j�"|j||��|tK|j|��j&_-dS)NT)� extract_numpyrFz]Cannot store a category dtype in a HDF5 dataset that uses format="fixed". Use format="table".r�)r���skipnartr�rRrS� datetime64[rXr�r�).r:r�r�rr�rSrYr&r�rNr�r�rr�r��Atom� from_dtype� create_carrayr�r�r�rT�object_r� infer_dtyperzr�r�rr�create_vlarray� ObjectAtomr�r\r��viewr^r�r�r�r'�asi8r�r&�unitr) r�r�r�r*r�� empty_arrayrr��ca� inferred_typer��vlarrrs rXr�zGenericFixed.write_array( s����c��6�6�6�� �$�*� � � �L� $� $�T�Z�� 5� 5� 5��j�A�o� �� � �e�k�#3� 4� 4� �%�/��� �� "��u�c�"�"� "����!� ��� �=� $��*�%�%� >� >��y�y�~�0�0���=�=�� >� >� >� >� >� >� >� >� >� >� >���� >� >� >� >� � � � 3��\�/�/��J��T�5�;�� �0������1�1�1����&�&�s�E�2�2�2�2� �[� ��� +� +� �O�E�%�@�@�@�M�� U���(�*�*��$� �s�E�'B�B��� �b�"4�AQ�AS�AS�T�T�T�T��L�/�/�� �C����AU�AU�AW�AW�X�X�E� �L�L�� � � � � �_�U�[�#� .� .� >� �L� %� %�d�j�#�u�z�z�$�7G�7G� H� H� H�;>�u�{�;K�;K�G�D�J�� $� $� -� 8� 8� �� �_� 5� 5� >� �L� %� %�� �C��� � � ��4�:�s�+�+�D� '�u�x�0�0�D�M� �'H�U�[�5E�'H�'H�'H�D�M� $� $� �_�U�[�#� .� .� >� �L� %� %�d�j�#�u�z�z�$�7G�7G� H� H� H�;H�G�D�J�� $� $� -� 8� 8� � >� � "� "�3�� .� .� .� .� �L� %� %�d�j�#�u� =� =� =�7A��� �C� � �)�4�4�4s�),C!�!C%�(C%r r rrr)r�r^r�r�r�r�r]r-)r�r^r�r-r]r�)r�r^r�r.r]r�)r�r^r�r�r�r�r]r.)rrGr�r�r�r�r]r-)r�r^r�rIr]r�r`)r�r^r�rHr*r�r]r�)r�rrrr,r/rdr*rgrarrerirvrxrr�rFrIr�r�r�r�r�r�r�r�r�r�rZrXr^r^ s��������$�$�$�j�+�x�H�O�C�C�?�+@�+@�+B�+B�C�C�C���J�����1�1�1�1�9�9�9� /�/�/�b � � � ������X��(�(�(�(� L�L�L�L����� � � � � �FFJ� F� F� F� F� F�5�5�5�5�.5�5�5�5�4FJ� � � � � �0HL�$�$�$�$�$�L*�*�*�*�BF�XB�XB�XB�XB�XB�XB�XBrZr^c�^��eZdZUdZdgZded<ed���Z ddd �Zd�fd � Z �xZ S)r�r�rfrAc�h� t|jj��fS#ttf$rYdSwxYwr`)rur�r�r�r�r�s rXr�zSeriesFixed.shape� sD�� ��� �)�*�*�,� ,���>�*� � � ��4�4� ���s ��1�1Nr�r�r�r]r1c�*�|�||��|�d||���}|�d||���}t|||jd���}t ��r&t |d���r|�d��}|S) Nr�r�r�F)r�rfr�Tr��string[pyarrow_numpy])rxr�r�r1rfrrr)r�rvr�r�r�r�r�rrs rXr?zSeriesFixed.read� s��� ���7�E�*�*�*�����u�4��@�@�������T��B�B����e�$�)�%�H�H�H�� %� '� '� <�O�F�4�,P�,P�,P� <��]�]�#:�;�;�F�� rZr�c ����t��j|fi|��|�d|j��|�d|��|j|j_dS)Nr�r�)r�r�r�r�r�rfrg)r�r�r�r�s �rXr�zSeriesFixed.write� s^������� �c�$�$�V�$�$�$� ����#�)�,�,�,� ����3�'�'�'��(�� ���rZr[�r�r�r�r�r]r1r ) r�rrrrarrr�r?r�rrs@rXr�r�� s����������K���J��N�N�N� ����X���� �� � � � � �#�#�#�#�#�#�#�#�#�#rZr�c�^��eZdZUddgZded<edd���Z ddd �Zd�fd� Z�xZ S)�BlockManagerFixedr��nblocksrir]� Shape | Nonec�z� |j}d}t|j��D]9}t|jd|�d���}t|dd��}|� ||dz }�:|jj}t|dd��}|�t |d|dz ���}ng}|�|��|S#t$rYdSwxYw)Nr�block�_itemsr�rk) r�r�r�r�r�� block0_valuesrsr�r�)r�r�r*r�rr�s rXr�zBlockManagerFixed.shape� s��� ��9�D��E��4�<�(�(� &� &���t�z�+<�1�+<�+<�+<�=�=����g�t�4�4���$��U�1�X�%�E���:�+�D��D�'�4�0�0�E�� ��U�1��q��>�2�3�3����� �L�L�� � � ��L��� � � ��4�4� ���s�B)B,�, B:�9B:Nr�r�r�r+c���|�||��|����d��}g}t|j��D]A}||kr||fnd\}} |�d|��|| ���} |�| ���B|d} g} t|j��D]�}|�d|�d���} |�d|�d�|| ���}| | � | ��}t|j ||dd � ��}t��r&t|d � ��r|�d ��}| �|����t| ��dkrMt!| dd ���}t#��r|���}|�| d ���}|St|d|d���S)Nrrrcr�r�r�rrkF�r�r�r�Tr�r�)rcr�)r�r��r�r�)rxr"�_get_block_manager_axisr�r�r�r�r�r�r�r+r�rrrrur3rr�r�)r�rvr�r�r�� select_axisr�r�r@rA�axr*�dfs� blk_itemsr��df�outs rXr?zBlockManagerFixed.read� s��� ���7�E�*�*�*��m�m�o�o�=�=�a�@�@� ����t�y�!�!� � �A�-.�+�-=�-=�U�D�M�M�<�M�F�E��������6���F�F�B� �K�K��O�O�O�O��Q������t�|�$�$� � �A����(9��(9�(9�(9�:�:�I��_�_�%7�Q�%7�%7�%7�v�E�_�R�R�F��E�-�-�i�8�8�9�G��6�8�W�D��G�%�P�P�P�B�)�+�+� 8���t�0T�0T�0T� 8��Y�Y�6�7�7�� �J�J�r�N�N�N�N� �s�8�8�a�<�<���1�4�0�0�0�C�"�$�$� !��h�h�j�j���+�+�e�%�+�8�8�C��J���a���Q��8�8�8�8rZr�c ����t��j|fi|��t|jt��r|�d��}|j}|���s|���}|j|j _t|j ��D]:\}}|dkr|j std���|�d|��|���;t|j��|j _t|j��D]_\}}|j�|j��}|�d|�d�|j|���|�d|�d�|���`dS)Nr�rz/Columns index has to be unique for fixed formatrcr)r*r�)r�r�rS�_mgrr<� _as_manager�is_consolidated� consolidater�rgr�r�� is_uniquer�r�ru�blocksr�r*r��mgr_locsr�r�) r�r�r�r�r�r��blkr�r�s �rXr�zBlockManagerFixed.write� sy������� �c�$�$�V�$�$�$� �c�h� � -� -� +��/�/�'�*�*�C��x���#�#�%�%� &��#�#�%�%�D��)�� ���t�y�)�)� -� -�E�A�r��A�v�v�r�|�v� �!R�S�S�S� � � �Z�A�Z�Z�� ,� ,� ,� ,�!���-�-�� ���� �,�,� ;� ;�F�A�s�� ���� �5�5�I� � � �/�Q�/�/�/���9� � M� M� M� � � �.�Q�.�.�.� � :� :� :� :�  ;� ;rZ)r]r�r[)r�r�r�r�r]r+r ) r�rrrarrr�r?r�rrs@rXr�r�� s����������)�$�J��L�L�L� �����X��8�� �� '9�'9�'9�'9�'9�R;�;�;�;�;�;�;�;�;�;rZr�c��eZdZdZeZdS)r�r�N)r�rrrr+r"r�rZrXr�r� s�������K��H�H�HrZr�c���eZdZUdZdZdZded<ded<dZded <d Zd ed < dedf�fd"� Z e dgd#���Z dgd$�Z dhd&�Z did'�Ze djd)���Zdkd-�Ze dld/���Ze djd0���Ze d1���Ze d2���Ze d3���Ze d4���Ze dmd6���Ze dld7���Ze djd8���Ze dnd:���Zdod<�Zd=�Zdpd?�ZdqdA�ZdrdD�ZdsdE�Z didF�Z!didG�Z"dtdidH�Z#didI�Z$e%dJ���Z& dudvdL�Z' dwdxdQ�Z(e)dydS���Z*dT�Z+ dzd{dW�Z,e-d|dZ���Z.dtd}d]�Z/d~da�Z0 duddb�Z1 dud�dd�Z2�xZ3S)�raa represent a table: facilitate read/write of various types of tables Attrs in Table Node ------------------- These are attributes that are store in the main table node, they are necessary to recreate these tables when read back in. index_axes : a list of tuples of the (original indexing axis and index column) non_index_axes: a list of tuples of the (original index axis and columns on a non-indexing axis) values_axes : a list of the columns which comprise the data of this table data_columns : a list of the columns that we are allowing indexing (these become single columns in values_axes) nan_rep : the string to use for nan representations for string objects levels : the names of levels metadata : the names of the metadata columns � wide_tabler|r^r r�rkzint | list[Hashable]r�Trsr,Nr�r�r�r�rGr[r\r�� index_axes�list[IndexCol] | Noner^� list[tuple[AxisInt, Any]] | None� values_axes�list[DataCol] | Noner�� list | Noner�� dict | Noner]r�c ���t���||||���|pg|_|pg|_|pg|_|pg|_| pi|_| |_dS)Nr�)r�r�r�r^r�r�r�r�) r�r�r�r[r�r�r^r�r�r�r�r�s �rXr�zTable.__init__. so��� ��������&��I�I�I�$�*����,�2����&�,�"���(�.�B����J�B�� ��� � � rZc�B�|j�d��dS)N�_r)r�rr�s rX�table_type_shortzTable.table_type_shortC s����$�$�S�)�)�!�,�,rZc ��|���t|j��rd�|j��nd}d|�d�}d}|jr*d�d�|jD����}d|�d�}d�d�|jD����}|jd �|�d |j�d |j �d |j �d |�d|�d� S)r1r7rcz,dc->[rXr.c�,�g|]}t|����Sr��r^rZs rXrrz"Table.__repr__.<locals>.<listcomp>O s��:�:�:��S��V�V�:�:�:rZr4c��g|] }|j�� Sr�rer�s rXrrz"Table.__repr__.<locals>.<listcomp>R s��@�@�@�1���@�@�@rZr5z (typ->z,nrows->z,ncols->z ,indexers->[r6) rGrur�r=r(r'r�r�r�rE�ncols)r��jdcr��ver�jver� jindex_axess rXr zTable.__repr__G s#�� ������-0��1B�-C�-C�K�c�h�h�t�(�)�)�)��� �c�_�_�_���� � � ��8�8�:�:�T�\�:�:�:�;�;�D��d�+�+�+�C��h�h�@�@���@�@�@�A�A� ��� -� B�s� B� B��*� B� B�48�J� B� B��j� B� B�.9� B� B�<>� B� B� B� rZr�c�8�|jD]}||jkr|cS�dS)zreturn the axis for cN)r�rf)r�r�r�s rXr�zTable.__getitem__Y s1���� � �A��A�F�{�{�������trZc �r�|�dS|j|jkr td|j�d|j�d����dD]}t||d��}t||d��}||krUt|��D],\}}||}||krt d|�d|�d|�d�����-t d|�d|�d|�d������dS) z"validate against an existing tableNz'incompatible table_type with existing [r�rX)r�r^r�zinvalid combination of [z] on appending data [z] vs current table [)r�r�r�r�r�r{)r�r@r��sv�ovr��sax�oaxs rXr�zTable.validate` sb�� �=� �F� � �t�� .� .��<��$�<�<�)-��<�<�<��� � A� � �A���q�$�'�'�B����4�(�(�B��R�x�x�(��m�m���F�A�s��Q�%�C��c�z�z�(�@�q�@�@� #�@�@�9<�@�@�@����"� �,�q�,�,�r�,�,�&(�,�,�,����� � rZr�c�6�t|jt��S)z@the levels attribute is 1 or a list in the case of a multi-index)rSr�rsr�s rX�is_multi_indexzTable.is_multi_index� s���$�+�t�,�,�,rZr�r�� tuple[DataFrame, list[Hashable]]c���tj|jj��} |���}n"#t $r}t d��|�d}~wwxYwt |t��sJ�||fS)ze validate that we can store the multi-index; reset and return the new object zBduplicate names/columns in the multi-index when storing as a tableN)r}�fill_missing_namesr�r�� reset_indexr�rSr+)r�r�r�� reset_objr�s rX�validate_multiindexzTable.validate_multiindex� s����'�� ��8�8�� ����)�)�I�I��� � � ��T���� ����� �����)�Y�/�/�/�/�/��&� � s�5� A�A�Aric�H�tjd�|jD����S)z-based on our axes, compute the expected nrowsc�2�g|]}|jjd��Sr])rqr��ror�s rXrrz(Table.nrows_expected.<locals>.<listcomp>� s!��D�D�D�q�� ���*�D�D�DrZ)rTr�r�r�s rX�nrows_expectedzTable.nrows_expected� s%���w�D�D�D�O�D�D�D�E�E�ErZc��d|jvS)zhas this table been createdr|rKr�s rXr�zTable.is_exists� s���$�*�$�$rZc�.�t|jdd��S�Nr|�r�r�r�s rXrLzTable.storable� s���t�z�7�D�1�1�1rZc��|jS)z,return the table group (this is my storable))rLr�s rXr|z Table.table� s ���}�rZc��|jjSr`)r|rYr�s rXrYz Table.dtype� s ���z��rZc��|jjSr`rjr�s rXrkzTable.description� rlrZ�itertools.chain[IndexCol]c�@�tj|j|j��Sr`)rirjr�r�r�s rXr�z Table.axes� s����t���0@�A�A�ArZc�>�td�|jD����S)z.the number of total columns in the values axesc3�>K�|]}t|j��V��dSr`)rur�r�s rXr�zTable.ncols.<locals>.<genexpr>� s*����;�;�Q�3�q�x�=�=�;�;�;�;�;�;rZ)�sumr�r�s rXr�z Table.ncols� s$���;�;�$�*:�;�;�;�;�;�;rZc��dSr�r�r�s rX� is_transposedzTable.is_transposed� r�rZ�tuple[int, ...]c��ttjd�|jD��d�|jD������S)z@return a tuple of my permutated axes, non_indexable at the frontc�8�g|]}t|d����Sr]r-r�s rXrrz*Table.data_orientation.<locals>.<listcomp>� s"��8�8�8�q��Q�q�T���8�8�8rZc�6�g|]}t|j����Sr�)rircr�s rXrrz*Table.data_orientation.<locals>.<listcomp>� s ��6�6�6���Q�V���6�6�6rZ)rtrirjr^r�r�s rX�data_orientationzTable.data_orientation� sL��� �O�8�8�D�$7�8�8�8�6�6�d�o�6�6�6� � � � � rZ�dict[str, Any]c����ddd��d��jD��}�fd��jD��}�fd��jD��}t||z|z��S)z<return a dict of the kinds allowable columns for this objectr�r��rrkc� �g|] }|j|f�� Sr��r(r�s rXrrz$Table.queryables.<locals>.<listcomp>� s�� 4� 4� 4�q�q�w��l� 4� 4� 4rZc�*��g|]\}}�|df��Sr`r�)rorcr�� axis_namess �rXrrz$Table.queryables.<locals>.<listcomp>� s'��� O� O� O�<�4��z�$���&� O� O� OrZc�X��g|]&}|jt�j��v�|j|f��'Sr�)rfr�r�r()ror�r�s �rXrrz$Table.queryables.<locals>.<listcomp>� s=��� � � ��a�f��D�DU�@V�@V�6V�6V�Q�W�a�L�6V�6V�6VrZ)r�r^r�r�)r��d1�d2�d3r"s` @rX� queryableszTable.queryables� s�����!�Y�/�/� �5� 4�D�O� 4� 4� 4�� O� O� O� O�4�;N� O� O� O�� � � � �"&�"2� � � ���B��G�b�L�!�!�!rZc�$�d�|jD��S)zreturn a list of my index colsc�*�g|]}|j|jf��Sr�)rcr(rs rXrrz$Table.index_cols.<locals>.<listcomp>� s!��;�;�;�a�����!�;�;�;rZ�r�r�s rX� index_colszTable.index_cols� s��<�;�4�?�;�;�;�;rZrc�$�d�|jD��S)zreturn a list of my values colsc��g|] }|j�� Sr�r rs rXrrz%Table.values_cols.<locals>.<listcomp>� s��2�2�2�A���2�2�2rZ)r�r�s rX� values_colszTable.values_cols� s��2�2��!1�2�2�2�2rZr�c�*�|jj}|�d|�d�S)z)return the metadata pathname for this keyz/meta/z/metar>r;s rX�_get_metadata_pathzTable._get_metadata_path� s#��� �&���)�)�s�)�)�)�)rZr�rOc��|j�|�|��t|d���d|j|j|j���dS)z� Write out a metadata array to the key as a fixed-format Series. Parameters ---------- key : str values : ndarray Fr�r|)r�r[r�r�N)r�r�r0r1r[r�r�)r�r�r�s rXr�zTable.write_metadata� s^�� � ��� � #� #�C� (� (� �6�� &� &� &���]��;��L� � � � � � rZc��tt|jdd��|d���-|j�|�|����SdS)z'return the meta data array for this keyr�N)r�r�r�r�r0r�s rXr�zTable.read_metadata� sK�� �7�4�:�v�t�4�4�c�4� @� @� L��;�%�%�d�&=�&=�c�&B�&B�C�C� C��trZc��t|j��|j_|���|j_|���|j_|j|j_|j|j_|j|j_|j|j_|j |j_ |j |j_ |j |j_ dS)zset our table type & indexablesN) r^r�rgr+r.r^r�r�r[r�r�r�r�s rXrFzTable.set_attrs� s��� #�D�O� 4� 4�� �� $��� 1� 1�� ��!%�!1�!1�!3�!3�� ��$(�$7�� �!�"&�"3�� ��!�\�� ��"�m�� �� �K�� �� �K�� ���)�� ���rZc��t|jdd��pg|_t|jdd��pg|_t|jdd��pi|_t|jdd��|_t t|jdd����|_tt|jdd����|_ t|jd d��pg|_ d �|j D��|_ d �|j D��|_ dS) r|r^Nr�r�r�r[r�r�r�c� �g|] }|j� |�� Sr��r#r�s rXrrz#Table.get_attrs.<locals>.<listcomp>� ��K�K�K���9J�K�1�K�K�KrZc� �g|] }|j� |�� Sr�r6r�s rXrrz#Table.get_attrs.<locals>.<listcomp>� ��P�P�P�!�a�>O�P�A�P�P�PrZ)r�rgr^r�r�r�rcr[rYr�r�� indexablesr�r�r�s rXrIzTable.get_attrs s���%�d�j�2B�D�I�I�O�R���#�D�J���E�E�K�����D�J���5�5�;��� ��t�z�9�d�;�;�� �(����Z��)N�)N�O�O�� �%�g�d�j�(�H�&M�&M�N�N�� �&-�d�j�(�D�&I�&I�&O�R�� �K�K�d�o�K�K�K���P�P�t��P�P�P����rZc���|�]|jrXtd�d�|jD����z}t j|t t�����dSdSdS)rRNr.c�,�g|]}t|����Sr�r�rZs rXrrz*Table.validate_version.<locals>.<listcomp>s��4R�4R�4R��S��V�V�4R�4R�4RrZr�)r(rxr=r'r�r�rr)r�rvr�s rXrSzTable.validate_versions~�� � ��"� �(�3�8�8�4R�4R�T�\�4R�4R�4R�+S�+S�S��� ��*�/�1�1������� � � � rZc��|�dSt|t��sdS|���}|D] }|dkr� ||vrtd|�d�����!dS)z� validate the min_itemsize doesn't contain items that are not in the axes this needs data_columns to be defined Nr�zmin_itemsize has the key [z%] which is not an axis or data_column)rSr�r'r�)r�r��qrWs rX�validate_min_itemsizezTable.validate_min_itemsize!s��� � � �F��,��-�-� � �F� �O�O� � ��� � �A��H�}�}����z�z� �"��"�"�"�����  � rZc �,�� � � ���g}�j� �jj�t�jj��D]z\}\}}t � |��}��|��}|�dnd}|�d�}t �|d��} t|||| |�j||���} |�| ���{t�j ��� t|��� � � � ��fd��|� �fd�t�jj ��D����|S)z/create/cache the indexables if they don't existNr�r1)rfrcr+r�r*r|r�r,c ���t|t��sJ�t}|� vrt}t � |��}t |�j��}t �|�d�d��}t �|�d�d��}t|��}��|��}t �|�d�d��} |||||� |z|�j | ||�� � } | S)Nr1r�r�) rfr(r�r�r+r*r|r�r,rY) rSr^r�rr��_maybe_adjust_namer'r�r�r|)r�r��klassr��adj_namer�rYr��mdr�r��base_posr��descr�� table_attrss �����rXr}zTable.indexables.<locals>.fYs����a��%�%� %� %�%��E��B�w�w�(���4��#�#�D�)�!�T�\�:�:�H��[�X�*<�*<�*<�d�C�C�F��K�H�)<�)<�)<�d�C�C�E�"�%�(�(�D��#�#�A�&�&�B��;�8�(:�(:�(:�D�A�A�D��%������q�L���j���� � � �C��JrZc�.��g|]\}}�||����Sr�r�)ror�r�r}s �rXrrz$Table.indexables.<locals>.<listcomp>~s'���R�R�R���1�A�A�a��G�G�R�R�RrZ)rkr|rgr�r+r�r�r"r�r�r�rur�r.)r�� _indexablesr�rcrfr�rEr�r2r�� index_colrFr�rGr}rHs` @@@@@rXr:zTable.indexables6sd��������� �����j�&� � )���)>�?�?� *� *�O�A�|��d��4��&�&�D��#�#�D�)�)�B�!#��:�:�T�D�����I��;� �4�8�8�D� �������j��� � � �I� � � �y� )� )� )� )���"� #� #���{�#�#��! �! �! �! �! �! �! �! �! �J ���R�R�R�R� �$�*�:P�0Q�0Q�R�R�R�S�S�S��rZr�c ��|���sdS|durdS|�|durd�|jD��}t|ttf��s|g}i}|�||d<|�||d<|j}|D]�}t |j|d��}|��|jrY|j }|j } |j } |�| |kr|� ��n| |d<|�| |kr|� ��n| |d<|js6|j �d��rtd���|jdi|����||jd d vrt%d |�d |�d |�d������dS)aZ Create a pytables index on the specified columns. Parameters ---------- columns : None, bool, or listlike[str] Indicate which columns to create an index on. * False : Do not create any indexes. * True : Create indexes on all columns. * None : Create indexes on all columns. * listlike : Create indexes on the given columns. optlevel : int or None, default None Optimization level, if None, pytables defaults to 6. kind : str or None, default None Kind of index, if None, pytables defaults to "medium". Raises ------ TypeError if trying to create an index on a complex-type column. Notes ----- Cannot index Time64Col or ComplexCol. Pytables must be >= 3.0. NFTc�*�g|]}|j� |j��Sr�)r$r(r�s rXrrz&Table.create_index.<locals>.<listcomp>�s"��I�I�I�1�Q�5H�I�q�w�I�I�IrZr�r��complexz�Columns containing complex values can be stored but cannot be indexed when using table format. Either use fixed format, set index=False, or do not include the columns containing complex values to data_columns when initializing the table.rrkzcolumn z/ is not a data_column. In order to read column z: you must reload the dataframe into HDFStore and include z with the data_columns argument.r�)rGr�rSrtrsr|r�r�r�r�r�r�� remove_indexr�r�r�r�r^r�) r�r�r�r��kwr|r�r�r�� cur_optlevel�cur_kinds rXr�zTable.create_index�s���<��� � � � �F� �e� � � �F� �?�g��o�o�I�I�� �I�I�I�G��'�E�4�=�1�1� ��i�G� �� � �%�B�z�N� � ��B�v�J�� ���$ �$ �A��� �A�t�,�,�A��}��<� 6��G�E�#(�>�L�$�z�H��'�H��,<�,<����(�(�(�(�%-��6� ��+� ��0H�0H����(�(�(�(�)5��:���|� )��v�(�(��3�3��'�H����#�A�N�(�(�R�(�(�(���d�)�!�,�Q�/�/�/�$�U�a�U�U�/0�U�U�12�U�U�U����0�=$ �$ rZr�r�r��9list[tuple[np.ndarray, np.ndarray] | tuple[Index, Index]]c��t||||���}|���}g}|jD]Y}|�|j��|�||j|j|j���}|� |���Z|S)a Create the axes sniffed from the table. Parameters ---------- where : ??? start : int or None, default None stop : int or None, default None Returns ------- List[Tuple[index_values, column_values]] rLr) � Selectionr�r�r�r�rbr�r[r�r�) r�rvr�r�� selectionr�rr��ress rX� _read_axeszTable._read_axes�s���"�d�%�u�4�H�H�H� ��!�!�#�#������ � �A� �J�J�t�y� !� !� !��)�)��� ����{� ���C� �N�N�3� � � � ��rZrc��|S)zreturn the data for this objr��r�r�rs rX� get_objectzTable.get_object�s ��� rZc�����t|��sgS|d\}�|j�|i��}|�d��dkr|rtd|�d|�����|durt ���}n|�g}t |t ��rQt|���t |��}|��fd�|� ��D�����fd �|D��S) zd take the input data_columns and min_itemize and create a data columns spec rr�r.z"cannot use a multi-index on axis [z] with data_columns TNc�(��g|]}|dk�|�v� |��Srdr�)rorW�existing_data_columnss �rXrrz/Table.validate_data_columns.<locals>.<listcomp>s7��������H�}�}��2G�)G�)G��)G�)G�)GrZc���g|]}|�v�|�� Sr�r�)ror�� axis_labelss �rXrrz/Table.validate_data_columns.<locals>.<listcomp>#s#���<�<�<�a�1� �+;�+;��+;�+;�+;rZ) rur�r�r�rsrSr�r�r�r")r�r�r�r^rcr�r`r^s @@rX�validate_data_columnszTable.validate_data_columns�sG���� �>�"�"� ��I�*�1�-���k��y�}�}�T�2�&�&�� �8�8�F� � �|� +� +� � +��/�T�/�/� ,�/�/��� � �4� � �� �,�,�L�L� � !��L� �l�D� )� )� �$'� �$5�$5� !�� �-�-�L� � � �����)�.�.�0�0���� � � �=�<�<�<�<�<�<�<�<rZr+r�c�4 ���t�t��s/|jj}t d|�dt ����d������dg��fd��D���|���r/d}d�|jD���t|j ��}|j }nd }|j } |j d ksJ�t���|j d z krtd ���g} |�d }t�fd�dD����} �j| } t| ��} |r�t| ��}|j|d }t%t'j| ��t'j|��dd���sSt%t'jt+| ����t'jt+|����dd���r|} | �| i��}t| j��|d<t | ��j|d<| �| | f���d} �j| } ��| ��}t7|| |j|j��}| |_|�d��|� | ��|�!|��|g}t|��}|d ksJ�t| ��d ksJ�| D]} tE�| d| d ���� |jd k}|�#||| ��}|�$�|���%��}|�&||| |j'|��\}}g}tQtS||����D�]\}\}}tT}d}|rRt|��d kr?|d|vr5tV}|d}|�$t|tX��std���|rF|rD |j'|}n7#tZt\f$r!} td|�d|j'�d���| �d} ~ wwxYwd}|pd|��}!t_|!|j0||||j|j|���}"tc|!|j2��}#|�3|"��}$ti|"j5j6��}%d}&to|"dd���tq|"j9��}&dx}'x}(})t|"j5tt��r4|"j;})d}'t'j<|"j=���>��}(t|"��\}*}+||#|!t|��|$||%|&|)|'|(|+|*�� � },|,� | ��|�|,��|d z }��d�|D��}-t |��|j@|j|j|j|| ||-| |�� � }.t�|d��r |jB|._B|.�C|��|r|r|.�D|��|.S)a0 Create and return the axes. Parameters ---------- axes: list or None The names or numbers of the axes to create. obj : DataFrame The object to create axes on. validate: bool, default True Whether to validate the obj against an existing object already written. nan_rep : A value to use for string column nan_rep. data_columns : List[str], True, or None, default None Specify the columns that we want to create to allow indexing on. * True : Use all available columns. * None : Use no columns. * List[str] : Use the specified columns. min_itemsize: Dict[str, int] or None, default None The min itemsize for a column in bytes. z/cannot properly create the storer for: [group->r�rXNrc�:��g|]}��|����Sr�)�_get_axis_number)ror�r�s �rXrrz&Table._create_axes.<locals>.<listcomp>Qs'���6�6�6�A��$�$�Q�'�'�6�6�6rZTc��g|] }|j�� Sr�r�r�s rXrrz&Table._create_axes.<locals>.<listcomp>Vs��4�4�4�q�A�F�4�4�4rZFr&rkz<currently only support ndim-1 indexers in an AppendableTable�nanc3�$�K�|] }|�v�|V�� dSr`r�)ror[r�s �rXr�z%Table._create_axes.<locals>.<genexpr>ns'�����6�6���� � �1� � � � �6�6rZrr�r�r�rzIncompatible appended table [z]with existing table [� values_block_)� existing_colr�r�r[r�r�r&r�) rfr(r�r*r+r�r&r�r�r,rYr�c�*�g|]}|j� |j��Sr�)r$rf)rorns rXrrz&Table._create_axes.<locals>.<listcomp>�s"��B�B�B�C�C�,A�B�s�x�B�B�BrZ) r�r�r[r�r�r^r�r�r�r�r�)ErSr+r�r�r�r�rGr�rsr�r�r�r�rur�r�r�r^r*rT�arrayr�r�r�r�r��_get_axis_namer�r[r�rcr-r�rv� _reindex_axisrar[re�_get_blocks_and_itemsr�r�rkr�rr^� IndexErrorr��_maybe_convert_for_string_atomr�rBr'r�r�rYrfr�r�r&r&r�rr�rr�r�rNr�r?r�)/r�r�r�r�r�r�r�r�� table_exists�new_info�new_non_index_axesr�r�� append_axis�indexer� exist_axisr�� axis_name� new_index�new_index_axes�jrr�r�r��vaxesr�r��b_itemsrCrfrir��new_name�data_convertedrDr*r�r&r�r,r�r�r�rn�dcs� new_tables/ `` rX� _create_axeszTable._create_axes%s����@�#�y�)�)� ��J�&�E��'�%�'�'��s�)�)�'�'�'��� � �<��3�D�7�6�6�6��6�6�6�� �?�?� � � !��L�4�4�D�O�4�4�4�D��� 1�2�2�L��l�G�G�!�L��9���y�A�~�~�~�~� �t�9�9�� �A� � %� %��N��� � $&�� �?��G��6�6�6�6�f�6�6�6�6�6�� �H�S�M���1�g�g� � � -��,�-�-�G��,�W�5�a�8�J�#����%�%����$�$�� � ��� -�$��H�V�K�0�0�1�1��H�V�J�/�/�0�0�#� $� ���-� #-�K��"�"�3��+�+���Q�W� � ��W� ��A�w�w�'��V� ��!�!�3� �"4�5�5�5��1�g�� �H�S�M���&�&�s�+�+� �"�9�a���� �L�L� �� �� ���!�������h�'�'�'�� � ��.�.�.�#��� �� � ���A�v�v�v�v��%�&�&�!�+�+�+�+�#� 1� 1�A���Q�q�T�1�Q�4�0�0�C�C��^�q�(� ��1�1� �,�(:� � � �����Z�0�0�=�=�?�?�� �6�6� �<�!3�T�5E�|� � ��� � ��!*�3�v�y�+A�+A�!B�!B�I �I � �A�~��W��E��D�� V��G� � �� 1� 1�g�a�j�L�6P�6P�(���q�z��� � �4��(=�(=� �$�%T�U�U�U� � $�� $��#'�#3�A�#6�L�L��"�H�-����$�D��D�D�04�0@�D�D�D������������� $� ��2�2�q�2�2�H�;��� �)�)�����{�� � � �N�*�(�D�L�A�A�H��/�/�.�1�1�C�!�.�"6�";�<�<�D��B��~�t�T�2�2�>��^�.�/�/��(,� ,�D� ,�8�g��.�.�0@�A�A� I�(�0��!���:�n�&?�@�@�F�F�H�H��7��G�G� �D�*��%����G�}�}�������!� �� � � �C� �O�O�H� %� %� %� �L�L�� � � � ��F�A�A�B�B�5�B�B�B���D��J�J��;��*��]��;�%�-�����  �  �  � � �4�� "� "� +�#�{�I� ��'�'� �5�5�5� � %� � %� � � �t� $� $� $��s�5 P�P5�P0�0P5r�rqc��t|jt��r|�d��}d�}|j}t t |��}t |j��}||��}t|��r�|d\} } t| ��� t|����} |� | | ���j}t t |��}t |j��}||��}|D]l} |� | g| ���j}t t |��}|� |j��|� ||�����m|r�d�t||��D��} g}g}|D]�}t|j��} | �|��\}}|�|��|�|���Z#t$t&f$r8}d�d�|D����}t+d|�d ���|�d}~wwxYw|}|}||fS) Nr�c�*���fd��jD��S)Nc�N��g|]!}�j�|j����"Sr�)r*r�r�)ror��mgrs �rXrrzFTable._get_blocks_and_items.<locals>.get_blk_items.<locals>.<listcomp>$s)���G�G�G�S�C�I�N�N�3�<�0�0�G�G�GrZ)r�)r�s`rX� get_blk_itemsz2Table._get_blocks_and_items.<locals>.get_blk_items#s���G�G�G�G�C�J�G�G�G� GrZrr�c�\�i|])\}}t|�����||f��*Sr�)rt�tolist)ro�br|s rXr�z/Table._get_blocks_and_items.<locals>.<dictcomp>BsD������A�w��g�n�n�&�&�'�'�!�W����rZr7c�,�g|]}t|����Sr�r3)ro�items rXrrz/Table._get_blocks_and_items.<locals>.<listcomp>Os ��&L�&L�&L�d�|�D�'9�'9�&L�&L�&LrZz+cannot match existing table structure for [z] on appending data)rSr�r<r�r r=rsr�rur-r�r�r�rkrtr�rnr�ror�r=r�)r�rqrsr�r�r�r�r�r�rcr`� new_labelsr��by_items� new_blocks� new_blk_items�ear*r�r|r��jitemss rXrnzTable._get_blocks_and_itemss��� �e�j�,� /� /� /��%�%�g�.�.�E� H� H� H��j���<��%�%��"�3�:�.�.��!.��s�!3�!3� � �|� � � 5� !3�1� 5� �D�+��{�+�+�6�6�u�\�7J�7J�K�K�J��-�-� ��-�6�6�;�C��|�S�)�)�C��#�*�%�%�F�%� �c�*�*�I�!� 5� 5���m�m�Q�C�d�m�3�3�8���<��-�-��� � �c�j�)�)�)�� � ���s�!3�!3�4�4�4�4� � &���"%�f�i�"8�"8����H�')�J��M�!� � ���b�i�(�(�� �!)���e�!4�!4�J�A�w��%�%�a�(�(�(�!�(�(��1�1�1�1��"�H�-���� �X�X�&L�&L�e�&L�&L�&L�M�M�F�$�,�f�,�,�,�������������  �F�%�I��y� � s�/AG2�2H;�3H6�6H;rVrUc�p���|�t|��}|�G�jr@t�jt��sJ��jD]}||vr|�d|����jD]\}}t �|||�����fd�}�|j�-|j���D]\}} } ||| | �����S)zprocess axes filtersNrc�L���jD�]}��|��}��|��}|�J�||krX� jr'|�t � j����}|||��}��|���|cS||vrutt�|��j ��}t|��}t�t��rd|z }|||��}��|���|cS�� td|�d����)Nr�rkzcannot find the field [z] for filtering!)� _AXIS_ORDERSrd� _get_axisr��unionr-r�r�r;r�r�rSr+r�) �field�filt�oprw� axis_number� axis_values�takersr�r�r�s ��rX�process_filterz*Table.process_axes.<locals>.process_filterjsO���!$�!1�A�A�I�"%�"6�"6�y�"A�"A�K�"%�-�-� �":�":�K�&�2�2�2�� �)�)� �.�B�#'�:�:�e�D�K�.@�.@�#A�#A�D�!#��K��!6�!6��"�w�w�K�w�8�8��@�@�@�@��+�-�-�!-�g�c�5�.A�.A�.H�!I�!I��+�D�1�1��&�c�9�5�5�:�*+�k�/�K�!#��F�D�!1�!1��"�w�w�K�w�8�8��@�@�@�@�.�!�!R�5�!R�!R�!R�S�S�SrZ) rsr�rSr��insertr^rm�filterr�) r�r�rVr�rrc�labelsr�r�r�r�s `` rX� process_axeszTable.process_axesYs���� � ��7�m�m�G� � �4�#6� ��d�k�4�0�0� 0� 0�0��[� )� )���G�#�#��N�N�1�a�(�(�(��!�/� T� T�L�D�&���T�6�7�;�;�C� T� T� T� T� T� T� T�@ � � '�#,�#3�#:�#:�#<�#<� 6� 6���r�4�$�n�U�D�"�5�5���� rZr�r�r�c��|�t|jd��}d|d�}d�|jD��|d<|r<|� |jpd}t ���|||p|j���}||d <n|j� |j|d <|S) z:create the description of the table from the axes & valuesNi'r|)rfr�c�(�i|]}|j|j��Sr�)r(r*r�s rXr�z,Table.create_description.<locals>.<dictcomp>�s��>�>�>�q�A�G�Q�U�>�>�>rZrk� )r�r�r�r�)�maxrr�r�r�r-r�r�)r�r�r�r�r�r�r�s rX�create_descriptionzTable.create_description�s��� � ��t�2�E�:�:�L��l� ;� ;��?�>�D�I�>�>�>��-�� � )�� � �O�0�q� ��i�i�'�'�#��%�9��)9�(���G� #�A�i�L�L� �]� &��=�A�i�L��rZc���|�|��|���sdSt||||���}|���}|j��|j���D]|\}}}|�||���|���dz���} ||| j ||���z |��j }�}t|��S)zf select coordinates (row numbers) from a table; return the coordinates object FrLNrkr�) rSrGrU� select_coordsr�r�rSrr��ilocr�r-) r�rvr�r�rV�coordsr�r�r�r�s rXrNzTable.read_coordinates�s��� ���e�$�$�$���� � � ��5��d�%�u�4�H�H�H� ��(�(�*�*�� � � '�#,�#3�#:�#:�#<�#<� S� S���r�4��'�'�������F�J�J�L�L�1�4D�(���� ���4�9�V�f�j�j�l�l�-B�#C�T� J� J� Q�R����V�}�}�rZrQc��|���|���sdS|�td���|jD]�}||jkr�|jst d|�d����t|jj |��}|� |j ��|� |||�|j |j|j���}t!t#|d|j��|d���cS��t'd|�d ����) zj return a single column from the table, generally only indexables are interesting FNz4read_column does not currently accept a where clausezcolumn [z=] can not be extracted individually; it is not data indexablerrk)rfr�z] not found in the table)rSrGr�r�rfr$r�r�r|r�r�r�rbr�r[r�r1r]r&r�)r�rQrvr�r�r�r�� col_valuess rXrSzTable.read_column�sB�� ��������� � � ��5� � ��R�S�S� S��� U� U�A�������*��$�3�6�3�3�3���� �D�J�O�V�4�4��� � �4�9�%�%�%��Y�Y��e�D�j�M� �L�!�]��;� '��� � �g�j��m�Q�T�:�:��e�T�T�T�T�T�T�! �$�B�&�B�B�B�C�C�CrZ)Nr�NNNNNN)r�r�r�rGr[r\r�r^r�r�r^r�r�r�r�r�r�r�r]r�r )r�r^r r)r�r�r]r�r )r]r)r]r)r]r)r]r)r�r^r]r^)r�r^r�rOr]r�r r`r)r�r\r]r�r)r�r�r�r�r]rS�rr�)TNNN)r�r+r�r�)r�r+rqr�)rVrUr]r+)r�r�r�r�r�r�r]rr\)rQr^r�r�r�r�)4r�rrrrr rr�rlr�rr�r r�r�r�rrr�rLr|rYrkr�r�rrr'r+r.r0r�r�rFrIrSr?rr:r�rXrr[rar�� staticmethodrnr�r�rNrSrrs@rXrr s�����������.�K��K������O�O�O�#$�F�$�$�$�$��H��N�N�N� $��,0�;?�,0�$(� ���������*�-�-�-��X�-� � � � �$��������B�-�-�-��X�-�!�!�!�!�"�F�F�F��X�F��%�%�%��X�%��2�2��X�2�����X��� � ��X� ��&�&��X�&��B�B�B��X�B��<�<�<��X�<������X��� � � ��X� � "� "� "� "�<�<�<� 3�3�3�3�*�*�*�*�  � � � �$���� $� $� $� $� Q� Q� Q� Q� � � � � �����*�I�I��^�I�X?C�T�T�T�T�T�nCG� � � � � �D�����[��$=�$=�$=�T����n�n�n�n�n�`�A!�A!�A!��\�A!�F5�5�5�5�5�n����@HL������:� �� )D�)D�)D�)D�)D�)D�)D�)D�)DrZrc�0�eZdZdZdZ d d d�Zd d �ZdS)r�z� a write-once read-many table: this format DOES NOT ALLOW appending to a table. writing is a one-time operation the data are stored in a format that allows for searching the data on disk r�Nr�r�r�c� �td���)z[ read the indices and the indexing array, calculate offset rows and return z!WORMTable needs to implement readrVrWs rXr?zWORMTable.read�s��"�"E�F�F�FrZr]r�c � �td���)z� write in a format that we can search later on (but cannot append to): write out the indices and the values using _write_array (e.g. a CArray) create an indexing table so that we can search z"WORMTable needs to implement writerVrYs rXr�zWORMTable.write s�� "�"F�G�G�GrZr[r\r )r�rrrr�r?r�r�rZrXr�r��sk�������� �J��� �� G� G� G� G� G�H�H�H�H�H�HrZr�c�T�eZdZdZdZ ddd�Zddd�Zdd�Zd d!d�ZdS)"r{�(support the new appendable table formats� appendableNFTr�r�r�r�r�rrr]r�c���|s'|jr |j�|jd��|�||||| | ���}|jD]}|����|jsJ|�|||| ���}|���| |d<|jj |jfi|��|j |j _ |jD]}|� ||���|� || ���dS)Nr|)r�r�r�r�r�r�)r�r�r�r�rr)r�)r�r�rr�r�r�rxr�rF� create_tabler�rgr�� write_data)r�r�r�r�r�r�r�r�r�r�r�r�r�rrr|r��optionss rXr�zAppendableTable.writesM�� � :�$�.� :� �L� $� $�T�Z�� 9� 9� 9��!�!����%��%� "� � ���� � �A� � � � � � � ��� ?��.�.��#�%�)� /���G� �O�O� � � �%0�G�M� "� '�E�M� &�u�{� >� >�g� >� >� >�!�:�� ���� .� .�A� � � �u�f� -� -� -� -� ����6��2�2�2�2�2rZc�N���|jj}|j}g}|rv|jD]n}t |j���d���}t|tj ��r*|� |� dd������ot|��r/|d}|dd�D]}||z}�|� ��}nd}d�|jD��} t| ��} | dks J| ���d �|jD��} d �| D��} g} t| ��D]L\} }|f|j|| | zjz}| � |�|�����M|�d }tjt'||��|j� ��}||zdz}t)|��D]e} | |z�t'| dz|z|�����krdS|�|��fd �| D��|� |���nd��fd�| D������fdS)z` we form the data into a 2-d including indexes,values,mask write chunk-by-chunk rr��u1Fr�rkNc��g|] }|j�� Sr�)rqr�s rXrrz.AppendableTable.write_data.<locals>.<listcomp>os��6�6�6��1�9�6�6�6rZc�6�g|]}|�����Sr�)rer�s rXrrz.AppendableTable.write_data.<locals>.<listcomp>us ��:�:�:�A�!�+�+�-�-�:�:�:rZc ��g|]I}|�tjtj|j��|jdz ������JSr�)� transposerT�roll�aranger�r�s rXrrz.AppendableTable.write_data.<locals>.<listcomp>vsB��V�V�V�!�!�+�+�b�g�b�i���&7�&7���!��D�D�E�E�V�V�VrZrr�c�$��g|] }|����� Sr�r�)ror��end_i�start_is ��rXrrz.AppendableTable.write_data.<locals>.<listcomp>�s"���;�;�;�a��7�5�=�)�;�;�;rZc�$��g|] }|����� Sr�r�)ror�r�r�s ��rXrrz.AppendableTable.write_data.<locals>.<listcomp>�s"���:�:�:�Q��'�%�-�(�:�:�:rZ)�indexesr r�)rYr�rr�r4r�r�rSrTrXr�rrurr�r�r��reshaper�rr��write_data_chunk)r�r�r�r�rE�masksr�r r�r��nindexesr��bvaluesr�r�� new_shape�rows�chunksr�r�s @@rXr�zAppendableTable.write_dataTs������ � ���#���� � @��%� @� @���A�F�|�|�'�'�Q�'�/�/���d�B�J�/�/�@��L�L����T���!>�!>�?�?�?�� �u�:�:� ���8�D��1�2�2�Y� � ���a�x����:�:�<�<�D�D��D�7�6�d�o�6�6�6���w�<�<���1�}�}�}�h�}�}�}�;�:��)9�:�:�:��V�V�v�V�V�V�����f�%�%� 1� 1�D�A�q���4�:�e�H�q�L�.A�#B�#H�H�I� �N�N�1�9�9�Y�/�/� 0� 0� 0� 0� � ��I��x��I�u�-�-�T�Z�@�@�@���)�#�a�'���v��� � �A��)�m�G���Q��)�+�U�3�3�E��%������ � !� !��;�;�;�;�;�7�;�;�;�,0�,<�T�'�%�-�(�(�$�:�:�:�:�:�'�:�:�:� "� � � � � � rZr�rOr��list[np.ndarray]r �npt.NDArray[np.bool_] | Noner�c��|D]}tj|j��sdS�|djd}|t|��krtj||j���}|jj}t|��}t|��D]\} } | ||| <�t|��D]\} }|||| |z<�|�K|���� td���} | � ��s|| }t|��r5|j � |��|j ���dSdS)z� Parameters ---------- rows : an empty memory space where we are putting the chunk indexes : an array of the indexes mask : an array of the masks values : an array of the values Nrr�Fr�)rTr�r�rur�rYr�r�rrr�r�r|r�r5) r�r�r�r r�r�rEr�r�r�r�r�s rXr�z AppendableTable.write_data_chunk�sm�� � � �A��7�1�7�#�#� ���� ��� � ��#�� �C��I�I� � ��8�E���4�4�4�D�� � ���w�<�<�� ��(�(� !� !�F�A�s� �D��q��N�N��f�%�%� *� *�D�A�q�()�D��q�8�|�$� %� %� � ������$�$�T��$�6�6�6�A��5�5�7�7� ��A�w�� �t�9�9� � �J� � �d� #� #� #� �J� � � � � � � � � rZr�r�c�B�|�t|��sm|�+|�)|j}|j�|jd���n>|�|j}|j�||���}|j���|S|���sdS|j}t||||���}|� ��}t|d���� ��}t|��} | �r'|� ��} t| | dkj��} t| ��sdg} | d| kr| �| ��| ddkr| �dd��| ���} t'| ��D]c} |�t+| | ����}|�||jd||jddz���| } �d|j���| S) NTrxr�Fr�rkrr�)rurEr�rr�r|� remove_rowsr5rGrUr�r1� sort_values�diffrsr�r�r�rn�reversedr�r�)r�rvr�r�rEr|rVr�� sorted_series�lnr�r��pgr)r�s rXrzAppendableTable.delete�s(�� �=��E� � �=��}���� ��� �(�(���t�(�D�D�D�D��<��:�D�� �.�.�U��.�F�F��� � � �"�"�"��L���� � � ��4�� ���d�E��T�B�B�B� ��(�(�*�*���v�E�2�2�2�>�>�@�@� � �� � �� � � �%�%�'�'�D��$�t�a�x�.�.�/�/�F��v�;�;� �����b�z�R���� � �b�!�!�!��a�y�A�~�~�� � �a��#�#�#������B��f�%�%� � ��$�)�)�%��2�,�,�7�7���!�!��t�z�!�}�-�D���B��4H�1�4L�"������� �J� � � � � �� rZ) NFNNNNNNFNNT) r�r�r�r�r�r�rrr�r]r�r)r�r�r�r�r]r�) r�rOr�r�r r�r�r�r]r�rr\) r�rrrr�r�r�r�rr�rZrXr{r{s�������2�2��J� ������ $����� �93�93�93�93�93�v9�9�9�9�9�v*�*�*�*�X8�8�8�8�8�8�8rZr{c�p�eZdZUdZdZdZdZeZde d<e dd ���Z e dd ���Z ddd�Zd S)r�r�r�r�r&r!r"r]r�c�.�|jdjdkS)Nrrk)r�rcr�s rXrz"AppendableFrameTable.is_transposed�s����q�!�&�!�+�+rZrc��|r|j}|S)zthese are written transposed)r�rZs rXr[zAppendableFrameTable.get_objects�� � ��%�C�� rZNr�r�r�c ������|������sdS��|||���}t�j��r,�j��jddi��ni}�fd�t�j��D��}t|��dksJ�|d}||d} g} t�j��D�]4\} } | �j vr�|| \} }|�d��dkrt| ��}ntj | ��}|�d��}|�|� |d� ���jr%|}|}t| t| d d��� ��}n)|j}t| t| d d��� ��}|}|jdkr<t%|t&j��r"|�d|jdf��}t%|t&j��rt/|j||d � ��}n@t%|t��rt/|||���}nt/j|g||���}t3��r|jjdks8|j|jk���sJ|j|jf���t3��r&t=|d���r|�d��}| � |����6t| ��dkr | d}ntC| d���}tE�|||���}��#|||���}|S)NrLrc�8��g|]\}}|�jdu�|��Sr]r*)ror�r�r�s �rXrrz-AppendableFrameTable.read.<locals>.<listcomp>s.���P�P�P�e�a��r�T�_�Q�=O�7O�7O��7O�7O�7OrZrkr�r.r�T��inplacerfreFr�r�rr�r�r�)rVr�)$rSrGrXrur^r�r�r�r�r�r-r.� from_tuples� set_namesrr�r�r�rSrTrXr�r�r+� _from_arraysrrYr��dtypesr�rrr�r3rUr�)r�rvr�r�r�rrr��inds�indr��framesr�r�� index_valsrqr�r�r��index_�cols_r�rVs` rXr?zAppendableFrameTable.read s���� ���e�$�$�$���� � � ��4����u�E���E�E���4�&�'�'� �D�I�M�M�$�-�a�0��3�R� 8� 8� 8�� � Q�P�P�P�y���3�3�P�P�P���4�y�y�A�~�~�~�~��1�g���s� �A������d�i�(�(�+ �+ �D�A�q���(�(�(��"(��)� �J���x�x����<�/�/��Z�(�(���!�-�j�9�9���H�H�W�%�%�E�� ����u�d��3�3�3��!� � �����e�'�%���*F�*F�G�G�G��� ����u�7�5�&�$�+G�+G�H�H�H�����{�a���J�v�r�z�$B�$B������F�L��O�(<�=�=���&�"�*�-�-� S��v�x��f�5�Q�Q�Q����F�E�*�*� S��v�u�F�C�C�C����+�V�H�e�6�R�R�R��.�0�0� T�V�\�5F�#�5M�5M�� �V�\�1�6�6�8�8�S�S�2�9�f�l�:S�S�S�8�)�+�+� 8����1�1�1� 8��Y�Y�6�7�7�� �M�M�"� � � � � �v�;�;�!� � ����B�B���Q�'�'�'�B��d�%�u�4�H�H�H� � � � �r�Y�� � H� H��� rZrr�r[r\)r�rrrrr�r�r+r"rrrrr[r?r�rZrXr�r��s��������2�2��K�#�J� �D�)2�H�2�2�2�2� �,�,�,��X�,������[���� �� R�R�R�R�R�R�RrZr�c�|��eZdZdZdZdZdZeZe dd���Z e dd ���Z dd�fd � Z dd�fd� Z�xZS)r�r�r�r�r&r]r�c��dSr�r�r�s rXrz#AppendableSeriesTable.is_transposedfr�rZrc��|Sr`r�rZs rXr[z AppendableSeriesTable.get_objectjs��� rZNr�c ����t|t��s|jpd}|�|��}t ��jd||j���d�|��dS)�+we are going to write this as a frame tabler��r�r�Nr�)rSr+rf�to_framer�r�r�r�)r�r�r�r�rfr�s �rXr�zAppendableSeriesTable.writeosi����#�y�)�)� %��8�'�x�D��,�,�t�$�$�C����� �K�#�C�K�,>�,>�,@�,@�K�K�F�K�K�K�K�KrZr�r�r�r1c�j��|j}|�B|r@t|jt��sJ�|jD]}||vr|�d|���t ���||||���}|r|�|jd���|jdd�df}|j dkrd|_ |S)NrrbTr�r�) r�rSr�rsr�r�r?� set_indexr�rf) r�rvr�r�r�r�rrWr�s �rXr?zAppendableSeriesTable.readvs�����,�� � �>� ��d�k�4�0�0� 0� 0�0��[� )� )���G�#�#��N�N�1�a�(�(�(�� �G�G�L�L�u�g�U��L� N� N�� � 3� �K�K�� �T�K� 2� 2� 2� �F�1�1�1�a�4�L�� �6�X� � ��A�F��rZrr�r`r r[r�)r�rrrrr�r�r1r"rrrr[r�r?rrs@rXr�r�^s��������2�2� �K�$�J� �D��H� �����X�������[��L�L�L�L�L�L�L��� �� ����������rZr�c�,��eZdZdZdZdZd�fd� Z�xZS)r�r�r�r�r]r�c �<��|jpd}|�|��\}|_t|jt��sJ�t |j��}|�|��t |��|_t��j dd|i|��dS)r�r�r�Nr�) rfrr�rSrsr�r-r�r�r�)r�r�r�rf�newobjr�r�s �rXr�z AppendableMultiSeriesTable.write�s�����x�#�8��"�6�6�s�;�;���� ��$�+�t�,�,�,�,�,��D�K� � �� � � �D�����t��������� �+�+�&�+�F�+�+�+�+�+rZr )r�rrrrr�r�rrs@rXr�r��sM�������2�2� �K�)�J�,�,�,�,�,�,�,�,�,�,rZr�c��eZdZUdZdZdZdZeZde d<e dd ���Z e d ���Z dd �Z ed ���Zdd�ZdS)r�z:a table that read/writes the generic pytables table formatr�r�r&zlist[Hashable]r�r]r^c��|jSr`)rr�s rXr�zGenericTable.pandas_type�s ����rZc�<�t|jdd��p|jSr r r�s rXrLzGenericTable.storable�s���t�z�7�D�1�1�?�T�Z�?rZr�c��g|_d|_g|_d�|jD��|_d�|jD��|_d�|jD��|_dS)r|Nc� �g|] }|j� |�� Sr�r6r�s rXrrz*GenericTable.get_attrs.<locals>.<listcomp>�r7rZc� �g|] }|j� |�� Sr�r6r�s rXrrz*GenericTable.get_attrs.<locals>.<listcomp>�r9rZc��g|] }|j�� Sr�rer�s rXrrz*GenericTable.get_attrs.<locals>.<listcomp>�s��>�>�>��Q�V�>�>�>rZ)r^r�r�r:r�r�r�r�s rXrIzGenericTable.get_attrs�sf�� ����� ��� �K�K�d�o�K�K�K���P�P�t��P�P�P���>�>�T�-=�>�>�>����rZc ��|j}|�d��}|�dnd}tdd|j||���}|g}t |j��D]x\}}t |t��sJ�t||��}|�|��}|�dnd}t|||g||j||���} |� | ���y|S)z0create the indexables from the table descriptionr�Nr�r)rfrcr|r�r,)rfr+r�r*r|r�r,) rkr�r�r|r��_v_namesrSr^r�rr�) r�r�rEr�rKrJr�rr�r�s rXr:zGenericTable.indexables�s�� � �� � � �� (� (���^�z�z���#��q�� ��� � � � �IR�{� ��a�j�)�)� #� #�D�A�q��a��%�%� %� %�%��1�a�=�=�D��#�#�A�&�&�B�!#��:�:�T�D�(����s���j������B� � � �r� "� "� "� "��rZc � �td���)Nz cannot write on an generic tablerV)r�r�s rXr�zGenericTable.write�s��!�"D�E�E�ErZNr r )r�rrrrr�r�r+r"rrr�rLrIrr:r�r�rZrXr�r��s��������D�D��K� �J� �D��H����� � � � ��X� ��@�@��X�@�?�?�?�?�� � ��^� �FF�F�F�F�F�FrZr�c���eZdZdZdZeZdZej d��Z e dd���Z dd�fd � Z dd�fd� Z�xZS)r�za frame with a multi-indexr�r&z ^level_\d+$r]r^c��dS)N�appendable_multir�r�s rXr�z*AppendableMultiFrameTable.table_type_short�s��!�!rZNr�c �>��|�g}n|dur|j���}|�|��\}|_t |jt ��sJ�|jD]}||vr|�d|���t��jd||d�|��dS)NTrr�r�) r�r�rr�rSrsr�r�r�)r�r�r�r�rr�s �rXr�zAppendableMultiFrameTable.write�s���� � ��L�L� �T� !� !��;�-�-�/�/�L��3�3�C�8�8���T�[��$�+�t�,�,�,�,�,��� *� *�A�� �$�$��#�#�A�q�)�)�)������ �C�#�L�C�C�F�C�C�C�C�CrZr�r�r�c�����t���||||���}|��j��}|j��fd�|jjD����|_|S)Nrbc�L��g|] }�j�|��rdn|��!Sr`)� _re_levels�search)rorfr�s �rXrrz2AppendableMultiFrameTable.read.<locals>.<listcomp> s2��� W� W� W��T�_�+�+�D�1�1� ;�T�T�t� W� W� WrZ)r�r?r�r�r�r�r�)r�rvr�r�r�r�r�s` �rXr?zAppendableMultiFrameTable.read�ss�����W�W�\�\��w�e�$�\� O� O�� �\�\�$�+� &� &���8�%�%� W� W� W� W���� W� W� W� � ���� rZr r`r r[r\)r�rrrr�r+r"r��re�compilerrr�r�r?rrs@rXr�r��s��������$�$�(�J��H� �D����N�+�+�J� �"�"�"��X�"� D� D� D� D� D� D� D��� �� ����������rZr�r�r+rcrJr�r-c��|�|��}t|��}|�t|��}|�|�|��r|�|��r|St|�����}|�6t|������|d���}|�|��s8t dd��g|jz}|||<|jt|��}|S)NF)�sort) r�r;�equals�uniquer��slicer�r�rt)r�rcr�r@r��slicers rXrmrms��� ���t� � �B� �&� !� !�F� ���U�#�#�� � ����u�-�-� �6�=�=��3D�3D� �� � �&�-�-�/�/� *� *�F� ���e�l�l�n�n�-�-�:�:�6��:�N�N�� �=�=�� � �%�',�T�4�'8�'8�&9�C�H�&D����t� ��g�e�F�m�m�$�� �JrZr&r� str | tzinfoc�.�tj|��}|S)z+for a tz-aware type, return an encoded zone)r� get_timezone)r&�zones rXr�r�)s�� � !�"� %� %�D� �KrZr��np.ndarray | Indexr�r,c��dSr`r��r�r&r�s rXr]r]/s ���CrZrOc��dSr`r�rs rXr]r]6s���CrZ�str | tzinfo | None�np.ndarray | DatetimeIndexc��t|t��r|j� |j|ksJ�|j�|S|�|t|t��r|j}nd}|���}t |��}t||���}|�d���|��}n|rtj |d���}|S)a coerce the values to a DatetimeIndex if tz is set preserve the input shape if possible Parameters ---------- values : ndarray or Index tz : str or tzinfo coerce : if we do not have a passed timezone, coerce to M8[ns] ndarray Nrerm�M8[ns]r�) rSr,r&rfrrYrorprTr)r�r&r�rfs rXr]r];s����&�-�(�(���y� �F�I��O�O�O�3� �9� ��M� �~� �f�m� ,� ,� $��;�D�D��D��\�\�^�^�F� �R� � ���v�D�1�1�1���#�#�E�*�*�5�5�b�9�9��� �4���F�(�3�3�3�� �MrZrfc ��t|t��sJ�|j}t|��\}}t |��}t �|��}tj|j d��s(t|j ��st|j ��r4t||||t|dd��t|dd��|���St|t��rtd���tj|d���} t#j|��} | dkr\t#jd �| D��t"j� ��}t||dt)�����|� ��S| d krPt-| ||��}|j j} t||d t)���| ��|� ��S| d vrt|||||���St|t"j��r|j t4ksJ�|dks J|���t)�����}t|||||� ��S)N�iur%r&)r�r�r*r%r&r'zMultiIndex not supported here!Fr�rc�6�g|]}|�����Sr�)� toordinalr�s rXrrz"_convert_index.<locals>.<listcomp>�s ��>�>�>�!�� � � � �>�>�>rZr�)r'rt)�integer�floating)r�r�r*r'rA)rSr^rfr�r�rr�rr\rYr%r!r"r�r.r�r�rTr�int32r�� Time32Col�_convert_string_arrayr/rurXrAr�) rfr�r[r�r'r r�r�r�r�r�r/s rXr�r�bs~�� �d�C� � � � � ���J�5�U�;�;��I�z� �*� %� %�D� � %� %�i� 0� 0�D� ��� �T�*�*� � �u�{� +� +� � ��� %� %� �� ��������-�-��u�d�D�)�)�!� � � � ��%��$�$�:��8�9�9�9��O�E�%�8�8�8�M��Z�� � �F������J�>�>�v�>�>�>�b�h�O�O�O� �� �)�V�W�Y�Y�%8�%8�%:�%:�z� � � � � �(� "� "�)�&�(�F�C�C� ��?�+��� � � � �I�I� � �� )� )�!�  � � � � �1� 1� 1�� ���4�J� � � � ��)�R�Z�0�0�N�Y�_��5N�5N�5N�N��x���������y�y�#�#�%�%����i��t� �K�K�K�KrZr�c�Z�|�d��r9|dkrt|��}n�t|�|����}n�|dkrt|��}n�|dkr\ t jd�|D��t ���}n�#t$r(t jd�|D��t ���}YnhwxYw|dvrt j|��}nK|dvrt|d||� ��}n3|d krt j|d ��}ntd |�����|S) Nr�r�rc�6�g|]}tj|����Sr�r�r�s rXrrz$_unconvert_index.<locals>.<listcomp>�s#��B�B�B��� 0�� 3� 3�B�B�BrZr�c�6�g|]}tj|����Sr�r�r�s rXrrz$_unconvert_index.<locals>.<listcomp>�s#��D�D�D�!�� 2�1� 5� 5�D�D�DrZ)r �floatr�rtrrArzunrecognized index type ) r�r,r�r2rTrrAr�r )r�r�r[r�r�s rXr�r��sd�� ���|�$�$�<� �<� � �!�$�'�'�E�E�!�$�)�)�D�/�/�2�2�E�E� �� � ��t�$�$��� ���� T��J�B�B�T�B�B�B�&�Q�Q�Q�E�E��� T� T� T��J�D�D�t�D�D�D�F�S�S�S�E�E�E� T���� �-� -� -�� �4� � ��� �(� � �'� �$��&� � � ��� �� � �� �4��7�#�#����:�D�:�:�;�;�;� �Ls�,%B�/C�Cr�rIrc��|jtkr|Sttj|��}|jj}t j|d���} | dkrtd���| dkrtd���| dks|dks|St|��} |� ��} || | <t j| d���} | dkrwt| j d ��D]\} | | } t j| d���} | dkr6t|��| kr|| nd | ��}td |�d | �d �����]t| ||���| j ��}|j}t#|t$��r9t'|�|��p|�d��pd ��}t+|pd |��}|�|�|��}|�||kr|}|�d|��d���}|S)NFr�rz+[date] is not implemented as a table columnr_z>too many timezones in this block, create separate data columnsrtrArzNo.zCannot serialize the column [z2] because its data contents are not [string] but [z] object dtyper�z|Sr�)rYrAr rTrXrfrr�r�r4r�r�r�rur$r�r/rSr�rir�r�r}r)rfr�rir�r�r[r�r�r�r�r r�r�rn�error_column_labelr~r/�ecis rXrprp�s^���}�������2�:�w�'�'�G���#�J��O�G�E�:�:�:�M������E�F�F�F�� �"�"�� L� � � � �X� %� %��x�)?�)?��� ��=�=�D� �<�<�>�>�D��D��J��O�D��7�7�7�M��� � � �t�z�!�}�%�%� � �A��q�'�C��O�C��>�>�>�M���(�(�36�w�<�<�!�3C�3C�W�Q�Z�Z��q���"��6�4F�6�6�%�6�6�6����)�+�4��6�B�B�J�J�4�:�V�V�N��&�H��,��%�%�V��<�+�+�D�1�1�T�\�5E�5E�h�5O�5O�T�ST�U�U� ��<�$�1�h�/�/�H����'�'��1�1�� �?�s�X�~�~��H�#�*�*�?��?�?��*�G�G�N� �rZr�c��t|��rYt|���d���j�||��j�|j��}t|�����}tdtj |����}tj |d|�����}|S)a Take a string-like that is object dtype and coerce to a fixed size string type. Parameters ---------- data : np.ndarray[object] encoding : str errors : str Handler for encoding errors. Returns ------- np.ndarray[fixed-length-string] Fr�rk�Sr�)rur1rr^�encoderr�r�r r�� libwriters�max_len_string_arrayrTr)r�r[r��ensuredr/s rXr$r$s���  �4�y�y� � �4�:�:�<�<�e� ,� ,� ,� ����&�)�)� �W�W�T�Z�(�(� ��D�J�J�L�L�)�)�G��1�j�5�g�>�>�?�?�H� �:�d�.�h�.�.� 1� 1� 1�D� �KrZc�*�|j}tj|���t���}t |��r�t jt|����}d|��}t|dt��r1t|d���j � ||���j}n1|�|d����td���}|�d}t j||��|�|��S) a* Inverse of _convert_string_array. Parameters ---------- data : np.ndarray[fixed-length-string] nan_rep : the storage repr of NaN encoding : str errors : str Handler for encoding errors. Returns ------- np.ndarray[object] Decoded data. r��UrFr�)r�Nrf)r�rTrrrArur/r0r rSrur1r^rVrr�!string_array_replace_from_nan_repr�)r�r�r[r�r�r/rYs rXr r 's���& �J�E� �:�d�j�j�l�l�&� 1� 1� 1�D� �4�y�y�M��2�=��3F�3F�G�G���H���� �d�1�g�u� %� %� M��$�U�+�+�+�/�6�6�x��6�O�O�W�D�D��;�;�u�5�;�1�1�8�8��e�8�L�L�D������0��w�?�?�?� �<�<�� � �rZr^c��t|t��sJt|�����t|��rt |||��}||��}|Sr`)rSr^r�� _need_convert�_get_converter)r�r^r[r��convs rXr[r[MsY�� �h�� $� $�4�4�d�8�n�n�4�4� $��X�����h��&�9�9����f���� �MrZc�h�����dkrd�Sd�vr�fd�S�dkr��fd�Std������)Nr�c�.�tj|d���S)Nrr��rTr)r[s rXr�z _get_converter.<locals>.<lambda>Ws����A�X�6�6�6�rZc�0��tj|����S)Nr�r;)r[r�s �rXr�z _get_converter.<locals>.<lambda>Ys�����A�T�2�2�2�rZrtc�*��t|d�����S)Nr)r )r[r[r�s ��rXr�z _get_converter.<locals>.<lambda>[s ���0� �t�h�v� � � �rZz invalid kind )r�)r�r[r�s```rXr7r7Usu����� �|���6�6�6� �� � �2�2�2�2�2� �� � � � � � � � ��/��/�/�0�0�0rZc��|dvsd|vrdSdS)N)r�rtr�TFr�r�s rXr6r6bs"�� �'�'�'�<�4�+?�+?��t� �5rZr'� Sequence[int]c�(�t|t��st|��dkrtd���|ddkrN|ddkrB|ddkr6t jd|��}|r|���d}d|��}|S) z� Prior to 0.10.1, we named values blocks like: values_block_0 an the name values_0, adjust the given name if necessary. Parameters ---------- name : str version : Tuple[int, int, int] Returns ------- str �z6Version is incorrect, expected sequence of 3 integers.rrkr%r&zvalues_block_(\d+)�values_)rSr^rur�rrr�)rfr'r��grps rXrBrBhs����'�3���S�3�w�<�<�!�#3�#3��Q�R�R�R��q�z�Q���7�1�:��+�+��� �a��� �I�+�T� 2� 2�� � #��(�(�*�*�Q�-�C�"�S�?�?�D� �KrZ� dtype_strc� �t|��}|�d��rd}n�|�d��rd}n�|�d��rd}n�|�d��rd}n�|�d��r|}n||�d��rd }nd|�d ��rd }nL|�d ��rd }n4|�d ��rd}n|d krd }ntd|�d����|S)zA Find the "kind" string describing the given dtype name. )rtrurtr(rN)rir�r r�� timedeltar�r�r�r�rAzcannot interpret dtype of [rX)rYr�r�)rDr�s rXr�r��sQ�� � �*�*�I����/�0�0�E���� � � �g� &� &�E���� � � �i� (� (�E���� � � �o� .� .�E���� � � �l� +� +�E���� � � �k� *� *� E���� � � �f� %� %� E���� � � �j� )� )�E���� � � �h� '� '�E���� �h� � �����C�y�C�C�C�D�D�D� �KrZc�|�t|t��r|j}t|jt��rd|jj�d�}n |jj}|jjdvr(tj |� d����}nt|t��r|j }tj |��}||fS)zJ Convert the passed data into a storable form and a dtype string. r�rX�mMrS) rSr5r�rYr'r�rfr�rTrr�r/r�)r�r�s rXr�r��s����$� �$�$���z���$�*�o�.�.�%�5�4�:�?�5�5�5� � ��Z�_� � �z��$����z�$�)�)�D�/�/�*�*��� �D�+� &� &���y�� �:�d� � �D� �� �rZc�4�eZdZdZ ddd �Zd �Zd �Zd �ZdS)rUz� Carries out a selection operation on a tables.Table object. Parameters ---------- table : a Table object where : list of Terms (or convertible to) start, stop: indices to start and/or stop selection Nr|rr�r�r�r]r�c��||_||_||_||_d|_d|_d|_d|_t|���r2tt��5tj |d���}|dvr�tj|��}|jtjkrA|j|j}}|�d}|� |jj}tj||��||_n�t'|jjtj��r^|j�||jk���s$|j�,||jk���rtd���||_ddd��n #1swxYwY|j�I|�|��|_|j�*|j���\|_|_dSdSdS)NFr�)r �booleanrz3where must have index locations >= start and < stop)r|rvr�r�� conditionr��termsrhr#rr�rr�rTrrY�bool_rEr�� issubclassr�r r�generate�evaluate)r�r|rvr�r��inferreds rXr�zSelection.__init__�s���� ��� ��� ��� ������ ��� ���� �� � � 1��*�%�%� 1� 1��?�5��?�?�?���5�5�5��J�u�-�-�E��{�b�h�.�.�&*�j�$�)�t�� �=�$%�E��<�#'�:�#3�D�+-�9�U�D�+A�+A�%�+H��(�(�#�E�K�$4�b�j�A�A�1� �J�2��� �8J�7O�7O�7Q�7Q�2� �I�1�u�� �7I�6N�6N�6P�6P�1�",� U�#�#��,1��(�% 1� 1� 1� 1� 1� 1� 1� 1� 1� 1� 1���� 1� 1� 1� 1�( � � #����u�-�-�D�J��z�%�.2�j�.A�.A�.C�.C�+���� � � � $� #�&�%s�DE0�0E4�7E4c�4�|�dS|j���} t|||jj���S#t$rR}d�|�����}td|�d|�d���}t|��|�d}~wwxYw)z'where can be a : dict,list,tuple,stringN)r'r[r7z- The passed where expression: a* contains an invalid variable reference all of the variable references must be a reference to an axis (e.g. 'index' or 'columns'), or a data_column The currently defined references are: z ) r|r'r8r[� NameErrorr=r"rr�)r�rvr>r��qkeysr/s rXrPzSelection.generate�s��� �=��4� �J� !� !� #� #�� +���!�d�j�>Q�R�R�R� R��� +� +� +��H�H�Q�V�V�X�X�&�&�E���.3��� DI� �����C��S�/�/�s� *����� +���s�;� B�A B�Bc�B�|j�C|jj�|j���|j|j���S|j�$|jj�|j��S|jj�|j|j���S)�( generate the selection Nr�) rLr|� read_wherer�r�r�rhrNr?r�s rXr�zSelection.select s��� �>� %��:�#�.�.���%�%�'�'�t�z�� �/��� �� � )��:�#�4�4�T�5E�F�F� F��z��$�$�4�:�D�I�$�F�F�FrZc�>�|j|j}}|jj}|�d}n |dkr||z }|�|}n |dkr||z }|j�:|jj�|j���||d���S|j�|jStj ||��S)rWNrT)r�r�r ) r�r�r|rErL�get_where_listr�rhrTr�)r�r�r�rEs rXr�zSelection.select_coordss����j�$�)�t��� � �� �=��E�E� �Q�Y�Y� �U�N�E� �<��D�D� �A�X�X� �E�M�D� �>� %��:�#�2�2���%�%�'�'�u�4�d�3��� �� � )��#� #��y���%�%�%rZr)r|rr�r�r�r�r]r�)r�rrrr�rPr�r�r�rZrXrUrU�sx������ � �� �� +D�+D�+D�+D�+D�Z+�+�+�. G� G� G�&�&�&�&�&rZrU)r[r\r]r^)rhri) r�NNFNTNNNNr�rQ)r�r�r�r^r�r�r�r^r�r�r�r\r�r�r�r\r�r�r�r�r�r�r�r�r�r^r[r^r]r�) Nr�r�NNNNFN)r�r�r�r^r�r^rvr�r�r�r�r�r�r�r�r�r�r�)r�rGr�rGr]r�r`)r�r+rcrJr�r-r]r+)r&rr]rr)r�rr&rr�r�r]r,)r�rr&r�r�r�r]rO)r�rr&rr�r�r]r) rfr^r�r-r[r^r�r^r]r")r�r^r[r^r�r^r]r)rfr^r�rIr�r)r�rOr[r^r�r^r]rO)r�rOr^r^r[r^r�r^)r�r^r[r^r�r^)r�r^r]r�)rfr^r'r?r]r^)rDr^r]r^)r�rI)�r� __future__r� contextlibrr�r_rrrir�r�textwrapr�typingrr r r r r rr��numpyrT�pandas._configrrrr� pandas._libsrrr/�pandas._libs.libr�pandas._libs.tslibsr�pandas.compat._optionalr�pandas.compat.pickle_compatr� pandas.errorsrrrrr�pandas.util._decoratorsr�pandas.util._exceptionsr�pandas.core.dtypes.commonr r!r"r#r$r%�pandas.core.dtypes.dtypesr&r'r(r)�pandas.core.dtypes.missingr*rr+r,r-r.r/r0r1r2r3r4�pandas.core.arraysr5r6r7�pandas.core.common�core�commonr}� pandas.core.computation.pytablesr8r9�pandas.core.constructionr:�pandas.core.indexes.apir;�pandas.core.internalsr<r=�pandas.io.commonr>�pandas.io.formats.printingr?r@�collections.abcrArBrC�typesrDr�rErFrG�pandas._typingrHrIrJrKrLrMrNrOrPr9rarYrcrgrnrwrxrryrzr�r�rr�� config_prefix�register_option�is_bool�is_one_of_factoryr�r�r�r�r�r�r�rHr"r�r�rrrr^r�r�r�rr�r{r�r�r�r�r�rmr�r]r�r�rpr$r r[r7r6rBr�r�rUr�rZrX�<module>r}sA �����#�"�"�"�"�"������� � � � ������������� � � � � � � � �����������������������������������������������������-�,�,�,�,�,�)�)�)�)�)�)�>�>�>�>�>�>�4�4�4�4�4�4���������������3�2�2�2�2�2�4�4�4�4�4�4����������������������������� 8�7�7�7�7�7� � � � � � � � � � � � � � � � � � � � � � � � ����������� !� � � � � � � � ���������3�2�2�2�2�2�0�0�0�0�0�0��������� ,�+�+�+�+�+��������� �,����������� $�#�#�#�#�#����������� � � � � � � � � � � � � � � � � � � � �,�+�+�+�+�+� ���� � � ����� � � ���:�:�:�:�*������ !������ ������ �g�G�g�N�N� ���� � �� ������ ����� �V��(�#�#����F��>�5�*���W�W�W�W��F��� ��*�&�*�+C�+C�+C�D�D� ����������������������� �$)�!����4� �����04� ��59���5�5�5�5�5�t ���#��� $�� �X�X�X�X�X�v � � � �Z�Z�Z�Z�Z�Z�Z�Z�z,m�m�m�m�m�m�m�m�`e>�e>�e>�e>�e>�e>�e>�e>�P  � � � � �h� � � �:Y9�Y9�Y9�Y9�Y9�h�Y9�Y9�Y9�x$�$�$�$�$�w�$�$�$�63�3�3�3�3�.�3�3�3�i?�i?�i?�i?�i?�i?�i?�i?�XbB�bB�bB�bB�bB�5�bB�bB�bB�J #� #� #� #� #�,� #� #� #�F`;�`;�`;�`;�`;� �`;�`;�`;�F�����"���� dD�dD�dD�dD�dD�E�dD�dD�dD�NH�H�H�H�H��H�H�H�<`�`�`�`�`�e�`�`�`�Fe�e�e�e�e�?�e�e�e�P.�.�.�.�.�0�.�.�.�b,�,�,�,�,�!6�,�,�,�$@F�@F�@F�@F�@F�'�@F�@F�@F�F(�(�(�(�(� 4�(�(�(�X9=������4����  �AF����� ���  ����� ��� IN�$�$�$�$�$�N=L�=L�=L�=L�@����:F�F�F�F�R����>#�#�#�#�L���� 1� 1� 1� 1����� ����2����B����2r&�r&�r&�r&�r&�r&�r&�r&�r&�r&s�>G�G�G
Memory