id int64 0 328k | repository_name stringlengths 7 58 | file_path stringlengths 9 302 | class_name stringlengths 5 256 | human_written_code stringlengths 16 2.16M | class_skeleton stringlengths 18 1.49M ⌀ | total_program_units int64 1 1.76k | total_doc_str int64 0 771 | AvgCountLine float64 0 7.89k | AvgCountLineBlank float64 0 297 | AvgCountLineCode float64 0 7.89k | AvgCountLineComment float64 0 7.89k | AvgCyclomatic float64 0 130 | CommentToCodeRatio float64 0 168 | CountClassBase float64 0 40 | CountClassCoupled float64 0 583 | CountClassCoupledModified float64 0 575 | CountClassDerived float64 0 5.35k | CountDeclInstanceMethod float64 0 529 | CountDeclInstanceVariable float64 0 296 | CountDeclMethod float64 0 599 | CountDeclMethodAll float64 0 1.12k | CountLine float64 1 40.4k | CountLineBlank float64 0 8.16k | CountLineCode float64 1 25.7k | CountLineCodeDecl float64 1 8.15k | CountLineCodeExe float64 0 24.2k | CountLineComment float64 0 16.5k | CountStmt float64 1 9.71k | CountStmtDecl float64 1 8.15k | CountStmtExe float64 0 9.69k | MaxCyclomatic float64 0 759 | MaxInheritanceTree float64 0 16 | MaxNesting float64 0 34 | SumCyclomatic float64 0 2.9k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7,200 | pandas-dev/pandas | pandas-dev_pandas/doc/make.py | make.DocBuilder | import os
import webbrowser
import subprocess
import sys
import docutils
import docutils.parsers.rst
import csv
import shutil
class DocBuilder:
"""
Class to wrap the different commands of this script.
All public methods of this class can be called as parameters of the
script.
"""
def __init__... |
class DocBuilder:
'''
Class to wrap the different commands of this script.
All public methods of this class can be called as parameters of the
script.
'''
def __init__(self, num_jobs='auto', include_api=True, whatsnew=False, single_doc=None, verbosity=0, warnings_are_errors=False, no_browser=F... | 16 | 13 | 19 | 2 | 13 | 5 | 3 | 0.4 | 0 | 8 | 0 | 0 | 11 | 7 | 13 | 13 | 266 | 34 | 168 | 60 | 143 | 68 | 117 | 45 | 103 | 6 | 0 | 3 | 40 |
7,201 | pandas-dev/pandas | pandas-dev_pandas/pandas/_config/config.py | pandas._config.config.DeprecatedOption | from typing import TYPE_CHECKING, Any, NamedTuple, cast
class DeprecatedOption(NamedTuple):
key: str
category: type[Warning]
msg: str | None
rkey: str | None
removal_ver: str | None |
class DeprecatedOption(NamedTuple):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 0 | 5 | 1 | 4 | 0 | 5 | 1 | 4 | 0 | 1 | 0 | 0 |
7,202 | pandas-dev/pandas | pandas-dev_pandas/pandas/_config/config.py | pandas._config.config.DictWrapper | from typing import TYPE_CHECKING, Any, NamedTuple, cast
class DictWrapper:
"""provide attribute-style access to a nested dict"""
d: dict[str, Any]
def __init__(self, d: dict[str, Any], prefix: str='') -> None:
object.__setattr__(self, 'd', d)
object.__setattr__(self, 'prefix', prefix)
... |
class DictWrapper:
'''provide attribute-style access to a nested dict'''
def __init__(self, d: dict[str, Any], prefix: str='') -> None:
pass
def __setattr__(self, key: str, val: Any) -> None:
pass
def __getattr__(self, key: str):
pass
def __dir__(self) -> list[str]:
... | 5 | 1 | 7 | 0 | 7 | 1 | 2 | 0.1 | 0 | 7 | 1 | 0 | 4 | 0 | 4 | 4 | 37 | 5 | 29 | 9 | 24 | 3 | 27 | 8 | 22 | 4 | 0 | 1 | 9 |
7,203 | pandas-dev/pandas | pandas-dev_pandas/pandas/_config/config.py | pandas._config.config.OptionError | class OptionError(AttributeError, KeyError):
"""
Exception raised for pandas.options.
Backwards compatible with KeyError checks.
See Also
--------
options : Access and modify global pandas settings.
Examples
--------
>>> pd.options.context
Traceback (most recent call last):
... | class OptionError(AttributeError, KeyError):
'''
Exception raised for pandas.options.
Backwards compatible with KeyError checks.
See Also
--------
options : Access and modify global pandas settings.
Examples
--------
>>> pd.options.context
Traceback (most recent call last):
O... | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 12 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 14 | 16 | 3 | 1 | 1 | 0 | 12 | 1 | 1 | 0 | 0 | 5 | 0 | 0 |
7,204 | pandas-dev/pandas | pandas-dev_pandas/pandas/_config/config.py | pandas._config.config.RegisteredOption | from typing import TYPE_CHECKING, Any, NamedTuple, cast
class RegisteredOption(NamedTuple):
key: str
defval: Any
doc: str
validator: Callable[[object], Any] | None
cb: Callable[[str], Any] | None |
class RegisteredOption(NamedTuple):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 0 | 6 | 1 | 5 | 0 | 6 | 1 | 5 | 0 | 1 | 0 | 0 |
7,205 | pandas-dev/pandas | pandas-dev_pandas/pandas/_testing/__init__.py | pandas._testing.SubclassedDataFrame | from pandas import ArrowDtype, DataFrame, Index, MultiIndex, RangeIndex, Series
class SubclassedDataFrame(DataFrame):
_metadata = ['testattr']
@property
def _constructor(self):
return lambda *args, **kwargs: SubclassedDataFrame(*args, **kwargs)
@property
def _constructor_sliced(self):
... |
class SubclassedDataFrame(DataFrame):
@property
def _constructor(self):
pass
@property
def _constructor_sliced(self):
pass | 5 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 2 | 0 | 2 | 2 | 10 | 2 | 8 | 6 | 3 | 0 | 6 | 4 | 3 | 1 | 1 | 0 | 2 |
7,206 | pandas-dev/pandas | pandas-dev_pandas/pandas/_testing/__init__.py | pandas._testing.SubclassedSeries | from pandas import ArrowDtype, DataFrame, Index, MultiIndex, RangeIndex, Series
class SubclassedSeries(Series):
_metadata = ['testattr', 'name']
@property
def _constructor(self):
return lambda *args, **kwargs: SubclassedSeries(*args, **kwargs)
@property
def _constructor_expanddim(self):
... |
class SubclassedSeries(Series):
@property
def _constructor(self):
pass
@property
def _constructor_expanddim(self):
pass | 5 | 0 | 5 | 0 | 2 | 3 | 1 | 0.63 | 1 | 1 | 1 | 0 | 2 | 0 | 2 | 252 | 15 | 2 | 8 | 6 | 3 | 5 | 6 | 4 | 3 | 1 | 3 | 0 | 2 |
7,207 | pandas-dev/pandas | pandas-dev_pandas/pandas/_typing.py | pandas._typing.BaseBuffer | from typing import TYPE_CHECKING, Any, Literal, ParamSpec, Protocol, SupportsIndex, TypeAlias, TypeVar, Union, overload
class BaseBuffer(Protocol):
@property
def mode(self) -> str:
...
def seek(self, offset: int, whence: int=..., /) -> int:
...
def seekable(self) -> bool:
...... |
class BaseBuffer(Protocol):
@property
def mode(self) -> str:
pass
def seek(self, offset: int, whence: int=..., /) -> int:
pass
def seekable(self) -> bool:
pass
def tell(self) -> int:
pass | 6 | 0 | 3 | 0 | 2 | 1 | 1 | 0.5 | 1 | 3 | 0 | 2 | 4 | 0 | 4 | 4 | 18 | 3 | 10 | 6 | 4 | 5 | 9 | 5 | 4 | 1 | 1 | 0 | 4 |
7,208 | pandas-dev/pandas | pandas-dev_pandas/pandas/_typing.py | pandas._typing.ReadBuffer | from typing import TYPE_CHECKING, Any, Literal, ParamSpec, Protocol, SupportsIndex, TypeAlias, TypeVar, Union, overload
class ReadBuffer(BaseBuffer, Protocol[AnyStr_co]):
def read(self, n: int=..., /) -> AnyStr_co:
... |
class ReadBuffer(BaseBuffer, Protocol[AnyStr_co]):
def read(self, n: int=..., /) -> AnyStr_co:
pass | 2 | 0 | 3 | 0 | 2 | 1 | 1 | 0.33 | 2 | 1 | 0 | 2 | 1 | 0 | 1 | 5 | 4 | 0 | 3 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 2 | 0 | 1 |
7,209 | pandas-dev/pandas | pandas-dev_pandas/pandas/_typing.py | pandas._typing.ReadCsvBuffer | from typing import TYPE_CHECKING, Any, Literal, ParamSpec, Protocol, SupportsIndex, TypeAlias, TypeVar, Union, overload
from collections.abc import Callable, Hashable, Iterator, Mapping, MutableMapping, Sequence
class ReadCsvBuffer(ReadBuffer[AnyStr_co], Protocol):
def __iter__(self) -> Iterator[AnyStr_co]:
... |
class ReadCsvBuffer(ReadBuffer[AnyStr_co], Protocol):
def __iter__(self) -> Iterator[AnyStr_co]:
pass
def fileno(self) -> int:
pass
def readline(self) -> AnyStr_co:
pass
@property
def closed(self) -> bool:
pass | 6 | 0 | 3 | 0 | 2 | 1 | 1 | 0.4 | 2 | 3 | 0 | 0 | 4 | 0 | 4 | 9 | 17 | 3 | 10 | 6 | 4 | 4 | 9 | 5 | 4 | 1 | 3 | 0 | 4 |
7,210 | pandas-dev/pandas | pandas-dev_pandas/pandas/_typing.py | pandas._typing.ReadPickleBuffer | from typing import TYPE_CHECKING, Any, Literal, ParamSpec, Protocol, SupportsIndex, TypeAlias, TypeVar, Union, overload
class ReadPickleBuffer(ReadBuffer[bytes], Protocol):
def readline(self) -> bytes:
... |
class ReadPickleBuffer(ReadBuffer[bytes], Protocol):
def readline(self) -> bytes:
pass | 2 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 2 | 1 | 0 | 0 | 1 | 0 | 1 | 6 | 2 | 0 | 2 | 2 | 1 | 0 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
7,211 | pandas-dev/pandas | pandas-dev_pandas/pandas/_typing.py | pandas._typing.SequenceNotStr | from collections.abc import Callable, Hashable, Iterator, Mapping, MutableMapping, Sequence
from typing import TYPE_CHECKING, Any, Literal, ParamSpec, Protocol, SupportsIndex, TypeAlias, TypeVar, Union, overload
class SequenceNotStr(Protocol[_T_co]):
@overload
def __getitem__(self, index: SupportsIndex, /) ->... |
class SequenceNotStr(Protocol[_T_co]):
@overload
def __getitem__(self, index: SupportsIndex, /) -> _T_co:
pass
@overload
def __getitem__(self, index: SupportsIndex, /) -> _T_co:
pass
def __contains__(self, value: object, /) -> bool:
pass
def __len__(self) -> int:
... | 11 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 6 | 0 | 0 | 8 | 0 | 8 | 8 | 18 | 7 | 11 | 11 | 8 | 0 | 17 | 9 | 8 | 1 | 1 | 0 | 8 |
7,212 | pandas-dev/pandas | pandas-dev_pandas/pandas/_typing.py | pandas._typing.WriteBuffer | from typing import TYPE_CHECKING, Any, Literal, ParamSpec, Protocol, SupportsIndex, TypeAlias, TypeVar, Union, overload
class WriteBuffer(BaseBuffer, Protocol[AnyStr_contra]):
def write(self, b: AnyStr_contra, /) -> Any:
...
def flush(self) -> Any:
... |
class WriteBuffer(BaseBuffer, Protocol[AnyStr_contra]):
def write(self, b: AnyStr_contra, /) -> Any:
pass
def flush(self) -> Any:
pass | 3 | 0 | 3 | 0 | 2 | 1 | 1 | 0.4 | 2 | 0 | 0 | 1 | 2 | 0 | 2 | 6 | 8 | 1 | 5 | 3 | 2 | 2 | 5 | 3 | 2 | 1 | 2 | 0 | 2 |
7,213 | pandas-dev/pandas | pandas-dev_pandas/pandas/_typing.py | pandas._typing.WriteExcelBuffer | from typing import TYPE_CHECKING, Any, Literal, ParamSpec, Protocol, SupportsIndex, TypeAlias, TypeVar, Union, overload
class WriteExcelBuffer(WriteBuffer[bytes], Protocol):
def truncate(self, size: int | None=..., /) -> int:
... |
class WriteExcelBuffer(WriteBuffer[bytes], Protocol):
def truncate(self, size: int | None=..., /) -> int:
pass | 2 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 2 | 1 | 0 | 0 | 1 | 0 | 1 | 7 | 2 | 0 | 2 | 2 | 1 | 0 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
7,214 | pandas-dev/pandas | pandas-dev_pandas/pandas/compat/pickle_compat.py | pandas.compat.pickle_compat.Unpickler | from typing import TYPE_CHECKING, Any
import numpy as np
from pandas._libs.tslibs import BaseOffset
import pickle
from pandas.core.internals import BlockManager
from pandas.core.arrays import DatetimeArray, PeriodArray, TimedeltaArray
from pandas._libs.arrays import NDArrayBacked
class Unpickler(pickle._Unpickler):
... |
class Unpickler(pickle._Unpickler):
def find_class(self, module: str, name: str) -> Any:
pass
def load_reduce(self) -> None:
pass
def load_newobj(self) -> None:
pass | 4 | 0 | 13 | 1 | 11 | 3 | 3 | 0.26 | 1 | 9 | 0 | 0 | 3 | 0 | 3 | 79 | 49 | 7 | 38 | 14 | 34 | 10 | 34 | 14 | 30 | 4 | 1 | 2 | 9 |
7,215 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/_numba/extensions.py | pandas.core._numba.extensions.ILocModel | from numba.core.datamodel import models
from numba.core.extending import NativeValue, box, lower_builtin, make_attribute_wrapper, overload, overload_attribute, overload_method, register_model, type_callable, typeof_impl, unbox
@register_model(IlocType)
class ILocModel(models.StructModel):
def __init__(self, dmm, ... | @register_model(IlocType)
class ILocModel(models.StructModel):
def __init__(self, dmm, fe_type) -> None:
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 4 | 0 | 4 | 3 | 2 | 0 | 4 | 3 | 2 | 1 | 1 | 0 | 1 |
7,216 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/_numba/extensions.py | pandas.core._numba.extensions.IlocType | from numba import types
class IlocType(types.Type):
def __init__(self, obj_type) -> None:
self.obj_type = obj_type
name = f'iLocIndexer({obj_type})'
super().__init__(name=name)
@property
def key(self):
return self.obj_type |
class IlocType(types.Type):
def __init__(self, obj_type) -> None:
pass
@property
def key(self):
pass | 4 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 2 | 1 | 2 | 2 | 9 | 1 | 8 | 6 | 4 | 0 | 7 | 5 | 4 | 1 | 1 | 0 | 2 |
7,217 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/_numba/extensions.py | pandas.core._numba.extensions.IndexModel | from numba import types
from numba.core.extending import NativeValue, box, lower_builtin, make_attribute_wrapper, overload, overload_attribute, overload_method, register_model, type_callable, typeof_impl, unbox
from numba.core.datamodel import models
@register_model(IndexType)
class IndexModel(models.StructModel):
... | @register_model(IndexType)
class IndexModel(models.StructModel):
def __init__(self, dmm, fe_type) -> None:
pass | 3 | 0 | 14 | 0 | 7 | 7 | 1 | 0.88 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 15 | 0 | 8 | 3 | 6 | 7 | 4 | 3 | 2 | 1 | 1 | 0 | 1 |
7,218 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/_numba/extensions.py | pandas.core._numba.extensions.IndexType | from numba import types
from typing import Self
class IndexType(types.Type):
"""
The type class for Index objects.
"""
def __init__(self, dtype, layout, pyclass: any) -> None:
self.pyclass = pyclass
name = f'index({dtype}, {layout})'
self.dtype = dtype
self.layout = lay... |
class IndexType(types.Type):
'''
The type class for Index objects.
'''
def __init__(self, dtype, layout, pyclass: any) -> None:
pass
@property
def key(self):
pass
@property
def as_array(self):
pass
def copy(self, dtype=None, ndim: int=1, layout=None) ->... | 7 | 1 | 4 | 0 | 4 | 0 | 1 | 0.16 | 1 | 3 | 0 | 0 | 4 | 3 | 4 | 4 | 26 | 4 | 19 | 11 | 12 | 3 | 17 | 9 | 12 | 2 | 1 | 1 | 5 |
7,219 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/_numba/extensions.py | pandas.core._numba.extensions.SeriesModel | from numba.core.extending import NativeValue, box, lower_builtin, make_attribute_wrapper, overload, overload_attribute, overload_method, register_model, type_callable, typeof_impl, unbox
from numba.core.datamodel import models
@register_model(SeriesType)
class SeriesModel(models.StructModel):
def __init__(self, d... | @register_model(SeriesType)
class SeriesModel(models.StructModel):
def __init__(self, dmm, fe_type) -> None:
pass | 3 | 0 | 7 | 0 | 7 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 8 | 0 | 8 | 3 | 6 | 0 | 4 | 3 | 2 | 1 | 1 | 0 | 1 |
7,220 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/_numba/extensions.py | pandas.core._numba.extensions.SeriesType | from numba import types
from typing import Self
class SeriesType(types.Type):
"""
The type class for Series objects.
"""
def __init__(self, dtype, index, namety) -> None:
assert isinstance(index, IndexType)
self.dtype = dtype
self.index = index
self.values = types.Array... |
class SeriesType(types.Type):
'''
The type class for Series objects.
'''
def __init__(self, dtype, index, namety) -> None:
pass
@property
def key(self):
pass
@property
def as_array(self):
pass
def copy(self, dtype=None, ndim: int=1, layout: str='C') -> ... | 7 | 1 | 5 | 0 | 5 | 0 | 1 | 0.14 | 1 | 5 | 1 | 0 | 4 | 4 | 4 | 4 | 28 | 4 | 21 | 12 | 14 | 3 | 19 | 10 | 14 | 2 | 1 | 1 | 5 |
7,221 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/accessor.py | pandas.core.accessor.Accessor | class Accessor:
"""
Custom property-like object.
A descriptor for accessors.
Parameters
----------
name : str
Namespace that will be accessed under, e.g. ``df.foo``.
accessor : cls
Class with the extension methods.
Notes
-----
For accessor, The class's __init__... | class Accessor:
'''
Custom property-like object.
A descriptor for accessors.
Parameters
----------
name : str
Namespace that will be accessed under, e.g. ``df.foo``.
accessor : cls
Class with the extension methods.
Notes
-----
For accessor, The class's __init__ me... | 3 | 1 | 4 | 0 | 4 | 1 | 2 | 2 | 0 | 1 | 0 | 0 | 2 | 2 | 2 | 2 | 29 | 5 | 8 | 5 | 5 | 16 | 8 | 5 | 5 | 2 | 0 | 1 | 3 |
7,222 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/accessor.py | pandas.core.accessor.DirNamesMixin | from typing import TYPE_CHECKING, final
class DirNamesMixin:
_accessors: set[str] = set()
_hidden_attrs: frozenset[str] = frozenset()
@final
def _dir_deletions(self) -> set[str]:
"""
Delete unwanted __dir__ for this object.
"""
return self._accessors | self._hidden_attr... |
class DirNamesMixin:
@final
def _dir_deletions(self) -> set[str]:
'''
Delete unwanted __dir__ for this object.
'''
pass
def _dir_additions(self) -> set[str]:
'''
Add additional __dir__ for this object.
'''
pass
def __dir__(self) -> list... | 5 | 3 | 7 | 0 | 3 | 4 | 1 | 1 | 0 | 4 | 0 | 0 | 3 | 0 | 3 | 3 | 28 | 4 | 12 | 8 | 7 | 12 | 11 | 7 | 7 | 1 | 0 | 0 | 3 |
7,223 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/accessor.py | pandas.core.accessor.PandasDelegate | import functools
class PandasDelegate:
"""
Abstract base class for delegating methods/properties.
"""
def _delegate_property_get(self, name: str, *args, **kwargs):
raise TypeError(f'You cannot access the property {name}')
def _delegate_property_set(self, name: str, value, *args, **kwargs)... |
class PandasDelegate:
'''
Abstract base class for delegating methods/properties.
'''
def _delegate_property_get(self, name: str, *args, **kwargs):
pass
def _delegate_property_set(self, name: str, value, *args, **kwargs) -> None:
pass
def _delegate_method(self, name: str, ... | 12 | 2 | 12 | 2 | 8 | 2 | 1 | 0.49 | 0 | 6 | 0 | 0 | 3 | 0 | 4 | 4 | 85 | 15 | 47 | 23 | 27 | 23 | 29 | 13 | 19 | 5 | 0 | 2 | 13 |
7,224 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/apply.py | pandas.core.apply.Apply | from pandas.core.dtypes.common import is_dict_like, is_extension_array_dtype, is_list_like, is_numeric_dtype, is_sequence
import numpy as np
from pandas.core.dtypes.cast import is_nested_object
import pandas.core.common as com
from pandas._typing import AggFuncType, AggFuncTypeBase, AggFuncTypeDict, AggObjType, Axis, A... |
class Apply(metaclass=abc.ABCMeta):
def __init__(self, obj: AggObjType, func: AggFuncType, raw: bool, result_type: str | None, *, by_row: Literal[False, 'compat', '_compat']='compat', engine: str='python', engine_kwargs: dict[str, bool] | None=None, args, kwargs) -> None:
pass
@abc.abstractmethod
... | 22 | 12 | 31 | 4 | 19 | 8 | 4 | 0.4 | 1 | 21 | 0 | 2 | 18 | 9 | 18 | 38 | 578 | 93 | 346 | 153 | 273 | 140 | 239 | 104 | 211 | 9 | 3 | 4 | 71 |
7,225 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/apply.py | pandas.core.apply.FrameApply | from pandas.core.dtypes.generic import ABCDataFrame, ABCNDFrame, ABCSeries
import functools
from collections.abc import Callable
from pandas.core._numba.executor import generate_apply_looper
from pandas.core.util.numba_ import get_jit_arguments, prepare_function_arguments
from typing import TYPE_CHECKING, Any, Literal,... |
class FrameApply(NDFrameApply):
def __init__(self, obj: AggObjType, func: AggFuncType, raw: bool, result_type: str | None, *, by_row: Literal[False, 'compat']=False, engine: str='python', engine_kwargs: dict[str, bool] | None=None, args, kwargs) -> None:
pass
@property
@abc.abstractmethod
def ... | 38 | 4 | 15 | 2 | 11 | 2 | 3 | 0.2 | 1 | 14 | 0 | 2 | 20 | 6 | 21 | 63 | 365 | 64 | 253 | 84 | 197 | 50 | 160 | 54 | 134 | 12 | 5 | 3 | 63 |
7,226 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/apply.py | pandas.core.apply.FrameColumnApply | from pandas.core.dtypes.generic import ABCDataFrame, ABCNDFrame, ABCSeries
from pandas.compat._optional import import_optional_dependency
from pandas._libs.internals import BlockValuesRefs
from pandas.core.construction import ensure_wrapped_if_datetimelike
from pandas._typing import AggFuncType, AggFuncTypeBase, AggFun... |
class FrameColumnApply(FrameApply):
def apply_broadcast(self, target: DataFrame) -> DataFrame:
pass
@property
def series_generator(self) -> Generator[Series]:
pass
@staticmethod
@functools.cache
def generate_numba_apply_func(func, nogil=True, nopython=True, parallel=False) -> C... | 16 | 2 | 15 | 2 | 10 | 3 | 2 | 0.28 | 1 | 10 | 0 | 0 | 7 | 2 | 8 | 71 | 135 | 26 | 85 | 44 | 62 | 24 | 61 | 32 | 48 | 5 | 6 | 3 | 16 |
7,227 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/apply.py | pandas.core.apply.FrameRowApply | from pandas.core.util.numba_ import get_jit_arguments, prepare_function_arguments
from typing import TYPE_CHECKING, Any, Literal, TypeAlias, cast
from pandas.compat._optional import import_optional_dependency
from pandas.core.dtypes.generic import ABCDataFrame, ABCNDFrame, ABCSeries
import functools
from pandas._typing... |
class FrameRowApply(FrameApply):
@property
def series_generator(self) -> Generator[Series]:
pass
@staticmethod
@functools.cache
def generate_numba_apply_func(func, nogil=True, nopython=True, parallel=False) -> Callable[[npt.NDArray, Index, Index], dict[int, Any]]:
pass
@num... | 14 | 1 | 14 | 2 | 10 | 2 | 2 | 0.18 | 1 | 9 | 0 | 0 | 5 | 2 | 6 | 69 | 103 | 18 | 72 | 36 | 51 | 13 | 52 | 25 | 41 | 8 | 6 | 2 | 15 |
7,228 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/apply.py | pandas.core.apply.GroupByApply | from pandas._typing import AggFuncType, AggFuncTypeBase, AggFuncTypeDict, AggObjType, Axis, AxisInt, NDFrameT, npt
import pandas.core.common as com
from typing import TYPE_CHECKING, Any, Literal, TypeAlias, cast
class GroupByApply(Apply):
obj: GroupBy | Resampler | BaseWindow
def __init__(self, obj: GroupBy[N... |
class GroupByApply(Apply):
def __init__(self, obj: GroupBy[NDFrameT], func: AggFuncType, *, args, kwargs) -> None:
pass
def apply(self):
pass
def transform(self):
pass
def agg_or_apply_list_like(self, op_name: Literal['agg', 'apply']) -> DataFrame | Series:
pass
... | 6 | 0 | 17 | 2 | 14 | 1 | 2 | 0.05 | 1 | 5 | 0 | 1 | 5 | 1 | 5 | 43 | 92 | 15 | 73 | 37 | 52 | 4 | 45 | 23 | 38 | 5 | 4 | 1 | 12 |
7,229 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/apply.py | pandas.core.apply.NDFrameApply | from typing import TYPE_CHECKING, Any, Literal, TypeAlias, cast
class NDFrameApply(Apply):
"""
Methods shared by FrameApply and SeriesApply but
not GroupByApply or ResamplerWindowApply
"""
obj: DataFrame | Series
@property
def index(self) -> Index:
return self.obj.index
@prope... |
class NDFrameApply(Apply):
'''
Methods shared by FrameApply and SeriesApply but
not GroupByApply or ResamplerWindowApply
'''
@property
def index(self) -> Index:
pass
@property
def agg_axis(self) -> Index:
pass
def agg_or_apply_list_like(self, op_name: Literal['agg',... | 7 | 1 | 12 | 2 | 10 | 0 | 3 | 0.09 | 1 | 4 | 2 | 2 | 4 | 0 | 4 | 42 | 59 | 12 | 43 | 22 | 32 | 4 | 33 | 16 | 28 | 6 | 4 | 2 | 12 |
7,230 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/apply.py | pandas.core.apply.ResamplerWindowApply | from pandas._typing import AggFuncType, AggFuncTypeBase, AggFuncTypeDict, AggObjType, Axis, AxisInt, NDFrameT, npt
class ResamplerWindowApply(GroupByApply):
axis: AxisInt = 0
obj: Resampler | BaseWindow
def __init__(self, obj: Resampler | BaseWindow, func: AggFuncType, *, args, kwargs) -> None:
su... |
class ResamplerWindowApply(GroupByApply):
def __init__(self, obj: Resampler | BaseWindow, func: AggFuncType, *, args, kwargs) -> None:
pass
def apply(self):
pass
def transform(self):
pass | 4 | 0 | 7 | 0 | 7 | 0 | 1 | 0 | 1 | 4 | 0 | 0 | 3 | 0 | 3 | 46 | 26 | 3 | 23 | 12 | 12 | 0 | 9 | 5 | 5 | 1 | 5 | 0 | 3 |
7,231 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/apply.py | pandas.core.apply.SeriesApply | from pandas.core.dtypes.generic import ABCDataFrame, ABCNDFrame, ABCSeries
from pandas.core.dtypes.common import is_dict_like, is_extension_array_dtype, is_list_like, is_numeric_dtype, is_sequence
from collections.abc import Callable
import numpy as np
import pandas.core.common as com
from typing import TYPE_CHECKING, ... |
class SeriesApply(NDFrameApply):
def __init__(self, obj: Series, func: AggFuncType, *, by_row: Literal[False, 'compat', '_compat']='compat', args, kwargs) -> None:
pass
def apply(self) -> DataFrame | Series:
pass
def agg(self):
pass
def apply_empty_result(self) -> Series:
... | 8 | 1 | 15 | 2 | 11 | 2 | 3 | 0.18 | 1 | 8 | 0 | 0 | 6 | 0 | 6 | 48 | 110 | 19 | 78 | 29 | 62 | 14 | 55 | 21 | 47 | 5 | 5 | 2 | 19 |
7,232 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arraylike.py | pandas.core.arraylike.OpsMixin | import operator
from pandas.core.ops.common import unpack_zerodim_and_defer
from pandas.core import roperator
class OpsMixin:
def _cmp_method(self, other, op):
return NotImplemented
@unpack_zerodim_and_defer('__eq__')
def __eq__(self, other):
return self._cmp_method(other, operator.eq)
... |
class OpsMixin:
def _cmp_method(self, other, op):
pass
@unpack_zerodim_and_defer('__eq__')
def __eq__(self, other):
pass
@unpack_zerodim_and_defer('__ne__')
def __ne__(self, other):
pass
@unpack_zerodim_and_defer('__lt__')
def __lt__(self, other):
pass
@... | 60 | 1 | 5 | 1 | 2 | 2 | 1 | 0.84 | 0 | 0 | 0 | 0 | 31 | 0 | 31 | 31 | 218 | 51 | 91 | 60 | 31 | 76 | 63 | 32 | 31 | 1 | 0 | 0 | 31 |
7,233 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/_arrow_string_mixins.py | pandas.core.arrays._arrow_string_mixins.ArrowStringArrayMixin | from functools import partial
import re
from pandas.compat import HAS_PYARROW, pa_version_under17p0
import numpy as np
from typing import TYPE_CHECKING, Any, Literal, Self
from pandas._libs import lib
class ArrowStringArrayMixin:
_pa_array: pa.ChunkedArray
def __init__(self, *args, **kwargs) -> None:
... |
class ArrowStringArrayMixin:
def __init__(self, *args, **kwargs) -> None:
pass
def _from_pyarrow_array(self, pa_array) -> Self:
pass
def _convert_bool_result(self, result, na=lib.no_default, method_name=None):
pass
def _convert_int_result(self, result):
pass
def... | 38 | 0 | 8 | 0 | 7 | 1 | 2 | 0.07 | 0 | 12 | 0 | 0 | 36 | 0 | 36 | 36 | 327 | 42 | 270 | 129 | 192 | 18 | 193 | 89 | 155 | 6 | 0 | 3 | 70 |
7,234 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/_mixins.py | pandas.core.arrays._mixins.NDArrayBackedExtensionArray | from pandas.core.arrays.base import ExtensionArray
import numpy as np
from pandas.core.dtypes.common import pandas_dtype
from pandas._libs.arrays import NDArrayBacked
from pandas.core import missing
from typing import TYPE_CHECKING, Any, Literal, Self, cast, overload
from pandas.core.dtypes.missing import array_equival... |
class NDArrayBackedExtensionArray(NDArrayBacked, ExtensionArray):
'''
ExtensionArray that is backed by a single NumPy ndarray.
'''
def _box_func(self, x):
'''
Wrap numpy type in our dtype.type if necessary.
'''
pass
def _validate_scalar(self, value):
pass
... | 43 | 7 | 12 | 1 | 8 | 3 | 2 | 0.47 | 2 | 17 | 0 | 0 | 26 | 0 | 29 | 101 | 433 | 75 | 250 | 113 | 171 | 117 | 173 | 67 | 139 | 7 | 1 | 2 | 58 |
7,235 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/arrow/accessors.py | pandas.core.arrays.arrow.accessors.ArrowAccessor | from abc import ABCMeta, abstractmethod
from pandas.compat import HAS_PYARROW
class ArrowAccessor(metaclass=ABCMeta):
@abstractmethod
def __init__(self, data, validation_msg: str) -> None:
self._data = data
self._validation_msg = validation_msg
self._validate(data)
@abstractmethod... |
class ArrowAccessor(metaclass=ABCMeta):
@abstractmethod
def __init__(self, data, validation_msg: str) -> None:
pass
@abstractmethod
def _is_valid_pyarrow_dtype(self, pyarrow_dtype) -> bool:
pass
def _validate(self, data) -> None:
pass
@property
def _pa_array(self):... | 8 | 0 | 4 | 0 | 4 | 1 | 2 | 0.11 | 1 | 4 | 0 | 2 | 4 | 2 | 4 | 24 | 24 | 4 | 18 | 11 | 10 | 2 | 15 | 8 | 10 | 3 | 3 | 1 | 6 |
7,236 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/arrow/accessors.py | pandas.core.arrays.arrow.accessors.ListAccessor | class ListAccessor(ArrowAccessor):
"""
Accessor object for list data properties of the Series values.
Parameters
----------
data : Series
Series containing Arrow list data.
"""
def __init__(self, data=None) -> None:
super().__init__(data, validation_msg="Can only use the '.... | class ListAccessor(ArrowAccessor):
'''
Accessor object for list data properties of the Series values.
Parameters
----------
data : Series
Series containing Arrow list data.
'''
def __init__(self, data=None) -> None:
pass
def _is_valid_pyarrow_dtype(self, pyarrow_dtype) ... | 7 | 4 | 28 | 2 | 11 | 15 | 2 | 1.5 | 1 | 10 | 0 | 0 | 6 | 0 | 6 | 30 | 181 | 21 | 64 | 17 | 54 | 96 | 32 | 17 | 22 | 6 | 4 | 2 | 11 |
7,237 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/arrow/accessors.py | pandas.core.arrays.arrow.accessors.StructAccessor | from typing import TYPE_CHECKING, cast
from pandas.core.dtypes.common import is_list_like
class StructAccessor(ArrowAccessor):
"""
Accessor object for structured data properties of the Series values.
Parameters
----------
data : Series
Series containing Arrow struct data.
"""
def ... |
class StructAccessor(ArrowAccessor):
'''
Accessor object for structured data properties of the Series values.
Parameters
----------
data : Series
Series containing Arrow struct data.
'''
def __init__(self, data=None) -> None:
pass
def _is_valid_pyarrow_dtype(self, pyar... | 8 | 4 | 48 | 5 | 18 | 25 | 2 | 1.97 | 1 | 11 | 0 | 0 | 5 | 0 | 5 | 29 | 265 | 33 | 78 | 42 | 46 | 154 | 36 | 20 | 26 | 6 | 4 | 2 | 11 |
7,238 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/arrow/array.py | pandas.core.arrays.arrow.array.ArrowExtensionArray | import unicodedata
from pandas.core import algorithms as algos, missing, ops, roperator
from pandas.core.dtypes.missing import isna
from typing import TYPE_CHECKING, Any, Literal, Self, cast, overload
import textwrap
import re
from pathlib import Path
from pandas.tseries.frequencies import to_offset
import operator
fro... | null | 210 | 42 | 17 | 1 | 12 | 4 | 3 | 0.34 | 4 | 29 | 0 | 0 | 135 | 0 | 143 | 326 | 2,709 | 356 | 1,755 | 599 | 1,405 | 604 | 1,115 | 397 | 957 | 22 | 5 | 4 | 427 |
7,239 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/arrow/extension_types.py | pandas.core.arrays.arrow.extension_types.ArrowIntervalType | from pandas.core.arrays.interval import VALID_CLOSED
import json
from pandas.core.dtypes.dtypes import IntervalDtype, PeriodDtype
import pyarrow
class ArrowIntervalType(pyarrow.ExtensionType):
def __init__(self, subtype, closed: IntervalClosedType) -> None:
assert closed in VALID_CLOSED
self._clos... |
class ArrowIntervalType(pyarrow.ExtensionType):
def __init__(self, subtype, closed: IntervalClosedType) -> None:
pass
@property
def subtype(self):
pass
@property
def closed(self) -> IntervalClosedType:
pass
def __arrow_ext_serialize__(self) -> bytes:
pass
@... | 13 | 0 | 4 | 0 | 4 | 0 | 1 | 0.05 | 0 | 6 | 0 | 0 | 8 | 2 | 9 | 9 | 50 | 9 | 39 | 20 | 26 | 2 | 31 | 17 | 21 | 2 | 0 | 1 | 11 |
7,240 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/arrow/extension_types.py | pandas.core.arrays.arrow.extension_types.ArrowPeriodType | import pyarrow
from pandas.core.dtypes.dtypes import IntervalDtype, PeriodDtype
import json
class ArrowPeriodType(pyarrow.ExtensionType):
def __init__(self, freq) -> None:
self._freq = freq
pyarrow.ExtensionType.__init__(self, pyarrow.int64(), 'pandas.period')
@property
def freq(self):
... |
class ArrowPeriodType(pyarrow.ExtensionType):
def __init__(self, freq) -> None:
pass
@property
def freq(self):
pass
def __arrow_ext_serialize__(self) -> bytes:
pass
@classmethod
def __arrow_ext_deserialize__(cls, storage_type, serialized) -> ArrowPeriodType:
pa... | 11 | 0 | 3 | 0 | 3 | 0 | 1 | 0.08 | 0 | 6 | 0 | 0 | 7 | 1 | 8 | 8 | 34 | 7 | 25 | 14 | 14 | 2 | 22 | 12 | 13 | 2 | 0 | 1 | 9 |
7,241 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/base.py | pandas.core.arrays.base.ExtensionArray | from pandas.compat.numpy import function as nv
from pandas.core.sorting import nargminmax, nargsort
from typing import TYPE_CHECKING, Any, ClassVar, Literal, Self, cast, overload
from pandas._libs import algos as libalgos, lib
from pandas.errors import AbstractMethodError
import numpy as np
from pandas.core.dtypes.comm... |
class ExtensionArray:
'''
Abstract base class for custom 1-D array types.
pandas will recognize instances of this class as proper arrays
with a custom type and will not attempt to coerce them to objects. They
may be stored directly inside a :class:`DataFrame` or :class:`Series`.
Attributes
... | 97 | 60 | 31 | 4 | 7 | 21 | 2 | 2.98 | 0 | 23 | 1 | 1 | 65 | 0 | 71 | 71 | 2,547 | 381 | 547 | 234 | 374 | 1,630 | 327 | 136 | 248 | 7 | 0 | 2 | 126 |
7,242 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/base.py | pandas.core.arrays.base.ExtensionArraySupportsAnyAll | from typing import TYPE_CHECKING, Any, ClassVar, Literal, Self, cast, overload
from pandas.errors import AbstractMethodError
class ExtensionArraySupportsAnyAll(ExtensionArray):
@overload
def any(self, *, skipna: Literal[True]=...) -> bool:
...
@overload
def any(self, *, skipna: bool) -> bool ... |
class ExtensionArraySupportsAnyAll(ExtensionArray):
@overload
def any(self, *, skipna: Literal[True]=...) -> bool:
pass
@overload
def any(self, *, skipna: Literal[True]=...) -> bool:
pass
def any(self, *, skipna: Literal[True]=...) -> bool:
pass
@overload
def all(se... | 11 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 2 | 0 | 0 | 6 | 0 | 6 | 77 | 18 | 5 | 13 | 11 | 6 | 0 | 13 | 7 | 6 | 1 | 1 | 0 | 6 |
7,243 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/base.py | pandas.core.arrays.base.ExtensionOpsMixin | from pandas.core import arraylike, missing, roperator
import operator
from pandas.errors import AbstractMethodError
class ExtensionOpsMixin:
"""
A base class for linking the operators to their dunder names.
.. note::
You may want to set ``__array_priority__`` if you want your
implementation... |
class ExtensionOpsMixin:
'''
A base class for linking the operators to their dunder names.
.. note::
You may want to set ``__array_priority__`` if you want your
implementation to be called when involved in binary operations
with NumPy arrays.
'''
@classmethod
def _create_ar... | 13 | 1 | 7 | 0 | 7 | 0 | 1 | 0.15 | 0 | 1 | 0 | 1 | 0 | 0 | 6 | 6 | 61 | 8 | 46 | 13 | 33 | 7 | 38 | 7 | 31 | 1 | 0 | 0 | 6 |
7,244 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/base.py | pandas.core.arrays.base.ExtensionScalarOpsMixin | from pandas.core.dtypes.generic import ABCDataFrame, ABCIndex, ABCSeries
from pandas.compat import set_function_name
import numpy as np
from pandas.core.dtypes.common import is_list_like, is_scalar, pandas_dtype
class ExtensionScalarOpsMixin(ExtensionOpsMixin):
"""
A mixin for defining ops on an ExtensionArray... |
class ExtensionScalarOpsMixin(ExtensionOpsMixin):
'''
A mixin for defining ops on an ExtensionArray.
It is assumed that the underlying scalar objects have the operators
already defined.
Notes
-----
If you have defined a subclass MyExtensionArray(ExtensionArray), then
use MyExtensionArra... | 10 | 2 | 23 | 3 | 12 | 9 | 2 | 1.63 | 1 | 4 | 1 | 0 | 0 | 0 | 3 | 9 | 114 | 23 | 35 | 16 | 25 | 57 | 30 | 13 | 23 | 3 | 1 | 2 | 11 |
7,245 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/boolean.py | pandas.core.arrays.boolean.BooleanArray | from pandas._libs import lib, missing as libmissing
from pandas.core.arrays.masked import BaseMaskedArray, BaseMaskedDtype
from pandas.core.dtypes.common import is_list_like
import numpy as np
from pandas.core.array_algos import masked_accumulations
from typing import TYPE_CHECKING, ClassVar, Self, cast
from pandas.cor... |
class BooleanArray(BaseMaskedArray):
'''
Array of boolean (True/False) data with missing values.
This is a pandas Extension array for boolean data, under the hood
represented by 2 numpy arrays: a boolean array with the data and
a boolean array with the mask (True indicating missing).
BooleanArr... | 13 | 1 | 14 | 1 | 12 | 0 | 3 | 0.49 | 1 | 15 | 1 | 0 | 4 | 1 | 7 | 188 | 175 | 30 | 98 | 44 | 69 | 48 | 63 | 25 | 53 | 9 | 2 | 2 | 23 |
7,246 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/boolean.py | pandas.core.arrays.boolean.BooleanDtype | from pandas.core.dtypes.dtypes import register_extension_dtype
import numpy as np
from pandas.core.arrays.masked import BaseMaskedArray, BaseMaskedDtype
from pandas.util._decorators import set_module
from typing import TYPE_CHECKING, ClassVar, Self, cast
@register_extension_dtype
@set_module('pandas')
class BooleanDty... | @register_extension_dtype
@set_module('pandas')
class BooleanDtype(BaseMaskedDtype):
'''
Extension dtype for boolean data.
.. warning::
BooleanDtype is considered experimental. The implementation and
parts of the API may change without warning.
Attributes
----------
None
Method... | 16 | 3 | 9 | 1 | 6 | 2 | 2 | 0.57 | 1 | 5 | 1 | 0 | 7 | 0 | 8 | 8 | 116 | 23 | 60 | 28 | 42 | 34 | 43 | 20 | 33 | 7 | 1 | 2 | 14 |
7,247 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/categorical.py | pandas.core.arrays.categorical.Categorical | from pandas.io.formats import console
from pandas.core.dtypes.generic import ABCIndex, ABCSeries
from typing import TYPE_CHECKING, Literal, Self, cast, overload
from pandas.core.dtypes.dtypes import ArrowDtype, CategoricalDtype, CategoricalDtypeType, ExtensionDtype
from shutil import get_terminal_size
import operator
f... |
class Categorical(NDArrayBackedExtensionArray, PandasObject, ObjectStringArrayMixin):
'''
Represent a categorical variable in classic R / S-plus fashion.
`Categoricals` can only take on a limited, and usually fixed, number
of possible values (`categories`). In contrast to statistical categorical
va... | 96 | 49 | 30 | 4 | 11 | 15 | 3 | 1.38 | 3 | 26 | 0 | 0 | 67 | 0 | 75 | 307 | 2,541 | 432 | 892 | 335 | 707 | 1,231 | 603 | 235 | 511 | 18 | 6 | 4 | 205 |
7,248 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/categorical.py | pandas.core.arrays.categorical.CategoricalAccessor | from pandas.core.dtypes.dtypes import ArrowDtype, CategoricalDtype, CategoricalDtypeType, ExtensionDtype
from pandas.core.base import ExtensionArray, NoNewAttributesMixin, PandasObject
from pandas.core.accessor import PandasDelegate, delegate_names
@delegate_names(delegate=Categorical, accessors=['categories', 'ordere... | @delegate_names(delegate=Categorical, accessors=['categories', 'ordered'], typ='property')
@delegate_names(delegate=Categorical, accessors=['rename_categories', 'reorder_categories', 'add_categories', 'remove_categories', 'remove_unused_categories', 'set_categories', 'as_ordered', 'as_unordered'], typ='method')
class C... | 11 | 2 | 7 | 1 | 4 | 3 | 1 | 4.76 | 3 | 4 | 0 | 0 | 5 | 3 | 6 | 19 | 165 | 22 | 25 | 16 | 14 | 119 | 23 | 14 | 14 | 2 | 2 | 1 | 8 |
7,249 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/datetimelike.py | pandas.core.arrays.datetimelike.DatelikeOps | import numpy as np
from pandas.util._decorators import Appender, Substitution, cache_readonly
from pandas._typing import ArrayLike, AxisInt, DatetimeLikeScalar, Dtype, DtypeObj, F, InterpolateOptions, NpDtype, PositionalIndexer2D, PositionalIndexerTuple, ScalarIndexer, SequenceIndexer, TakeIndexer, TimeAmbiguous, TimeN... |
class DatelikeOps(DatetimeLikeArrayMixin):
'''
Common ops for DatetimeIndex/PeriodIndex, but not TimedeltaIndex.
'''
@Substitution(URL='https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior')
def strftime(self, date_format: str) -> npt.NDArray[np.object_]:
'''
... | 3 | 2 | 50 | 8 | 6 | 37 | 2 | 3.73 | 1 | 3 | 0 | 0 | 1 | 0 | 1 | 210 | 59 | 9 | 11 | 8 | 4 | 41 | 7 | 4 | 4 | 2 | 3 | 1 | 2 |
7,250 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/datetimelike.py | pandas.core.arrays.datetimelike.DatetimeLikeArrayMixin | from pandas._libs import algos, lib
from pandas.core import algorithms, missing, nanops, ops
from pandas._config.config import get_option
from pandas.core.dtypes.missing import is_valid_na_for_dtype, isna
import numpy as np
from pandas.core.dtypes.generic import ABCCategorical, ABCMultiIndex
import warnings
import pand... |
class DatetimeLikeArrayMixin(OpsMixin, NDArrayBackedExtensionArray):
'''
Shared Base/Mixin class for DatetimeArray, TimedeltaArray, PeriodArray
Assumes that __new__/__init__ defines:
_ndarray
and that inheriting subclass implements:
freq
'''
@cache_readonly
def _can_hold_na(... | 115 | 31 | 18 | 2 | 10 | 6 | 3 | 0.59 | 2 | 32 | 1 | 2 | 75 | 5 | 75 | 209 | 1,521 | 247 | 814 | 265 | 653 | 480 | 601 | 176 | 515 | 15 | 2 | 4 | 227 |
7,251 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/datetimelike.py | pandas.core.arrays.datetimelike.TimelikeOps | import numpy as np
from typing import TYPE_CHECKING, Any, Literal, Self, TypeAlias, Union, cast, final, overload
from pandas._libs.tslibs import BaseOffset, Day, IncompatibleFrequency, NaT, NaTType, Period, Resolution, Tick, Timedelta, Timestamp, add_overflowsafe, astype_overflowsafe, get_unit_from_dtype, iNaT, ints_to... |
class TimelikeOps(DatetimeLikeArrayMixin):
'''
Common ops for TimedeltaIndex/DatetimeIndex, but not PeriodIndex.
'''
@classmethod
def _validate_dtype(cls, values, dtype):
pass
@property
def freq(self):
'''
Return the frequency object if it is set, otherwise None.
... | 41 | 9 | 17 | 2 | 9 | 6 | 2 | 0.65 | 1 | 15 | 0 | 0 | 22 | 3 | 26 | 235 | 495 | 71 | 259 | 114 | 175 | 168 | 157 | 56 | 130 | 6 | 3 | 3 | 60 |
7,252 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/datetimes.py | pandas.core.arrays.datetimes.DatetimeArray | import pandas.core.common as com
from pandas.util._validators import validate_inclusive
import warnings
import numpy as np
from pandas._libs import lib, tslib
from pandas._libs.tslibs import BaseOffset, NaT, NaTType, Resolution, Timestamp, astype_overflowsafe, fields, get_resolution, get_supported_dtype, get_unit_from_... |
class DatetimeArray(dtl.TimelikeOps, dtl.DatelikeOps):
'''
Pandas ExtensionArray for tz-naive or tz-aware datetime data.
.. warning::
DatetimeArray is currently experimental, and its API may change
without warning. In particular, :attr:`DatetimeArray.dtype` is
expected to change to alw... | 54 | 21 | 35 | 4 | 13 | 18 | 3 | 0.63 | 2 | 22 | 0 | 0 | 32 | 4 | 38 | 171 | 2,205 | 305 | 1,168 | 215 | 1,054 | 740 | 362 | 144 | 317 | 27 | 3 | 3 | 120 |
7,253 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/floating.py | pandas.core.arrays.floating.Float32Dtype | from typing import TYPE_CHECKING, Any, ClassVar
from pandas.util._decorators import set_module
from pandas.core.dtypes.base import register_extension_dtype
import numpy as np
@register_extension_dtype
@set_module('pandas')
class Float32Dtype(FloatingDtype):
type = np.float32
name: ClassVar[str] = 'Float32'
... | @register_extension_dtype
@set_module('pandas')
class Float32Dtype(FloatingDtype):
pass | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 4 | 0 | 4 | 4 | 3 | 0 | 4 | 4 | 3 | 0 | 3 | 0 | 0 |
7,254 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/floating.py | pandas.core.arrays.floating.Float64Dtype | from pandas.core.dtypes.base import register_extension_dtype
from pandas.util._decorators import set_module
from typing import TYPE_CHECKING, Any, ClassVar
import numpy as np
@register_extension_dtype
@set_module('pandas')
class Float64Dtype(FloatingDtype):
type = np.float64
name: ClassVar[str] = 'Float64'
... | @register_extension_dtype
@set_module('pandas')
class Float64Dtype(FloatingDtype):
pass | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 4 | 0 | 4 | 4 | 3 | 0 | 4 | 4 | 3 | 0 | 3 | 0 | 0 |
7,255 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/floating.py | pandas.core.arrays.floating.FloatingArray | from pandas.core.arrays.numeric import NumericArray, NumericDtype
class FloatingArray(NumericArray):
"""
Array of floating (optional missing) values.
.. warning::
FloatingArray is currently experimental, and its API or internal
implementation may change without warning. Especially the behav... |
class FloatingArray(NumericArray):
'''
Array of floating (optional missing) values.
.. warning::
FloatingArray is currently experimental, and its API or internal
implementation may change without warning. Especially the behaviour
regarding NaN (distinct from NA missing values) is subje... | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 24.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 185 | 67 | 16 | 2 | 2 | 1 | 49 | 2 | 2 | 1 | 0 | 3 | 0 | 0 |
7,256 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/floating.py | pandas.core.arrays.floating.FloatingDtype | import numpy as np
from pandas.core.dtypes.common import is_float_dtype
from pandas.core.arrays.numeric import NumericArray, NumericDtype
from typing import TYPE_CHECKING, Any, ClassVar
class FloatingDtype(NumericDtype):
"""
An ExtensionDtype to hold a single size of floating dtype.
These specific impleme... |
class FloatingDtype(NumericDtype):
'''
An ExtensionDtype to hold a single size of floating dtype.
These specific implementations are subclasses of the non-public
FloatingDtype. For example we have Float32Dtype to represent float32.
The attributes name & type are set when these subclasses are create... | 6 | 3 | 7 | 1 | 2 | 4 | 1 | 1.46 | 1 | 4 | 1 | 2 | 0 | 0 | 3 | 11 | 40 | 8 | 13 | 10 | 6 | 19 | 10 | 7 | 6 | 1 | 2 | 0 | 3 |
7,257 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/integer.py | pandas.core.arrays.integer.Int16Dtype | from pandas.core.dtypes.base import register_extension_dtype
import numpy as np
from pandas.util._decorators import set_module
from typing import TYPE_CHECKING, Any, ClassVar
@register_extension_dtype
@set_module('pandas')
class Int16Dtype(IntegerDtype):
type = np.int16
name: ClassVar[str] = 'Int16'
__doc_... | @register_extension_dtype
@set_module('pandas')
class Int16Dtype(IntegerDtype):
pass | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 4 | 0 | 4 | 4 | 3 | 0 | 4 | 4 | 3 | 0 | 3 | 0 | 0 |
7,258 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/integer.py | pandas.core.arrays.integer.Int32Dtype | from typing import TYPE_CHECKING, Any, ClassVar
from pandas.util._decorators import set_module
from pandas.core.dtypes.base import register_extension_dtype
import numpy as np
@register_extension_dtype
@set_module('pandas')
class Int32Dtype(IntegerDtype):
type = np.int32
name: ClassVar[str] = 'Int32'
__doc_... | @register_extension_dtype
@set_module('pandas')
class Int32Dtype(IntegerDtype):
pass | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 4 | 0 | 4 | 4 | 3 | 0 | 4 | 4 | 3 | 0 | 3 | 0 | 0 |
7,259 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/integer.py | pandas.core.arrays.integer.Int64Dtype | from pandas.core.dtypes.base import register_extension_dtype
from pandas.util._decorators import set_module
from typing import TYPE_CHECKING, Any, ClassVar
import numpy as np
@register_extension_dtype
@set_module('pandas')
class Int64Dtype(IntegerDtype):
type = np.int64
name: ClassVar[str] = 'Int64'
__doc_... | @register_extension_dtype
@set_module('pandas')
class Int64Dtype(IntegerDtype):
pass | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 4 | 0 | 4 | 4 | 3 | 0 | 4 | 4 | 3 | 0 | 3 | 0 | 0 |
7,260 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/integer.py | pandas.core.arrays.integer.Int8Dtype | from pandas.util._decorators import set_module
from typing import TYPE_CHECKING, Any, ClassVar
import numpy as np
from pandas.core.dtypes.base import register_extension_dtype
@register_extension_dtype
@set_module('pandas')
class Int8Dtype(IntegerDtype):
type = np.int8
name: ClassVar[str] = 'Int8'
__doc__ =... | @register_extension_dtype
@set_module('pandas')
class Int8Dtype(IntegerDtype):
pass | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 4 | 0 | 4 | 4 | 3 | 0 | 4 | 4 | 3 | 0 | 3 | 0 | 0 |
7,261 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/integer.py | pandas.core.arrays.integer.IntegerArray | from pandas.core.arrays.numeric import NumericArray, NumericDtype
class IntegerArray(NumericArray):
"""
Array of integer (optional missing) values.
Uses :attr:`pandas.NA` as the missing value.
.. warning::
IntegerArray is currently experimental, and its API or internal
implementation m... |
class IntegerArray(NumericArray):
'''
Array of integer (optional missing) values.
Uses :attr:`pandas.NA` as the missing value.
.. warning::
IntegerArray is currently experimental, and its API or internal
implementation may change without warning.
We represent an IntegerArray with 2 nu... | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 26 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 185 | 72 | 18 | 2 | 2 | 1 | 52 | 2 | 2 | 1 | 0 | 3 | 0 | 0 |
7,262 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/integer.py | pandas.core.arrays.integer.IntegerDtype | from typing import TYPE_CHECKING, Any, ClassVar
import numpy as np
from pandas.core.arrays.numeric import NumericArray, NumericDtype
from pandas.core.dtypes.common import is_integer_dtype
class IntegerDtype(NumericDtype):
"""
An ExtensionDtype to hold a single size & kind of integer dtype.
These specific ... |
class IntegerDtype(NumericDtype):
'''
An ExtensionDtype to hold a single size & kind of integer dtype.
These specific implementations are subclasses of the non-public
IntegerDtype. For example, we have Int8Dtype to represent signed int 8s.
The attributes name & type are set when these subclasses ar... | 6 | 3 | 9 | 1 | 5 | 4 | 2 | 0.86 | 1 | 5 | 1 | 8 | 0 | 0 | 3 | 11 | 48 | 9 | 21 | 12 | 14 | 18 | 16 | 8 | 12 | 3 | 2 | 2 | 5 |
7,263 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/integer.py | pandas.core.arrays.integer.UInt16Dtype | from pandas.core.dtypes.base import register_extension_dtype
from pandas.util._decorators import set_module
import numpy as np
from typing import TYPE_CHECKING, Any, ClassVar
@register_extension_dtype
@set_module('pandas')
class UInt16Dtype(IntegerDtype):
type = np.uint16
name: ClassVar[str] = 'UInt16'
__d... | @register_extension_dtype
@set_module('pandas')
class UInt16Dtype(IntegerDtype):
pass | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 4 | 0 | 4 | 4 | 3 | 0 | 4 | 4 | 3 | 0 | 3 | 0 | 0 |
7,264 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/integer.py | pandas.core.arrays.integer.UInt32Dtype | from pandas.core.dtypes.base import register_extension_dtype
import numpy as np
from typing import TYPE_CHECKING, Any, ClassVar
from pandas.util._decorators import set_module
@register_extension_dtype
@set_module('pandas')
class UInt32Dtype(IntegerDtype):
type = np.uint32
name: ClassVar[str] = 'UInt32'
__d... | @register_extension_dtype
@set_module('pandas')
class UInt32Dtype(IntegerDtype):
pass | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 4 | 0 | 4 | 4 | 3 | 0 | 4 | 4 | 3 | 0 | 3 | 0 | 0 |
7,265 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/integer.py | pandas.core.arrays.integer.UInt64Dtype | from typing import TYPE_CHECKING, Any, ClassVar
import numpy as np
from pandas.core.dtypes.base import register_extension_dtype
from pandas.util._decorators import set_module
@register_extension_dtype
@set_module('pandas')
class UInt64Dtype(IntegerDtype):
type = np.uint64
name: ClassVar[str] = 'UInt64'
__d... | @register_extension_dtype
@set_module('pandas')
class UInt64Dtype(IntegerDtype):
pass | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 4 | 0 | 4 | 4 | 3 | 0 | 4 | 4 | 3 | 0 | 3 | 0 | 0 |
7,266 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/integer.py | pandas.core.arrays.integer.UInt8Dtype | from pandas.util._decorators import set_module
from pandas.core.dtypes.base import register_extension_dtype
import numpy as np
from typing import TYPE_CHECKING, Any, ClassVar
@register_extension_dtype
@set_module('pandas')
class UInt8Dtype(IntegerDtype):
type = np.uint8
name: ClassVar[str] = 'UInt8'
__doc_... | @register_extension_dtype
@set_module('pandas')
class UInt8Dtype(IntegerDtype):
pass | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 4 | 0 | 4 | 4 | 3 | 0 | 4 | 4 | 3 | 0 | 3 | 0 | 0 |
7,267 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/interval.py | pandas.core.arrays.interval.IntervalArray | from pandas._libs.missing import NA
from pandas.core.dtypes.cast import LossySetitemError, maybe_upcast_numeric_to_64bit
from pandas.core.dtypes.generic import ABCDataFrame, ABCDatetimeIndex, ABCIntervalIndex, ABCPeriodIndex
import pandas.core.common as com
from pandas._libs.interval import VALID_CLOSED, Interval, Inte... | @Appender(_interval_shared_docs['class'] % {'klass': 'IntervalArray', 'summary': 'Pandas array for interval data that are closed on the same side.', 'name': '', 'extra_attributes': '', 'extra_methods': '', 'examples': textwrap.dedent(' Examples\n --------\n A new ``IntervalArray`` can be constructed directly f... | 97 | 21 | 21 | 3 | 11 | 8 | 3 | 0.49 | 2 | 25 | 0 | 0 | 54 | 1 | 63 | 135 | 1,789 | 279 | 1,017 | 281 | 786 | 499 | 514 | 167 | 442 | 21 | 1 | 3 | 172 |
7,268 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/masked.py | pandas.core.arrays.masked.BaseMaskedArray | from pandas.core.util.hashing import hash_array
from pandas.core.ops import invalid_comparison
from pandas.core.indexers import check_array_indexer
from pandas.core.dtypes.common import is_bool, is_integer_dtype, is_list_like, is_scalar, is_string_dtype, pandas_dtype
from pandas.core.construction import array as pd_arr... |
class BaseMaskedArray(OpsMixin, ExtensionArray):
'''
Base class for masked arrays (which use _data and _mask to store the data).
numpy based
'''
@classmethod
def _simple_new(cls, values: np.ndarray, mask: npt.NDArray[np.bool_]) -> Self:
pass
def __init__(self, values: np.ndarray, m... | 116 | 13 | 17 | 2 | 11 | 4 | 3 | 0.37 | 2 | 31 | 0 | 0 | 77 | 0 | 82 | 185 | 1,517 | 234 | 944 | 362 | 718 | 349 | 623 | 224 | 527 | 19 | 1 | 4 | 225 |
7,269 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/numeric.py | pandas.core.arrays.numeric.NumericArray | import numpy as np
from typing import TYPE_CHECKING, Any, Self
import numbers
from pandas.core.arrays.masked import BaseMaskedArray, BaseMaskedDtype
from pandas.util._decorators import cache_readonly
class NumericArray(BaseMaskedArray):
"""
Base class for IntegerArray and FloatingArray.
"""
_dtype_cls:... |
class NumericArray(BaseMaskedArray):
'''
Base class for IntegerArray and FloatingArray.
'''
def __init__(self, values: np.ndarray, mask: npt.NDArray[np.bool_], copy: bool=False) -> None:
pass
@cache_readonly
def dtype(self) -> NumericDtype:
pass
@classmethod
def _co... | 8 | 1 | 10 | 1 | 9 | 1 | 2 | 0.12 | 1 | 6 | 1 | 0 | 2 | 0 | 4 | 185 | 53 | 8 | 41 | 23 | 26 | 5 | 23 | 14 | 17 | 4 | 2 | 1 | 7 |
7,270 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/numeric.py | pandas.core.arrays.numeric.NumericDtype | from typing import TYPE_CHECKING, Any, Self
from pandas.core.arrays.masked import BaseMaskedArray, BaseMaskedDtype
import numpy as np
from pandas.errors import AbstractMethodError
from pandas.util._decorators import cache_readonly
from pandas.core.dtypes.common import is_integer_dtype, is_string_dtype, pandas_dtype
cl... |
class NumericDtype(BaseMaskedDtype):
def __repr__(self) -> str:
pass
@cache_readonly
def is_signed_integer(self) -> bool:
pass
@cache_readonly
def is_unsigned_integer(self) -> bool:
pass
@property
def _is_numeric(self) -> bool:
pass
def __from_arrow__(s... | 15 | 3 | 9 | 1 | 6 | 2 | 2 | 0.34 | 1 | 8 | 0 | 0 | 5 | 0 | 8 | 8 | 90 | 16 | 56 | 27 | 35 | 19 | 41 | 16 | 30 | 5 | 1 | 2 | 15 |
7,271 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/numpy_.py | pandas.core.arrays.numpy_.NumpyExtensionArray | from pandas.core.dtypes.common import pandas_dtype
from pandas.core.arraylike import OpsMixin
from typing import TYPE_CHECKING, Any, Literal, Self
from pandas.core.dtypes.missing import isna
import numpy as np
from pandas.core.construction import ensure_wrapped_if_datetimelike
from pandas._libs.tslibs import is_support... |
class NumpyExtensionArray(OpsMixin, NDArrayBackedExtensionArray, ObjectStringArrayMixin):
'''
A pandas ExtensionArray for NumPy data.
This is mostly for internal compatibility, and is not especially
useful on its own.
Parameters
----------
values : ndarray
The NumPy ndarray to wrap.... | 36 | 3 | 13 | 1 | 11 | 1 | 2 | 0.23 | 3 | 10 | 0 | 0 | 30 | 0 | 31 | 287 | 520 | 70 | 367 | 190 | 208 | 85 | 183 | 64 | 150 | 12 | 6 | 2 | 66 |
7,272 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/period.py | pandas.core.arrays.period.PeriodArray | from pandas.core.arrays import datetimelike as dtl
from pandas._libs.tslibs.dtypes import FreqGroup, PeriodDtypeBase
from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast, overload
from pandas._libs import algos as libalgos, lib
from pandas.util._decorators import cache_readonly, doc
from pandas.core.dtyp... |
class PeriodArray(dtl.DatelikeOps, libperiod.PeriodMixin):
'''
Pandas ExtensionArray for storing Period data.
Users should use :func:`~pandas.array` to create new instances.
Parameters
----------
values : Union[PeriodArray, Series[period], ndarray[int], PeriodIndex]
The data to store. T... | 44 | 12 | 18 | 2 | 10 | 6 | 3 | 0.44 | 2 | 21 | 0 | 0 | 25 | 2 | 31 | 138 | 1,003 | 155 | 599 | 158 | 515 | 261 | 256 | 105 | 221 | 10 | 3 | 3 | 82 |
7,273 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/sparse/accessor.py | pandas.core.arrays.sparse.accessor.BaseAccessor | class BaseAccessor:
_validation_msg = "Can only use the '.sparse' accessor with Sparse data."
def __init__(self, data=None) -> None:
self._parent = data
self._validate(data)
def _validate(self, data) -> None:
raise NotImplementedError | class BaseAccessor:
def __init__(self, data=None) -> None:
pass
def _validate(self, data) -> None:
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 1 | 0 | 2 | 2 | 1 | 2 | 2 | 9 | 2 | 7 | 5 | 4 | 0 | 7 | 5 | 4 | 1 | 0 | 0 | 2 |
7,274 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/sparse/accessor.py | pandas.core.arrays.sparse.accessor.SparseAccessor | from pandas.core.dtypes.dtypes import SparseDtype
from pandas.core.arrays.sparse.array import SparseArray
from pandas.core.accessor import PandasDelegate, delegate_names
@delegate_names(SparseArray, ['npoints', 'density', 'fill_value', 'sp_values'], typ='property')
class SparseAccessor(BaseAccessor, PandasDelegate):
... | @delegate_names(SparseArray, ['npoints', 'density', 'fill_value', 'sp_values'], typ='property')
class SparseAccessor(BaseAccessor, PandasDelegate):
'''
Accessor for SparseSparse from other sparse matrix data types.
Parameters
----------
data : Series or DataFrame
The Series or DataFrame to w... | 9 | 4 | 33 | 4 | 6 | 24 | 2 | 4.5 | 2 | 9 | 0 | 0 | 5 | 1 | 6 | 12 | 230 | 32 | 36 | 17 | 22 | 162 | 24 | 13 | 13 | 3 | 1 | 1 | 9 |
7,275 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/sparse/accessor.py | pandas.core.arrays.sparse.accessor.SparseFrameAccessor | from pandas.core.accessor import PandasDelegate, delegate_names
from pandas.compat._optional import import_optional_dependency
from pandas.core.dtypes.cast import find_common_type
from pandas.core.arrays.sparse.array import SparseArray
import numpy as np
from pandas.core.dtypes.dtypes import SparseDtype
class SparseFr... |
class SparseFrameAccessor(BaseAccessor, PandasDelegate):
'''
DataFrame accessor for sparse data.
It allows users to interact with a `DataFrame` that contains sparse data types
(`SparseDtype`). It provides methods and attributes to efficiently work with sparse
storage, reducing memory usage while ma... | 10 | 5 | 30 | 4 | 11 | 15 | 2 | 1.43 | 2 | 10 | 0 | 0 | 4 | 0 | 6 | 12 | 206 | 31 | 72 | 36 | 55 | 103 | 60 | 30 | 49 | 5 | 1 | 1 | 14 |
7,276 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/sparse/array.py | pandas.core.arrays.sparse.array.SparseArray | import operator
from pandas.core.dtypes.common import is_bool_dtype, is_integer, is_list_like, is_object_dtype, is_scalar, is_string_dtype, pandas_dtype
import numbers
from pandas.core.dtypes.cast import find_common_type, maybe_box_datetimelike
from collections import abc
from pandas.io.formats import printing
from pan... |
class SparseArray(OpsMixin, PandasObject, ExtensionArray):
'''
An ExtensionArray for storing sparse data.
SparseArray efficiently stores data with a high frequency of a
specific fill value (e.g., zeros), saving memory by only retaining
non-fill elements and their indices. This class is particularly... | 88 | 23 | 21 | 3 | 11 | 7 | 3 | 0.68 | 3 | 24 | 1 | 0 | 61 | 1 | 66 | 176 | 1,572 | 261 | 787 | 290 | 651 | 537 | 610 | 221 | 541 | 25 | 2 | 4 | 210 |
7,277 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/string_.py | pandas.core.arrays.string_.BaseStringArray | from pandas.util._decorators import doc, set_module
from pandas._libs import lib, missing as libmissing
from pandas.core import missing, nanops, ops, roperator
from pandas.core.dtypes.common import is_array_like, is_bool_dtype, is_integer_dtype, is_object_dtype, is_string_dtype, pandas_dtype
import numpy as np
from pan... |
class BaseStringArray(ExtensionArray):
'''
Mixin class for StringArray, ArrowStringArray.
'''
def _logical_method(self, other, op):
pass
@doc(ExtensionArray.tolist)
def tolist(self) -> list:
pass
def _formatter(self, boxed: bool=False):
pass
def _str_map(s... | 9 | 1 | 21 | 2 | 16 | 3 | 4 | 0.18 | 1 | 8 | 0 | 1 | 6 | 0 | 7 | 79 | 159 | 23 | 116 | 37 | 89 | 21 | 70 | 20 | 60 | 9 | 1 | 3 | 27 |
7,278 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/string_.py | pandas.core.arrays.string_.StringArray | from pandas.core.arrays.floating import FloatingArray, FloatingDtype
from pandas.core.algorithms import isin
from pandas.core.arrays.base import ExtensionArray
from pandas.util._decorators import doc, set_module
from pandas._config import get_option, using_string_dtype
from pandas.core.indexers import check_array_index... |
class StringArray(BaseStringArray, NumpyExtensionArray):
'''
Extension array for string data.
.. warning::
StringArray is considered experimental. The implementation and
parts of the API may change without warning.
Parameters
----------
values : array-like
The array of dat... | 30 | 5 | 14 | 1 | 11 | 1 | 3 | 0.34 | 2 | 17 | 1 | 1 | 20 | 3 | 23 | 287 | 432 | 69 | 273 | 87 | 217 | 92 | 194 | 56 | 166 | 8 | 7 | 3 | 68 |
7,279 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/string_.py | pandas.core.arrays.string_.StringDtype | from pandas._libs import lib, missing as libmissing
import numpy as np
from pandas.compat import HAS_PYARROW, PYARROW_MIN_VERSION
from pandas.util._exceptions import find_stack_level
from pandas._libs.arrays import NDArrayBacked
import warnings
from typing import TYPE_CHECKING, Any, Literal, Self, cast
from pandas._con... | @set_module('pandas')
@register_extension_dtype
class StringDtype(StorageExtensionDtype):
'''
Extension dtype for string data.
.. warning::
StringDtype is considered experimental. The implementation and
parts of the API may change without warning.
Parameters
----------
storage : {"... | 20 | 4 | 19 | 2 | 13 | 4 | 4 | 0.53 | 1 | 18 | 3 | 0 | 11 | 2 | 12 | 39 | 285 | 42 | 162 | 46 | 128 | 86 | 109 | 29 | 92 | 11 | 2 | 4 | 47 |
7,280 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/string_arrow.py | pandas.core.arrays.string_arrow.ArrowStringArray | from pandas.core.arrays.numeric import NumericDtype
import numpy as np
from pandas.util._exceptions import find_stack_level
from typing import TYPE_CHECKING, Self
from pandas.core.dtypes.missing import isna
import operator
from pandas.core.arrays._arrow_string_mixins import ArrowStringArrayMixin
from pandas.core.dtypes... |
class ArrowStringArray(ObjectStringArrayMixin, ArrowExtensionArray, BaseStringArray):
'''
Extension array for string data in a ``pyarrow.ChunkedArray``.
.. warning::
ArrowStringArray is considered experimental. The implementation and
parts of the API may change without warning.
Parameters... | 36 | 5 | 12 | 1 | 10 | 1 | 3 | 0.2 | 3 | 17 | 0 | 1 | 21 | 1 | 25 | 420 | 402 | 55 | 291 | 104 | 236 | 59 | 201 | 75 | 174 | 7 | 6 | 3 | 71 |
7,281 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/arrays/timedeltas.py | pandas.core.arrays.timedeltas.TimedeltaArray | from datetime import timedelta
from pandas._libs.tslibs import Day, NaT, NaTType, Tick, Timedelta, astype_overflowsafe, get_supported_dtype, iNaT, is_supported_dtype, periods_per_second, to_offset
from pandas.core import nanops, roperator
from pandas.util._validators import validate_endpoints
from pandas.core.dtypes.mi... |
class TimedeltaArray(dtl.TimelikeOps):
'''
Pandas ExtensionArray for timedelta data.
.. warning::
TimedeltaArray is currently experimental, and its API may change
without warning. In particular, :attr:`TimedeltaArray.dtype` is
expected to change to be an instance of an ``ExtensionDtype... | 57 | 8 | 16 | 2 | 10 | 4 | 3 | 0.41 | 1 | 12 | 0 | 0 | 32 | 3 | 37 | 169 | 942 | 162 | 554 | 170 | 458 | 229 | 313 | 116 | 270 | 12 | 3 | 3 | 108 |
7,282 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/base.py | pandas.core.base.IndexOpsMixin | from pandas.compat import PYPY
from typing import TYPE_CHECKING, Any, Generic, Literal, Self, cast, final, overload
from pandas._typing import AxisInt, DtypeObj, IndexLabel, NDFrameT, Shape, npt
from pandas.core.dtypes.cast import can_hold_element
from pandas.errors import AbstractMethodError
from pandas.core.dtypes.mi... |
class IndexOpsMixin(OpsMixin):
'''
Common ops mixin to support a unified interface / docs for Series / Index
'''
@property
def dtype(self) -> DtypeObj:
pass
@property
def _values(self) -> ExtensionArray | np.ndarray:
pass
@final
def transpose(self, *args, **kwargs) -... | 59 | 22 | 30 | 4 | 6 | 20 | 2 | 1.83 | 1 | 16 | 0 | 0 | 33 | 0 | 33 | 64 | 1,216 | 205 | 361 | 136 | 253 | 659 | 154 | 64 | 117 | 8 | 1 | 3 | 56 |
7,283 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/base.py | pandas.core.base.NoNewAttributesMixin | class NoNewAttributesMixin:
"""
Mixin which prevents adding new attributes.
Prevents additional attributes via xxx.attribute = "something" after a
call to `self.__freeze()`. Mainly used to prevent the user from using
wrong attributes on an accessor (`Series.cat/.str/.dt`).
If you really want t... | class NoNewAttributesMixin:
'''
Mixin which prevents adding new attributes.
Prevents additional attributes via xxx.attribute = "something" after a
call to `self.__freeze()`. Mainly used to prevent the user from using
wrong attributes on an accessor (`Series.cat/.str/.dt`).
If you really want to ... | 3 | 2 | 9 | 0 | 5 | 4 | 2 | 1.55 | 0 | 4 | 0 | 0 | 2 | 0 | 2 | 2 | 32 | 4 | 11 | 3 | 8 | 17 | 7 | 3 | 4 | 2 | 0 | 1 | 3 |
7,284 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/base.py | pandas.core.base.PandasObject | from pandas.core.dtypes.common import is_object_dtype, is_scalar
from typing import TYPE_CHECKING, Any, Generic, Literal, Self, cast, final, overload
from pandas.core.accessor import DirNamesMixin
class PandasObject(DirNamesMixin):
"""
Base class for various pandas objects.
"""
_cache: dict[str, Any]
... |
class PandasObject(DirNamesMixin):
'''
Base class for various pandas objects.
'''
@property
def _constructor(self) -> type[Self]:
'''
Class constructor (for this class it's just `__class__`).
'''
pass
def __repr__(self) -> str:
'''
Return a s... | 6 | 5 | 8 | 0 | 4 | 4 | 2 | 0.95 | 1 | 5 | 0 | 0 | 4 | 0 | 4 | 7 | 45 | 6 | 20 | 8 | 14 | 19 | 18 | 7 | 13 | 3 | 1 | 1 | 8 |
7,285 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/base.py | pandas.core.base.SelectionMixin | from pandas.core.dtypes.generic import ABCDataFrame, ABCIndex, ABCMultiIndex, ABCSeries
from typing import TYPE_CHECKING, Any, Generic, Literal, Self, cast, final, overload
from pandas._typing import AxisInt, DtypeObj, IndexLabel, NDFrameT, Shape, npt
import numpy as np
from pandas.errors import AbstractMethodError
fro... |
class SelectionMixin(Generic[NDFrameT]):
'''
mixin implementing the selection & aggregation interface on a group-like
object sub-classes need to define: obj, exclusions
'''
@final
@property
def _selection_list(self):
pass
@cache_readonly
def _selected_obj(self):
... | 17 | 3 | 9 | 1 | 6 | 2 | 2 | 0.37 | 1 | 9 | 0 | 0 | 8 | 0 | 8 | 10 | 101 | 15 | 63 | 21 | 46 | 23 | 47 | 16 | 38 | 5 | 1 | 2 | 19 |
7,286 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/computation/engines.py | pandas.core.computation.engines.AbstractEngine | from pandas.core.computation.align import align_terms, reconstruct_object
import abc
from pandas.io.formats import printing
class AbstractEngine(metaclass=abc.ABCMeta):
"""Object serving as a base class for all engines."""
has_neg_frac = False
def __init__(self, expr) -> None:
self.expr = expr
... |
class AbstractEngine(metaclass=abc.ABCMeta):
'''Object serving as a base class for all engines.'''
def __init__(self, expr) -> None:
pass
def convert(self) -> str:
'''
Convert an expression for evaluation.
Defaults to return the expression as a string.
'''
... | 8 | 4 | 11 | 1 | 5 | 5 | 1 | 0.96 | 1 | 2 | 0 | 2 | 5 | 4 | 5 | 25 | 65 | 12 | 27 | 14 | 19 | 26 | 17 | 12 | 11 | 2 | 3 | 1 | 6 |
7,287 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/computation/engines.py | pandas.core.computation.engines.NumExprEngine | class NumExprEngine(AbstractEngine):
"""NumExpr engine class"""
has_neg_frac = True
def _evaluate(self):
import numexpr as ne
s = self.convert()
env = self.expr.env
scope = env.full_scope
_check_ne_builtin_clash(self.expr)
return ne.evaluate(s, local_dict=sco... | class NumExprEngine(AbstractEngine):
'''NumExpr engine class'''
def _evaluate(self):
pass | 2 | 1 | 10 | 2 | 7 | 1 | 1 | 0.22 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 26 | 15 | 4 | 9 | 7 | 6 | 2 | 9 | 7 | 6 | 1 | 4 | 0 | 1 |
7,288 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/computation/engines.py | pandas.core.computation.engines.PythonEngine | class PythonEngine(AbstractEngine):
"""
Evaluate an expression in Python space.
Mostly for testing purposes.
"""
has_neg_frac = False
def evaluate(self):
return self.expr()
def _evaluate(self) -> None:
pass | class PythonEngine(AbstractEngine):
'''
Evaluate an expression in Python space.
Mostly for testing purposes.
'''
def evaluate(self):
pass
def _evaluate(self) -> None:
pass | 3 | 1 | 2 | 0 | 2 | 0 | 1 | 0.67 | 1 | 0 | 0 | 0 | 2 | 0 | 2 | 27 | 14 | 4 | 6 | 4 | 3 | 4 | 6 | 4 | 3 | 1 | 4 | 0 | 2 |
7,289 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/computation/expr.py | pandas.core.computation.expr.BaseExprVisitor | from pandas.core.computation.ops import ARITH_OPS_SYMS, BOOL_OPS_SYMS, CMP_OPS_SYMS, LOCAL_TAG, MATHOPS, REDUCTIONS, UNARY_OPS_SYMS, BinOp, Constant, FuncNode, Op, Term, UnaryOp, is_term
import ast
from keyword import iskeyword
from pandas.errors import UndefinedVariableError
from functools import partial, reduce
impor... | @disallow(_unsupported_nodes)
@add_ops(_op_classes)
class BaseExprVisitor(ast.NodeVisitor):
'''
Custom ast walker. Parsers of other engines should subclass this class
if necessary.
Parameters
----------
env : Scope
engine : str
parser : str
preparser : callable
'''
def __ini... | 31 | 4 | 12 | 1 | 9 | 1 | 3 | 0.18 | 1 | 13 | 0 | 2 | 27 | 5 | 27 | 30 | 404 | 66 | 289 | 105 | 251 | 51 | 215 | 96 | 185 | 12 | 2 | 3 | 71 |
7,290 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/computation/expr.py | pandas.core.computation.expr.Expr | from pandas.core.computation.ops import ARITH_OPS_SYMS, BOOL_OPS_SYMS, CMP_OPS_SYMS, LOCAL_TAG, MATHOPS, REDUCTIONS, UNARY_OPS_SYMS, BinOp, Constant, FuncNode, Op, Term, UnaryOp, is_term
from pandas.core.computation.scope import Scope
import pandas.core.common as com
from pandas.io.formats import printing
class Expr:
... |
class Expr:
'''
Object encapsulating an expression.
Parameters
----------
expr : str
engine : str, optional, default 'numexpr'
parser : str, optional, default 'pandas'
env : Scope, optional, default None
level : int, optional, default 2
'''
def __init__(self, expr, engi... | 10 | 3 | 5 | 0 | 4 | 1 | 1 | 0.47 | 0 | 4 | 0 | 0 | 7 | 3 | 7 | 7 | 59 | 9 | 34 | 20 | 17 | 16 | 25 | 11 | 17 | 2 | 0 | 1 | 8 |
7,291 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/computation/expr.py | pandas.core.computation.expr.PandasExprVisitor | from pandas.core.computation.parsing import clean_backtick_quoted_toks, tokenize_string
from functools import partial, reduce
@disallow((_unsupported_nodes | _python_not_supported) - (_boolop_nodes | frozenset(['BoolOp', 'Attribute', 'In', 'NotIn', 'Tuple'])))
class PandasExprVisitor(BaseExprVisitor):
def __init_... | @disallow((_unsupported_nodes | _python_not_supported) - (_boolop_nodes | frozenset(['BoolOp', 'Attribute', 'In', 'NotIn', 'Tuple'])))
class PandasExprVisitor(BaseExprVisitor):
def __init__(self, env, engine, parser, preparser=partial(_preparse, f=_compose(_replace_locals, _replace_booleans, clean_backtick_quoted_... | 3 | 0 | 11 | 0 | 11 | 0 | 1 | 0 | 1 | 2 | 0 | 0 | 1 | 0 | 1 | 31 | 12 | 0 | 12 | 11 | 1 | 0 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
7,292 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/computation/expr.py | pandas.core.computation.expr.PythonExprVisitor | @disallow(_unsupported_nodes | _python_not_supported | frozenset(['Not']))
class PythonExprVisitor(BaseExprVisitor):
def __init__(self, env, engine, parser, preparser=lambda source, f=None: source) -> None:
super().__init__(env, engine, parser, preparser=preparser) | @disallow(_unsupported_nodes | _python_not_supported | frozenset(['Not']))
class PythonExprVisitor(BaseExprVisitor):
def __init__(self, env, engine, parser, preparser=lambda source, f=None: source) -> None:
pass | 3 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 31 | 5 | 0 | 5 | 4 | 1 | 0 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
7,293 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/computation/ops.py | pandas.core.computation.ops.BinOp | import numpy as np
from pandas.io.formats.printing import pprint_thing, pprint_thing_encoded
from functools import partial
from pandas._libs.tslibs import Timestamp
from pandas.core.computation.common import ensure_decoded, result_type_many
class BinOp(Op):
"""
Hold a binary operator and its operands.
Par... |
class BinOp(Op):
'''
Hold a binary operator and its operands.
Parameters
----------
op : str
lhs : Term or Op
rhs : Term or Op
'''
def __init__(self, op: str, lhs, rhs) -> None:
pass
def __call__(self, env):
'''
Recursively evaluate an expression in Pyt... | 7 | 4 | 24 | 3 | 15 | 5 | 3 | 0.47 | 1 | 11 | 0 | 0 | 5 | 4 | 5 | 13 | 150 | 24 | 86 | 26 | 78 | 40 | 60 | 24 | 52 | 7 | 1 | 2 | 17 |
7,294 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/computation/ops.py | pandas.core.computation.ops.Constant | class Constant(Term):
def _resolve_name(self):
return self._name
@property
def name(self):
return self.value
def __repr__(self) -> str:
return repr(self.name) | class Constant(Term):
def _resolve_name(self):
pass
@property
def name(self):
pass
def __repr__(self) -> str:
pass | 5 | 0 | 3 | 0 | 2 | 1 | 1 | 0.25 | 1 | 1 | 0 | 0 | 3 | 0 | 3 | 19 | 12 | 2 | 8 | 5 | 3 | 2 | 7 | 4 | 3 | 1 | 1 | 0 | 3 |
7,295 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/computation/ops.py | pandas.core.computation.ops.FuncNode | import numpy as np
class FuncNode:
def __init__(self, name: str) -> None:
if name not in MATHOPS:
raise ValueError(f'"{name}" is not a supported function')
self.name = name
self.func = getattr(np, name)
def __call__(self, *args) -> MathCall:
return MathCall(self, a... |
class FuncNode:
def __init__(self, name: str) -> None:
pass
def __call__(self, *args) -> MathCall:
pass | 3 | 0 | 4 | 0 | 4 | 0 | 2 | 0 | 0 | 3 | 1 | 0 | 2 | 2 | 2 | 2 | 9 | 1 | 8 | 5 | 5 | 0 | 8 | 5 | 5 | 2 | 0 | 1 | 3 |
7,296 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/computation/ops.py | pandas.core.computation.ops.MathCall | from pandas.io.formats.printing import pprint_thing, pprint_thing_encoded
class MathCall(Op):
def __init__(self, func, args) -> None:
super().__init__(func.name, args)
self.func = func
def __call__(self, env):
operands = [op(env) for op in self.operands]
return self.func.func(... |
class MathCall(Op):
def __init__(self, func, args) -> None:
pass
def __call__(self, env):
pass
def __repr__(self) -> str:
pass | 4 | 0 | 3 | 0 | 3 | 1 | 1 | 0.2 | 1 | 3 | 0 | 0 | 3 | 1 | 3 | 11 | 13 | 2 | 10 | 7 | 6 | 2 | 10 | 7 | 6 | 1 | 1 | 0 | 3 |
7,297 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/computation/ops.py | pandas.core.computation.ops.Op | from datetime import datetime
import pandas.core.common as com
import numpy as np
from pandas.io.formats.printing import pprint_thing, pprint_thing_encoded
from pandas.core.computation.common import ensure_decoded, result_type_many
class Op:
"""
Hold an operator of arbitrary arity.
"""
op: str
def... |
class Op:
'''
Hold an operator of arbitrary arity.
'''
def __init__(self, op: str, operands: Iterable[Term | Op], encoding=None) -> None:
pass
def __iter__(self) -> Iterator:
pass
def __repr__(self) -> str:
'''
Print a generic n-ary operator and its operands u... | 14 | 2 | 4 | 0 | 3 | 1 | 1 | 0.24 | 0 | 9 | 1 | 3 | 8 | 2 | 8 | 8 | 52 | 10 | 34 | 20 | 20 | 8 | 29 | 15 | 20 | 2 | 0 | 1 | 10 |
7,298 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/computation/ops.py | pandas.core.computation.ops.Term | from pandas.io.formats.printing import pprint_thing, pprint_thing_encoded
import numpy as np
from pandas.core.dtypes.common import is_list_like, is_scalar
from pandas.core.computation.scope import DEFAULT_GLOBALS
from datetime import datetime
class Term:
def __new__(cls, name, env, side=None, encoding=None):
... |
class Term:
def __new__(cls, name, env, side=None, encoding=None):
pass
def __init__(self, name, env, side=None, encoding=None) -> None:
pass
@property
def local_name(self) -> str:
pass
def __repr__(self) -> str:
pass
def __call__(self, *args, **kwargs):
... | 26 | 1 | 5 | 0 | 4 | 1 | 1 | 0.17 | 0 | 9 | 1 | 1 | 16 | 5 | 16 | 16 | 113 | 23 | 77 | 40 | 51 | 13 | 64 | 31 | 47 | 3 | 0 | 2 | 23 |
7,299 | pandas-dev/pandas | pandas-dev_pandas/pandas/core/computation/ops.py | pandas.core.computation.ops.UnaryOp | from pandas.io.formats.printing import pprint_thing, pprint_thing_encoded
from typing import TYPE_CHECKING, Literal
import numpy as np
class UnaryOp(Op):
"""
Hold a unary operator and its operands.
Parameters
----------
op : str
The token used to represent the operator.
operand : Term ... |
class UnaryOp(Op):
'''
Hold a unary operator and its operands.
Parameters
----------
op : str
The token used to represent the operator.
operand : Term or Op
The Term or Op operand to the operator.
Raises
------
ValueError
* If no function associated with the ... | 6 | 1 | 6 | 0 | 6 | 1 | 2 | 0.6 | 1 | 5 | 1 | 0 | 4 | 2 | 4 | 12 | 46 | 7 | 25 | 11 | 19 | 15 | 20 | 9 | 15 | 3 | 1 | 1 | 7 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.