forked from pandas-dev/pandas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinternals.pyi
74 lines (64 loc) · 2 KB
/
internals.pyi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
from typing import (
Iterator,
Sequence,
final,
overload,
)
import numpy as np
from pandas._typing import (
ArrayLike,
T,
)
from pandas import Index
from pandas.core.arrays._mixins import NDArrayBackedExtensionArray
from pandas.core.internals.blocks import Block as B
def slice_len(slc: slice, objlen: int = ...) -> int: ...
def get_blkno_indexers(
blknos: np.ndarray, # int64_t[:]
group: bool = ...,
) -> list[tuple[int, slice | np.ndarray]]: ...
def get_blkno_placements(
blknos: np.ndarray,
group: bool = ...,
) -> Iterator[tuple[int, BlockPlacement]]: ...
class BlockPlacement:
def __init__(self, val: int | slice | np.ndarray): ...
@property
def indexer(self) -> np.ndarray | slice: ...
@property
def as_array(self) -> np.ndarray: ...
@property
def is_slice_like(self) -> bool: ...
@overload
def __getitem__(self, loc: slice | Sequence[int]) -> BlockPlacement: ...
@overload
def __getitem__(self, loc: int) -> int: ...
def __iter__(self) -> Iterator[int]: ...
def __len__(self) -> int: ...
def delete(self, loc) -> BlockPlacement: ...
def append(self, others: list[BlockPlacement]) -> BlockPlacement: ...
class SharedBlock:
_mgr_locs: BlockPlacement
ndim: int
values: ArrayLike
def __init__(self, values: ArrayLike, placement: BlockPlacement, ndim: int): ...
class NumpyBlock(SharedBlock):
values: np.ndarray
@final
def getitem_block_index(self: T, slicer: slice) -> T: ...
class NDArrayBackedBlock(SharedBlock):
values: NDArrayBackedExtensionArray
@final
def getitem_block_index(self: T, slicer: slice) -> T: ...
class Block(SharedBlock): ...
class BlockManager:
blocks: tuple[B, ...]
axes: list[Index]
_known_consolidated: bool
_is_consolidated: bool
_blknos: np.ndarray
_blklocs: np.ndarray
def __init__(
self, blocks: tuple[B, ...], axes: list[Index], verify_integrity=True
): ...
def get_slice(self: T, slobj: slice, axis: int = ...) -> T: ...