| Server IP : 209.209.40.120 / Your IP : 216.73.217.112 Web Server : Microsoft-IIS/10.0 System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586 User : NEWWWW$ ( 0) PHP Version : 8.3.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/Python312/Lib/site-packages/pandas/core/arrays/sparse/__pycache__/ |
Upload File : |
�
- �g�0 � �� � d Z ddlmZ ddlmZ ddlZddlmZ ddl m
Z
ddlmZ ddl
mZmZ dd lmZ erdd
lmZmZ G d� d� Z eeg d
�d�� G d� dee� � Z G d� dee� Zy)zSparse accessor� )�annotations)�
TYPE_CHECKINGN)�import_optional_dependency)�find_common_type)�SparseDtype)�PandasDelegate�delegate_names)�SparseArray)� DataFrame�Seriesc � � e Zd ZdZddd�Zd� Zy)�BaseAccessorz5Can only use the '.sparse' accessor with Sparse data.Nc �4 � || _ | j |� y �N)�_parent� _validate��self�datas �DC:\Python312\Lib\site-packages\pandas/core/arrays/sparse/accessor.py�__init__zBaseAccessor.__init__ s � �������t�� c � � t �r )�NotImplementedErrorr s r r zBaseAccessor._validate! s � �!�!r r )�return�None)�__name__�
__module__�__qualname__�_validation_msgr r � r r r r s � �M�O��"r r )�npoints�density�
fill_value� sp_values�property)�typc �L � e Zd ZdZd� Zd d�Zd d�Zed
dd�� Zdd
d�Z dd�Z
y)�SparseAccessorz�
Accessor for SparseSparse from other sparse matrix data types.
Examples
--------
>>> ser = pd.Series([0, 0, 2, 2, 2], dtype="Sparse[int]")
>>> ser.sparse.density
0.6
>>> ser.sparse.sp_values
array([2, 2, 2])
c �b � t |j t � st | j � �y r )�
isinstance�dtyper �AttributeErrorr r s r r zSparseAccessor._validate5 s&