Search is not available for this dataset
repo_id
stringlengths
12
110
file_path
stringlengths
24
164
content
stringlengths
3
89.3M
__index_level_0__
int64
0
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_testing/compat.py
""" Helpers for sharing tests between DataFrame/Series """ from __future__ import annotations from typing import TYPE_CHECKING from pandas import DataFrame if TYPE_CHECKING: from pandas._typing import DtypeObj def get_dtype(obj) -> DtypeObj: if isinstance(obj, DataFrame): # Note: we are assuming on...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_testing/_warnings.py
from __future__ import annotations from contextlib import ( contextmanager, nullcontext, ) import inspect import re import sys from typing import ( TYPE_CHECKING, Literal, cast, ) import warnings if TYPE_CHECKING: from collections.abc import ( Generator, Sequence, ) @cont...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_testing/__init__.py
from __future__ import annotations import collections from collections import Counter from datetime import datetime from decimal import Decimal import operator import os import re import string from sys import byteorder from typing import ( TYPE_CHECKING, Callable, ContextManager, cast, ) import numpy...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/compat/_constants.py
""" _constants ====== Constants relevant for the Python implementation. """ from __future__ import annotations import platform import sys import sysconfig IS64 = sys.maxsize > 2**32 PY310 = sys.version_info >= (3, 10) PY311 = sys.version_info >= (3, 11) PY312 = sys.version_info >= (3, 12) PYPY = platform.python_im...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/compat/compressors.py
""" Patched ``BZ2File`` and ``LZMAFile`` to handle pickle protocol 5. """ from __future__ import annotations from pickle import PickleBuffer from pandas.compat._constants import PY310 try: import bz2 has_bz2 = True except ImportError: has_bz2 = False try: import lzma has_lzma = True except Im...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/compat/pyarrow.py
""" support pyarrow compatibility across versions """ from __future__ import annotations from pandas.util.version import Version try: import pyarrow as pa _palv = Version(Version(pa.__version__).base_version) pa_version_under10p1 = _palv < Version("10.0.1") pa_version_under11p0 = _palv < Version("11...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/compat/_optional.py
from __future__ import annotations import importlib import sys from typing import TYPE_CHECKING import warnings from pandas.util._exceptions import find_stack_level from pandas.util.version import Version if TYPE_CHECKING: import types # Update install.rst & setup.cfg when updating versions! VERSIONS = { ...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/compat/__init__.py
""" compat ====== Cross-compatible functions for different versions of Python. Other items: * platform checker """ from __future__ import annotations import os import platform import sys from typing import TYPE_CHECKING from pandas.compat._constants import ( IS64, ISMUSL, PY310, PY311, PY312, ...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/compat/pickle_compat.py
""" Support pre-0.12 series pickle compatibility. """ from __future__ import annotations import contextlib import copy import io import pickle as pkl from typing import TYPE_CHECKING import numpy as np from pandas._libs.arrays import NDArrayBacked from pandas._libs.tslibs import BaseOffset from pandas import Index ...
0
public_repos/pandas/pandas/compat
public_repos/pandas/pandas/compat/numpy/function.py
""" For compatibility with numpy libraries, pandas functions or methods have to accept '*args' and '**kwargs' parameters to accommodate numpy arguments that are not actually used or respected in the pandas implementation. To ensure that users do not abuse these parameters, validation is performed in 'validators.py' to...
0
public_repos/pandas/pandas/compat
public_repos/pandas/pandas/compat/numpy/__init__.py
""" support numpy compatibility across versions """ import warnings import numpy as np from pandas.util.version import Version # numpy versioning _np_version = np.__version__ _nlv = Version(_np_version) np_version_lt1p23 = _nlv < Version("1.23") np_version_gte1p24 = _nlv >= Version("1.24") np_version_gte1p24p3 = _nl...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/arrays/__init__.py
""" All of pandas' ExtensionArrays. See :ref:`extending.extension-types` for more. """ from pandas.core.arrays import ( ArrowExtensionArray, ArrowStringArray, BooleanArray, Categorical, DatetimeArray, FloatingArray, IntegerArray, IntervalArray, NumpyExtensionArray, PeriodArray, ...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/hashtable.pxd
from numpy cimport ( intp_t, ndarray, ) from pandas._libs.khash cimport ( complex64_t, complex128_t, float32_t, float64_t, int8_t, int16_t, int32_t, int64_t, kh_complex64_t, kh_complex128_t, kh_float32_t, kh_float64_t, kh_int8_t, kh_int16_t, kh_int32_...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/byteswap.pyx
""" The following are faster versions of struct.unpack that avoid the overhead of Python function calls. In the SAS7BDAT parser, they may be called up to (n_rows * n_cols) times. """ from cython cimport Py_ssize_t from libc.stdint cimport ( uint16_t, uint32_t, uint64_t, ) from libc.string cimport memcpy ...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/khash_for_primitive_helper.pxi.in
""" Template for wrapping khash-tables for each primitive `dtype` WARNING: DO NOT edit .pxi FILE directly, .pxi is generated from .pxi.in """ {{py: # name, c_type primitive_types = [('int64', 'int64_t'), ('uint64', 'uint64_t'), ('float64', 'float64_t'), ('int3...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/hashtable.pyi
from typing import ( Any, Hashable, Literal, ) import numpy as np from pandas._typing import npt def unique_label_indices( labels: np.ndarray, # const int64_t[:] ) -> np.ndarray: ... class Factorizer: count: int uniques: Any def __init__(self, size_hint: int) -> None: ... def get_co...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/arrays.pyi
from typing import Sequence import numpy as np from pandas._typing import ( AxisInt, DtypeObj, Self, Shape, ) class NDArrayBacked: _dtype: DtypeObj _ndarray: np.ndarray def __init__(self, values: np.ndarray, dtype: DtypeObj) -> None: ... @classmethod def _simple_new(cls, values: n...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/sparse_op_helper.pxi.in
""" Template for each `dtype` helper function for sparse ops WARNING: DO NOT edit .pxi FILE directly, .pxi is generated from .pxi.in """ # ---------------------------------------------------------------------- # Sparse op # ---------------------------------------------------------------------- ctypedef fused sparse_...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/join.pyx
cimport cython from cython cimport Py_ssize_t import numpy as np cimport numpy as cnp from numpy cimport ( int64_t, intp_t, ndarray, ) cnp.import_array() from pandas._libs.algos import groupsort_indexer from pandas._libs.dtypes cimport ( numeric_object_t, numeric_t, ) @cython.wraparound(False)...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/parsers.pyi
from typing import ( Hashable, Literal, ) import numpy as np from pandas._typing import ( ArrayLike, Dtype, npt, ) STR_NA_VALUES: set[str] DEFAULT_BUFFER_HEURISTIC: int def sanitize_objects( values: npt.NDArray[np.object_], na_values: set, ) -> int: ... class TextReader: unnamed_col...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/reshape.pyi
import numpy as np from pandas._typing import npt def unstack( values: np.ndarray, # reshape_t[:, :] mask: np.ndarray, # const uint8_t[:] stride: int, length: int, width: int, new_values: np.ndarray, # reshape_t[:, :] new_mask: np.ndarray, # uint8_t[:, :] ) -> None: ... def explode( ...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/internals.pyx
from collections import defaultdict import weakref cimport cython from cpython.pyport cimport PY_SSIZE_T_MAX from cpython.slice cimport PySlice_GetIndicesEx from cython cimport Py_ssize_t import numpy as np cimport numpy as cnp from numpy cimport ( NPY_INTP, int64_t, intp_t, ndarray, ) cnp.import_ar...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/algos_common_helper.pxi.in
""" Template for each `dtype` helper function using 1-d template WARNING: DO NOT edit .pxi FILE directly, .pxi is generated from .pxi.in """ # ---------------------------------------------------------------------- # ensure_dtype # ---------------------------------------------------------------------- def ensure_pla...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/lib.pxd
from numpy cimport ndarray cdef bint c_is_list_like(object, bint) except -1 cpdef ndarray eq_NA_compat(ndarray[object] arr, object key)
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/algos_take_helper.pxi.in
""" Template for each `dtype` helper function for take WARNING: DO NOT edit .pxi FILE directly, .pxi is generated from .pxi.in """ # ---------------------------------------------------------------------- # take_1d, take_2d # ---------------------------------------------------------------------- {{py: # c_type_in, ...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/hashtable_class_helper.pxi.in
""" Template for each `dtype` helper function for hashtable WARNING: DO NOT edit .pxi FILE directly, .pxi is generated from .pxi.in """ {{py: # name complex_types = ['complex64', 'complex128'] }} {{for name in complex_types}} cdef kh{{name}}_t to_kh{{name}}_t({{name}}_t val) noexcept nogil: cd...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/algos.pxd
from pandas._libs.dtypes cimport ( numeric_object_t, numeric_t, ) cdef numeric_t kth_smallest_c(numeric_t* arr, Py_ssize_t k, Py_ssize_t n) noexcept nogil cdef enum TiebreakEnumType: TIEBREAK_AVERAGE TIEBREAK_MIN, TIEBREAK_MAX TIEBREAK_FIRST TIEBREAK_FIRST_DESCENDING TIEBREAK_DENSE ...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/properties.pyx
from cpython.dict cimport ( PyDict_Contains, PyDict_GetItem, PyDict_SetItem, ) from cython cimport Py_ssize_t cdef class CachedProperty: cdef readonly: object fget, name, __doc__ def __init__(self, fget): self.fget = fget self.name = fget.__name__ self.__doc__ = g...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/ops_dispatch.pyi
import numpy as np def maybe_dispatch_ufunc_to_dunder_op( self, ufunc: np.ufunc, method: str, *inputs, **kwargs ): ...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/lib.pyx
from collections import abc from decimal import Decimal from enum import Enum from sys import getsizeof from typing import ( Literal, _GenericAlias, ) cimport cython from cpython.datetime cimport ( PyDate_Check, PyDateTime_Check, PyDelta_Check, PyTime_Check, date, datetime, import_d...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/meson.build
_algos_take_helper = custom_target('algos_take_helper_pxi', output: 'algos_take_helper.pxi', input: 'algos_take_helper.pxi.in', command: [ py, tempita, '@INPUT@', '-o', '@OUTDIR@' ] ) _algos_common_helper = custom_target('algos_common_helper_pxi', output: 'algos_common_helper.pxi', input...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/sparse.pyx
cimport cython import numpy as np cimport numpy as cnp from libc.math cimport ( INFINITY as INF, NAN as NaN, ) from numpy cimport ( float64_t, int8_t, int32_t, int64_t, ndarray, uint8_t, ) cnp.import_array() # -------------------------------------------------------------------------...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/testing.pyx
import cmath import math import warnings import numpy as np from numpy cimport import_array import_array() from pandas._libs.missing cimport ( checknull, is_matching_na, ) from pandas._libs.util cimport ( is_array, is_complex_object, is_real_number_object, ) from pandas.util._exceptions import ...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/groupby.pyx
cimport cython from cython cimport ( Py_ssize_t, floating, ) from libc.math cimport ( NAN, sqrt, ) from libc.stdlib cimport ( free, malloc, ) import numpy as np cimport numpy as cnp from numpy cimport ( complex64_t, complex128_t, float32_t, float64_t, int8_t, int64_t, ...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/util.pxd
cimport numpy as cnp from libc.stdint cimport ( INT8_MAX, INT8_MIN, INT16_MAX, INT16_MIN, INT32_MAX, INT32_MIN, INT64_MAX, INT64_MIN, UINT8_MAX, UINT16_MAX, UINT32_MAX, UINT64_MAX, ) from pandas._libs.tslibs.util cimport *
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/sas.pyx
# cython: language_level=3, initializedcheck=False # cython: warn.maybe_uninitialized=True, warn.unused=True from cython cimport Py_ssize_t from libc.stddef cimport size_t from libc.stdint cimport ( int64_t, uint8_t, uint16_t, uint32_t, uint64_t, ) from libc.stdlib cimport ( calloc, free, ) ...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/missing.pxd
from numpy cimport ( ndarray, uint8_t, ) cpdef bint is_matching_na(object left, object right, bint nan_matches_none=*) cpdef bint check_na_tuples_nonequal(object left, object right) cpdef bint checknull(object val, bint inf_as_na=*) cpdef ndarray[uint8_t] isnaobj(ndarray arr, bint inf_as_na=*) cdef bint is_...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/index.pyx
cimport cython from cpython.sequence cimport PySequence_GetItem import numpy as np cimport numpy as cnp from numpy cimport ( int64_t, intp_t, ndarray, uint8_t, uint64_t, ) cnp.import_array() from pandas._libs cimport util from pandas._libs.hashtable cimport HashTable from pandas._libs.tslibs.na...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/arrays.pyx
""" Cython implementations for internal ExtensionArrays. """ cimport cython import numpy as np cimport numpy as cnp from cpython cimport PyErr_Clear from numpy cimport ndarray cnp.import_array() @cython.freelist(16) cdef class NDArrayBacked: """ Implementing these methods in cython improves performance qui...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/ops.pyi
from typing import ( Any, Callable, Iterable, Literal, TypeAlias, overload, ) import numpy as np from pandas._typing import npt _BinOp: TypeAlias = Callable[[Any, Any], Any] _BoolOp: TypeAlias = Callable[[Any, Any], bool] def scalar_compare( values: np.ndarray, # object[:] val: obje...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/json.pyi
from typing import ( Any, Callable, ) def ujson_dumps( obj: Any, ensure_ascii: bool = ..., double_precision: int = ..., indent: int = ..., orient: str = ..., date_unit: str = ..., iso_dates: bool = ..., default_handler: None | Callable[[Any], str | float | bool | list | dict...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/index_class_helper.pxi.in
""" Template for functions of IndexEngine subclasses. WARNING: DO NOT edit .pxi FILE directly, .pxi is generated from .pxi.in """ # ---------------------------------------------------------------------- # IndexEngine Subclass Methods # ---------------------------------------------------------------------- {{py: # n...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/writers.pyx
cimport cython from cython cimport Py_ssize_t import numpy as np from cpython cimport ( PyBytes_GET_SIZE, PyUnicode_GET_LENGTH, ) from numpy cimport ( ndarray, uint8_t, ) ctypedef fused pandas_string: str bytes @cython.boundscheck(False) @cython.wraparound(False) def write_csv_rows( list...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/hashing.pyx
# Translated from the reference implementation # at https://github.com/veorq/SipHash cimport cython from libc.stdlib cimport ( free, malloc, ) import numpy as np from numpy cimport ( import_array, ndarray, uint8_t, uint64_t, ) import_array() from pandas._libs.util cimport is_nan @cython.b...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/arrays.pxd
from numpy cimport ndarray cdef class NDArrayBacked: cdef: readonly ndarray _ndarray readonly object _dtype cpdef NDArrayBacked _from_backing_data(self, ndarray values) cpdef __setstate__(self, state)
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/interval.pyi
from typing import ( Any, Generic, TypeVar, overload, ) import numpy as np import numpy.typing as npt from pandas._typing import ( IntervalClosedType, Timedelta, Timestamp, ) VALID_CLOSED: frozenset[str] _OrderableScalarT = TypeVar("_OrderableScalarT", int, float) _OrderableTimesT = Type...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/parsers.pyx
# Copyright (c) 2012, Lambda Foundry, Inc. # See LICENSE for the license from collections import defaultdict from csv import ( QUOTE_MINIMAL, QUOTE_NONE, QUOTE_NONNUMERIC, ) import time import warnings from pandas.util._exceptions import find_stack_level from pandas import StringDtype from pandas.core.arr...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/missing.pyx
from decimal import Decimal import numbers from sys import maxsize cimport cython from cpython.datetime cimport ( date, time, timedelta, ) from cython cimport Py_ssize_t import numpy as np cimport numpy as cnp from numpy cimport ( flatiter, float64_t, int64_t, ndarray, uint8_t, ) cnp...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/sas.pyi
from pandas.io.sas.sas7bdat import SAS7BDATReader class Parser: def __init__(self, parser: SAS7BDATReader) -> None: ... def read(self, nrows: int) -> None: ... def get_subheader_index(signature: bytes) -> int: ...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/hashtable.pyx
cimport cython from cpython.mem cimport ( PyMem_Free, PyMem_Malloc, ) from cpython.ref cimport ( Py_INCREF, PyObject, ) from libc.stdlib cimport ( free, malloc, ) import numpy as np cimport numpy as cnp from numpy cimport ndarray cnp.import_array() from pandas._libs cimport util from pandas...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/reshape.pyx
cimport cython from cython cimport Py_ssize_t from numpy cimport ( int64_t, ndarray, uint8_t, ) import numpy as np cimport numpy as cnp from libc.math cimport NAN cnp.import_array() from pandas._libs.dtypes cimport numeric_object_t from pandas._libs.lib cimport c_is_list_like @cython.wraparound(False)...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/tslib.pyi
from datetime import tzinfo import numpy as np from pandas._typing import npt def format_array_from_datetime( values: npt.NDArray[np.int64], tz: tzinfo | None = ..., format: str | None = ..., na_rep: str | float = ..., reso: int = ..., # NPY_DATETIMEUNIT ) -> npt.NDArray[np.object_]: ... def arr...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/internals.pyi
from typing import ( Iterator, Sequence, final, overload, ) import weakref import numpy as np from pandas._typing import ( ArrayLike, Self, npt, ) from pandas import Index from pandas.core.internals.blocks import Block as B def slice_len(slc: slice, objlen: int = ...) -> int: ... def get...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/byteswap.pyi
def read_float_with_byteswap(data: bytes, offset: int, byteswap: bool) -> float: ... def read_double_with_byteswap(data: bytes, offset: int, byteswap: bool) -> float: ... def read_uint16_with_byteswap(data: bytes, offset: int, byteswap: bool) -> int: ... def read_uint32_with_byteswap(data: bytes, offset: int, byteswap:...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/algos.pyx
cimport cython from cython cimport Py_ssize_t from libc.math cimport ( fabs, sqrt, ) from libc.stdlib cimport ( free, malloc, ) from libc.string cimport memmove import numpy as np cimport numpy as cnp from numpy cimport ( NPY_FLOAT64, NPY_INT8, NPY_INT16, NPY_INT32, NPY_INT64, ...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/index.pyi
import numpy as np from pandas._typing import npt from pandas import MultiIndex from pandas.core.arrays import ExtensionArray multiindex_nulls_shift: int class IndexEngine: over_size_threshold: bool def __init__(self, values: np.ndarray) -> None: ... def __contains__(self, val: object) -> bool: ... ...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/hashtable_func_helper.pxi.in
""" Template for each `dtype` helper function for hashtable WARNING: DO NOT edit .pxi FILE directly, .pxi is generated from .pxi.in """ {{py: # name, dtype, ttype, c_type, to_c_type dtypes = [('Complex128', 'complex128', 'complex128', 'khcomplex128_t', 'to_khcomplex128_t'), ('Compl...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/intervaltree.pxi.in
""" Template for intervaltree WARNING: DO NOT edit .pxi FILE directly, .pxi is generated from .pxi.in """ from pandas._libs.algos import is_monotonic ctypedef fused int_scalar_t: int64_t float64_t ctypedef fused uint_scalar_t: uint64_t float64_t ctypedef fused scalar_t: int_scalar_t uint_sc...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/ops_dispatch.pyx
DISPATCHED_UFUNCS = { "add", "sub", "mul", "pow", "mod", "floordiv", "truediv", "divmod", "eq", "ne", "lt", "gt", "le", "ge", "remainder", "matmul", "or", "xor", "and", "neg", "pos", "abs", } UNARY_UFUNCS = { "neg", "pos", ...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/sparse.pyi
from typing import Sequence import numpy as np from pandas._typing import ( Self, npt, ) class SparseIndex: length: int npoints: int def __init__(self) -> None: ... @property def ngaps(self) -> int: ... @property def nbytes(self) -> int: ... @property def indices(self) -> ...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/writers.pyi
import numpy as np from pandas._typing import ArrayLike def write_csv_rows( data: list[ArrayLike], data_index: np.ndarray, nlevels: int, cols: np.ndarray, writer: object, # _csv.writer ) -> None: ... def convert_json_to_lines(arr: str) -> str: ... def max_len_string_array( arr: np.ndarray, #...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/khash.pxd
from cpython.object cimport PyObject from numpy cimport ( complex64_t, complex128_t, float32_t, float64_t, int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t, uint32_t, uint64_t, ) cdef extern from "pandas/vendored/klib/khash_python.h": const int KHASH_TRACE_DOMAI...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/indexing.pyi
from typing import ( Generic, TypeVar, ) from pandas.core.indexing import IndexingMixin _IndexingMixinT = TypeVar("_IndexingMixinT", bound=IndexingMixin) class NDFrameIndexerBase(Generic[_IndexingMixinT]): name: str # in practice obj is either a DataFrame or a Series obj: _IndexingMixinT def...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/tslib.pyx
import warnings from pandas.util._exceptions import find_stack_level cimport cython from datetime import timezone from cpython.datetime cimport ( PyDate_Check, PyDateTime_Check, datetime, import_datetime, timedelta, tzinfo, ) from cpython.object cimport PyObject # import datetime C API impo...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/missing.pyi
import numpy as np from numpy import typing as npt class NAType: def __new__(cls, *args, **kwargs): ... NA: NAType def is_matching_na( left: object, right: object, nan_matches_none: bool = ... ) -> bool: ... def isposinf_scalar(val: object) -> bool: ... def isneginf_scalar(val: object) -> bool: ... def check...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/indexing.pyx
cdef class NDFrameIndexerBase: """ A base class for _NDFrameIndexer for fast instantiation and attribute access. """ cdef: Py_ssize_t _ndim cdef public: str name object obj def __init__(self, name: str, obj): self.obj = obj self.name = name self....
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/join.pyi
import numpy as np from pandas._typing import npt def inner_join( left: np.ndarray, # const intp_t[:] right: np.ndarray, # const intp_t[:] max_groups: int, sort: bool = ..., ) -> tuple[npt.NDArray[np.intp], npt.NDArray[np.intp]]: ... def left_outer_join( left: np.ndarray, # const intp_t[:] ...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/ops.pyx
import operator cimport cython from cpython.object cimport ( Py_EQ, Py_GE, Py_GT, Py_LE, Py_LT, Py_NE, PyObject_RichCompareBool, ) from cython cimport Py_ssize_t import numpy as np from numpy cimport ( import_array, ndarray, uint8_t, ) import_array() from pandas._libs.missi...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/lib.pyi
# TODO(npdtypes): Many types specified here can be made more specific/accurate; # the more specific versions are specified in comments from decimal import Decimal from typing import ( Any, Callable, Final, Generator, Hashable, Literal, TypeAlias, overload, ) import numpy as np from pa...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/interval.pyx
import numbers from operator import ( le, lt, ) from cpython.datetime cimport ( PyDelta_Check, import_datetime, ) import_datetime() cimport cython from cpython.object cimport PyObject_RichCompare from cython cimport Py_ssize_t import numpy as np cimport numpy as cnp from numpy cimport ( NPY_QUI...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/groupby.pyi
from typing import Literal import numpy as np from pandas._typing import npt def group_median_float64( out: np.ndarray, # ndarray[float64_t, ndim=2] counts: npt.NDArray[np.int64], values: np.ndarray, # ndarray[float64_t, ndim=2] labels: npt.NDArray[np.int64], min_count: int = ..., # Py_ssize_t...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/dtypes.pxd
""" Common location for shared fused types """ from numpy cimport ( float32_t, float64_t, int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t, uint32_t, uint64_t, ) # All numeric types except complex ctypedef fused numeric_t: int8_t int16_t int32_t int64_t ...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/algos.pyi
from typing import Any import numpy as np from pandas._typing import npt class Infinity: def __eq__(self, other) -> bool: ... def __ne__(self, other) -> bool: ... def __lt__(self, other) -> bool: ... def __le__(self, other) -> bool: ... def __gt__(self, other) -> bool: ... def __ge__(self, ot...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/__init__.py
__all__ = [ "NaT", "NaTType", "OutOfBoundsDatetime", "Period", "Timedelta", "Timestamp", "iNaT", "Interval", ] # Below imports needs to happen first to ensure pandas top level # module gets monkeypatched with the pandas_datetime_CAPI # see pandas_datetime_exec in pd_datetime.c import p...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/testing.pyi
def assert_dict_equal(a, b, compare_keys: bool = ...): ... def assert_almost_equal( a, b, rtol: float = ..., atol: float = ..., check_dtype: bool = ..., obj=..., lobj=..., robj=..., index_values=..., ): ...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/properties.pyi
from typing import ( Sequence, overload, ) from pandas._typing import ( AnyArrayLike, DataFrame, Index, Series, ) # note: this is a lie to make type checkers happy (they special # case property). cache_readonly uses attribute names similar to # property (fget) but it does not provide fset and ...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/_libs/hashing.pyi
import numpy as np from pandas._typing import npt def hash_object_array( arr: npt.NDArray[np.object_], key: str, encoding: str = ..., ) -> npt.NDArray[np.uint64]: ...
0
public_repos/pandas/pandas/_libs
public_repos/pandas/pandas/_libs/window/meson.build
py.extension_module( 'aggregations', ['aggregations.pyx'], cython_args: ['-X always_allow_keywords=true'], include_directories: [inc_np, inc_pd], subdir: 'pandas/_libs/window', override_options : ['cython_language=cpp'], install: true ) py.extension_module( 'indexers', ['indexers.py...
0
public_repos/pandas/pandas/_libs
public_repos/pandas/pandas/_libs/window/aggregations.pyi
from typing import ( Any, Callable, Literal, ) import numpy as np from pandas._typing import ( WindowingRankType, npt, ) def roll_sum( values: np.ndarray, # const float64_t[:] start: np.ndarray, # np.ndarray[np.int64] end: np.ndarray, # np.ndarray[np.int64] minp: int, # int64_...
0
public_repos/pandas/pandas/_libs
public_repos/pandas/pandas/_libs/window/indexers.pyi
import numpy as np from pandas._typing import npt def calculate_variable_window_bounds( num_values: int, # int64_t window_size: int, # int64_t min_periods, center: bool, closed: str | None, index: np.ndarray, # const int64_t[:] ) -> tuple[npt.NDArray[np.int64], npt.NDArray[np.int64]]: ...
0
public_repos/pandas/pandas/_libs
public_repos/pandas/pandas/_libs/window/indexers.pyx
# cython: boundscheck=False, wraparound=False, cdivision=True import numpy as np from numpy cimport ( int64_t, ndarray, ) # Cython routines for window indexers def calculate_variable_window_bounds( int64_t num_values, int64_t window_size, object min_periods, # unused but here to match get_wind...
0
public_repos/pandas/pandas/_libs
public_repos/pandas/pandas/_libs/window/aggregations.pyx
# cython: boundscheck=False, wraparound=False, cdivision=True from libc.math cimport ( round, signbit, sqrt, ) from libcpp.deque cimport deque from pandas._libs.algos cimport TiebreakEnumType import numpy as np cimport numpy as cnp from numpy cimport ( float32_t, float64_t, int64_t, ndar...
0
public_repos/pandas/pandas/_libs/include
public_repos/pandas/pandas/_libs/include/pandas/inline_helper.h
/* Copyright (c) 2016, PyData Development Team All rights reserved. Distributed under the terms of the BSD Simplified License. The full license is in the LICENSE file, distributed with this software. */ #pragma once #ifndef PANDAS_INLINE #if defined(__clang__) #define PANDAS_INLINE static __inline__ __attribute__((...
0
public_repos/pandas/pandas/_libs/include
public_repos/pandas/pandas/_libs/include/pandas/portable.h
/* Copyright (c) 2016, PyData Development Team All rights reserved. Distributed under the terms of the BSD Simplified License. The full license is in the LICENSE file, distributed with this software. */ #pragma once #include <string.h> #if defined(_MSC_VER) #define strcasecmp(s1, s2) _stricmp(s1, s2) #endif // GH...
0
public_repos/pandas/pandas/_libs/include
public_repos/pandas/pandas/_libs/include/pandas/skiplist.h
/* Copyright (c) 2016, PyData Development Team All rights reserved. Distributed under the terms of the BSD Simplified License. The full license is in the LICENSE file, distributed with this software. Flexibly-sized, index-able skiplist data structure for maintaining a sorted list of values Port of Wes McKinney's Cy...
0
public_repos/pandas/pandas/_libs/include/pandas
public_repos/pandas/pandas/_libs/include/pandas/datetime/pd_datetime.h
/* Copyright (c) 2016, PyData Development Team All rights reserved. Distributed under the terms of the BSD Simplified License. The full license is in the LICENSE file, distributed with this software. Written by Mark Wiebe (mwwiebe@gmail.com) Copyright (c) 2011 by Enthought, Inc. Copyright (c) 2005-2011, NumPy Devel...
0
public_repos/pandas/pandas/_libs/include/pandas
public_repos/pandas/pandas/_libs/include/pandas/datetime/date_conversions.h
/* Copyright (c) 2020, PyData Development Team All rights reserved. Distributed under the terms of the BSD Simplified License. The full license is in the LICENSE file, distributed with this software. */ #pragma once #define PY_SSIZE_T_CLEAN #include <Python.h> #include <numpy/ndarraytypes.h> // Scales value inplace ...
0
public_repos/pandas/pandas/_libs/include/pandas
public_repos/pandas/pandas/_libs/include/pandas/parser/io.h
/* Copyright (c) 2016, PyData Development Team All rights reserved. Distributed under the terms of the BSD Simplified License. The full license is in the LICENSE file, distributed with this software. */ #pragma once #define PY_SSIZE_T_CLEAN #include "tokenizer.h" #include <Python.h> #define FS(source) ((file_sourc...
0
public_repos/pandas/pandas/_libs/include/pandas
public_repos/pandas/pandas/_libs/include/pandas/parser/tokenizer.h
/* Copyright (c) 2012, Lambda Foundry, Inc., except where noted Incorporates components of WarrenWeckesser/textreader, licensed under 3-clause BSD See LICENSE for the license */ #pragma once #define PY_SSIZE_T_CLEAN #include <Python.h> #define ERROR_NO_DIGITS 1 #define ERROR_OVERFLOW 2 #define ERROR_INVALID_CHAR...
0
public_repos/pandas/pandas/_libs/include/pandas
public_repos/pandas/pandas/_libs/include/pandas/parser/pd_parser.h
/* Copyright (c) 2023, PyData Development Team All rights reserved. Distributed under the terms of the BSD Simplified License. */ #pragma once #ifdef __cplusplus extern "C" { #endif #define PY_SSIZE_T_CLEAN #include "pandas/parser/tokenizer.h" #include <Python.h> typedef struct { int (*to_double)(char *, double...
0
public_repos/pandas/pandas/_libs/include/pandas/vendored/numpy
public_repos/pandas/pandas/_libs/include/pandas/vendored/numpy/datetime/np_datetime_strings.h
/* Copyright (c) 2016, PyData Development Team All rights reserved. Distributed under the terms of the BSD Simplified License. The full license is in the LICENSE file, distributed with this software. Written by Mark Wiebe (mwwiebe@gmail.com) Copyright (c) 2011 by Enthought, Inc. Copyright (c) 2005-2011, NumPy Deve...
0
public_repos/pandas/pandas/_libs/include/pandas/vendored/numpy
public_repos/pandas/pandas/_libs/include/pandas/vendored/numpy/datetime/np_datetime.h
/* Copyright (c) 2016, PyData Development Team All rights reserved. Distributed under the terms of the BSD Simplified License. The full license is in the LICENSE file, distributed with this software. Copyright (c) 2005-2011, NumPy Developers All rights reserved. This file is derived from NumPy 1.7. See NUMPY_LICEN...
0
public_repos/pandas/pandas/_libs/include/pandas/vendored/ujson
public_repos/pandas/pandas/_libs/include/pandas/vendored/ujson/python/version.h
/* Copyright (c) 2011-2013, ESN Social Software AB and Jonas Tarnstrom All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, t...
0
public_repos/pandas/pandas/_libs/include/pandas/vendored/ujson
public_repos/pandas/pandas/_libs/include/pandas/vendored/ujson/lib/ultrajson.h
/* Copyright (c) 2011-2013, ESN Social Software AB and Jonas Tarnstrom All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, t...
0
public_repos/pandas/pandas/_libs/include/pandas/vendored
public_repos/pandas/pandas/_libs/include/pandas/vendored/klib/khash.h
// Licence at LICENSES/KLIB_LICENSE /* An example: #include "khash.h" KHASH_MAP_INIT_INT(32, char) int main() { int ret, is_missing; khiter_t k; khash_t(32) *h = kh_init(32); k = kh_put(32, h, 5, &ret); if (!ret) kh_del(32, h, k); kh_value(h, k) = 10; k = kh_g...
0
public_repos/pandas/pandas/_libs/include/pandas/vendored
public_repos/pandas/pandas/_libs/include/pandas/vendored/klib/khash_python.h
// Licence at LICENSES/KLIB_LICENSE #include <Python.h> #include <string.h> typedef struct { float real; float imag; } khcomplex64_t; typedef struct { double real; double imag; } khcomplex128_t; // khash should report usage to tracemalloc #if PY_VERSION_HEX >= 0x03060000 #include <pymem.h> #if PY_VERSION_HEX...
0
public_repos/pandas/pandas/_libs
public_repos/pandas/pandas/_libs/tslibs/np_datetime.pyi
import numpy as np from pandas._typing import npt class OutOfBoundsDatetime(ValueError): ... class OutOfBoundsTimedelta(ValueError): ... # only exposed for testing def py_get_unit_from_dtype(dtype: np.dtype): ... def py_td64_to_tdstruct(td64: int, unit: int) -> dict: ... def astype_overflowsafe( values: np.ndarr...
0
public_repos/pandas/pandas/_libs
public_repos/pandas/pandas/_libs/tslibs/np_datetime.pyx
from cpython.datetime cimport ( PyDateTime_CheckExact, PyDateTime_DATE_GET_HOUR, PyDateTime_DATE_GET_MICROSECOND, PyDateTime_DATE_GET_MINUTE, PyDateTime_DATE_GET_SECOND, PyDateTime_GET_DAY, PyDateTime_GET_MONTH, PyDateTime_GET_YEAR, import_datetime, ) from cpython.object cimport ( ...
0
public_repos/pandas/pandas/_libs
public_repos/pandas/pandas/_libs/tslibs/ccalendar.pyx
# cython: boundscheck=False """ Cython implementations of functions resembling the stdlib calendar module """ cimport cython from numpy cimport ( int32_t, int64_t, ) # ---------------------------------------------------------------------- # Constants # Slightly more performant cython lookups than a 2D table #...
0
public_repos/pandas/pandas/_libs
public_repos/pandas/pandas/_libs/tslibs/conversion.pyi
from datetime import ( datetime, tzinfo, ) import numpy as np DT64NS_DTYPE: np.dtype TD64NS_DTYPE: np.dtype def precision_from_unit( in_reso: int, out_reso: int = ..., ) -> tuple[int, int]: ... # (int64_t, _) def localize_pydatetime(dt: datetime, tz: tzinfo | None) -> datetime: ...
0