repo
stringlengths
7
90
file_url
stringlengths
81
315
file_path
stringlengths
4
228
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 14:38:15
2026-01-05 02:33:18
truncated
bool
2 classes
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/array.py
asv_bench/benchmarks/array.py
import numpy as np import pandas as pd class BooleanArray: def setup(self): self.values_bool = np.array([True, False, True, False]) self.values_float = np.array([1.0, 0.0, 1.0, 0.0]) self.values_integer = np.array([1, 0, 1, 0]) self.values_integer_like = [1, 0, 1, 0] self....
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/reindex.py
asv_bench/benchmarks/reindex.py
import numpy as np from pandas import ( DataFrame, Index, MultiIndex, Series, date_range, period_range, ) class Reindex: def setup(self): rng = date_range(start="1/1/1970", periods=10000, freq="1min") self.df = DataFrame(np.random.rand(10000, 10), index=rng, columns=range(...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/hash_functions.py
asv_bench/benchmarks/hash_functions.py
import numpy as np import pandas as pd class UniqueForLargePyObjectInts: def setup(self): lst = [x << 32 for x in range(5000)] self.arr = np.array(lst, dtype=np.object_) def time_unique(self): pd.unique(self.arr) class Float64GroupIndex: # GH28303 def setup(self): s...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/__init__.py
asv_bench/benchmarks/__init__.py
"""Pandas benchmarks."""
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/dtypes.py
asv_bench/benchmarks/dtypes.py
import string import numpy as np import pandas as pd from pandas import ( DataFrame, Index, ) import pandas._testing as tm from pandas.api.types import ( is_extension_array_dtype, pandas_dtype, ) from .pandas_vb_common import ( datetime_dtypes, extension_dtypes, numeric_dtypes, string...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/package.py
asv_bench/benchmarks/package.py
""" Benchmarks for pandas at the package-level. """ import subprocess import sys class TimeImport: def time_import(self): # on py37+ we the "-X importtime" usage gives us a more precise # measurement of the import time we actually care about, # without the subprocess or interpreter over...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/stat_ops.py
asv_bench/benchmarks/stat_ops.py
import numpy as np import pandas as pd ops = ["mean", "sum", "median", "std", "skew", "kurt", "prod", "sem", "var"] class FrameOps: params = [ops, ["float", "int", "Int64"], [0, 1, None]] param_names = ["op", "dtype", "axis"] def setup(self, op, dtype, axis): values = np.random.randn(100000, 4)...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/gil.py
asv_bench/benchmarks/gil.py
from functools import wraps import threading import numpy as np from pandas import ( DataFrame, Index, Series, date_range, factorize, read_csv, ) from pandas.core.algorithms import take_nd try: from pandas import ( rolling_kurt, rolling_max, rolling_mean, r...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/index_cached_properties.py
asv_bench/benchmarks/index_cached_properties.py
import pandas as pd class IndexCache: number = 1 repeat = (3, 100, 20) params = [ [ "CategoricalIndex", "DatetimeIndex", "Float64Index", "IntervalIndex", "Int64Index", "MultiIndex", "PeriodIndex", "Ran...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/sparse.py
asv_bench/benchmarks/sparse.py
import numpy as np import scipy.sparse import pandas as pd from pandas import ( MultiIndex, Series, date_range, ) from pandas.arrays import SparseArray def make_array(size, dense_proportion, fill_value, dtype): dense_size = int(size * dense_proportion) arr = np.full(size, fill_value, dtype) i...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/indexing.py
asv_bench/benchmarks/indexing.py
""" These benchmarks are for Series and DataFrame indexing methods. For the lower-level methods directly on Index and subclasses, see index_object.py, indexing_engine.py, and index_cached.py """ from datetime import datetime import warnings import numpy as np from pandas import ( NA, CategoricalIndex, D...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/ctors.py
asv_bench/benchmarks/ctors.py
import numpy as np from pandas import ( DatetimeIndex, Index, MultiIndex, Series, Timestamp, date_range, ) def no_change(arr): return arr def list_of_str(arr): return list(arr.astype(str)) def gen_of_str(arr): return (x for x in arr.astype(str)) def arr_dict(arr): return...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/replace.py
asv_bench/benchmarks/replace.py
import numpy as np import pandas as pd class FillNa: params = [True, False] param_names = ["inplace"] def setup(self, inplace): N = 10**6 rng = pd.date_range("1/1/2000", periods=N, freq="min") data = np.random.randn(N) data[::2] = np.nan self.ts = pd.Series(data, ...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/indexing_engines.py
asv_bench/benchmarks/indexing_engines.py
""" Benchmarks in this file depend mostly on code in _libs/ We have to created masked arrays to test the masked engine though. The array is unpacked on the Cython level. If a PR does not edit anything in _libs, it is very unlikely that benchmarks in this file will be affected. """ import numpy as np from pandas._li...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/groupby.py
asv_bench/benchmarks/groupby.py
from functools import partial from itertools import product from string import ascii_letters import numpy as np from pandas import ( NA, Categorical, DataFrame, Index, MultiIndex, Series, Timestamp, date_range, period_range, to_timedelta, ) method_blocklist = { "object": {...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
true
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/rolling.py
asv_bench/benchmarks/rolling.py
import warnings import numpy as np import pandas as pd class Methods: params = ( ["DataFrame", "Series"], [("rolling", {"window": 10}), ("rolling", {"window": 1000}), ("expanding", {})], ["int", "float"], [ "median", "mean", "max", ...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/libs.py
asv_bench/benchmarks/libs.py
""" Benchmarks for code in pandas/_libs, excluding pandas/_libs/tslibs, which has its own directory. If a PR does not edit anything in _libs/, then it is unlikely that the benchmarks will be affected. """ import numpy as np from pandas._libs.lib import ( infer_dtype, is_list_like, is_scalar, ) from pand...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/multiindex_object.py
asv_bench/benchmarks/multiindex_object.py
import string import numpy as np from pandas import ( NA, DataFrame, Index, MultiIndex, RangeIndex, Series, array, date_range, ) class GetLoc: def setup(self): self.mi_large = MultiIndex.from_product( [np.arange(1000), np.arange(20), list(string.ascii_letters)...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/timedelta.py
asv_bench/benchmarks/timedelta.py
""" Timedelta benchmarks with non-tslibs dependencies. See benchmarks.tslibs.timedelta for benchmarks that rely only on tslibs. """ from pandas import ( DataFrame, Series, timedelta_range, ) class DatetimeAccessor: def setup_cache(self): N = 100000 series = Series(timedelta_range("1 ...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/tslibs/timestamp.py
asv_bench/benchmarks/tslibs/timestamp.py
from datetime import ( datetime, timezone, ) import zoneinfo import numpy as np from pandas import Timestamp from .tslib import _tzs class TimestampConstruction: def setup(self): self.npdatetime64 = np.datetime64("2020-01-01 00:00:00") self.dttime_unaware = datetime(2020, 1, 1, 0, 0, 0)...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/tslibs/resolution.py
asv_bench/benchmarks/tslibs/resolution.py
""" ipython analogue: tr = TimeResolution() mi = pd.MultiIndex.from_product(tr.params[:-1] + ([str(x) for x in tr.params[-1]],)) df = pd.DataFrame(np.nan, index=mi, columns=["mean", "stdev"]) for unit in tr.params[0]: for size in tr.params[1]: for tz in tr.params[2]: tr.setup(unit, size, tz) ...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/tslibs/normalize.py
asv_bench/benchmarks/tslibs/normalize.py
try: from pandas._libs.tslibs import ( is_date_array_normalized, normalize_i8_timestamps, ) except ImportError: from pandas._libs.tslibs.conversion import ( normalize_i8_timestamps, is_date_array_normalized, ) import pandas as pd from .tslib import ( _sizes, _tz...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/tslibs/offsets.py
asv_bench/benchmarks/tslibs/offsets.py
""" offsets benchmarks that rely only on tslibs. See benchmarks.offset for offsets benchmarks that rely on other parts of pandas. """ from datetime import datetime import numpy as np from pandas import offsets try: import pandas.tseries.holiday except ImportError: pass hcal = pandas.tseries.holiday.USFede...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/tslibs/period.py
asv_bench/benchmarks/tslibs/period.py
""" Period benchmarks that rely only on tslibs. See benchmarks.period for Period benchmarks that rely on other parts of pandas. """ import numpy as np from pandas._libs.tslibs.period import ( Period, periodarr_to_dt64arr, ) from pandas.tseries.frequencies import to_offset from .tslib import ( _sizes, ...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/tslibs/tslib.py
asv_bench/benchmarks/tslibs/tslib.py
""" ipython analogue: tr = TimeIntsToPydatetime() mi = pd.MultiIndex.from_product( tr.params[:-1] + ([str(x) for x in tr.params[-1]],) ) df = pd.DataFrame(np.nan, index=mi, columns=["mean", "stdev"]) for box in tr.params[0]: for size in tr.params[1]: for tz in tr.params[2]: tr.setup(box, si...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/tslibs/fields.py
asv_bench/benchmarks/tslibs/fields.py
import numpy as np from pandas._libs.tslibs.fields import ( get_date_field, get_start_end_field, get_timedelta_field, ) from .tslib import _sizes class TimeGetTimedeltaField: params = [ _sizes, ["seconds", "microseconds", "nanoseconds"], ] param_names = ["size", "field"] ...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/tslibs/__init__.py
asv_bench/benchmarks/tslibs/__init__.py
""" Benchmarks in this directory should depend only on tslibs, tseries.offsets, and to_offset. i.e. any code changes that do not touch those files should not need to run these benchmarks. """
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/tslibs/tz_convert.py
asv_bench/benchmarks/tslibs/tz_convert.py
from datetime import timezone import numpy as np from pandas._libs.tslibs.tzconversion import tz_localize_to_utc from .tslib import ( _sizes, _tzs, tzlocal_obj, ) try: old_sig = False from pandas._libs.tslibs import tz_convert_from_utc except ImportError: try: old_sig = False ...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/tslibs/timedelta.py
asv_bench/benchmarks/tslibs/timedelta.py
""" Timedelta benchmarks that rely only on tslibs. See benchmarks.timedeltas for Timedelta benchmarks that rely on other parts of pandas. """ import datetime import numpy as np from pandas import Timedelta class TimedeltaConstructor: def setup(self): self.nptimedelta64 = np.timedelta64(3600) se...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/algos/isin.py
asv_bench/benchmarks/algos/isin.py
import numpy as np from pandas import ( Categorical, Index, NaT, Series, date_range, ) class IsIn: params = [ "int64", "uint64", "object", "Int64", "boolean", "bool", "datetime64[ns]", "category[object]", "category[int]",...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/algos/__init__.py
asv_bench/benchmarks/algos/__init__.py
""" algos/ directory is intended for individual functions from core.algorithms In many cases these algorithms are reachable in multiple ways: algos.foo(x, y) Series(x).foo(y) Index(x).foo(y) pd.array(x).foo(y) In most cases we profile the Series variant directly, trusting the performance of the others to ...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/io/stata.py
asv_bench/benchmarks/io/stata.py
import numpy as np from pandas import ( DataFrame, Index, date_range, read_stata, ) from ..pandas_vb_common import BaseIO class Stata(BaseIO): params = ["tc", "td", "tm", "tw", "th", "tq", "ty"] param_names = ["convert_dates"] def setup(self, convert_dates): self.fname = "__test...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/io/excel.py
asv_bench/benchmarks/io/excel.py
from io import BytesIO import numpy as np from odf.opendocument import OpenDocumentSpreadsheet from odf.table import ( Table, TableCell, TableRow, ) from odf.text import P from pandas import ( DataFrame, ExcelWriter, Index, date_range, read_excel, ) def _generate_dataframe(): N =...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/io/parsers.py
asv_bench/benchmarks/io/parsers.py
try: from pandas._libs.tslibs.parsing import _does_string_look_like_datetime except ImportError: # Avoid whole benchmark suite import failure on asv (currently 0.4) pass class DoesStringLookLikeDatetime: params = (["2Q2005", "0.0", "10000"],) param_names = ["value"] def setup(self, value): ...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/io/sql.py
asv_bench/benchmarks/io/sql.py
import sqlite3 import numpy as np from sqlalchemy import create_engine from pandas import ( DataFrame, Index, date_range, read_sql_query, read_sql_table, ) class SQL: params = ["sqlalchemy", "sqlite"] param_names = ["connection"] def setup(self, connection): N = 10000 ...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/io/hdf.py
asv_bench/benchmarks/io/hdf.py
import numpy as np from pandas import ( DataFrame, HDFStore, Index, date_range, read_hdf, ) from ..pandas_vb_common import BaseIO class HDFStoreDataFrame(BaseIO): def setup(self): N = 25000 index = Index([f"i-{i}" for i in range(N)], dtype=object) self.df = DataFrame(...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/io/__init__.py
asv_bench/benchmarks/io/__init__.py
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/io/json.py
asv_bench/benchmarks/io/json.py
import sys import numpy as np from pandas import ( DataFrame, Index, concat, date_range, json_normalize, read_json, timedelta_range, ) from ..pandas_vb_common import BaseIO class ReadJSON(BaseIO): fname = "__test__.json" params = (["split", "index", "records"], ["int", "datetime...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/io/pickle.py
asv_bench/benchmarks/io/pickle.py
import numpy as np from pandas import ( DataFrame, Index, date_range, read_pickle, ) from ..pandas_vb_common import BaseIO class Pickle(BaseIO): def setup(self): self.fname = "__test__.pkl" N = 100000 C = 5 self.df = DataFrame( np.random.randn(N, C), ...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/io/sas.py
asv_bench/benchmarks/io/sas.py
from pathlib import Path from pandas import read_sas ROOT = Path(__file__).parents[3] / "pandas" / "tests" / "io" / "sas" / "data" class SAS: def time_read_sas7bdat(self): read_sas(ROOT / "test1.sas7bdat") def time_read_xpt(self): read_sas(ROOT / "paxraw_d_short.xpt") def time_read_sas...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/io/csv.py
asv_bench/benchmarks/io/csv.py
from io import ( BytesIO, StringIO, ) import random import string import numpy as np from pandas import ( Categorical, DataFrame, Index, concat, date_range, period_range, read_csv, to_datetime, ) from ..pandas_vb_common import BaseIO class ToCSV(BaseIO): fname = "__test_...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/asv_bench/benchmarks/io/style.py
asv_bench/benchmarks/io/style.py
import numpy as np from pandas import ( DataFrame, IndexSlice, ) class Render: params = [[12, 24, 36], [12, 120]] param_names = ["cols", "rows"] def setup(self, cols, rows): self.df = DataFrame( np.random.randn(rows, cols), columns=[f"float_{i + 1}" for i in range...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/_typing.py
pandas/_typing.py
from __future__ import annotations from builtins import type as type_t # pyright: ignore[reportUnusedImport] from collections.abc import ( Callable, Hashable, Iterator, Mapping, MutableMapping, Sequence, ) from datetime import ( date, datetime, timedelta, tzinfo, ) from os impo...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/testing.py
pandas/testing.py
""" Public testing utility functions. """ from pandas._testing import ( assert_extension_array_equal, assert_frame_equal, assert_index_equal, assert_series_equal, ) __all__ = [ "assert_extension_array_equal", "assert_frame_equal", "assert_index_equal", "assert_series_equal", ]
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/_version.py
pandas/_version.py
# This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by github's download-from-tag # feature). Distribution tarballs (built by setup.py sdist) and build # directories (produced by setup.py build) will contain a much shorter file # that just contains t...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/conftest.py
pandas/conftest.py
""" This file is very long and growing, but it was decided to not split it yet, as it's still manageable (2020-03-17, ~1.1k LoC). See gh-31989 Instead of splitting it was decided to define sections here: - Configuration / Settings - Autouse fixtures - Common arguments - Missing values & co. - Classes - Indices - Serie...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
true
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/__init__.py
pandas/__init__.py
from __future__ import annotations __docformat__ = "restructuredtext" # Let users know if they're missing any of our hard dependencies # except tzdata (see https://github.com/pandas-dev/pandas/issues/63264) _hard_dependencies = ("numpy", "dateutil") for _dependency in _hard_dependencies: try: __import__(...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/util/_tester.py
pandas/util/_tester.py
""" Entrypoint for testing from the top-level namespace. """ from __future__ import annotations import os import sys from pandas.compat._optional import import_optional_dependency from pandas.util._decorators import set_module PKG = os.path.dirname(os.path.dirname(__file__)) @set_module("pandas") def test(extra_a...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/util/_exceptions.py
pandas/util/_exceptions.py
from __future__ import annotations import contextlib import inspect import os import re from typing import ( TYPE_CHECKING, Any, ) import warnings if TYPE_CHECKING: from collections.abc import Generator from types import FrameType @contextlib.contextmanager def rewrite_exception(old_name: str, new_n...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/util/_test_decorators.py
pandas/util/_test_decorators.py
""" This module provides decorator functions which can be applied to test objects in order to skip those objects when certain conditions occur. A sample use case is to detect if the platform is missing ``matplotlib``. If so, any test objects which require ``matplotlib`` and decorated with ``@td.skip_if_no("matplotlib")...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/util/_print_versions.py
pandas/util/_print_versions.py
from __future__ import annotations import json import locale import os import platform import struct import sys from typing import TYPE_CHECKING from pandas.util._decorators import set_module if TYPE_CHECKING: from pandas._typing import JSONSerializable from pandas.compat._optional import ( VERSIONS, ge...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/util/_decorators.py
pandas/util/_decorators.py
from __future__ import annotations from functools import wraps import inspect from textwrap import dedent from typing import ( TYPE_CHECKING, Any, cast, ) import warnings from pandas._libs.properties import cache_readonly from pandas._typing import ( F, T, ) from pandas.util._exceptions import fin...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/util/__init__.py
pandas/util/__init__.py
def __getattr__(key: str): # These imports need to be lazy to avoid circular import errors if key == "hash_array": from pandas.core.util.hashing import hash_array return hash_array if key == "hash_pandas_object": from pandas.core.util.hashing import hash_pandas_object retur...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/util/_doctools.py
pandas/util/_doctools.py
from __future__ import annotations from typing import TYPE_CHECKING import numpy as np import pandas as pd if TYPE_CHECKING: from collections.abc import Iterable from matplotlib.figure import Figure class TablePlotter: """ Layout some DataFrames in vertical/horizontal layout for explanation. ...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/util/_validators.py
pandas/util/_validators.py
""" Module that contains many useful utilities for validating data or function arguments """ from __future__ import annotations from collections.abc import ( Iterable, Sequence, ) from typing import ( TypeVar, overload, ) import numpy as np from pandas._libs import lib from pandas._libs.missing impo...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/util/version/__init__.py
pandas/util/version/__init__.py
# Vendored from https://github.com/pypa/packaging/blob/main/src/packaging/_structures.py # and https://github.com/pypa/packaging/blob/main/src/packaging/version.py # changeset 24e5350b2ff3c5c7a36676c2af5f2cb39fd1baf8 # This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/compat/_constants.py
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 PY312 = sys.version_info >= (3, 12) PY314 = sys.version_info >= (3, 14) PYPY = platform.python_implementation() == "PyPy" WASM = (sys...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/compat/pickle_compat.py
pandas/compat/pickle_compat.py
""" Pickle compatibility to pandas version 1.0 """ from __future__ import annotations import contextlib import io import pickle from typing import ( TYPE_CHECKING, Any, ) import numpy as np from pandas._libs.arrays import NDArrayBacked from pandas._libs.tslibs import BaseOffset from pandas.core.arrays impo...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/compat/_optional.py
pandas/compat/_optional.py
from __future__ import annotations import importlib import sys from typing import ( TYPE_CHECKING, Literal, overload, ) import warnings from pandas.util._exceptions import find_stack_level from pandas.util.version import Version if TYPE_CHECKING: import types # Update install.rst, actions-311-minim...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/compat/__init__.py
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 ( CHAINED_WARNING_DISABLED, IS64, ISMUSL, ...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/compat/pyarrow.py
pandas/compat/pyarrow.py
"""support pyarrow compatibility across versions""" from __future__ import annotations from pandas.util.version import Version PYARROW_MIN_VERSION = "13.0.0" try: import pyarrow as pa _palv = Version(Version(pa.__version__).base_version) pa_version_under14p0 = _palv < Version("14.0.0") pa_version_un...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/compat/numpy/function.py
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...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/compat/numpy/__init__.py
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_gt2 = _nlv >= Version("2.0.0") is_numpy_dev = _nlv.dev is not None _min_numpy_ver = "1.26.0" if _nlv <...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/errors/__init__.py
pandas/errors/__init__.py
""" Expose public exceptions & warnings """ from __future__ import annotations import abc import ctypes from pandas._config.config import OptionError from pandas._libs.tslibs import ( IncompatibleFrequency, OutOfBoundsDatetime, OutOfBoundsTimedelta, ) from pandas.util.version import InvalidVersion cl...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
true
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/errors/cow.py
pandas/errors/cow.py
_chained_assignment_msg = ( "A value is trying to be set on a copy of a DataFrame or Series " "through chained assignment.\n" "Such chained assignment never works to update the original DataFrame or " "Series, because the intermediate object on which we are setting values " "always behaves as a copy...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/_config/localization.py
pandas/_config/localization.py
""" Helpers for configuring locale settings. Name `localization` is chosen to avoid overlap with builtin `locale` module. """ from __future__ import annotations from contextlib import contextmanager import locale import platform import re import subprocess from typing import ( TYPE_CHECKING, cast, ) from pa...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/_config/display.py
pandas/_config/display.py
""" Unopinionated display configuration. """ from __future__ import annotations import locale import sys from pandas._config import config as cf # ----------------------------------------------------------------------------- # Global formatting options _initial_defencoding: str | None = None def detect_console_en...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/_config/config.py
pandas/_config/config.py
""" The config module holds package-wide configurables and provides a uniform API for working with them. Overview ======== This module supports the following requirements: - options are referenced using keys in dot.notation, e.g. "x.y.option - z". - keys are case-insensitive. - functions should accept partial/regex k...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/_config/__init__.py
pandas/_config/__init__.py
""" pandas._config is considered explicitly upstream of everything else in pandas, should have no intra-pandas dependencies. importing `dates` and `display` ensures that keys needed by _libs are initialized. """ __all__ = [ "config", "describe_option", "detect_console_encoding", "get_option", "opt...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/_config/dates.py
pandas/_config/dates.py
""" config for datetime formatting """ from __future__ import annotations from pandas._config import config as cf pc_date_dayfirst_doc = """ : boolean When True, prints and parses dates with the day first, eg 20/01/2005 """ pc_date_yearfirst_doc = """ : boolean When True, prints and parses dates with the ye...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/test_expressions.py
pandas/tests/test_expressions.py
import operator import re import numpy as np import pytest from pandas.compat._optional import import_optional_dependency from pandas import option_context import pandas._testing as tm from pandas.core.api import DataFrame from pandas.core.computation import expressions as expr from pandas.util.version import Versio...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/test_downstream.py
pandas/tests/test_downstream.py
""" Testing that we work in the downstream packages """ import array from functools import partial import importlib import subprocess import sys import numpy as np import pytest from pandas.errors import IntCastingNaNError import pandas as pd from pandas import ( DataFrame, DatetimeIndex, Series, Ti...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/test_errors.py
pandas/tests/test_errors.py
import warnings import pytest from pandas.errors import ( AbstractMethodError, Pandas4Warning, Pandas5Warning, PandasChangeWarning, PandasDeprecationWarning, PandasPendingDeprecationWarning, UndefinedVariableError, ) import pandas as pd import pandas._testing as tm @pytest.mark.parametr...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/test_multilevel.py
pandas/tests/test_multilevel.py
import datetime import numpy as np import pytest import pandas as pd from pandas import ( ArrowDtype, DataFrame, MultiIndex, Series, ) import pandas._testing as tm class TestMultiLevel: def test_reindex_level(self, multiindex_year_month_day_dataframe_random_data): # axis=0 ymd = ...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/test_aggregation.py
pandas/tests/test_aggregation.py
import numpy as np import pytest from pandas.core.apply import ( _make_unique_kwarg_list, maybe_mangle_lambdas, ) def test_maybe_mangle_lambdas_passthrough(): assert maybe_mangle_lambdas("mean") == "mean" assert maybe_mangle_lambdas(lambda x: x).__name__ == "<lambda>" # don't mangle single lambda...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/test_take.py
pandas/tests/test_take.py
from datetime import datetime import numpy as np import pytest from pandas._libs import iNaT from pandas import array import pandas._testing as tm import pandas.core.algorithms as algos @pytest.fixture( params=[ (np.int8, np.int16(127), np.int8), (np.int8, np.int16(128), np.int16), (np....
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/test_sorting.py
pandas/tests/test_sorting.py
from collections import defaultdict from datetime import datetime from itertools import product import numpy as np import pytest from pandas import ( NA, DataFrame, MultiIndex, Series, array, concat, merge, ) import pandas._testing as tm from pandas.core.algorithms import safe_sort import ...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/test_common.py
pandas/tests/test_common.py
import collections from functools import partial import string import subprocess import sys import numpy as np import pytest from pandas.compat import WASM import pandas as pd from pandas import Series import pandas._testing as tm from pandas.core import ops import pandas.core.common as com from pandas.util.version ...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/test_col.py
pandas/tests/test_col.py
from datetime import datetime import numpy as np import pytest from pandas._libs.properties import cache_readonly import pandas as pd import pandas._testing as tm from pandas.api.typing import Expression from pandas.tests.test_register_accessor import ensure_removed @pytest.mark.parametrize( ("expr", "expected...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/test_register_accessor.py
pandas/tests/test_register_accessor.py
from collections.abc import Generator import contextlib import weakref import pytest import pandas as pd import pandas._testing as tm from pandas.core import accessor def test_dirname_mixin() -> None: # GH37173 class X(accessor.DirNamesMixin): x = 1 y: int def __init__(self) -> Non...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/test_algos.py
pandas/tests/test_algos.py
from datetime import datetime import struct import numpy as np import pytest from pandas._libs import ( algos as libalgos, hashtable as ht, ) from pandas.core.dtypes.common import ( is_bool_dtype, is_complex_dtype, is_float_dtype, is_integer_dtype, is_object_dtype, ) from pandas.core.dtyp...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
true
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/test_optional_dependency.py
pandas/tests/test_optional_dependency.py
import sys import types import pytest from pandas.compat._optional import ( VERSIONS, import_optional_dependency, ) import pandas._testing as tm def test_import_optional(): match = "Import .*notapackage.* pip .* conda .* notapackage" with pytest.raises(ImportError, match=match) as exc_info: ...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/test_flags.py
pandas/tests/test_flags.py
import pytest import pandas as pd class TestFlags: def test_equality(self): a = pd.DataFrame().set_flags(allows_duplicate_labels=True).flags b = pd.DataFrame().set_flags(allows_duplicate_labels=False).flags assert a == a assert b == b assert a != b assert a != 2 ...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/__init__.py
pandas/tests/__init__.py
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/test_nanops.py
pandas/tests/test_nanops.py
from functools import partial import numpy as np import pytest import pandas.util._test_decorators as td from pandas.core.dtypes.common import is_integer_dtype import pandas as pd from pandas import ( Series, isna, ) import pandas._testing as tm from pandas.core import nanops use_bn = nanops._USE_BOTTLENEC...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
true
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/scalar/test_nat.py
pandas/tests/scalar/test_nat.py
from datetime import ( datetime, timedelta, ) import operator import zoneinfo import numpy as np import pytest from pandas._libs.tslibs import iNaT from pandas import ( DatetimeIndex, DatetimeTZDtype, Index, NaT, Period, Series, Timedelta, TimedeltaIndex, Timestamp, is...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/scalar/__init__.py
pandas/tests/scalar/__init__.py
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/scalar/test_na_scalar.py
pandas/tests/scalar/test_na_scalar.py
from datetime import ( date, time, timedelta, ) import pickle import numpy as np import pytest from pandas._libs.missing import NA from pandas.core.dtypes.common import is_scalar import pandas as pd import pandas._testing as tm def test_singleton(): assert NA is NA new_NA = type(NA)() asse...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/scalar/period/test_asfreq.py
pandas/tests/scalar/period/test_asfreq.py
import pytest from pandas._libs.tslibs.period import INVALID_FREQ_ERR_MSG from pandas.errors import OutOfBoundsDatetime from pandas import ( Period, Timestamp, offsets, ) import pandas._testing as tm bday_msg = "Period with BDay freq is deprecated" class TestFreqConversion: """Test frequency conver...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
true
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/scalar/period/__init__.py
pandas/tests/scalar/period/__init__.py
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/scalar/period/test_arithmetic.py
pandas/tests/scalar/period/test_arithmetic.py
from datetime import timedelta import numpy as np import pytest from pandas._libs.tslibs.period import IncompatibleFrequency from pandas import ( NaT, Period, Timedelta, Timestamp, offsets, ) class TestPeriodArithmetic: def test_add_overflow_raises(self): # GH#55503 per = Ti...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/scalar/period/test_period.py
pandas/tests/scalar/period/test_period.py
from datetime import ( date, datetime, timedelta, ) import re import numpy as np import pytest from pandas._libs.tslibs import iNaT from pandas._libs.tslibs.ccalendar import ( DAYS, MONTHS, ) from pandas._libs.tslibs.np_datetime import OutOfBoundsDatetime from pandas._libs.tslibs.parsing import Da...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
true
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/scalar/timestamp/test_comparisons.py
pandas/tests/scalar/timestamp/test_comparisons.py
from datetime import ( datetime, timedelta, ) import operator import numpy as np import pytest from pandas import Timestamp import pandas._testing as tm class TestTimestampComparison: def test_compare_non_nano_dt64(self): # don't raise when converting dt64 to Timestamp in __richcmp__ dt ...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/scalar/timestamp/test_timestamp.py
pandas/tests/scalar/timestamp/test_timestamp.py
"""test the scalar Timestamp""" import calendar from datetime import ( datetime, timedelta, timezone, ) import locale import time import unicodedata import zoneinfo from dateutil.tz import ( tzlocal, tzutc, ) from hypothesis import ( given, strategies as st, ) import numpy as np import pyt...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/scalar/timestamp/test_timezones.py
pandas/tests/scalar/timestamp/test_timezones.py
""" Tests for Timestamp timezone-related methods """ from datetime import datetime from pandas._libs.tslibs import timezones from pandas import Timestamp class TestTimestampTZOperations: # ------------------------------------------------------------------ def test_timestamp_timetz_equivalent_with_datetime...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/scalar/timestamp/test_constructors.py
pandas/tests/scalar/timestamp/test_constructors.py
import calendar from datetime import ( date, datetime, timedelta, timezone, ) import zoneinfo import dateutil.tz from dateutil.tz import ( gettz, tzoffset, tzutc, ) import numpy as np import pytest from pandas._libs.tslibs.dtypes import NpyDatetimeUnit from pandas.compat import PY314 from ...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
true
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/scalar/timestamp/test_formats.py
pandas/tests/scalar/timestamp/test_formats.py
from datetime import ( datetime, timezone, ) import pprint import dateutil.tz import pytest from pandas.compat import WASM from pandas import Timestamp ts_no_ns = Timestamp( year=2019, month=5, day=18, hour=15, minute=17, second=8, microsecond=132263, ) ts_no_ns_year1 = Timestamp...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/scalar/timestamp/__init__.py
pandas/tests/scalar/timestamp/__init__.py
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/scalar/timestamp/test_arithmetic.py
pandas/tests/scalar/timestamp/test_arithmetic.py
from datetime import ( datetime, timedelta, timezone, ) from dateutil.tz import gettz import numpy as np import pytest from pandas._libs.tslibs import ( OutOfBoundsDatetime, OutOfBoundsTimedelta, Timedelta, Timestamp, offsets, to_offset, ) import pandas._testing as tm class Test...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/scalar/timestamp/methods/test_normalize.py
pandas/tests/scalar/timestamp/methods/test_normalize.py
import pytest from pandas._libs.tslibs import Timestamp from pandas._libs.tslibs.dtypes import NpyDatetimeUnit class TestTimestampNormalize: @pytest.mark.parametrize("arg", ["2013-11-30", "2013-11-30 12:00:00"]) def test_normalize(self, tz_naive_fixture, arg, unit): tz = tz_naive_fixture ts =...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false