o
    Û­j†  ã                   @  s    d dl mZ d dlmZ d dlmZ d dlmZ d dlm	Z	 d dl
mZ d dlmZ erDd dlmZ d d	lmZ d d
lmZ d dlmZ ddejfddd„ZdS )é    )Úannotations)ÚTYPE_CHECKING)Úlib)Úimport_optional_dependency)Úcheck_dtype_backend)Úis_list_like)Ústringify_path)ÚSequence)ÚPath)ÚDtypeBackend)Ú	DataFrameNTÚpathú
str | PathÚusecolsúSequence[str] | NoneÚconvert_categoricalsÚboolÚdtype_backendúDtypeBackend | lib.NoDefaultÚreturnr   c                 C  sj   t dƒ}t|ƒ |durt|ƒstdƒ‚t|ƒ}|jt| ƒ||d�\}}|j|_|t	j
ur3|j|d�}|S )a‘  
    Load an SPSS file from the file path, returning a DataFrame.

    Parameters
    ----------
    path : str or Path
        File path.
    usecols : list-like, optional
        Return a subset of the columns. If None, return all columns.
    convert_categoricals : bool, default is True
        Convert categorical columns into pd.Categorical.
    dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable'
        Back-end data type applied to the resultant :class:`DataFrame`
        (still experimental). Behaviour is as follows:

        * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
          (default).
        * ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
          DataFrame.

        .. versionadded:: 2.0

    Returns
    -------
    DataFrame

    Examples
    --------
    >>> df = pd.read_spss("spss_data.sav")  # doctest: +SKIP
    Ú
pyreadstatNzusecols must be list-like.)r   Úapply_value_formats)r   )r   r   r   Ú	TypeErrorÚlistÚread_savr   Ú__dict__Úattrsr   Ú
no_defaultÚconvert_dtypes)r   r   r   r   r   ÚdfÚmetadata© r!   úK/var/www/html/CropPilot/venv/lib/python3.10/site-packages/pandas/io/spss.pyÚ	read_spss   s   $

ÿ
r#   )
r   r   r   r   r   r   r   r   r   r   )Ú
__future__r   Útypingr   Úpandas._libsr   Úpandas.compat._optionalr   Úpandas.util._validatorsr   Úpandas.core.dtypes.inferencer   Úpandas.io.commonr   Úcollections.abcr	   Úpathlibr
   Úpandas._typingr   Úpandasr   r   r#   r!   r!   r!   r"   Ú<module>   s     ü