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/pandas/tests/internals/test_internals.py | pandas/tests/internals/test_internals.py | from datetime import (
date,
datetime,
)
import itertools
import re
import numpy as np
import pytest
from pandas._libs.internals import BlockPlacement
from pandas.compat import IS64
from pandas.errors import Pandas4Warning
from pandas.core.dtypes.common import is_scalar
import pandas as pd
from pandas impor... | 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/internals/test_api.py | pandas/tests/internals/test_api.py | """
Tests for the pseudo-public API implemented in internals/api.py and exposed
in core.internals
"""
import datetime
import numpy as np
import pytest
from pandas.errors import Pandas4Warning
import pandas as pd
import pandas._testing as tm
from pandas.api.internals import create_dataframe_from_blocks
from pandas.c... | 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/internals/__init__.py | pandas/tests/internals/__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/indexing/test_coercion.py | pandas/tests/indexing/test_coercion.py | from __future__ import annotations
from datetime import (
datetime,
timedelta,
)
import numpy as np
import pytest
from pandas.compat import (
IS64,
is_platform_windows,
)
from pandas.compat.numpy import np_version_gt2
import pandas as pd
import pandas._testing as tm
################################... | 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/indexing/test_partial.py | pandas/tests/indexing/test_partial.py | """
test setting *parts* of objects both positionally and label based
TODO: these should be split among the indexer tests
"""
import numpy as np
import pytest
import pandas as pd
from pandas import (
DataFrame,
Index,
Period,
Series,
Timestamp,
date_range,
period_range,
)
import pandas._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/tests/indexing/test_datetime.py | pandas/tests/indexing/test_datetime.py | import re
import pytest
import pandas as pd
from pandas import (
DataFrame,
Index,
Series,
Timestamp,
date_range,
)
import pandas._testing as tm
class TestDatetimeIndex:
def test_get_loc_naive_dti_aware_str_deprecated(self):
# GH#46903
ts = Timestamp("20130101")._value
... | 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/indexing/test_indexing.py | pandas/tests/indexing/test_indexing.py | """test fancy indexing & misc"""
import array
from datetime import datetime
import re
import weakref
import numpy as np
import pytest
from pandas.errors import IndexingError
from pandas.core.dtypes.common import (
is_float_dtype,
is_integer_dtype,
is_object_dtype,
)
import pandas as pd
from pandas impo... | 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/indexing/common.py | pandas/tests/indexing/common.py | """common utilities"""
from __future__ import annotations
from typing import (
Any,
Literal,
)
def _mklbl(prefix: str, n: int):
return [f"{prefix}{i}" for i in range(n)]
def check_indexing_smoketest_or_raises(
obj,
method: Literal["iloc", "loc"],
key: Any,
axes: Literal[0, 1] | None = ... | 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/indexing/test_iat.py | pandas/tests/indexing/test_iat.py | import numpy as np
from pandas import (
DataFrame,
Series,
period_range,
)
def test_iat(float_frame):
for i, row in enumerate(float_frame.index):
for j, col in enumerate(float_frame.columns):
result = float_frame.iat[i, j]
expected = float_frame.at[row, col]
... | 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/indexing/test_chaining_and_caching.py | pandas/tests/indexing/test_chaining_and_caching.py | from string import ascii_letters
import numpy as np
import pytest
import pandas as pd
from pandas import (
DataFrame,
Index,
Series,
Timestamp,
date_range,
option_context,
)
import pandas._testing as tm
msg = "A value is trying to be set on a copy of a slice from a DataFrame"
class TestCach... | 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/indexing/test_floats.py | pandas/tests/indexing/test_floats.py | import numpy as np
import pytest
from pandas import (
DataFrame,
Index,
RangeIndex,
Series,
date_range,
period_range,
timedelta_range,
)
import pandas._testing as tm
def gen_obj(klass, index):
if klass is Series:
obj = Series(np.arange(len(index)), index=index)
else:
... | 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/indexing/test_iloc.py | pandas/tests/indexing/test_iloc.py | """test positional based indexing with iloc"""
from datetime import datetime
import re
import numpy as np
import pytest
from pandas.compat import pa_version_under16p0
from pandas.errors import IndexingError
import pandas.util._test_decorators as td
from pandas import (
NA,
Categorical,
CategoricalDtype,... | 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/indexing/test_scalar.py | pandas/tests/indexing/test_scalar.py | """test scalar indexing, including at and iat"""
from datetime import (
datetime,
timedelta,
)
import itertools
import numpy as np
import pytest
from pandas import (
DataFrame,
Index,
Series,
Timedelta,
Timestamp,
date_range,
)
import pandas._testing as tm
def generate_indices(f, va... | 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/indexing/test_na_indexing.py | pandas/tests/indexing/test_na_indexing.py | import pytest
import pandas as pd
import pandas._testing as tm
@pytest.mark.parametrize(
"values, dtype",
[
([], "object"),
([1, 2, 3], "int64"),
([1.0, 2.0, 3.0], "float64"),
(["a", "b", "c"], "object"),
(["a", "b", "c"], "string"),
([1, 2, 3], "datetime64[ns]... | 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/indexing/test_check_indexer.py | pandas/tests/indexing/test_check_indexer.py | import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
from pandas.api.indexers import check_array_indexer
@pytest.mark.parametrize(
"indexer, expected",
[
# integer
([1, 2], np.array([1, 2], dtype=np.intp)),
(np.array([1, 2], dtype="int64"), np.array([1, 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/indexing/__init__.py | pandas/tests/indexing/__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/indexing/test_loc.py | pandas/tests/indexing/test_loc.py | """test label based indexing with loc"""
from collections import namedtuple
import contextlib
from datetime import (
date,
datetime,
time,
timedelta,
)
import re
from dateutil.tz import gettz
import numpy as np
import pytest
from pandas._libs import index as libindex
from pandas.errors import Indexin... | 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/indexing/test_categorical.py | pandas/tests/indexing/test_categorical.py | import re
import numpy as np
import pytest
import pandas.util._test_decorators as td
import pandas as pd
from pandas import (
Categorical,
CategoricalDtype,
CategoricalIndex,
DataFrame,
Index,
Interval,
Series,
Timedelta,
Timestamp,
option_context,
)
import pandas._testing as ... | 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/indexing/test_indexers.py | pandas/tests/indexing/test_indexers.py | # Tests aimed at pandas.core.indexers
import numpy as np
import pytest
from pandas.core.indexers import (
is_scalar_indexer,
length_of_indexer,
validate_indices,
)
def test_length_of_indexer():
arr = np.zeros(4, dtype=bool)
arr[0] = 1
result = length_of_indexer(arr)
assert result == 1
d... | 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/indexing/test_at.py | pandas/tests/indexing/test_at.py | from datetime import (
datetime,
timezone,
)
import numpy as np
import pytest
from pandas.errors import InvalidIndexError
from pandas import (
CategoricalDtype,
CategoricalIndex,
DataFrame,
DatetimeIndex,
MultiIndex,
Series,
Timestamp,
)
import pandas._testing as tm
def test_at_... | 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/indexing/interval/test_interval_new.py | pandas/tests/indexing/interval/test_interval_new.py | import re
import numpy as np
import pytest
from pandas.compat import WASM
from pandas import (
Index,
Interval,
IntervalIndex,
Series,
)
import pandas._testing as tm
class TestIntervalIndex:
@pytest.fixture
def series_with_interval_index(self):
"""
Fixture providing a Series... | 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/indexing/interval/test_interval.py | pandas/tests/indexing/interval/test_interval.py | import numpy as np
import pytest
from pandas._libs import index as libindex
from pandas.compat import WASM
import pandas as pd
from pandas import (
DataFrame,
IntervalIndex,
Series,
)
import pandas._testing as tm
class TestIntervalIndex:
@pytest.fixture
def series_with_interval_index(self):
... | 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/indexing/interval/__init__.py | pandas/tests/indexing/interval/__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/indexing/multiindex/test_partial.py | pandas/tests/indexing/multiindex/test_partial.py | import numpy as np
import pytest
from pandas import (
DataFrame,
DatetimeIndex,
MultiIndex,
date_range,
)
import pandas._testing as tm
class TestMultiIndexPartial:
def test_getitem_partial_int(self):
# GH 12416
# with single item
l1 = [10, 20]
l2 = ["a", "b"]
... | 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/indexing/multiindex/test_indexing_slow.py | pandas/tests/indexing/multiindex/test_indexing_slow.py | import numpy as np
import pytest
import pandas as pd
from pandas import (
DataFrame,
Series,
)
import pandas._testing as tm
@pytest.fixture
def m():
return 5
@pytest.fixture
def n():
return 100
@pytest.fixture
def cols():
return ["jim", "joe", "jolie", "joline", "jolia"]
@pytest.fixture
def... | 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/indexing/multiindex/test_datetime.py | pandas/tests/indexing/multiindex/test_datetime.py | from datetime import datetime
import numpy as np
from pandas import (
DataFrame,
Index,
MultiIndex,
Period,
Series,
period_range,
to_datetime,
)
import pandas._testing as tm
def test_multiindex_period_datetime():
# GH4861, using datetime in period of multiindex raises exception
... | 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/indexing/multiindex/test_slice.py | pandas/tests/indexing/multiindex/test_slice.py | from datetime import (
datetime,
timedelta,
)
import numpy as np
import pytest
from pandas.errors import UnsortedIndexError
import pandas as pd
from pandas import (
DataFrame,
Index,
MultiIndex,
Series,
Timestamp,
)
import pandas._testing as tm
from pandas.tests.indexing.common import _mk... | 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/indexing/multiindex/test_chaining_and_caching.py | pandas/tests/indexing/multiindex/test_chaining_and_caching.py | import numpy as np
from pandas._libs import index as libindex
from pandas import (
DataFrame,
MultiIndex,
RangeIndex,
Series,
)
import pandas._testing as tm
def test_detect_chained_assignment():
# Inplace ops, originally from:
# https://stackoverflow.com/questions/20508968/series-fillna-in-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/tests/indexing/multiindex/test_iloc.py | pandas/tests/indexing/multiindex/test_iloc.py | import numpy as np
import pytest
from pandas import (
DataFrame,
MultiIndex,
Series,
)
import pandas._testing as tm
@pytest.fixture
def simple_multiindex_dataframe():
"""
Factory function to create simple 3 x 3 dataframe with
both columns and row MultiIndex using supplied data or
random d... | 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/indexing/multiindex/test_getitem.py | pandas/tests/indexing/multiindex/test_getitem.py | import numpy as np
import pytest
from pandas import (
DataFrame,
Index,
MultiIndex,
Series,
)
import pandas._testing as tm
from pandas.core.indexing import IndexingError
# ----------------------------------------------------------------------------
# test indexing of Series with multi-level Index
# --... | 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/indexing/multiindex/__init__.py | pandas/tests/indexing/multiindex/__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/indexing/multiindex/test_loc.py | pandas/tests/indexing/multiindex/test_loc.py | import numpy as np
import pytest
from pandas.errors import IndexingError
import pandas as pd
from pandas import (
DataFrame,
Index,
MultiIndex,
Series,
)
import pandas._testing as tm
@pytest.fixture
def frame_random_data_integer_multi_index():
levels = [[0, 1], [0, 1, 2]]
codes = [[0, 0, 0, ... | 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/indexing/multiindex/test_setitem.py | pandas/tests/indexing/multiindex/test_setitem.py | import numpy as np
import pytest
import pandas as pd
from pandas import (
DataFrame,
MultiIndex,
Series,
date_range,
isna,
notna,
)
import pandas._testing as tm
def assert_equal(a, b):
assert a == b
class TestMultiIndexSetItem:
def check(self, target, indexers, value, compare_fn=ass... | 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/indexing/multiindex/test_multiindex.py | pandas/tests/indexing/multiindex/test_multiindex.py | import numpy as np
import pytest
import pandas._libs.index as libindex
import pandas as pd
from pandas import (
CategoricalDtype,
DataFrame,
Index,
MultiIndex,
Series,
)
import pandas._testing as tm
from pandas.core.arrays.boolean import BooleanDtype
class TestMultiIndexBasic:
def test_multi... | 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/indexing/multiindex/test_sorted.py | pandas/tests/indexing/multiindex/test_sorted.py | import numpy as np
import pytest
from pandas import (
NA,
DataFrame,
MultiIndex,
Series,
array,
)
import pandas._testing as tm
class TestMultiIndexSorted:
def test_getitem_multilevel_index_tuple_not_sorted(self):
index_columns = list("abc")
df = DataFrame(
[[0, 1, ... | 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/tseries/__init__.py | pandas/tests/tseries/__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/tseries/offsets/test_custom_business_day.py | pandas/tests/tseries/offsets/test_custom_business_day.py | """
Tests for offsets.CustomBusinessDay / CDay
"""
from datetime import (
datetime,
timedelta,
)
import numpy as np
import pytest
from pandas._libs.tslibs.offsets import CDay
from pandas import (
_testing as tm,
read_pickle,
)
from pandas.tests.tseries.offsets.common import assert_offset_equal
from... | 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/tseries/offsets/test_month.py | pandas/tests/tseries/offsets/test_month.py | """
Tests for the following offsets:
- SemiMonthBegin
- SemiMonthEnd
- MonthBegin
- MonthEnd
"""
from __future__ import annotations
from datetime import datetime
import pytest
from pandas._libs.tslibs import Timestamp
from pandas._libs.tslibs.offsets import (
MonthBegin,
MonthEnd,
SemiMonthBegin,
Se... | 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/tseries/offsets/test_business_year.py | pandas/tests/tseries/offsets/test_business_year.py | """
Tests for the following offsets:
- BYearBegin
- BYearEnd
"""
from __future__ import annotations
from datetime import datetime
import pytest
from pandas.tests.tseries.offsets.common import (
assert_is_on_offset,
assert_offset_equal,
)
from pandas.tseries.offsets import (
BYearBegin,
BYearEnd,
)
... | 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/tseries/offsets/test_fiscal.py | pandas/tests/tseries/offsets/test_fiscal.py | """
Tests for Fiscal Year and Fiscal Quarter offset classes
"""
from datetime import datetime
from dateutil.relativedelta import relativedelta
import pytest
from pandas import Timestamp
from pandas.tests.tseries.offsets.common import (
WeekDay,
assert_is_on_offset,
assert_offset_equal,
)
from pandas.tse... | 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/tseries/offsets/test_index.py | pandas/tests/tseries/offsets/test_index.py | """
Tests for offset behavior with indices.
"""
import pytest
from pandas import (
Series,
date_range,
)
from pandas.tseries.offsets import (
BMonthBegin,
BMonthEnd,
BQuarterBegin,
BQuarterEnd,
BYearBegin,
BYearEnd,
MonthBegin,
MonthEnd,
QuarterBegin,
QuarterEnd,
Y... | 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/tseries/offsets/test_offsets_properties.py | pandas/tests/tseries/offsets/test_offsets_properties.py | """
Behavioral based tests for offsets and date_range.
This file is adapted from https://github.com/pandas-dev/pandas/pull/18761 -
which was more ambitious but less idiomatic in its use of Hypothesis.
You may wish to consult the previous version for inspiration on further
tests, or when trying to pin down the bugs ex... | 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/tseries/offsets/test_business_hour.py | pandas/tests/tseries/offsets/test_business_hour.py | """
Tests for offsets.BusinessHour
"""
from __future__ import annotations
from datetime import (
datetime,
time as dt_time,
)
import pytest
from pandas._libs.tslibs import (
Timedelta,
Timestamp,
)
from pandas._libs.tslibs.offsets import (
BDay,
BusinessHour,
Nano,
)
from pandas import ... | 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/tseries/offsets/test_week.py | pandas/tests/tseries/offsets/test_week.py | """
Tests for the following offsets:
- Week
- WeekOfMonth
- LastWeekOfMonth
"""
from __future__ import annotations
from datetime import (
datetime,
timedelta,
)
import pytest
from pandas._libs.tslibs import Timestamp
from pandas._libs.tslibs.offsets import (
Day,
LastWeekOfMonth,
Week,
WeekO... | 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/tseries/offsets/common.py | pandas/tests/tseries/offsets/common.py | """
Assertion helpers and base class for offsets tests
"""
from __future__ import annotations
def assert_offset_equal(offset, base, expected):
actual = offset + base
actual_swapped = base + offset
actual_apply = offset._apply(base)
try:
assert actual == expected
assert actual_swapped ... | 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/tseries/offsets/test_common.py | pandas/tests/tseries/offsets/test_common.py | from datetime import datetime
from dateutil.tz.tz import tzlocal
import pytest
from pandas._libs.tslibs import (
OutOfBoundsDatetime,
Timestamp,
)
from pandas.compat import (
IS64,
WASM,
is_platform_windows,
)
from pandas.tseries.offsets import (
FY5253,
BDay,
BMonthBegin,
BMonthE... | 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/tseries/offsets/test_custom_business_hour.py | pandas/tests/tseries/offsets/test_custom_business_hour.py | """
Tests for offsets.CustomBusinessHour
"""
from __future__ import annotations
from datetime import (
datetime,
time as dt_time,
)
import numpy as np
import pytest
from pandas._libs.tslibs import Timestamp
from pandas._libs.tslibs.offsets import (
BusinessHour,
CustomBusinessHour,
Nano,
)
from... | 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/tseries/offsets/test_quarter.py | pandas/tests/tseries/offsets/test_quarter.py | """
Tests for the following offsets:
- QuarterBegin
- QuarterEnd
"""
from __future__ import annotations
from datetime import datetime
import pytest
from pandas.tests.tseries.offsets.common import (
assert_is_on_offset,
assert_offset_equal,
)
from pandas.tseries.offsets import (
QuarterBegin,
Quarte... | 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/tseries/offsets/test_business_day.py | pandas/tests/tseries/offsets/test_business_day.py | """
Tests for offsets.BDay
"""
from __future__ import annotations
from datetime import (
date,
datetime,
timedelta,
)
import numpy as np
import pytest
from pandas._libs.tslibs.offsets import (
ApplyTypeError,
BDay,
BMonthEnd,
)
from pandas import (
DatetimeIndex,
Timedelta,
_tes... | 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/tseries/offsets/test_business_halfyear.py | pandas/tests/tseries/offsets/test_business_halfyear.py | """
Tests for the following offsets:
- BHalfYearBegin
- BHalfYearEnd
"""
from __future__ import annotations
from datetime import datetime
import pytest
from pandas.tests.tseries.offsets.common import (
assert_is_on_offset,
assert_offset_equal,
)
from pandas.tseries.offsets import (
BHalfYearBegin,
... | 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/tseries/offsets/__init__.py | pandas/tests/tseries/offsets/__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/tseries/offsets/test_dst.py | pandas/tests/tseries/offsets/test_dst.py | """
Tests for DateOffset additions over Daylight Savings Time
"""
from datetime import timedelta
import pytest
from pandas._libs.tslibs import Timestamp
from pandas._libs.tslibs.offsets import (
BMonthBegin,
BMonthEnd,
BQuarterBegin,
BQuarterEnd,
BYearBegin,
BYearEnd,
CBMonthBegin,
CB... | 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/tseries/offsets/test_halfyear.py | pandas/tests/tseries/offsets/test_halfyear.py | """
Tests for the following offsets:
- HalfYearBegin
- HalfYearEnd
"""
from __future__ import annotations
from datetime import datetime
import pytest
from pandas.tests.tseries.offsets.common import (
assert_is_on_offset,
assert_offset_equal,
)
from pandas.tseries.offsets import (
HalfYearBegin,
Hal... | 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/tseries/offsets/test_offsets.py | pandas/tests/tseries/offsets/test_offsets.py | """
Tests of pandas.tseries.offsets
"""
from __future__ import annotations
from datetime import (
datetime,
timedelta,
)
import numpy as np
import pytest
from pandas._libs.tslibs import (
NaT,
Timedelta,
Timestamp,
conversion,
timezones,
)
import pandas._libs.tslibs.offsets as liboffsets... | 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/tseries/offsets/test_business_quarter.py | pandas/tests/tseries/offsets/test_business_quarter.py | """
Tests for the following offsets:
- BQuarterBegin
- BQuarterEnd
"""
from __future__ import annotations
from datetime import datetime
import pytest
from pandas.tests.tseries.offsets.common import (
assert_is_on_offset,
assert_offset_equal,
)
from pandas.tseries.offsets import (
BQuarterBegin,
BQu... | 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/tseries/offsets/test_business_month.py | pandas/tests/tseries/offsets/test_business_month.py | """
Tests for the following offsets:
- BMonthBegin
- BMonthEnd
"""
from __future__ import annotations
from datetime import datetime
import pytest
import pandas as pd
from pandas.tests.tseries.offsets.common import (
assert_is_on_offset,
assert_offset_equal,
)
from pandas.tseries.offsets import (
BMonth... | 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/tseries/offsets/test_custom_business_month.py | pandas/tests/tseries/offsets/test_custom_business_month.py | """
Tests for the following offsets:
- CustomBusinessMonthBase
- CustomBusinessMonthBegin
- CustomBusinessMonthEnd
"""
from __future__ import annotations
from datetime import (
date,
datetime,
timedelta,
)
import numpy as np
import pytest
from pandas._libs.tslibs.offsets import (
CBMonthBegin,
C... | 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/tseries/offsets/test_easter.py | pandas/tests/tseries/offsets/test_easter.py | """
Tests for the following offsets:
- Easter
"""
from __future__ import annotations
from datetime import datetime
from dateutil.easter import (
EASTER_ORTHODOX,
EASTER_WESTERN,
)
import pytest
from pandas.tests.tseries.offsets.common import assert_offset_equal
from pandas.tseries.offsets import Easter
c... | 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/tseries/offsets/test_year.py | pandas/tests/tseries/offsets/test_year.py | """
Tests for the following offsets:
- YearBegin
- YearEnd
"""
from __future__ import annotations
from datetime import datetime
import numpy as np
import pytest
from pandas import Timestamp
from pandas.tests.tseries.offsets.common import (
assert_is_on_offset,
assert_offset_equal,
)
from pandas.tseries.off... | 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/tseries/offsets/test_ticks.py | pandas/tests/tseries/offsets/test_ticks.py | """
Tests for offsets.Tick and subclasses
"""
from datetime import (
datetime,
timedelta,
)
from hypothesis import (
assume,
example,
given,
)
import numpy as np
import pytest
from pandas._libs.tslibs.offsets import delta_to_tick
from pandas import (
Timedelta,
Timestamp,
)
import pandas... | 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/tseries/frequencies/test_inference.py | pandas/tests/tseries/frequencies/test_inference.py | from datetime import (
datetime,
timedelta,
)
import numpy as np
import pytest
from pandas._libs.tslibs.ccalendar import (
DAYS,
MONTHS,
)
from pandas._libs.tslibs.offsets import _get_offset
from pandas._libs.tslibs.period import INVALID_FREQ_ERR_MSG
from pandas.compat import is_platform_windows
impor... | 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/tseries/frequencies/test_freq_code.py | pandas/tests/tseries/frequencies/test_freq_code.py | import numpy as np
import pytest
from pandas._libs.tslibs import (
Period,
to_offset,
)
@pytest.mark.parametrize(
"freqstr,exp_freqstr",
[("D", "D"), ("W", "D"), ("ME", "D"), ("s", "s"), ("min", "s"), ("h", "s")],
)
def test_get_to_timestamp_base(freqstr, exp_freqstr):
off = to_offset(freqstr)
... | 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/tseries/frequencies/__init__.py | pandas/tests/tseries/frequencies/__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/tseries/frequencies/test_frequencies.py | pandas/tests/tseries/frequencies/test_frequencies.py | import pytest
from pandas._libs.tslibs import offsets
from pandas.tseries.frequencies import (
is_subperiod,
is_superperiod,
)
@pytest.mark.parametrize(
"p1,p2,expected",
[
# Input validation.
(offsets.MonthEnd(), None, False),
(offsets.YearEnd(), None, False),
(None,... | 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/tseries/holiday/test_calendar.py | pandas/tests/tseries/holiday/test_calendar.py | from datetime import datetime
import pytest
from pandas import (
DatetimeIndex,
offsets,
to_datetime,
)
import pandas._testing as tm
from pandas.tseries.holiday import (
AbstractHolidayCalendar,
Holiday,
Timestamp,
USFederalHolidayCalendar,
USLaborDay,
USThanksgivingDay,
get_c... | 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/tseries/holiday/__init__.py | pandas/tests/tseries/holiday/__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/tseries/holiday/test_observance.py | pandas/tests/tseries/holiday/test_observance.py | from datetime import datetime
import pytest
from pandas.tseries.holiday import (
after_nearest_workday,
before_nearest_workday,
nearest_workday,
next_monday,
next_monday_or_tuesday,
next_workday,
previous_friday,
previous_workday,
sunday_to_monday,
weekend_to_monday,
)
_WEDNES... | 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/tseries/holiday/test_holiday.py | pandas/tests/tseries/holiday/test_holiday.py | from datetime import (
datetime,
timezone,
)
from dateutil.relativedelta import MO
import pytest
from pandas import (
DateOffset,
DatetimeIndex,
Series,
Timestamp,
)
import pandas._testing as tm
from pandas.tseries.holiday import (
SA,
AbstractHolidayCalendar,
EasterMonday,
Go... | 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/tseries/holiday/test_federal.py | pandas/tests/tseries/holiday/test_federal.py | from datetime import datetime
from pandas import DatetimeIndex
import pandas._testing as tm
from pandas.tseries.holiday import (
AbstractHolidayCalendar,
USFederalHolidayCalendar,
USMartinLutherKingJr,
USMemorialDay,
)
def test_no_mlk_before_1986():
# see gh-10278
class MLKCalendar(AbstractH... | 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/plotting/test_backend.py | pandas/tests/plotting/test_backend.py | import sys
import types
import pytest
import pandas.util._test_decorators as td
import pandas
@pytest.fixture
def dummy_backend():
db = types.ModuleType("pandas_dummy_backend")
setattr(db, "plot", lambda *args, **kwargs: "used_dummy")
return db
@pytest.fixture
def restore_backend():
"""Restore th... | 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/plotting/test_series.py | pandas/tests/plotting/test_series.py | """Test cases for Series.plot"""
from datetime import datetime
from itertools import chain
import numpy as np
import pytest
from pandas.compat import is_platform_linux
import pandas.util._test_decorators as td
import pandas as pd
from pandas import (
DataFrame,
Series,
date_range,
period_range,
... | 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/plotting/common.py | pandas/tests/plotting/common.py | """
Module consolidating common testing functions for checking plotting.
"""
from __future__ import annotations
from typing import TYPE_CHECKING
import numpy as np
from pandas.core.dtypes.api import is_list_like
import pandas as pd
from pandas import Series
import pandas._testing as tm
if TYPE_CHECKING:
from ... | 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/plotting/test_boxplot_method.py | pandas/tests/plotting/test_boxplot_method.py | """Test cases for .boxplot method"""
from __future__ import annotations
import itertools
import string
import numpy as np
import pytest
from pandas import (
DataFrame,
MultiIndex,
Series,
date_range,
plotting,
timedelta_range,
)
import pandas._testing as tm
from pandas.tests.plotting.common ... | 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/plotting/test_common.py | pandas/tests/plotting/test_common.py | import pytest
from pandas import DataFrame
from pandas.tests.plotting.common import (
_check_plot_works,
_check_ticks_props,
_gen_two_subplots,
)
plt = pytest.importorskip("matplotlib.pyplot")
class TestCommon:
def test__check_ticks_props(self):
# GH 34768
df = DataFrame({"b": [0, 1,... | 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/plotting/test_hist_method.py | pandas/tests/plotting/test_hist_method.py | """Test cases for .hist method"""
import re
import numpy as np
import pytest
from pandas import (
DataFrame,
Index,
Series,
date_range,
to_datetime,
)
import pandas._testing as tm
from pandas.tests.plotting.common import (
_check_ax_scales,
_check_axes_shape,
_check_colors,
_check... | 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/plotting/test_style.py | pandas/tests/plotting/test_style.py | import pytest
from pandas import Series
mpl = pytest.importorskip("matplotlib")
plt = pytest.importorskip("matplotlib.pyplot")
from pandas.plotting._matplotlib.style import get_standard_colors
class TestGetStandardColors:
@pytest.mark.parametrize(
"num_colors, expected",
[
(3, ["red"... | 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/plotting/test_groupby.py | pandas/tests/plotting/test_groupby.py | """Test cases for GroupBy.plot"""
import numpy as np
import pytest
from pandas import (
DataFrame,
Index,
Series,
)
from pandas.tests.plotting.common import (
_check_axes_shape,
_check_legend_labels,
)
pytest.importorskip("matplotlib")
class TestDataFrameGroupByPlots:
def test_series_groupb... | 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/plotting/conftest.py | pandas/tests/plotting/conftest.py | import numpy as np
import pytest
from pandas import (
DataFrame,
to_datetime,
)
@pytest.fixture(autouse=True)
def autouse_mpl_cleanup(mpl_cleanup):
pass
@pytest.fixture
def hist_df():
n = 50
rng = np.random.default_rng(10)
gender = rng.choice(["Male", "Female"], size=n)
classroom = rng.... | 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/plotting/test_converter.py | pandas/tests/plotting/test_converter.py | from datetime import (
date,
datetime,
)
import subprocess
import sys
import numpy as np
import pytest
import pandas._config.config as cf
from pandas._libs.tslibs import to_offset
from pandas import (
Index,
Period,
PeriodIndex,
Series,
Timestamp,
arrays,
date_range,
)
import pan... | 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/plotting/__init__.py | pandas/tests/plotting/__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/plotting/test_misc.py | pandas/tests/plotting/test_misc.py | """Test cases for misc plot functions"""
import os
import numpy as np
import pytest
import pandas.util._test_decorators as td
from pandas import (
DataFrame,
Index,
Series,
Timestamp,
date_range,
interval_range,
period_range,
plotting,
read_csv,
)
import pandas._testing as tm
fro... | 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/plotting/test_datetimelike.py | pandas/tests/plotting/test_datetimelike.py | """Test cases for time series specific (freq conversion, etc)"""
from datetime import (
date,
datetime,
time,
timedelta,
)
import pickle
import numpy as np
import pytest
from pandas._libs.tslibs import (
BaseOffset,
to_offset,
)
from pandas.core.dtypes.dtypes import PeriodDtype
from pandas ... | 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/plotting/frame/test_frame_legend.py | pandas/tests/plotting/frame/test_frame_legend.py | import numpy as np
import pytest
import pandas.util._test_decorators as td
from pandas import (
DataFrame,
date_range,
)
from pandas.tests.plotting.common import (
_check_legend_labels,
_check_legend_marker,
_check_text_labels,
)
mpl = pytest.importorskip("matplotlib")
class TestFrameLegend:
... | 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/plotting/frame/test_frame_color.py | pandas/tests/plotting/frame/test_frame_color.py | """Test cases for DataFrame.plot"""
import re
import numpy as np
import pytest
import pandas as pd
from pandas import DataFrame
import pandas._testing as tm
from pandas.tests.plotting.common import (
_check_colors,
_check_plot_works,
_unpack_cycler,
)
mpl = pytest.importorskip("matplotlib")
plt = pytest... | 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/plotting/frame/test_frame_subplots.py | pandas/tests/plotting/frame/test_frame_subplots.py | """Test cases for DataFrame.plot"""
import string
import numpy as np
import pytest
from pandas.compat import is_platform_linux
import pandas as pd
from pandas import (
DataFrame,
Series,
date_range,
)
import pandas._testing as tm
from pandas.tests.plotting.common import (
_check_axes_shape,
_che... | 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/plotting/frame/test_frame_groupby.py | pandas/tests/plotting/frame/test_frame_groupby.py | """Test cases for DataFrame.plot"""
import pytest
from pandas import DataFrame
from pandas.tests.plotting.common import _check_visible
pytest.importorskip("matplotlib")
class TestDataFramePlotsGroupby:
def _assert_ytickslabels_visibility(self, axes, expected):
for ax, exp in zip(axes, expected, strict=... | 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/plotting/frame/test_frame.py | pandas/tests/plotting/frame/test_frame.py | """Test cases for DataFrame.plot"""
from datetime import (
date,
datetime,
)
import itertools
import re
import string
import numpy as np
import pytest
import pandas.util._test_decorators as td
from pandas.core.dtypes.api import is_list_like
import pandas as pd
from pandas import (
DataFrame,
Index,... | 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/plotting/frame/test_hist_box_by.py | pandas/tests/plotting/frame/test_hist_box_by.py | import re
import numpy as np
import pytest
from pandas import DataFrame
import pandas._testing as tm
from pandas.tests.plotting.common import (
_check_axes_shape,
_check_plot_works,
get_x_axis,
get_y_axis,
)
pytest.importorskip("matplotlib")
@pytest.fixture
def hist_df():
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/pandas/tests/plotting/frame/__init__.py | pandas/tests/plotting/frame/__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/resample/test_resample_api.py | pandas/tests/resample/test_resample_api.py | from datetime import datetime
import re
import numpy as np
import pytest
from pandas._libs import lib
from pandas._libs.tslibs import Day
import pandas as pd
from pandas import (
DataFrame,
NamedAgg,
Series,
)
import pandas._testing as tm
from pandas.core.indexes.datetimes import date_range
@pytest.fix... | 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/resample/test_period_index.py | pandas/tests/resample/test_period_index.py | from datetime import (
datetime,
timezone,
)
import re
import warnings
import zoneinfo
import dateutil
import numpy as np
import pytest
from pandas._libs.tslibs.ccalendar import (
DAYS,
MONTHS,
)
from pandas._libs.tslibs.period import IncompatibleFrequency
from pandas.errors import InvalidIndexError
... | 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/resample/test_base.py | pandas/tests/resample/test_base.py | from datetime import datetime
import numpy as np
import pytest
from pandas.errors import Pandas4Warning
from pandas.core.dtypes.common import is_extension_array_dtype
import pandas as pd
from pandas import (
DataFrame,
DatetimeIndex,
Index,
MultiIndex,
NaT,
PeriodIndex,
Series,
Timed... | 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/resample/test_timedelta.py | pandas/tests/resample/test_timedelta.py | from datetime import timedelta
import numpy as np
import pytest
import pandas.util._test_decorators as td
import pandas as pd
from pandas import (
DataFrame,
Series,
)
import pandas._testing as tm
from pandas.core.indexes.timedeltas import timedelta_range
def test_asfreq_bug():
df = DataFrame(data=[1, ... | 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/resample/test_time_grouper.py | pandas/tests/resample/test_time_grouper.py | from datetime import datetime
from operator import methodcaller
import numpy as np
import pytest
import pandas as pd
from pandas import (
DataFrame,
Index,
Series,
Timestamp,
)
import pandas._testing as tm
from pandas.core.groupby.grouper import Grouper
from pandas.core.indexes.datetimes import date_r... | 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/resample/conftest.py | pandas/tests/resample/conftest.py | import pytest
# The various methods we support
downsample_methods = [
"min",
"max",
"first",
"last",
"sum",
"mean",
"sem",
"median",
"prod",
"var",
"std",
"ohlc",
"quantile",
]
upsample_methods = ["count", "size"]
series_methods = ["nunique"]
resample_methods = downs... | 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/resample/test_datetime_index.py | pandas/tests/resample/test_datetime_index.py | from datetime import datetime
from functools import partial
import zoneinfo
import numpy as np
import pytest
from pandas._libs import lib
from pandas._libs.tslibs import Day
from pandas._typing import DatetimeNaTType
from pandas.compat import is_platform_windows
from pandas.errors import Pandas4Warning
import pandas.... | 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/resample/__init__.py | pandas/tests/resample/__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/resample/test_resampler_grouper.py | pandas/tests/resample/test_resampler_grouper.py | from textwrap import dedent
import numpy as np
import pytest
from pandas.compat import is_platform_windows
import pandas as pd
from pandas import (
DataFrame,
Index,
Series,
TimedeltaIndex,
Timestamp,
)
import pandas._testing as tm
from pandas.core.indexes.datetimes import date_range
@pytest.fi... | 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/frame/test_stack_unstack.py | pandas/tests/frame/test_stack_unstack.py | from datetime import datetime
import itertools
import re
import numpy as np
import pytest
from pandas._libs import lib
from pandas.errors import Pandas4Warning
import pandas as pd
from pandas import (
DataFrame,
Index,
MultiIndex,
Period,
Series,
Timedelta,
date_range,
)
import pandas._te... | 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/frame/common.py | pandas/tests/frame/common.py | from __future__ import annotations
from typing import TYPE_CHECKING
from pandas import (
DataFrame,
concat,
)
if TYPE_CHECKING:
from pandas._typing import AxisInt
def _check_mixed_float(df, dtype=None):
# float16 are most likely to be upcasted to float32
dtypes = {"A": "float32", "B": "float32"... | python | BSD-3-Clause | 91514c363604506f447e53380d3aa00520f1037b | 2026-01-04T14:39:36.002480Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.