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,300
pandas-dev/pandas
pandas-dev_pandas/pandas/core/computation/parsing.py
pandas.core.computation.parsing.ParseState
from enum import Enum class ParseState(Enum): DEFAULT = 0 IN_BACKTICK = 1 IN_SINGLE_QUOTE = 2 IN_DOUBLE_QUOTE = 3
class ParseState(Enum): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
49
5
0
5
5
4
0
5
5
4
0
4
0
0
7,301
pandas-dev/pandas
pandas-dev_pandas/pandas/core/computation/pytables.py
pandas.core.computation.pytables.BinOp
from pandas.core.computation.common import ensure_decoded from pandas.core.dtypes.common import is_list_like import numpy as np from decimal import Decimal, InvalidOperation from pandas.core.computation.ops import is_term from pandas._libs.tslibs import Timedelta, Timestamp from pandas.io.formats.printing import pprint...
class BinOp(ops.BinOp): def __init__(self, op: str, lhs, rhs, queryables: dict[str, Any], encoding) -> None: pass def _disallow_scalar_only_bool_ops(self) -> None: pass def prune(self, klass): pass def prune(self, klass): '''create and return a new specialized BinOp ...
20
9
13
1
11
1
3
0.13
1
16
5
2
12
2
12
25
174
21
135
31
115
18
97
25
82
14
2
2
44
7,302
pandas-dev/pandas
pandas-dev_pandas/pandas/core/computation/pytables.py
pandas.core.computation.pytables.ConditionBinOp
from typing import TYPE_CHECKING, Any, ClassVar, Self from pandas.io.formats.printing import pprint_thing, pprint_thing_encoded class ConditionBinOp(BinOp): def __repr__(self) -> str: return pprint_thing(f'[Condition : [{self.condition}]]') def invert(self): """invert the condition""" ...
class ConditionBinOp(BinOp): def __repr__(self) -> str: pass def invert(self): '''invert the condition''' pass def format(self): '''return the actual ne format''' pass def evaluate(self) -> Self | None: pass
5
2
10
1
6
3
2
0.44
1
3
0
1
4
2
4
29
43
8
25
10
20
11
21
9
16
5
3
2
8
7,303
pandas-dev/pandas
pandas-dev_pandas/pandas/core/computation/pytables.py
pandas.core.computation.pytables.Constant
class Constant(Term): def __init__(self, name, env: PyTablesScope, side=None, encoding=None) -> None: assert isinstance(env, PyTablesScope), type(env) super().__init__(name, env, side=side, encoding=encoding) def _resolve_name(self): return self._name
class Constant(Term): def __init__(self, name, env: PyTablesScope, side=None, encoding=None) -> None: pass def _resolve_name(self): pass
3
0
3
0
3
0
1
0
1
3
1
0
2
0
2
22
7
1
6
3
3
0
6
3
3
1
2
0
2
7,304
pandas-dev/pandas
pandas-dev_pandas/pandas/core/computation/pytables.py
pandas.core.computation.pytables.FilterBinOp
from pandas.core.indexes.base import Index from pandas.io.formats.printing import pprint_thing, pprint_thing_encoded from typing import TYPE_CHECKING, Any, ClassVar, Self class FilterBinOp(BinOp): filter: tuple[Any, Any, Index] | None = None def __repr__(self) -> str: if self.filter is None: ...
class FilterBinOp(BinOp): def __repr__(self) -> str: pass def invert(self) -> Self: '''invert the filter''' pass def format(self): '''return the actual filter format''' pass def evaluate(self) -> Self | None: pass def generate_filter_op(self, inv...
6
2
10
1
8
1
2
0.15
1
6
0
1
5
1
5
30
56
11
40
11
34
6
32
10
26
5
3
2
12
7,305
pandas-dev/pandas
pandas-dev_pandas/pandas/core/computation/pytables.py
pandas.core.computation.pytables.JointConditionBinOp
from typing import TYPE_CHECKING, Any, ClassVar, Self class JointConditionBinOp(ConditionBinOp): def evaluate(self) -> Self: self.condition = f'({self.lhs.condition} {self.op} {self.rhs.condition})' return self
class JointConditionBinOp(ConditionBinOp): def evaluate(self) -> Self: pass
2
0
3
0
3
1
1
0.5
1
0
0
0
1
1
1
30
5
0
4
3
2
2
4
3
2
1
4
0
1
7,306
pandas-dev/pandas
pandas-dev_pandas/pandas/core/computation/pytables.py
pandas.core.computation.pytables.JointFilterBinOp
from typing import TYPE_CHECKING, Any, ClassVar, Self class JointFilterBinOp(FilterBinOp): def format(self): raise NotImplementedError('unable to collapse Joint Filters') def evaluate(self) -> Self: return self
class JointFilterBinOp(FilterBinOp): def format(self): pass def evaluate(self) -> Self: pass
3
0
2
0
2
1
1
0.4
1
1
0
0
2
0
2
32
7
1
5
3
2
2
5
3
2
1
4
0
2
7,307
pandas-dev/pandas
pandas-dev_pandas/pandas/core/computation/pytables.py
pandas.core.computation.pytables.PyTablesExpr
from typing import TYPE_CHECKING, Any, ClassVar, Self from pandas.io.formats.printing import pprint_thing, pprint_thing_encoded import pandas.core.common as com from pandas.core.computation import expr, ops, scope as _scope from pandas.core.dtypes.common import is_list_like class PyTablesExpr(expr.Expr): """ H...
class PyTablesExpr(expr.Expr): ''' Hold a pytables-like expression, comprised of possibly multiple 'terms'. Parameters ---------- where : string term expression, PyTablesExpr, or list-like of PyTablesExprs queryables : a "kinds" map (dict of column name -> kind), or None if column is no...
4
2
23
2
20
1
4
0.41
1
13
4
0
3
5
3
10
103
14
63
19
53
26
42
12
38
6
1
3
11
7,308
pandas-dev/pandas
pandas-dev_pandas/pandas/core/computation/pytables.py
pandas.core.computation.pytables.PyTablesExprVisitor
from pandas.core.computation import expr, ops, scope as _scope import ast from functools import partial from typing import TYPE_CHECKING, Any, ClassVar, Self from pandas.core.computation.expr import BaseExprVisitor class PyTablesExprVisitor(BaseExprVisitor): const_type: ClassVar[type[ops.Term]] = Constant term...
class PyTablesExprVisitor(BaseExprVisitor): def __init__(self, env, engine, parser, **kwargs) -> None: pass def visit_UnaryOp(self, node, **kwargs) -> ops.Term | UnaryOp | None: pass def visit_Index(self, node, **kwargs): pass def visit_Assign(self, node, **kwargs): ...
9
0
9
1
7
1
3
0.1
1
11
3
0
8
0
8
38
81
15
60
21
51
6
52
20
43
5
3
3
20
7,309
pandas-dev/pandas
pandas-dev_pandas/pandas/core/computation/pytables.py
pandas.core.computation.pytables.PyTablesScope
from typing import TYPE_CHECKING, Any, ClassVar, Self from pandas.core.computation import expr, ops, scope as _scope class PyTablesScope(_scope.Scope): __slots__ = ('queryables',) queryables: dict[str, Any] def __init__(self, level: int, global_dict=None, local_dict=None, queryables: dict[str, Any] | None...
class PyTablesScope(_scope.Scope): def __init__(self, level: int, global_dict=None, local_dict=None, queryables: dict[str, Any] | None=None) -> None: pass
2
0
9
0
9
0
1
0
1
5
0
0
1
0
1
11
14
2
12
9
4
0
6
3
4
1
1
0
1
7,310
pandas-dev/pandas
pandas-dev_pandas/pandas/core/computation/pytables.py
pandas.core.computation.pytables.Term
from pandas.core.computation import expr, ops, scope as _scope from pandas.errors import UndefinedVariableError class Term(ops.Term): env: PyTablesScope def __new__(cls, name, env, side=None, encoding=None): if isinstance(name, str): klass = cls else: klass = Constant ...
class Term(ops.Term): def __new__(cls, name, env, side=None, encoding=None): pass def __init__(self, name, env: PyTablesScope, side=None, encoding=None) -> None: pass def _resolve_name(self): pass @property def value(self): pass
6
0
6
0
5
1
2
0.23
1
7
2
1
4
1
4
20
31
5
22
8
16
5
20
6
15
4
1
2
8
7,311
pandas-dev/pandas
pandas-dev_pandas/pandas/core/computation/pytables.py
pandas.core.computation.pytables.TermValue
class TermValue: """hold a term value the we use to construct a condition/filter""" def __init__(self, value, converted, kind: str) -> None: assert isinstance(kind, str), kind self.value = value self.converted = converted self.kind = kind def tostring(self, encoding) -> str...
class TermValue: '''hold a term value the we use to construct a condition/filter''' def __init__(self, value, converted, kind: str) -> None: pass def tostring(self, encoding) -> str: '''quote the string if not encoded else encode and return''' pass
3
2
8
0
7
2
3
0.29
0
1
0
0
2
3
2
2
20
2
14
6
11
4
13
6
10
4
0
2
5
7,312
pandas-dev/pandas
pandas-dev_pandas/pandas/core/computation/pytables.py
pandas.core.computation.pytables.UnaryOp
from pandas.core.computation import expr, ops, scope as _scope class UnaryOp(ops.UnaryOp): def prune(self, klass): if self.op != '~': raise NotImplementedError('UnaryOp only support invert type ops') operand = self.operand operand = operand.prune(klass) if operand is no...
class UnaryOp(ops.UnaryOp): def prune(self, klass): pass
2
0
17
2
15
0
3
0
1
3
2
0
1
0
1
13
18
2
16
3
14
0
9
3
7
3
2
1
3
7,313
pandas-dev/pandas
pandas-dev_pandas/pandas/core/computation/scope.py
pandas.core.computation.scope.DeepChainMap
from collections import ChainMap class DeepChainMap(ChainMap[_KT, _VT]): """ Variant of ChainMap that allows direct updates to inner scopes. Only works when all passed mapping are mutable. """ def __setitem__(self, key: _KT, value: _VT) -> None: for mapping in self.maps: if ke...
class DeepChainMap(ChainMap[_KT, _VT]): ''' Variant of ChainMap that allows direct updates to inner scopes. Only works when all passed mapping are mutable. ''' def __setitem__(self, key: _KT, value: _VT) -> None: pass def __delitem__(self, key: _KT) -> None: ''' Raises...
3
2
9
0
6
3
3
0.77
1
1
0
0
2
0
2
64
26
3
13
5
10
10
13
5
10
3
8
2
6
7,314
pandas-dev/pandas
pandas-dev_pandas/pandas/core/computation/scope.py
pandas.core.computation.scope.Scope
import inspect from pandas.errors import UndefinedVariableError import sys import itertools class Scope: """ Object to hold scope, with a few bells to deal with some custom syntax and contexts added by pandas. Parameters ---------- level : int global_dict : dict or None, optional, default ...
class Scope: ''' Object to hold scope, with a few bells to deal with some custom syntax and contexts added by pandas. Parameters ---------- level : int global_dict : dict or None, optional, default None local_dict : dict or Scope or None, optional, default None resolvers : list-like...
14
9
20
2
8
9
2
1.16
0
10
1
0
10
1
10
10
235
36
92
33
76
107
79
27
68
7
0
2
24
7,315
pandas-dev/pandas
pandas-dev_pandas/pandas/core/dtypes/base.py
pandas.core.dtypes.base.ExtensionDtype
from pandas.errors import AbstractMethodError import numpy as np from typing import TYPE_CHECKING, Any, Self, TypeVar, cast, overload from pandas._libs.properties import cache_readonly from pandas._libs.hashtable import object_hash from pandas.core.dtypes.generic import ABCDataFrame, ABCIndex, ABCSeries class Extensio...
class ExtensionDtype: ''' A custom data type, to be paired with an ExtensionArray. This enables support for third-party and custom dtypes within the pandas ecosystem. By implementing this interface and pairing it with a custom `ExtensionArray`, users can create rich data types that integrate cleanl...
36
19
14
2
4
9
2
2.55
0
12
0
1
18
0
21
21
402
75
92
40
54
235
70
25
47
6
0
2
32
7,316
pandas-dev/pandas
pandas-dev_pandas/pandas/core/dtypes/base.py
pandas.core.dtypes.base.Registry
from typing import TYPE_CHECKING, Any, Self, TypeVar, cast, overload class Registry: """ Registry for dtype inference. The registry allows one to map a string repr of a extension dtype to an extension dtype. The string alias can be used in several places, including * Series and Index construc...
class Registry: ''' Registry for dtype inference. The registry allows one to map a string repr of a extension dtype to an extension dtype. The string alias can be used in several places, including * Series and Index constructors * :meth:`pandas.array` * :meth:`pandas.Series.astype` ...
12
3
7
1
4
2
2
0.74
0
6
1
0
7
1
7
7
76
15
35
17
23
26
30
9
22
6
0
2
13
7,317
pandas-dev/pandas
pandas-dev_pandas/pandas/core/dtypes/base.py
pandas.core.dtypes.base.StorageExtensionDtype
from pandas._libs import missing as libmissing class StorageExtensionDtype(ExtensionDtype): """ExtensionDtype that may be backed by more than one implementation.""" name: str _metadata = ('storage',) def __init__(self, storage: str | None=None) -> None: self.storage = storage def __repr__...
class StorageExtensionDtype(ExtensionDtype): '''ExtensionDtype that may be backed by more than one implementation.''' def __init__(self, storage: str | None=None) -> None: pass def __repr__(self) -> str: pass def __str__(self) -> str: pass def __eq__(self, other: object)...
8
1
3
0
2
0
1
0.11
1
5
0
0
6
1
6
27
27
7
18
10
10
2
17
9
10
2
1
1
7
7,318
pandas-dev/pandas
pandas-dev_pandas/pandas/core/dtypes/dtypes.py
pandas.core.dtypes.dtypes.ArrowDtype
from pandas.compat import HAS_PYARROW, PYARROW_MIN_VERSION from datetime import date, datetime, time, timedelta from pandas.core.dtypes.base import ExtensionDtype, StorageExtensionDtype, register_extension_dtype from pandas._libs.tslibs import BaseOffset, NaT, NaTType, Period, Timedelta, Timestamp, timezones, to_offset...
@register_extension_dtype @set_module('pandas') class ArrowDtype(StorageExtensionDtype): ''' An ExtensionDtype for PyArrow data types. .. warning:: ArrowDtype is considered experimental. The implementation and parts of the API may change without warning. While most ``dtype`` arguments can ...
28
11
15
1
10
4
4
0.56
1
21
1
0
13
1
16
43
308
39
175
45
146
98
121
34
102
20
2
3
56
7,319
pandas-dev/pandas
pandas-dev_pandas/pandas/core/dtypes/dtypes.py
pandas.core.dtypes.dtypes.BaseMaskedDtype
import numpy as np from pandas._libs import lib, missing as libmissing from pandas._libs.properties import cache_readonly from pandas.core.dtypes.base import ExtensionDtype, StorageExtensionDtype, register_extension_dtype class BaseMaskedDtype(ExtensionDtype): """ Base class for dtypes for BaseMaskedArray subc...
class BaseMaskedDtype(ExtensionDtype): ''' Base class for dtypes for BaseMaskedArray subclasses. ''' @property def _truthy_value(self): pass @property def _falsey_value(self): pass @property def na_value(self) -> libmissing.NAType: pass @cache_readonl...
17
5
8
1
5
2
2
0.32
1
8
0
0
7
0
9
30
94
15
60
24
38
19
44
16
30
4
1
1
19
7,320
pandas-dev/pandas
pandas-dev_pandas/pandas/core/dtypes/dtypes.py
pandas.core.dtypes.dtypes.CategoricalDtype
from typing import TYPE_CHECKING, Any, Self, cast from pandas.core.dtypes.inference import is_bool, is_list_like import numpy as np from pandas.util._decorators import set_module from pandas._libs.properties import cache_readonly from pandas.core.dtypes.generic import ABCCategoricalIndex, ABCIndex, ABCRangeIndex from p...
@register_extension_dtype @set_module('pandas') class CategoricalDtype(PandasExtensionDtype, ExtensionDtype): ''' Type for categorical data with the categories and orderedness. It is a dtype representation for categorical data, which allows users to define a fixed set of values and optionally impose an ...
34
10
23
3
10
10
3
1.03
2
16
2
0
13
2
20
45
547
80
230
82
177
238
159
56
132
10
2
4
69
7,321
pandas-dev/pandas
pandas-dev_pandas/pandas/core/dtypes/dtypes.py
pandas.core.dtypes.dtypes.CategoricalDtypeType
class CategoricalDtypeType(type): """ the type of CategoricalDtype, this metaclass determines subclass ability """
class CategoricalDtypeType(type): ''' the type of CategoricalDtype, this metaclass determines subclass ability ''' pass
1
1
0
0
0
0
0
3
1
0
0
0
0
0
0
13
4
0
1
1
0
3
1
1
0
0
2
0
0
7,322
pandas-dev/pandas
pandas-dev_pandas/pandas/core/dtypes/dtypes.py
pandas.core.dtypes.dtypes.DatetimeTZDtype
from pandas.core.dtypes.base import ExtensionDtype, StorageExtensionDtype, register_extension_dtype from typing import TYPE_CHECKING, Any, Self, cast from pandas._libs.tslibs import BaseOffset, NaT, NaTType, Period, Timedelta, Timestamp, timezones, to_offset, tz_compare import numpy as np import re from pandas._libs.ts...
@register_extension_dtype @set_module('pandas') class DatetimeTZDtype(PandasExtensionDtype): ''' An ExtensionDtype for timezone-aware datetime data. **This is not an actual numpy dtype**, but a duck type. Parameters ---------- unit : str, default "ns" The precision of the datetime data. ...
29
8
11
1
5
5
2
1.01
1
13
0
0
15
2
17
42
265
47
110
51
78
111
88
40
66
8
2
2
31
7,323
pandas-dev/pandas
pandas-dev_pandas/pandas/core/dtypes/dtypes.py
pandas.core.dtypes.dtypes.IntervalDtype
import re from pandas.util._decorators import set_module from pandas._libs.properties import cache_readonly from pandas._libs.interval import Interval from pandas.core.dtypes.base import ExtensionDtype, StorageExtensionDtype, register_extension_dtype from typing import TYPE_CHECKING, Any, Self, cast import numpy as np ...
@register_extension_dtype @set_module('pandas') class IntervalDtype(PandasExtensionDtype): ''' An ExtensionDtype for Interval data. **This is not an actual numpy dtype**, but a duck type. Parameters ---------- subtype : str, np.dtype The dtype of the Interval bounds. closed : {'right...
25
6
14
1
10
3
3
0.38
1
12
1
0
12
0
15
40
277
42
172
55
139
65
124
43
102
13
2
6
47
7,324
pandas-dev/pandas
pandas-dev_pandas/pandas/core/dtypes/dtypes.py
pandas.core.dtypes.dtypes.NumpyEADtype
import numpy as np from pandas.core.dtypes.base import ExtensionDtype, StorageExtensionDtype, register_extension_dtype class NumpyEADtype(ExtensionDtype): """ A Pandas ExtensionDtype for NumPy dtypes. This is mostly for internal compatibility, and is not especially useful on its own. Parameters ...
class NumpyEADtype(ExtensionDtype): ''' A Pandas ExtensionDtype for NumPy dtypes. This is mostly for internal compatibility, and is not especially useful on its own. Parameters ---------- dtype : object Object to be converted to a NumPy data type object. See Also -------- ...
20
7
5
0
3
2
1
0.76
1
7
0
0
9
1
11
32
98
17
46
29
24
35
36
19
23
3
1
2
14
7,325
pandas-dev/pandas
pandas-dev_pandas/pandas/core/dtypes/dtypes.py
pandas.core.dtypes.dtypes.PandasExtensionDtype
from typing import TYPE_CHECKING, Any, Self, cast from pandas.core.dtypes.base import ExtensionDtype, StorageExtensionDtype, register_extension_dtype class PandasExtensionDtype(ExtensionDtype): """ A np.dtype duck-typed class, suitable for holding a custom dtype. THIS IS NOT A REAL NUMPY DTYPE """ ...
class PandasExtensionDtype(ExtensionDtype): ''' A np.dtype duck-typed class, suitable for holding a custom dtype. THIS IS NOT A REAL NUMPY DTYPE ''' def __repr__(self) -> str_type: ''' Return a string representation for a particular object. ''' pass def __hash_...
6
3
3
0
2
1
1
0.62
1
5
0
4
3
0
4
25
40
6
21
14
15
13
20
13
15
1
1
0
4
7,326
pandas-dev/pandas
pandas-dev_pandas/pandas/core/dtypes/dtypes.py
pandas.core.dtypes.dtypes.PeriodDtype
from typing import TYPE_CHECKING, Any, Self, cast from pandas.util._exceptions import find_stack_level from pandas._libs.tslibs import BaseOffset, NaT, NaTType, Period, Timedelta, Timestamp, timezones, to_offset, tz_compare import numpy as np import re from pandas._libs.tslibs.dtypes import PeriodDtypeBase, abbrev_to_n...
@register_extension_dtype @set_module('pandas') class PeriodDtype(PeriodDtypeBase, PandasExtensionDtype): ''' An ExtensionDtype for Period data. **This is not an actual numpy dtype**, but a duck type. Parameters ---------- freq : str or DateOffset The frequency of this PeriodDtype. A...
24
7
12
1
7
4
2
0.71
2
11
0
0
10
0
14
39
236
38
118
51
88
84
95
41
75
5
2
3
32
7,327
pandas-dev/pandas
pandas-dev_pandas/pandas/core/dtypes/dtypes.py
pandas.core.dtypes.dtypes.SparseDtype
import warnings from pandas._libs import lib, missing as libmissing from pandas.core.dtypes.base import ExtensionDtype, StorageExtensionDtype, register_extension_dtype from pandas._config.config import get_option from typing import TYPE_CHECKING, Any, Self, cast from pandas.util._exceptions import find_stack_level impo...
@register_extension_dtype @set_module('pandas') class SparseDtype(ExtensionDtype): ''' Dtype for data stored in :class:`SparseArray`. ``SparseDtype`` is used as the data type for :class:`SparseArray`, enabling more efficient storage of data that contains a significant number of repetitive values typ...
35
8
17
2
9
6
2
0.91
1
16
0
0
16
2
20
41
438
76
190
75
139
173
134
55
102
6
1
3
47
7,328
pandas-dev/pandas
pandas-dev_pandas/pandas/core/flags.py
pandas.core.flags.Flags
import weakref class Flags: """ Flags that apply to pandas objects. “Flags” differ from “metadata”. Flags reflect properties of the pandas object (the Series or DataFrame). Metadata refer to properties of the dataset, and should be stored in DataFrame.attrs. Parameters ---------- obj ...
class Flags: ''' Flags that apply to pandas objects. “Flags” differ from “metadata”. Flags reflect properties of the pandas object (the Series or DataFrame). Metadata refer to properties of the dataset, and should be stored in DataFrame.attrs. Parameters ---------- obj : Series or DataF...
10
2
8
1
4
3
2
1.94
0
7
0
0
7
2
7
7
117
23
32
15
22
62
30
13
22
4
0
2
13
7,329
pandas-dev/pandas
pandas-dev_pandas/pandas/core/frame.py
pandas.core.frame.DataFrame
from pandas.util._decorators import Appender, Substitution, deprecate_nonkeyword_arguments, doc, set_module from pandas.core.indexes.api import DatetimeIndex, Index, PeriodIndex, default_index, ensure_index, ensure_index_from_sequences from pandas.core.dtypes.dtypes import ArrowDtype, BaseMaskedDtype, ExtensionDtype fr...
null
465
115
41
5
16
21
3
1.15
2
75
0
0
267
0
270
556
13,312
1,912
5,327
2,582
3,269
6,122
2,221
771
1,899
34
3
5
845
7,330
pandas-dev/pandas
pandas-dev_pandas/pandas/core/generic.py
pandas.core.generic.NDFrame
from pandas.io.formats.printing import pprint_thing import sys from pandas.util._decorators import deprecate_kwarg, doc import re from pandas.core.array_algos.replace import should_use_regex from pandas.io.formats.format import DataFrameFormatter, DataFrameRenderer from pandas.errors.cow import _chained_assignment_meth...
null
491
106
44
5
15
24
3
1.49
2
63
0
0
233
4
240
251
11,564
1,607
4,016
1,896
2,411
5,983
1,796
579
1,531
30
2
6
713
7,331
pandas-dev/pandas
pandas-dev_pandas/pandas/core/groupby/base.py
pandas.core.groupby.base.OutputKey
import dataclasses @dataclasses.dataclass(order=True, frozen=True) class OutputKey: label: Hashable position: int
@dataclasses.dataclass(order=True, frozen=True) class OutputKey: pass
2
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
3
0
3
1
2
0
3
1
2
0
0
0
0
7,332
pandas-dev/pandas
pandas-dev_pandas/pandas/core/groupby/generic.py
pandas.core.groupby.generic.DataFrameGroupBy
import pandas.core.common as com from pandas.core.util.numba_ import maybe_use_numba from collections.abc import Callable from pandas.core.indexes.api import Index, MultiIndex, all_indexes_same, default_index from pandas.core.dtypes.inference import is_hashable from pandas.core.dtypes.common import ensure_int64, is_boo...
null
43
12
51
6
16
29
3
1.44
1
28
1
0
28
9
28
134
1,697
244
597
199
475
861
269
101
236
13
4
4
90
7,333
pandas-dev/pandas
pandas-dev_pandas/pandas/core/groupby/generic.py
pandas.core.groupby.generic.NamedAgg
from pandas.util._decorators import Appender, Substitution, doc, set_module from typing import TYPE_CHECKING, Any, Literal, NamedTuple, TypeAlias, TypeVar, cast @set_module('pandas') class NamedAgg(NamedTuple): """ Helper for column specific aggregation with control over output column names. Subclass of t...
@set_module('pandas') class NamedAgg(NamedTuple): ''' Helper for column specific aggregation with control over output column names. Subclass of typing.NamedTuple. Parameters ---------- column : Hashable Column label in the DataFrame to apply aggfunc. aggfunc : function or str ...
2
1
0
0
0
0
0
8
1
0
0
0
0
0
0
0
32
5
3
1
2
24
3
1
2
0
1
0
0
7,334
pandas-dev/pandas
pandas-dev_pandas/pandas/core/groupby/generic.py
pandas.core.groupby.generic.SeriesGroupBy
from pandas.core.frame import DataFrame from pandas.core.indexes.api import Index, MultiIndex, all_indexes_same, default_index from collections import abc from pandas.core.dtypes.common import ensure_int64, is_bool, is_dict_like, is_integer_dtype, is_list_like, is_numeric_dtype, is_scalar from typing import TYPE_CHECKI...
@set_module('pandas.api.typing') class SeriesGroupBy(GroupBy[Series]): def _wrap_agged_manager(self, mgr: Manager) -> Series: pass def _get_data_to_aggregate(self, *, numeric_only: bool=False, name: str | None=None) -> SingleBlockManager: pass def apply(self, func, *args, **kwargs) -> Ser...
53
15
43
5
14
23
3
1.34
1
30
0
0
29
0
29
135
1,496
221
547
198
440
732
296
128
259
23
4
2
87
7,335
pandas-dev/pandas
pandas-dev_pandas/pandas/core/groupby/groupby.py
pandas.core.groupby.groupby.BaseGroupBy
from pandas.core.indexes.api import Index, MultiIndex, default_index from pandas._libs import Timestamp, lib from pandas.core.groupby.indexing import GroupByIndexingMixin, GroupByNthSelector import numpy as np import warnings from pandas.core.groupby import base, numba_, ops from pandas.core.dtypes.common import is_boo...
class BaseGroupBy(PandasObject, SelectionMixin[NDFrameT], GroupByIndexingMixin): @final def __len__(self) -> int: pass @final def __repr__(self) -> str: pass @final @property def groups(self) -> dict[Hashable, Index]: ''' Dict {group name -> group labels}. ...
35
6
29
3
8
19
2
1.72
3
17
0
1
14
0
14
37
505
66
163
79
96
280
81
30
65
7
2
3
31
7,336
pandas-dev/pandas
pandas-dev_pandas/pandas/core/groupby/groupby.py
pandas.core.groupby.groupby.GroupBy
from pandas.core.internals.blocks import ensure_block_shape from pandas.core.dtypes.missing import isna, na_value_for_dtype, notna import pandas._libs.groupby as libgroupby from pandas._libs.algos import rank_1d from pandas.core.indexes.api import Index, MultiIndex, default_index from pandas._libs import Timestamp, lib...
class GroupBy(BaseGroupBy[NDFrameT]): ''' Class for grouping and aggregating relational data. See aggregate, transform, and apply functions on this object. It's easiest to use obj.groupby(...) to use GroupBy, but you can also do: :: grouped = groupby(obj, ...) Parameters ---------- ...
187
51
56
7
21
29
3
1.37
1
51
0
0
68
11
68
105
4,630
624
1,699
581
1,188
2,326
805
325
712
13
3
4
256
7,337
pandas-dev/pandas
pandas-dev_pandas/pandas/core/groupby/groupby.py
pandas.core.groupby.groupby.GroupByPlot
from pandas.core.base import PandasObject, SelectionMixin from typing import TYPE_CHECKING, Concatenate, Literal, Self, TypeAlias, TypeVar, Union, cast, final, overload @final class GroupByPlot(PandasObject): """ Class implementing the .plot attribute for groupby objects. """ def __init__(self, groupb...
@final class GroupByPlot(PandasObject): ''' Class implementing the .plot attribute for groupby objects. ''' def __init__(self, groupby: GroupBy) -> None: pass def __call__(self, *args, **kwargs): pass def f(self): pass def __getattr__(self, name: str):...
8
1
4
1
4
0
1
0.21
1
2
1
0
3
1
3
10
23
6
14
8
7
3
14
8
7
1
2
0
6
7,338
pandas-dev/pandas
pandas-dev_pandas/pandas/core/groupby/grouper.py
pandas.core.groupby.grouper.Grouper
from pandas.core.indexes.api import Index, MultiIndex, default_index from pandas.core.groupby import ops from pandas.core.series import Series from typing import TYPE_CHECKING, final import numpy as np class Grouper: """ A Grouper allows the user to specify a groupby instruction for an object. This specif...
null
7
3
27
3
17
8
3
2.2
0
11
0
0
5
6
5
5
338
47
91
37
72
200
62
25
55
11
0
4
16
7,339
pandas-dev/pandas
pandas-dev_pandas/pandas/core/groupby/grouper.py
pandas.core.groupby.grouper.Grouping
from pandas.core.series import Series from pandas.core.indexes.api import Index, MultiIndex, default_index from typing import TYPE_CHECKING, final from pandas.core.groupby import ops import numpy as np from pandas._libs import algos as libalgos from pandas.core.arrays import Categorical, ExtensionArray from pandas.core...
null
27
2
17
2
12
3
3
0.4
0
18
1
0
14
9
14
14
296
39
186
73
149
74
130
51
115
12
0
4
44
7,340
pandas-dev/pandas
pandas-dev_pandas/pandas/core/groupby/indexing.py
pandas.core.groupby.indexing.GroupByIndexingMixin
from collections.abc import Iterable from pandas.util._decorators import cache_readonly, doc import numpy as np from typing import TYPE_CHECKING, Literal, cast from pandas.core.dtypes.common import is_integer, is_list_like class GroupByIndexingMixin: """ Mixin for adding ._positional_selector to GroupBy. "...
class GroupByIndexingMixin: ''' Mixin for adding ._positional_selector to GroupBy. ''' @cache_readonly def _positional_selector(self) -> GroupByPositionalSelector: ''' Return positional selection for each group. ``groupby._positional_selector[i:j]`` is similar to ``g...
12
2
25
5
12
8
4
0.64
0
10
1
0
8
0
8
8
214
45
103
30
88
66
75
24
66
9
0
2
31
7,341
pandas-dev/pandas
pandas-dev_pandas/pandas/core/groupby/indexing.py
pandas.core.groupby.indexing.GroupByNthSelector
from typing import TYPE_CHECKING, Literal, cast class GroupByNthSelector: """ Dynamically substituted for GroupBy.nth to enable both call and index """ def __init__(self, groupby_object: groupby.GroupBy) -> None: self.groupby_object = groupby_object def __call__(self, n: PositionalIndexer...
class GroupByNthSelector: ''' Dynamically substituted for GroupBy.nth to enable both call and index ''' def __init__(self, groupby_object: groupby.GroupBy) -> None: pass def __call__(self, n: PositionalIndexer | tuple, dropna: Literal['any', 'all', None]=None) -> DataFrame | Series: ...
4
1
3
0
3
0
1
0.27
0
3
0
0
3
1
3
3
17
3
11
9
3
3
7
5
3
1
0
0
3
7,342
pandas-dev/pandas
pandas-dev_pandas/pandas/core/groupby/indexing.py
pandas.core.groupby.indexing.GroupByPositionalSelector
from pandas.util._decorators import cache_readonly, doc @doc(GroupByIndexingMixin._positional_selector) class GroupByPositionalSelector: def __init__(self, groupby_object: groupby.GroupBy) -> None: self.groupby_object = groupby_object def __getitem__(self, arg: PositionalIndexer | tuple) -> DataFrame...
@doc(GroupByIndexingMixin._positional_selector) class GroupByPositionalSelector: def __init__(self, groupby_object: groupby.GroupBy) -> None: pass def __getitem__(self, arg: PositionalIndexer | tuple) -> DataFrame | Series: ''' Select by positional index per group. Implements G...
4
1
18
2
3
13
1
4.33
0
3
0
0
2
1
2
2
37
5
6
5
3
26
6
5
3
1
0
0
2
7,343
pandas-dev/pandas
pandas-dev_pandas/pandas/core/groupby/ops.py
pandas.core.groupby.ops.BaseGrouper
from pandas.core.series import Series from pandas.core.dtypes.common import ensure_float64, ensure_int64, ensure_platform_int, ensure_uint64, is_1d_only_ea_dtype from pandas.core.arrays import Categorical from typing import TYPE_CHECKING, Any, Generic, final import numpy as np from pandas.core.frame import DataFrame fr...
class BaseGrouper: ''' This is an internal Grouper class, which actually holds the generated groups Parameters ---------- axis : Index groupings : Sequence[Grouping] all the grouping instances to handle in this grouper for example for grouper list to groupby, need to pass th...
61
10
13
1
10
3
2
0.28
0
26
4
1
30
3
30
30
482
62
330
160
238
92
198
103
167
8
0
3
58
7,344
pandas-dev/pandas
pandas-dev_pandas/pandas/core/groupby/ops.py
pandas.core.groupby.ops.BinGrouper
import collections from pandas._typing import ArrayLike, AxisInt, NDFrameT, Shape, npt from pandas.core.indexes.api import CategoricalIndex, Index, MultiIndex, ensure_index from pandas.core.groupby import grouper from pandas.core.dtypes.common import ensure_float64, ensure_int64, ensure_platform_int, ensure_uint64, is_...
class BinGrouper(BaseGrouper): ''' This is an internal Grouper class Parameters ---------- bins : the split index of binlabels to group the item of axis binlabels : the label list indexer : np.ndarray[np.intp], optional the indexer created by Grouper some groupers (TimeGroup...
24
3
8
1
6
1
2
0.44
1
7
0
0
12
1
12
42
149
27
85
46
57
37
63
31
50
4
1
3
21
7,345
pandas-dev/pandas
pandas-dev_pandas/pandas/core/groupby/ops.py
pandas.core.groupby.ops.DataSplitter
from pandas.errors import AbstractMethodError from pandas.util._decorators import cache_readonly from typing import TYPE_CHECKING, Any, Generic, final from pandas._typing import ArrayLike, AxisInt, NDFrameT, Shape, npt import numpy as np from pandas._libs import NaT, lib class DataSplitter(Generic[NDFrameT]): def...
class DataSplitter(Generic[NDFrameT]): def __init__(self, data: NDFrameT, ngroups: int, *, sort_idx: npt.NDArray[np.intp], sorted_ids: npt.NDArray[np.intp]) -> None: pass def __iter__(self) -> Iterator: pass @cache_readonly def _sorted_data(self) -> NDFrameT: pass def _ch...
6
0
7
1
6
1
2
0.08
1
6
0
2
4
4
4
6
32
5
25
20
12
2
17
12
12
3
1
1
6
7,346
pandas-dev/pandas
pandas-dev_pandas/pandas/core/groupby/ops.py
pandas.core.groupby.ops.FrameSplitter
from pandas.core.frame import DataFrame class FrameSplitter(DataSplitter): def _chop(self, sdata: DataFrame, slice_obj: slice) -> DataFrame: mgr = sdata._mgr.get_slice(slice_obj, axis=1) df = sdata._constructor_from_mgr(mgr, axes=mgr.axes) return df.__finalize__(sdata, method='groupby')
class FrameSplitter(DataSplitter): def _chop(self, sdata: DataFrame, slice_obj: slice) -> DataFrame: pass
2
0
6
0
4
2
1
0.4
1
2
0
0
1
0
1
7
7
0
5
4
3
2
5
4
3
1
2
0
1
7,347
pandas-dev/pandas
pandas-dev_pandas/pandas/core/groupby/ops.py
pandas.core.groupby.ops.SeriesSplitter
from pandas.core.series import Series class SeriesSplitter(DataSplitter): def _chop(self, sdata: Series, slice_obj: slice) -> Series: mgr = sdata._mgr.get_slice(slice_obj) ser = sdata._constructor_from_mgr(mgr, axes=mgr.axes) ser._name = sdata.name return ser.__finalize__(sdata, me...
class SeriesSplitter(DataSplitter): def _chop(self, sdata: Series, slice_obj: slice) -> Series: pass
2
0
6
0
5
1
1
0.17
1
2
0
0
1
0
1
7
7
0
6
4
4
1
6
4
4
1
2
0
1
7,348
pandas-dev/pandas
pandas-dev_pandas/pandas/core/groupby/ops.py
pandas.core.groupby.ops.WrappedCythonOp
from pandas._typing import ArrayLike, AxisInt, NDFrameT, Shape, npt import pandas._libs.groupby as libgroupby from pandas.core.dtypes.cast import maybe_downcast_to_dtype import numpy as np from pandas.core.dtypes.missing import isna, maybe_fill import functools from typing import TYPE_CHECKING, Any, Generic, final from...
class WrappedCythonOp: ''' Dispatch logic for functions defined in _libs.groupby Parameters ---------- kind: str Whether the operation is an aggregate or transform. how: str Operation name, e.g. "mean". has_dropped_na: bool True precisely when dropna=True and the gro...
19
4
35
3
27
5
6
0.21
0
5
0
0
9
3
11
11
457
45
342
80
292
73
152
43
140
26
0
4
68
7,349
pandas-dev/pandas
pandas-dev_pandas/pandas/core/indexers/objects.py
pandas.core.indexers.objects.BaseIndexer
from pandas.util._decorators import Appender import numpy as np class BaseIndexer: """ Base class for window bounds calculations. Parameters ---------- index_array : np.ndarray, default None Array-like structure representing the indices for the data points. If None, the default ind...
class BaseIndexer: ''' Base class for window bounds calculations. Parameters ---------- index_array : np.ndarray, default None Array-like structure representing the indices for the data points. If None, the default indices are assumed. This can be useful for handling non-uni...
4
1
9
0
8
1
2
2.11
0
5
0
7
2
2
2
2
61
5
18
16
5
38
8
6
5
2
0
1
3
7,350
pandas-dev/pandas
pandas-dev_pandas/pandas/core/indexers/objects.py
pandas.core.indexers.objects.ExpandingIndexer
import numpy as np from pandas.util._decorators import Appender class ExpandingIndexer(BaseIndexer): """Calculate expanding window bounds, mimicking df.expanding()""" @Appender(get_window_bounds_doc) def get_window_bounds(self, num_values: int=0, min_periods: int | None=None, center: bool | None=None, clo...
class ExpandingIndexer(BaseIndexer): '''Calculate expanding window bounds, mimicking df.expanding()''' @Appender(get_window_bounds_doc) def get_window_bounds(self, num_values: int=0, min_periods: int | None=None, center: bool | None=None, closed: str | None=None, step: int | None=None) -> tuple[np.ndarray,...
3
1
12
0
12
0
1
0.07
1
4
0
0
1
0
1
3
16
1
14
10
4
1
3
2
1
1
1
0
1
7,351
pandas-dev/pandas
pandas-dev_pandas/pandas/core/indexers/objects.py
pandas.core.indexers.objects.ExponentialMovingWindowIndexer
import numpy as np from pandas.util._decorators import Appender class ExponentialMovingWindowIndexer(BaseIndexer): """Calculate ewm window bounds (the entire window)""" @Appender(get_window_bounds_doc) def get_window_bounds(self, num_values: int=0, min_periods: int | None=None, center: bool | None=None, c...
class ExponentialMovingWindowIndexer(BaseIndexer): '''Calculate ewm window bounds (the entire window)''' @Appender(get_window_bounds_doc) def get_window_bounds(self, num_values: int=0, min_periods: int | None=None, center: bool | None=None, closed: str | None=None, step: int | None=None) -> tuple[np.ndarra...
3
1
9
0
9
0
1
0.09
1
4
0
0
1
0
1
3
13
1
11
10
1
1
3
2
1
1
1
0
1
7,352
pandas-dev/pandas
pandas-dev_pandas/pandas/core/indexers/objects.py
pandas.core.indexers.objects.FixedForwardWindowIndexer
from pandas.util._decorators import Appender import numpy as np class FixedForwardWindowIndexer(BaseIndexer): """ Creates window boundaries for fixed-length windows that include the current row. Parameters ---------- index_array : np.ndarray, default None Array-like structure representing ...
class FixedForwardWindowIndexer(BaseIndexer): ''' Creates window boundaries for fixed-length windows that include the current row. Parameters ---------- index_array : np.ndarray, default None Array-like structure representing the indices for the data points. If None, the default ind...
3
1
23
2
21
0
5
1.7
1
5
0
0
1
0
1
3
69
7
23
12
13
39
13
4
11
5
1
1
5
7,353
pandas-dev/pandas
pandas-dev_pandas/pandas/core/indexers/objects.py
pandas.core.indexers.objects.FixedWindowIndexer
import numpy as np from pandas.util._decorators import Appender class FixedWindowIndexer(BaseIndexer): """Creates window boundaries that are of fixed length.""" @Appender(get_window_bounds_doc) def get_window_bounds(self, num_values: int=0, min_periods: int | None=None, center: bool | None=None, closed: s...
class FixedWindowIndexer(BaseIndexer): '''Creates window boundaries that are of fixed length.''' @Appender(get_window_bounds_doc) def get_window_bounds(self, num_values: int=0, min_periods: int | None=None, center: bool | None=None, closed: str | None=None, step: int | None=None) -> tuple[np.ndarray, np.nd...
3
1
24
3
21
0
4
0.04
1
4
0
0
1
0
1
3
28
4
23
13
13
1
14
5
12
4
1
1
4
7,354
pandas-dev/pandas
pandas-dev_pandas/pandas/core/indexers/objects.py
pandas.core.indexers.objects.GroupbyIndexer
from pandas.core.dtypes.common import ensure_platform_int from pandas.util._decorators import Appender import numpy as np class GroupbyIndexer(BaseIndexer): """Calculate bounds to compute groupby rolling, mimicking df.groupby().rolling()""" def __init__(self, index_array: np.ndarray | None=None, window_size: ...
class GroupbyIndexer(BaseIndexer): '''Calculate bounds to compute groupby rolling, mimicking df.groupby().rolling()''' def __init__(self, index_array: np.ndarray | None=None, window_size: int | BaseIndexer=0, groupby_indices: dict | None=None, window_indexer: type[BaseIndexer]=BaseIndexer, indexer_kwargs: dic...
4
2
43
1
31
12
3
0.4
1
7
0
0
2
3
2
4
91
3
63
29
44
25
30
13
27
4
1
2
6
7,355
pandas-dev/pandas
pandas-dev_pandas/pandas/core/indexers/objects.py
pandas.core.indexers.objects.VariableOffsetWindowIndexer
from pandas.core.indexes.datetimes import DatetimeIndex import numpy as np from datetime import timedelta from pandas.tseries.offsets import Nano from pandas._libs.tslibs import BaseOffset from pandas.util._decorators import Appender class VariableOffsetWindowIndexer(BaseIndexer): """ Calculate window boundari...
class VariableOffsetWindowIndexer(BaseIndexer): ''' Calculate window boundaries based on a non-fixed offset such as a BusinessDay. Parameters ---------- index_array : np.ndarray, default 0 Array-like structure specifying the indices for data points. This parameter is currently not u...
4
1
45
6
34
6
9
0.91
1
10
0
0
2
2
2
4
153
21
69
33
51
63
50
18
47
14
1
3
17
7,356
pandas-dev/pandas
pandas-dev_pandas/pandas/core/indexers/objects.py
pandas.core.indexers.objects.VariableWindowIndexer
import numpy as np from pandas.util._decorators import Appender from pandas._libs.window.indexers import calculate_variable_window_bounds class VariableWindowIndexer(BaseIndexer): """Creates window boundaries that are of variable length, namely for time series.""" @Appender(get_window_bounds_doc) def get_...
class VariableWindowIndexer(BaseIndexer): '''Creates window boundaries that are of variable length, namely for time series.''' @Appender(get_window_bounds_doc) def get_window_bounds(self, num_values: int=0, min_periods: int | None=None, center: bool | None=None, closed: str | None=None, step: int | None=No...
3
1
20
0
16
6
1
0.39
1
4
0
0
1
0
1
3
24
1
18
10
8
7
3
2
1
1
1
0
1
7,357
pandas-dev/pandas
pandas-dev_pandas/pandas/core/indexes/accessors.py
pandas.core.indexes.accessors.ArrowTemporalProperties
from typing import TYPE_CHECKING, NoReturn, cast from pandas.core.arrays.arrow.array import ArrowExtensionArray from pandas.errors import Pandas4Warning from pandas.core.base import NoNewAttributesMixin, PandasObject from pandas.core.dtypes.common import is_integer_dtype, is_list_like from pandas.core.dtypes.generic im...
@delegate_names(delegate=ArrowExtensionArray, accessors=TimedeltaArray._datetimelike_ops, typ='property', accessor_mapping=lambda x: f'_dt_{x}', raise_on_missing=False) @delegate_names(delegate=ArrowExtensionArray, accessors=TimedeltaArray._datetimelike_methods, typ='method', accessor_mapping=lambda x: f'_dt_{x}', rais...
13
0
13
1
12
1
2
0.06
3
8
0
0
7
2
7
20
102
15
83
20
72
5
41
19
31
4
2
1
13
7,358
pandas-dev/pandas
pandas-dev_pandas/pandas/core/indexes/accessors.py
pandas.core.indexes.accessors.CombinedDatetimelikeProperties
from pandas._libs import lib from pandas.core.dtypes.generic import ABCSeries from pandas.core.dtypes.dtypes import ArrowDtype, CategoricalDtype, DatetimeTZDtype, PeriodDtype class CombinedDatetimelikeProperties(DatetimeProperties, TimedeltaProperties, PeriodProperties): """ Accessor object for Series values' ...
class CombinedDatetimelikeProperties(DatetimeProperties, TimedeltaProperties, PeriodProperties): ''' Accessor object for Series values' datetime-like, timedelta and period properties. See Also -------- DatetimeIndex : Index of datetime64 data. Examples -------- >>> dates = pd.Series( ...
2
1
33
4
25
5
9
1.39
3
9
1
0
1
0
1
25
74
8
28
5
24
39
15
3
13
9
4
1
9
7,359
pandas-dev/pandas
pandas-dev_pandas/pandas/core/indexes/accessors.py
pandas.core.indexes.accessors.DatetimeProperties
from pandas.core.accessor import PandasDelegate, delegate_names from pandas.core.arrays import DatetimeArray, PeriodArray, TimedeltaArray @delegate_names(delegate=DatetimeArray, accessors=DatetimeArray._datetimelike_ops + ['unit'], typ='property') @delegate_names(delegate=DatetimeArray, accessors=DatetimeArray._dateti...
@delegate_names(delegate=DatetimeArray, accessors=DatetimeArray._datetimelike_ops + ['unit'], typ='property') @delegate_names(delegate=DatetimeArray, accessors=DatetimeArray._datetimelike_methods + ['as_unit'], typ='method') class DatetimeProperties(Properties): ''' Accessor object for datetimelike properties o...
7
4
34
6
2
26
1
13.11
1
2
0
1
3
0
3
21
152
25
9
6
3
118
8
5
3
1
3
0
3
7,360
pandas-dev/pandas
pandas-dev_pandas/pandas/core/indexes/accessors.py
pandas.core.indexes.accessors.PeriodProperties
from pandas.core.accessor import PandasDelegate, delegate_names from pandas.core.arrays import DatetimeArray, PeriodArray, TimedeltaArray @delegate_names(delegate=PeriodArray, accessors=PeriodArray._datetimelike_ops, typ='property') @delegate_names(delegate=PeriodArray, accessors=PeriodArray._datetimelike_methods, typ...
@delegate_names(delegate=PeriodArray, accessors=PeriodArray._datetimelike_ops, typ='property') @delegate_names(delegate=PeriodArray, accessors=PeriodArray._datetimelike_methods, typ='method') class PeriodProperties(Properties): ''' Accessor object for datetimelike properties of the Series values. Returns a ...
3
1
0
0
0
0
0
54
1
0
0
1
0
0
0
18
59
4
1
1
0
54
1
1
0
0
3
0
0
7,361
pandas-dev/pandas
pandas-dev_pandas/pandas/core/indexes/accessors.py
pandas.core.indexes.accessors.Properties
from pandas.core.indexes.datetimes import DatetimeIndex from pandas.core.arrays import DatetimeArray, PeriodArray, TimedeltaArray from pandas.core.base import NoNewAttributesMixin, PandasObject from pandas.core.dtypes.common import is_integer_dtype, is_list_like from pandas.core.dtypes.generic import ABCSeries from typ...
class Properties(PandasDelegate, PandasObject, NoNewAttributesMixin): def __init__(self, data: Series, orig) -> None: pass def _get_values(self): pass def _delegate_property_get(self, name: str): pass def _delegate_property_set(self, name: str, value, *args, **kwargs) -> NoR...
6
0
14
3
10
0
3
0.04
3
10
0
3
5
3
5
18
78
19
57
19
49
2
40
19
32
5
2
2
15
7,362
pandas-dev/pandas
pandas-dev_pandas/pandas/core/indexes/accessors.py
pandas.core.indexes.accessors.TimedeltaProperties
from pandas.core.arrays import DatetimeArray, PeriodArray, TimedeltaArray import warnings from pandas.core.accessor import PandasDelegate, delegate_names from pandas.util._exceptions import find_stack_level import numpy as np from pandas.errors import Pandas4Warning @delegate_names(delegate=TimedeltaArray, accessors=T...
@delegate_names(delegate=TimedeltaArray, accessors=TimedeltaArray._datetimelike_ops, typ='property') @delegate_names(delegate=TimedeltaArray, accessors=TimedeltaArray._datetimelike_methods, typ='method') class TimedeltaProperties(Properties): ''' Accessor object for datetimelike properties of the Series values....
8
3
29
3
6
20
1
3.86
1
2
0
1
3
0
3
21
116
14
21
6
15
81
8
4
4
1
3
0
3
7,363
pandas-dev/pandas
pandas-dev_pandas/pandas/core/indexes/base.py
pandas.core.indexes.base.Index
from pandas.core.arrays import ArrowExtensionArray, BaseMaskedArray, Categorical, DatetimeArray, ExtensionArray, TimedeltaArray from pandas.core.array_algos.putmask import setitem_datetimelike_compat, validate_putmask import pandas.core.algorithms as algos from pandas.core.accessor import Accessor from pandas.io.format...
null
365
146
29
4
12
13
3
1.06
2
51
0
0
215
0
220
291
7,125
1,189
2,903
951
2,312
3,066
1,953
593
1,712
24
2
4
761
7,364
pandas-dev/pandas
pandas-dev_pandas/pandas/core/indexes/category.py
pandas.core.indexes.category.CategoricalIndex
import numpy as np from pandas.core.dtypes.missing import is_valid_na_for_dtype from pandas.util._decorators import cache_readonly, doc, set_module from pandas.core.arrays.categorical import Categorical, contains from pandas._libs import index as libindex from pandas.core.construction import extract_array from typing i...
@inherit_names(['argsort', 'tolist', 'codes', 'categories', 'ordered', '_reverse_indexer', 'searchsorted', 'min', 'max'], Categorical) @inherit_names(['rename_categories', 'reorder_categories', 'add_categories', 'remove_categories', 'remove_unused_categories', 'set_categories', 'as_ordered', 'as_unordered'], Categorica...
25
6
20
3
8
9
2
1.54
1
17
0
0
16
0
16
20
456
78
149
44
116
229
100
28
83
6
3
2
35
7,365
pandas-dev/pandas
pandas-dev_pandas/pandas/core/indexes/datetimelike.py
pandas.core.indexes.datetimelike.DatetimeIndexOpsMixin
from pandas.core.indexes.base import Index, _index_shared_docs from abc import ABC, abstractmethod from pandas.core.arrays import DatetimeArray, ExtensionArray, PeriodArray, TimedeltaArray from typing import TYPE_CHECKING, Any, Self, cast, final from pandas.core.indexes.extension import NDArrayBackedExtensionIndex from...
class DatetimeIndexOpsMixin(NDArrayBackedExtensionIndex, ABC): ''' Common ops mixin to support a unified interface datetimelike Index. ''' @doc(DatetimeLikeArrayMixin.mean) def mean(self, *, skipna: bool=True, axis: int | None=0): pass @property def freq(self) -> BaseOffset | None: ...
41
7
12
1
6
4
2
0.66
2
20
0
1
23
0
23
47
333
57
168
71
121
111
132
49
107
10
4
3
52
7,366
pandas-dev/pandas
pandas-dev_pandas/pandas/core/indexes/datetimelike.py
pandas.core.indexes.datetimelike.DatetimeTimedeltaMixin
from typing import TYPE_CHECKING, Any, Self, cast, final from pandas._libs.tslibs import BaseOffset, Resolution, Tick, parsing, to_offset from pandas.core.dtypes.concat import concat_compat from pandas.core.indexes.range import RangeIndex from pandas.core.arrays import DatetimeArray, ExtensionArray, PeriodArray, Timede...
class DatetimeTimedeltaMixin(DatetimeIndexOpsMixin, ABC): ''' Mixin class for methods shared by DatetimeIndex and TimedeltaIndex, but not PeriodIndex ''' @property def unit(self) -> str: pass def as_unit(self, unit: str) -> Self: ''' Convert to a dtype with the give...
36
6
14
1
9
4
2
0.52
2
11
0
0
26
2
26
73
434
68
244
104
194
126
191
80
164
8
5
4
64
7,367
pandas-dev/pandas
pandas-dev_pandas/pandas/core/indexes/datetimes.py
pandas.core.indexes.datetimes.DatetimeIndex
import datetime as dt from typing import TYPE_CHECKING, Self from pandas._libs.tslibs import Resolution, Tick, Timedelta, periods_per_day, timezones, to_offset from pandas.core.tools.times import to_time from pandas._libs.tslibs.dtypes import OFFSET_TO_PERIOD_FREQSTR from pandas.core.dtypes.missing import is_valid_na_f...
@inherit_names(DatetimeArray._field_ops + [method for method in DatetimeArray._datetimelike_methods if method not in ('tz_localize', 'tz_convert', 'strftime')], DatetimeArray, wrap=True) @inherit_names(['is_normalized'], DatetimeArray, cache=True) @inherit_names(['tz', 'tzinfo', 'dtype', 'to_pydatetime', 'date', 'time'...
43
11
19
2
10
7
3
1.01
1
19
0
0
25
1
25
99
686
108
288
108
226
291
207
73
177
10
6
3
72
7,368
pandas-dev/pandas
pandas-dev_pandas/pandas/core/indexes/extension.py
pandas.core.indexes.extension.ExtensionIndex
from pandas.core.indexes.base import Index from pandas.util._decorators import cache_readonly class ExtensionIndex(Index): """ Index subclass for indexes backed by ExtensionArray. """ _data: IntervalArray | NDArrayBackedExtensionArray def _validate_fill_value(self, value): """ Conv...
class ExtensionIndex(Index): ''' Index subclass for indexes backed by ExtensionArray. ''' def _validate_fill_value(self, value): ''' Convert value to be insertable to underlying array. ''' pass @cache_readonly def _isnan(self) -> npt.NDArray[np.bool_]: ...
4
2
5
0
2
3
1
1.71
1
0
0
1
2
0
2
304
23
5
7
4
3
12
6
3
3
1
3
0
2
7,369
pandas-dev/pandas
pandas-dev_pandas/pandas/core/indexes/extension.py
pandas.core.indexes.extension.NDArrayBackedExtensionIndex
class NDArrayBackedExtensionIndex(ExtensionIndex): """ Index subclass for indexes backed by NDArrayBackedExtensionArray. """ _data: NDArrayBackedExtensionArray def _get_engine_target(self) -> np.ndarray: return self._data._ndarray def _from_join_target(self, result: np.ndarray) -> Arra...
class NDArrayBackedExtensionIndex(ExtensionIndex): ''' Index subclass for indexes backed by NDArrayBackedExtensionArray. ''' def _get_engine_target(self) -> np.ndarray: pass def _from_join_target(self, result: np.ndarray) -> ArrayLike: pass
3
1
3
0
3
0
1
0.43
1
0
0
0
2
0
2
306
13
3
7
3
4
3
7
3
4
1
4
0
2
7,370
pandas-dev/pandas
pandas-dev_pandas/pandas/core/indexes/frozen.py
pandas.core.indexes.frozen.FrozenList
from pandas.io.formats.printing import pprint_thing from typing import NoReturn, Self from pandas.core.base import PandasObject class FrozenList(PandasObject, list): """ Container that doesn't allow setting item *but* because it's technically hashable, will be used for lookups, appropriately, etc. ...
class FrozenList(PandasObject, list): ''' Container that doesn't allow setting item *but* because it's technically hashable, will be used for lookups, appropriately, etc. ''' def union(self, other) -> FrozenList: ''' Returns a FrozenList with other concatenated to the end of se...
12
4
6
0
3
2
1
0.98
2
9
0
0
11
0
11
51
99
20
42
20
30
41
40
20
28
2
2
1
15
7,371
pandas-dev/pandas
pandas-dev_pandas/pandas/core/indexes/interval.py
pandas.core.indexes.interval.IntervalIndex
from pandas.core.indexers import is_valid_positional_slice from pandas._libs.tslibs import BaseOffset, Period, Timedelta, Timestamp, to_offset from pandas.core.indexes.datetimes import DatetimeIndex, date_range from pandas._libs import lib import numpy as np from pandas.util._decorators import Appender, cache_readonly,...
@Appender(_interval_shared_docs['class'] % {'klass': 'IntervalIndex', 'summary': 'Immutable index of intervals that are closed on the same side.', 'name': _index_doc_kwargs['name'], 'extra_attributes': 'is_overlapping\nvalues\n', 'extra_methods': '', 'examples': textwrap.dedent(" Examples\n --------\n A new ``...
62
18
20
2
9
9
3
0.84
1
23
0
0
33
0
36
38
872
131
405
148
251
340
244
90
207
11
2
3
90
7,372
pandas-dev/pandas
pandas-dev_pandas/pandas/core/indexes/multi.py
pandas.core.indexes.multi.MultiIndex
from pandas.core.indexes.frozen import FrozenList from pandas.core.construction import sanitize_array from pandas.core.dtypes.missing import array_equivalent, isna from pandas._libs import algos as libalgos, index as libindex, lib from pandas._config import get_option import numpy as np from pandas.io.formats.printing ...
@set_module('pandas') class MultiIndex(Index): ''' A multi-level, or hierarchical, index object for pandas objects. Parameters ---------- levels : sequence of arrays The unique labels for each level. codes : sequence of arrays Integers for each level designating which label at ea...
145
63
34
4
15
14
4
0.97
1
42
5
0
99
0
103
405
3,966
577
1,733
552
1,477
1,680
1,229
404
1,116
28
3
6
441
7,373
pandas-dev/pandas
pandas-dev_pandas/pandas/core/indexes/multi.py
pandas.core.indexes.multi.MultiIndexPyIntEngine
from pandas._libs import algos as libalgos, index as libindex, lib class MultiIndexPyIntEngine(libindex.BaseMultiIndexCodesEngine, libindex.ObjectEngine): """Manages a MultiIndex by mapping label combinations to positive integers. This class manages those (extreme) cases in which the number of possible la...
class MultiIndexPyIntEngine(libindex.BaseMultiIndexCodesEngine, libindex.ObjectEngine): '''Manages a MultiIndex by mapping label combinations to positive integers. This class manages those (extreme) cases in which the number of possible label combinations overflows the 64 bits integers, and uses an ObjectE...
1
1
0
0
0
0
0
1.67
2
0
0
0
0
0
0
0
10
2
3
3
2
5
3
3
2
0
1
0
0
7,374
pandas-dev/pandas
pandas-dev_pandas/pandas/core/indexes/multi.py
pandas.core.indexes.multi.MultiIndexUInt16Engine
from pandas._libs import algos as libalgos, index as libindex, lib class MultiIndexUInt16Engine(libindex.BaseMultiIndexCodesEngine, libindex.UInt16Engine): """Manages a MultiIndex by mapping label combinations to positive integers. The number of possible label combinations must not overflow the 16 bits intege...
class MultiIndexUInt16Engine(libindex.BaseMultiIndexCodesEngine, libindex.UInt16Engine): '''Manages a MultiIndex by mapping label combinations to positive integers. The number of possible label combinations must not overflow the 16 bits integers. ''' pass
1
1
0
0
0
0
0
1
2
0
0
0
0
0
0
0
8
2
3
3
2
3
3
3
2
0
1
0
0
7,375
pandas-dev/pandas
pandas-dev_pandas/pandas/core/indexes/multi.py
pandas.core.indexes.multi.MultiIndexUInt32Engine
from pandas._libs import algos as libalgos, index as libindex, lib class MultiIndexUInt32Engine(libindex.BaseMultiIndexCodesEngine, libindex.UInt32Engine): """Manages a MultiIndex by mapping label combinations to positive integers. The number of possible label combinations must not overflow the 32 bits intege...
class MultiIndexUInt32Engine(libindex.BaseMultiIndexCodesEngine, libindex.UInt32Engine): '''Manages a MultiIndex by mapping label combinations to positive integers. The number of possible label combinations must not overflow the 32 bits integers. ''' pass
1
1
0
0
0
0
0
1
2
0
0
0
0
0
0
0
8
2
3
3
2
3
3
3
2
0
1
0
0
7,376
pandas-dev/pandas
pandas-dev_pandas/pandas/core/indexes/multi.py
pandas.core.indexes.multi.MultiIndexUInt64Engine
from pandas._libs import algos as libalgos, index as libindex, lib class MultiIndexUInt64Engine(libindex.BaseMultiIndexCodesEngine, libindex.UInt64Engine): """Manages a MultiIndex by mapping label combinations to positive integers. The number of possible label combinations must not overflow the 64 bits intege...
class MultiIndexUInt64Engine(libindex.BaseMultiIndexCodesEngine, libindex.UInt64Engine): '''Manages a MultiIndex by mapping label combinations to positive integers. The number of possible label combinations must not overflow the 64 bits integers. ''' pass
1
1
0
0
0
0
0
1
2
0
0
0
0
0
0
0
8
2
3
3
2
3
3
3
2
0
1
0
0
7,377
pandas-dev/pandas
pandas-dev_pandas/pandas/core/indexes/multi.py
pandas.core.indexes.multi.MultiIndexUInt8Engine
from pandas._libs import algos as libalgos, index as libindex, lib class MultiIndexUInt8Engine(libindex.BaseMultiIndexCodesEngine, libindex.UInt8Engine): """Manages a MultiIndex by mapping label combinations to positive integers. The number of possible label combinations must not overflow the 8 bits integers....
class MultiIndexUInt8Engine(libindex.BaseMultiIndexCodesEngine, libindex.UInt8Engine): '''Manages a MultiIndex by mapping label combinations to positive integers. The number of possible label combinations must not overflow the 8 bits integers. ''' pass
1
1
0
0
0
0
0
1
2
0
0
0
0
0
0
0
8
2
3
3
2
3
3
3
2
0
1
0
0
7,378
pandas-dev/pandas
pandas-dev_pandas/pandas/core/indexes/period.py
pandas.core.indexes.period.PeriodIndex
from pandas.core.indexes.datetimes import DatetimeIndex, Index from pandas.core.indexes.datetimelike import DatetimeIndexOpsMixin from pandas._libs import index as libindex from pandas.util._decorators import cache_readonly, doc, set_module from pandas.core.dtypes.common import is_integer from pandas.core.arrays.period...
@inherit_names(['strftime', 'start_time', 'end_time'] + PeriodArray._field_ops, PeriodArray, wrap=True) @inherit_names(['is_leap_year'], PeriodArray) @set_module('pandas') class PeriodIndex(DatetimeIndexOpsMixin): ''' Immutable ndarray holding ordinal values indicating regular periods in time. Index keys ar...
44
8
13
2
7
5
2
1.07
1
13
0
0
21
0
23
71
450
74
182
80
118
194
124
41
100
10
5
3
49
7,379
pandas-dev/pandas
pandas-dev_pandas/pandas/core/indexes/range.py
pandas.core.indexes.range.RangeIndex
from pandas.core.dtypes.base import ExtensionDtype import numpy as np from pandas.core.dtypes.common import ensure_platform_int, ensure_python_int, is_float, is_integer, is_scalar, is_signed_integer_dtype from pandas.core.dtypes.generic import ABCTimedeltaIndex from pandas._libs import index as libindex, lib from panda...
@set_module('pandas') class RangeIndex(Index): ''' Immutable Index implementing a monotonic integer range. RangeIndex is a memory-saving special case of an Index limited to representing monotonic ranges with a 64-bit dtype. Using RangeIndex may in some instances improve computing speed. This is ...
99
26
17
2
11
4
3
0.44
1
25
0
0
69
0
72
374
1,403
218
831
289
657
365
603
183
529
20
3
4
246
7,380
pandas-dev/pandas
pandas-dev_pandas/pandas/core/indexes/timedeltas.py
pandas.core.indexes.timedeltas.TimedeltaIndex
from pandas.core.dtypes.common import is_scalar, pandas_dtype from pandas.util._decorators import set_module from pandas.core.indexes.extension import inherit_names from pandas._libs import index as libindex, lib from pandas.core.arrays.timedeltas import TimedeltaArray from pandas._libs.tslibs import Resolution, Timede...
@inherit_names(['__neg__', '__pos__', '__abs__', 'total_seconds', 'round', 'floor', 'ceil'] + TimedeltaArray._field_ops, TimedeltaArray, wrap=True) @inherit_names(['components', 'to_pytimedelta', 'sum', 'std', 'median'], TimedeltaArray) @set_module('pandas') class TimedeltaIndex(DatetimeTimedeltaMixin): ''' Imm...
15
3
10
1
8
2
2
1.22
1
7
0
0
8
0
8
82
183
35
68
28
49
83
46
17
37
8
6
2
16
7,381
pandas-dev/pandas
pandas-dev_pandas/pandas/core/indexing.py
pandas.core.indexing.IndexingMixin
class IndexingMixin: """ Mixin for adding .loc/.iloc/.at/.iat to Dataframes and Series. """ @property def iloc(self) -> _iLocIndexer: """ Purely integer-location based indexing for selection by position. .. versionchanged:: 3.0 Callables which return a tuple are...
class IndexingMixin: ''' Mixin for adding .loc/.iloc/.at/.iat to Dataframes and Series. ''' @property def iloc(self) -> _iLocIndexer: ''' Purely integer-location based indexing for selection by position. .. versionchanged:: 3.0 Callables which return a tuple are de...
9
5
142
32
2
108
1
33.54
0
4
4
0
4
0
4
4
581
132
13
9
4
436
9
5
4
1
0
0
4
7,382
pandas-dev/pandas
pandas-dev_pandas/pandas/core/indexing.py
pandas.core.indexing._AtIndexer
import sys from pandas.util._decorators import doc, set_module import warnings from pandas.compat._constants import REF_COUNT, WARNING_CHECK_DISABLED from pandas.errors.cow import _chained_assignment_msg from pandas.compat import PYPY from pandas.core.dtypes.common import is_array_like, is_bool_dtype, is_hashable, is_i...
@doc(IndexingMixin.at) class _AtIndexer(_ScalarAccessIndexer): def _convert_key(self, key): ''' Require they keys to be the same type as the index. (so we don't fallback) ''' pass @property def _axes_are_unique(self) -> bool: pass def __getitem__(self, k...
7
1
9
1
5
3
2
0.43
1
4
0
0
4
0
4
7
41
8
23
7
17
10
22
6
17
3
2
2
9
7,383
pandas-dev/pandas
pandas-dev_pandas/pandas/core/indexing.py
pandas.core.indexing._IndexSlice
from pandas.util._decorators import doc, set_module @set_module('pandas') class _IndexSlice: """ Create an object to more easily perform multi-index slicing. See Also -------- MultiIndex.remove_unused_levels : New MultiIndex with no unused levels. Notes ----- See :ref:`Defined Levels ...
@set_module('pandas') class _IndexSlice: ''' Create an object to more easily perform multi-index slicing. See Also -------- MultiIndex.remove_unused_levels : New MultiIndex with no unused levels. Notes ----- See :ref:`Defined Levels <advanced.shown_levels>` for further info on slicin...
3
1
2
0
2
0
1
11.33
0
0
0
0
1
0
1
1
45
8
3
2
1
34
3
2
1
1
0
0
1
7,384
pandas-dev/pandas
pandas-dev_pandas/pandas/core/indexing.py
pandas.core.indexing._LocIndexer
from pandas.errors import AbstractMethodError, ChainedAssignmentError, IndexingError, InvalidIndexError, LossySetitemError import numpy as np import pandas.core.common as com from pandas.core.indexes.api import Index, MultiIndex from pandas.util._decorators import doc, set_module from contextlib import suppress from pa...
@doc(IndexingMixin.loc) class _LocIndexer(_LocationIndexer): @doc(_LocationIndexer._validate_key) def _validate_key(self, key, axis: Axis) -> None: pass def _has_valid_setitem_indexer(self, indexer) -> bool: pass def _is_scalar_access(self, key: tuple) -> bool: ''' Ret...
16
7
25
3
12
9
4
0.74
1
15
0
0
13
0
13
35
348
59
166
35
151
123
132
33
118
19
2
4
54
7,385
pandas-dev/pandas
pandas-dev_pandas/pandas/core/indexing.py
pandas.core.indexing._LocationIndexer
import sys import pandas.core.common as com from pandas.core.indexes.api import Index, MultiIndex from pandas.core.dtypes.generic import ABCDataFrame, ABCSeries import warnings from contextlib import suppress from pandas.compat._constants import REF_COUNT, WARNING_CHECK_DISABLED from pandas.errors.cow import _chained_a...
class _LocationIndexer(NDFrameIndexerBase): @final def __call__(self, axis: Axis | None=None) -> Self: pass def _get_setitem_indexer(self, key): ''' Convert a potentially-label-based key into a positional indexer. ''' pass @final def _maybe_mask_setitem_val...
38
8
19
2
12
6
4
0.49
1
21
2
2
22
1
22
22
483
71
277
75
239
136
212
59
188
10
1
5
84
7,386
pandas-dev/pandas
pandas-dev_pandas/pandas/core/indexing.py
pandas.core.indexing._ScalarAccessIndexer
import pandas.core.common as com from pandas._libs.indexing import NDFrameIndexerBase from pandas.core.indexers import check_array_indexer, is_list_like_indexer, is_scalar_indexer, length_of_indexer from pandas.errors import AbstractMethodError, ChainedAssignmentError, IndexingError, InvalidIndexError, LossySetitemErro...
class _ScalarAccessIndexer(NDFrameIndexerBase): ''' Access scalars quickly. ''' def _convert_key(self, key): pass def __getitem__(self, key): pass def __setitem__(self, key, value) -> None: pass
4
1
9
1
7
1
3
0.26
1
4
0
2
3
0
3
3
36
7
23
4
19
6
21
4
17
4
1
2
8
7,387
pandas-dev/pandas
pandas-dev_pandas/pandas/core/indexing.py
pandas.core.indexing._iAtIndexer
import sys from pandas.util._decorators import doc, set_module import warnings from pandas.compat._constants import REF_COUNT, WARNING_CHECK_DISABLED from pandas.errors.cow import _chained_assignment_msg from pandas.compat import PYPY from pandas.core.dtypes.common import is_array_like, is_bool_dtype, is_hashable, is_i...
@doc(IndexingMixin.iat) class _iAtIndexer(_ScalarAccessIndexer): def _convert_key(self, key): ''' Require integer args. (and convert to label arguments) ''' pass def __setitem__(self, key, value) -> None: pass
4
1
8
0
5
3
3
0.43
1
1
0
0
1
0
1
4
11
1
7
4
5
3
7
4
5
3
2
2
3
7,388
pandas-dev/pandas
pandas-dev_pandas/pandas/core/indexing.py
pandas.core.indexing._iLocIndexer
from pandas.errors import AbstractMethodError, ChainedAssignmentError, IndexingError, InvalidIndexError, LossySetitemError import numpy as np import pandas.core.common as com from pandas.core.indexes.api import Index, MultiIndex from pandas.util._decorators import doc, set_module from pandas.core.dtypes.generic import ...
@doc(IndexingMixin.iloc) class _iLocIndexer(_LocationIndexer): def _validate_key(self, key, axis: AxisInt) -> None: pass def _has_valid_setitem_indexer(self, indexer) -> bool: ''' Validate that a positional indexer cannot enlarge its target will raise if needed, does not modify...
25
14
42
6
25
11
8
0.46
1
22
0
0
20
1
20
42
910
148
523
110
490
240
385
100
360
21
2
7
164
7,389
pandas-dev/pandas
pandas-dev_pandas/pandas/core/interchange/buffer.py
pandas.core.interchange.buffer.PandasBuffer
from typing import TYPE_CHECKING, Any from pandas.core.interchange.dataframe_protocol import Buffer, DlpackDeviceType class PandasBuffer(Buffer): """ Data in the buffer is guaranteed to be contiguous in memory. """ def __init__(self, x: np.ndarray, allow_copy: bool=True) -> None: """ H...
class PandasBuffer(Buffer): ''' Data in the buffer is guaranteed to be contiguous in memory. ''' def __init__(self, x: np.ndarray, allow_copy: bool=True) -> None: ''' Handle only regular columns (= numpy arrays) for now. ''' pass @property def bufsize(self) -> i...
9
6
8
0
5
3
1
0.69
1
7
0
0
6
1
6
30
61
7
32
10
23
22
17
8
10
3
5
2
8
7,390
pandas-dev/pandas
pandas-dev_pandas/pandas/core/interchange/buffer.py
pandas.core.interchange.buffer.PandasBufferPyarrow
from typing import TYPE_CHECKING, Any from pandas.core.interchange.dataframe_protocol import Buffer, DlpackDeviceType class PandasBufferPyarrow(Buffer): """ Data in the buffer is guaranteed to be contiguous in memory. """ def __init__(self, buffer: pa.Buffer, *, length: int) -> None: """ ...
class PandasBufferPyarrow(Buffer): ''' Data in the buffer is guaranteed to be contiguous in memory. ''' def __init__(self, buffer: pa.Buffer, *, length: int) -> None: ''' Handle pyarrow chunked arrays. ''' pass @property def bufsize(self) -> int: ''' ...
9
6
7
0
5
3
1
0.58
1
6
0
0
6
2
6
30
55
6
31
16
17
18
14
9
7
1
5
0
6
7,391
pandas-dev/pandas
pandas-dev_pandas/pandas/core/interchange/column.py
pandas.core.interchange.column.PandasColumn
from pandas.util._decorators import cache_readonly from pandas.errors import NoBufferPresent from pandas._libs.lib import infer_dtype from pandas.api.types import is_string_dtype import numpy as np from typing import TYPE_CHECKING, Any from pandas.core.interchange.dataframe_protocol import Column, ColumnBuffers, Column...
class PandasColumn(Column): ''' A column object, with only the methods and properties required by the interchange protocol defined. A column can contain one or more chunks. Each chunk can contain up to three buffers - a data buffer, a mask buffer (depending on null representation), and an offse...
22
14
25
2
16
8
4
0.54
1
24
0
0
15
2
15
45
403
44
241
65
217
129
153
53
137
10
5
3
54
7,392
pandas-dev/pandas
pandas-dev_pandas/pandas/core/interchange/dataframe.py
pandas.core.interchange.dataframe.PandasDataFrameXchg
from pandas.core.interchange.column import PandasColumn from collections import abc from pandas.core.interchange.utils import maybe_rechunk from pandas.core.interchange.dataframe_protocol import DataFrame as DataFrameXchg class PandasDataFrameXchg(DataFrameXchg): """ A data frame class, with only the methods r...
class PandasDataFrameXchg(DataFrameXchg): ''' A data frame class, with only the methods required by the interchange protocol defined. Instances of this (private) class are returned from ``pd.DataFrame.__dataframe__`` as objects with the methods and attributes defined on this class. ''' ...
15
3
5
0
4
1
2
0.32
1
11
0
0
13
2
13
45
92
15
59
24
42
19
47
21
33
4
5
2
22
7,393
pandas-dev/pandas
pandas-dev_pandas/pandas/core/interchange/dataframe_protocol.py
pandas.core.interchange.dataframe_protocol.Buffer
from abc import ABC, abstractmethod class Buffer(ABC): """ Data in the buffer is guaranteed to be contiguous in memory. Note that there is no dtype attribute present, a buffer can be thought of as simply a block of memory. However, if the column that the buffer is attached to has a dtype that's su...
class Buffer(ABC): ''' Data in the buffer is guaranteed to be contiguous in memory. Note that there is no dtype attribute present, a buffer can be thought of as simply a block of memory. However, if the column that the buffer is attached to has a dtype that's supported by DLPack and ``__dlpack__`` ...
11
5
7
1
1
5
1
2.5
1
4
1
0
4
0
4
24
51
9
12
9
1
30
6
5
1
1
4
0
4
7,394
pandas-dev/pandas
pandas-dev_pandas/pandas/core/interchange/dataframe_protocol.py
pandas.core.interchange.dataframe_protocol.CategoricalDescription
from typing import TYPE_CHECKING, Any, TypedDict class CategoricalDescription(TypedDict): is_ordered: bool is_dictionary: bool categories: Column | None
class CategoricalDescription(TypedDict): pass
1
0
0
0
0
0
0
1
1
0
0
0
0
0
0
0
8
0
4
1
3
4
4
1
3
0
1
0
0
7,395
pandas-dev/pandas
pandas-dev_pandas/pandas/core/interchange/dataframe_protocol.py
pandas.core.interchange.dataframe_protocol.Column
from typing import TYPE_CHECKING, Any, TypedDict from abc import ABC, abstractmethod class Column(ABC): """ A column object, with only the methods and properties required by the interchange protocol defined. A column can contain one or more chunks. Each chunk can contain up to three buffers - a da...
class Column(ABC): ''' A column object, with only the methods and properties required by the interchange protocol defined. A column can contain one or more chunks. Each chunk can contain up to three buffers - a data buffer, a mask buffer (depending on null representation), and an offsets buffer...
27
11
11
1
1
9
1
4.63
1
10
4
0
10
0
10
30
181
29
27
21
0
125
11
11
0
1
4
0
10
7,396
pandas-dev/pandas
pandas-dev_pandas/pandas/core/interchange/dataframe_protocol.py
pandas.core.interchange.dataframe_protocol.ColumnBuffers
from typing import TYPE_CHECKING, Any, TypedDict class ColumnBuffers(TypedDict): data: tuple[Buffer, Any] validity: tuple[Buffer, Any] | None offsets: tuple[Buffer, Any] | None
class ColumnBuffers(TypedDict): pass
1
0
0
0
0
0
0
2.25
1
0
0
0
0
0
0
0
15
2
4
1
3
9
4
1
3
0
1
0
0
7,397
pandas-dev/pandas
pandas-dev_pandas/pandas/core/interchange/dataframe_protocol.py
pandas.core.interchange.dataframe_protocol.ColumnNullType
import enum class ColumnNullType(enum.IntEnum): """ Integer enum for null type representation. Attributes ---------- NON_NULLABLE : int Non-nullable column. USE_NAN : int Use explicit float NaN value. USE_SENTINEL : int Sentinel value besides NaN/NaT. USE_BITMAS...
class ColumnNullType(enum.IntEnum): ''' Integer enum for null type representation. Attributes ---------- NON_NULLABLE : int Non-nullable column. USE_NAN : int Use explicit float NaN value. USE_SENTINEL : int Sentinel value besides NaN/NaT. USE_BITMASK : int ...
1
1
0
0
0
0
0
2.5
1
0
0
0
0
0
0
55
23
2
6
6
5
15
6
6
5
0
3
0
0
7,398
pandas-dev/pandas
pandas-dev_pandas/pandas/core/interchange/dataframe_protocol.py
pandas.core.interchange.dataframe_protocol.DataFrame
from typing import TYPE_CHECKING, Any, TypedDict from abc import ABC, abstractmethod class DataFrame(ABC): """ A data frame class, with only the methods required by the interchange protocol defined. A "data frame" represents an ordered collection of named columns. A column's "name" must be a uniqu...
class DataFrame(ABC): ''' A data frame class, with only the methods required by the interchange protocol defined. A "data frame" represents an ordered collection of named columns. A column's "name" must be a unique string. Columns may be accessed by name or by position. This could be a publ...
26
13
5
0
1
4
1
2.19
1
8
1
0
12
0
12
32
101
16
27
26
1
59
14
14
1
1
4
0
12
7,399
pandas-dev/pandas
pandas-dev_pandas/pandas/core/interchange/dataframe_protocol.py
pandas.core.interchange.dataframe_protocol.DtypeKind
import enum class DtypeKind(enum.IntEnum): """ Integer enum for data types. Attributes ---------- INT : int Matches to signed integer data type. UINT : int Matches to unsigned integer data type. FLOAT : int Matches to floating point data type. BOOL : int ...
class DtypeKind(enum.IntEnum): ''' Integer enum for data types. Attributes ---------- INT : int Matches to signed integer data type. UINT : int Matches to unsigned integer data type. FLOAT : int Matches to floating point data type. BOOL : int Matches to b...
1
1
0
0
0
0
0
2.5
1
0
0
0
0
0
0
55
29
2
8
8
7
20
8
8
7
0
3
0
0