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/io/formats/test_console.py
pandas/tests/io/formats/test_console.py
import locale import pytest from pandas._config import detect_console_encoding class MockEncoding: """ Used to add a side effect when accessing the 'encoding' property. If the side effect is a str in nature, the value will be returned. Otherwise, the side effect should be an exception that will be 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/io/formats/style/test_tooltip.py
pandas/tests/io/formats/style/test_tooltip.py
import numpy as np import pytest from pandas import ( DataFrame, MultiIndex, ) pytest.importorskip("jinja2") from pandas.io.formats.style import Styler @pytest.fixture def df(): return DataFrame( data=[[0, 1, 2], [3, 4, 5], [6, 7, 8]], columns=["A", "B", "C"], index=["x", "y", "z...
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/io/formats/style/test_format.py
pandas/tests/io/formats/style/test_format.py
import numpy as np import pytest from pandas import ( NA, DataFrame, IndexSlice, MultiIndex, NaT, Timestamp, option_context, ) pytest.importorskip("jinja2") from pandas.io.formats.style import Styler from pandas.io.formats.style_render import _str_escape @pytest.fixture def df(): ret...
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/io/formats/style/test_non_unique.py
pandas/tests/io/formats/style/test_non_unique.py
from textwrap import dedent import pytest from pandas import ( DataFrame, IndexSlice, ) pytest.importorskip("jinja2") from pandas.io.formats.style import Styler @pytest.fixture def df(): return DataFrame( [[1, 2, 3], [4, 5, 6], [7, 8, 9]], index=["i", "j", "j"], columns=["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/io/formats/style/test_html.py
pandas/tests/io/formats/style/test_html.py
import pathlib from textwrap import ( dedent, indent, ) import numpy as np import pytest from pandas import ( DataFrame, MultiIndex, option_context, ) jinja2 = pytest.importorskip("jinja2") from pandas.io.formats.style import Styler @pytest.fixture def env(): project_dir = pathlib.Path(__fi...
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/io/formats/style/test_highlight.py
pandas/tests/io/formats/style/test_highlight.py
import numpy as np import pytest from pandas import ( NA, DataFrame, IndexSlice, ) pytest.importorskip("jinja2") from pandas.io.formats.style import Styler @pytest.fixture(params=[(None, "float64"), (NA, "Int64")]) def df(request): # GH 45804 dtype = request.param[1] item = np.nan if dtype ...
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/io/formats/style/test_to_typst.py
pandas/tests/io/formats/style/test_to_typst.py
from textwrap import dedent import pytest from pandas import ( DataFrame, Series, ) pytest.importorskip("jinja2") from pandas.io.formats.style import Styler @pytest.fixture def df(): return DataFrame( {"A": [0, 1], "B": [-0.61, -1.22], "C": Series(["ab", "cd"], dtype=object)} ) @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/io/formats/style/test_style.py
pandas/tests/io/formats/style/test_style.py
import contextlib import copy import re from textwrap import dedent import numpy as np import pytest from pandas import ( DataFrame, IndexSlice, MultiIndex, Series, option_context, ) import pandas._testing as tm jinja2 = pytest.importorskip("jinja2") from pandas.io.formats.style import ( # isort...
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/io/formats/style/test_to_latex.py
pandas/tests/io/formats/style/test_to_latex.py
from textwrap import dedent import numpy as np import pytest from pandas import ( DataFrame, MultiIndex, Series, option_context, ) pytest.importorskip("jinja2") from pandas.io.formats.style import Styler from pandas.io.formats.style_render import ( _parse_latex_cell_styles, _parse_latex_css_c...
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/io/formats/style/test_to_string.py
pandas/tests/io/formats/style/test_to_string.py
from textwrap import dedent import pytest from pandas import ( DataFrame, Series, ) pytest.importorskip("jinja2") from pandas.io.formats.style import Styler @pytest.fixture def df(): return DataFrame( {"A": [0, 1], "B": [-0.61, -1.22], "C": Series(["ab", "cd"], dtype=object)} ) @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/io/formats/style/test_bar.py
pandas/tests/io/formats/style/test_bar.py
import io import numpy as np import pytest from pandas import ( NA, DataFrame, read_csv, ) pytest.importorskip("jinja2") def bar_grad(a=None, b=None, c=None, d=None): """Used in multiple tests to simplify formatting of expected result""" ret = [("width", "10em")] if all(x is None for x in [...
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/io/formats/style/__init__.py
pandas/tests/io/formats/style/__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/io/formats/style/test_exceptions.py
pandas/tests/io/formats/style/test_exceptions.py
import pytest jinja2 = pytest.importorskip("jinja2") from pandas import ( DataFrame, MultiIndex, ) from pandas.io.formats.style import Styler @pytest.fixture def df(): return DataFrame( data=[[0, -0.609], [1, -1.228]], columns=["A", "B"], index=["x", "y"], ) @pytest.fixtur...
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/io/formats/style/test_matplotlib.py
pandas/tests/io/formats/style/test_matplotlib.py
import numpy as np import pytest from pandas import ( DataFrame, IndexSlice, Series, ) mpl = pytest.importorskip("matplotlib") pytest.importorskip("jinja2") from pandas.io.formats.style import Styler pytestmark = pytest.mark.usefixtures("mpl_cleanup") @pytest.fixture def df(): return DataFrame([[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/io/parser/test_c_parser_only.py
pandas/tests/io/parser/test_c_parser_only.py
""" Tests that apply specifically to the CParser. Unless specifically stated as a CParser-specific issue, the goal is to eventually move as many of these tests out of this module as soon as the Python parser can accept further arguments when parsing. """ from decimal import Decimal from io import ( BytesIO, St...
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/io/parser/test_textreader.py
pandas/tests/io/parser/test_textreader.py
""" Tests the TextReader class in parsers.pyx, which is integral to the C engine in parsers.py """ from io import ( BytesIO, StringIO, ) import numpy as np import pytest import pandas._libs.parsers as parser from pandas._libs.parsers import TextReader from pandas.errors import ParserWarning from pandas 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/tests/io/parser/test_concatenate_chunks.py
pandas/tests/io/parser/test_concatenate_chunks.py
import numpy as np import pytest from pandas.errors import DtypeWarning import pandas._testing as tm from pandas.core.arrays import ArrowExtensionArray from pandas.io.parsers.c_parser_wrapper import _concatenate_chunks def test_concatenate_chunks_pyarrow(): # GH#51876 pa = pytest.importorskip("pyarrow") ...
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/io/parser/test_header.py
pandas/tests/io/parser/test_header.py
""" Tests that the file header is properly handled or inferred during parsing for all of the parsers defined in parsers.py """ from collections import namedtuple from io import StringIO import numpy as np import pytest from pandas.errors import ParserError from pandas import ( DataFrame, Index, MultiInd...
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/io/parser/test_unsupported.py
pandas/tests/io/parser/test_unsupported.py
""" Tests that features that are currently unsupported in either the Python or C parser are actually enforced and are clearly communicated to the user. Ultimately, the goal is to remove test cases from this test suite as new feature support is added to the parsers. """ from io import StringIO import os from pathlib i...
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/io/parser/test_dialect.py
pandas/tests/io/parser/test_dialect.py
""" Tests that dialects are properly handled during parsing for all of the parsers defined in parsers.py """ import csv from io import StringIO import pytest from pandas.errors import ParserWarning from pandas import DataFrame import pandas._testing as tm pytestmark = pytest.mark.filterwarnings( "ignore:Passin...
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/io/parser/test_upcast.py
pandas/tests/io/parser/test_upcast.py
import numpy as np import pytest from pandas._libs.parsers import ( _maybe_upcast, na_values, ) import pandas as pd from pandas import NA import pandas._testing as tm from pandas.core.arrays import ( ArrowStringArray, BooleanArray, FloatingArray, IntegerArray, ) def test_maybe_upcast(any_rea...
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/io/parser/test_compression.py
pandas/tests/io/parser/test_compression.py
""" Tests compressed data parsing functionality for all of the parsers defined in parsers.py """ import os from pathlib import Path import tarfile import zipfile import pytest from pandas import DataFrame import pandas._testing as tm pytestmark = pytest.mark.filterwarnings( "ignore:Passing a BlockManager to Dat...
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/io/parser/test_index_col.py
pandas/tests/io/parser/test_index_col.py
""" Tests that the specified index column (a.k.a "index_col") is properly handled or inferred during parsing for all of the parsers defined in parsers.py """ from io import StringIO import numpy as np import pytest from pandas import ( DataFrame, Index, MultiIndex, ) import pandas._testing as tm pytestm...
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/io/parser/conftest.py
pandas/tests/io/parser/conftest.py
from __future__ import annotations import os import pytest from pandas.compat import HAS_PYARROW from pandas.compat._optional import VERSIONS from pandas import ( read_csv, read_table, ) import pandas._testing as tm class BaseParser: engine: str | None = None low_memory = True float_precision_...
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/io/parser/test_multi_thread.py
pandas/tests/io/parser/test_multi_thread.py
""" Tests multithreading behaviour for reading and parsing files for each parser defined in parsers.py """ from contextlib import ExitStack from io import BytesIO from multiprocessing.pool import ThreadPool import numpy as np import pytest import pandas as pd from pandas import DataFrame 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/io/parser/test_comment.py
pandas/tests/io/parser/test_comment.py
""" Tests that comments are properly handled during parsing for all of the parsers defined in parsers.py """ from io import StringIO import numpy as np import pytest from pandas import DataFrame import pandas._testing as tm @pytest.mark.parametrize("na_values", [None, ["NaN"]]) def test_comment(all_parsers, na_val...
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/io/parser/__init__.py
pandas/tests/io/parser/__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/io/parser/test_network.py
pandas/tests/io/parser/test_network.py
""" Tests parsers ability to read and parse non-local files and hence require a network connection to be read. """ from io import BytesIO import logging import re import numpy as np import pytest import pandas.util._test_decorators as td from pandas import DataFrame import pandas._testing as tm from pandas.io.feat...
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/io/parser/test_converters.py
pandas/tests/io/parser/test_converters.py
""" Tests column conversion functionality during parsing for all of the parsers defined in parsers.py """ from io import StringIO from dateutil.parser import parse import numpy as np import pytest import pandas as pd from pandas import ( DataFrame, Index, ) import pandas._testing as tm def test_converters_...
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/io/parser/test_mangle_dupes.py
pandas/tests/io/parser/test_mangle_dupes.py
""" Tests that duplicate columns are handled appropriately when parsed by the CSV engine. In general, the expected result is that they are either thoroughly de-duplicated (if mangling requested) or ignored otherwise. """ from io import StringIO import pytest from pandas import ( DataFrame, Index, ) import 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/tests/io/parser/test_skiprows.py
pandas/tests/io/parser/test_skiprows.py
""" Tests that skipped rows are properly handled during parsing for all of the parsers defined in parsers.py """ from datetime import datetime from io import StringIO import numpy as np import pytest from pandas.errors import EmptyDataError from pandas import ( DataFrame, Index, ) 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/io/parser/test_na_values.py
pandas/tests/io/parser/test_na_values.py
""" Tests that NA values are properly handled during parsing for all of the parsers defined in parsers.py """ from io import StringIO import numpy as np import pytest from pandas._libs.parsers import STR_NA_VALUES from pandas import ( DataFrame, Index, MultiIndex, ) import pandas._testing as tm pytestm...
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/io/parser/test_encoding.py
pandas/tests/io/parser/test_encoding.py
""" Tests encoding functionality during parsing for all of the parsers defined in parsers.py """ from io import ( BytesIO, TextIOWrapper, ) import os import tempfile import numpy as np import pytest from pandas import ( DataFrame, read_csv, ) import pandas._testing as tm pytestmark = pytest.mark.fil...
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/io/parser/test_quoting.py
pandas/tests/io/parser/test_quoting.py
""" Tests that quoting specifications are properly handled during parsing for all of the parsers defined in parsers.py """ import csv from io import StringIO import pytest from pandas.compat import PY314 from pandas.errors import ParserError from pandas import DataFrame import pandas._testing as tm pytestmark = 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/io/parser/test_python_parser_only.py
pandas/tests/io/parser/test_python_parser_only.py
""" Tests that apply specifically to the Python parser. Unless specifically stated as a Python-specific issue, the goal is to eventually move as many of these tests out of this module as soon as the C parser can accept further arguments when parsing. """ from __future__ import annotations import csv from io 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/io/parser/test_read_fwf.py
pandas/tests/io/parser/test_read_fwf.py
""" Tests the 'read_fwf' function in parsers.py. This test suite is independent of the others because the engine is set to 'python-fwf' internally. """ from io import ( BytesIO, StringIO, ) import numpy as np import pytest from pandas.errors import EmptyDataError import pandas as pd from pandas 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/io/parser/test_parse_dates.py
pandas/tests/io/parser/test_parse_dates.py
""" Tests date parsing functionality for all of the parsers defined in parsers.py """ from datetime import ( datetime, timedelta, timezone, ) from io import StringIO import numpy as np import pytest from pandas.errors import Pandas4Warning import pandas as pd from pandas import ( DataFrame, Date...
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/io/parser/usecols/test_usecols_basic.py
pandas/tests/io/parser/usecols/test_usecols_basic.py
""" Tests the usecols functionality during parsing for all of the parsers defined in parsers.py """ from io import StringIO import numpy as np import pytest from pandas.errors import ParserError from pandas import ( DataFrame, Index, array, ) import pandas._testing as tm pytestmark = pytest.mark.filter...
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/io/parser/usecols/test_strings.py
pandas/tests/io/parser/usecols/test_strings.py
""" Tests the usecols functionality during parsing for all of the parsers defined in parsers.py """ from io import StringIO import pytest from pandas import DataFrame import pandas._testing as tm pytestmark = pytest.mark.filterwarnings( "ignore:Passing a BlockManager to DataFrame:DeprecationWarning" ) def 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/io/parser/usecols/__init__.py
pandas/tests/io/parser/usecols/__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/io/parser/usecols/test_parse_dates.py
pandas/tests/io/parser/usecols/test_parse_dates.py
""" Tests the usecols functionality during parsing for all of the parsers defined in parsers.py """ from io import StringIO import pytest from pandas import ( DataFrame, Index, Timestamp, ) import pandas._testing as tm pytestmark = pytest.mark.filterwarnings( "ignore:Passing a BlockManager to DataFr...
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/io/parser/dtypes/__init__.py
pandas/tests/io/parser/dtypes/__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/io/parser/dtypes/test_categorical.py
pandas/tests/io/parser/dtypes/test_categorical.py
""" Tests dtype specification during parsing for all of the parsers defined in parsers.py """ from io import StringIO import os import numpy as np import pytest from pandas._libs import parsers as libparsers from pandas.errors import Pandas4Warning from pandas.core.dtypes.dtypes import CategoricalDtype import pand...
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/io/parser/dtypes/test_dtypes_basic.py
pandas/tests/io/parser/dtypes/test_dtypes_basic.py
""" Tests dtype specification during parsing for all of the parsers defined in parsers.py """ from collections import defaultdict from io import StringIO import numpy as np import pytest from pandas.errors import ParserWarning import pandas as pd from pandas import ( DataFrame, Timestamp, ) 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/io/parser/dtypes/test_empty.py
pandas/tests/io/parser/dtypes/test_empty.py
""" Tests dtype specification during parsing for all of the parsers defined in parsers.py """ from io import StringIO import numpy as np import pytest from pandas import ( Categorical, DataFrame, Index, MultiIndex, Series, concat, ) import pandas._testing as tm skip_pyarrow = pytest.mark.use...
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/io/parser/common/test_float.py
pandas/tests/io/parser/common/test_float.py
""" Tests that work on both the Python and C engines but do not have a specific classification into the other test modules. """ from io import StringIO import numpy as np import pytest from pandas import DataFrame import pandas._testing as tm pytestmark = pytest.mark.filterwarnings( "ignore:Passing a BlockManag...
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/io/parser/common/test_decimal.py
pandas/tests/io/parser/common/test_decimal.py
""" Tests that work on both the Python and C engines but do not have a specific classification into the other test modules. """ from io import StringIO import pytest from pandas import DataFrame import pandas._testing as tm pytestmark = pytest.mark.filterwarnings( "ignore:Passing a BlockManager to DataFrame:Dep...
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/io/parser/common/test_index.py
pandas/tests/io/parser/common/test_index.py
""" Tests that work on both the Python and C engines but do not have a specific classification into the other test modules. """ from datetime import datetime from io import StringIO import os import pytest from pandas import ( DataFrame, Index, MultiIndex, ) import pandas._testing as tm pytestmark = 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/io/parser/common/test_data_list.py
pandas/tests/io/parser/common/test_data_list.py
""" Tests that work on both the Python and C engines but do not have a specific classification into the other test modules. """ import csv from io import StringIO import pytest from pandas import DataFrame import pandas._testing as tm from pandas.io.parsers import TextParser pytestmark = pytest.mark.filterwarnings...
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/io/parser/common/test_iterator.py
pandas/tests/io/parser/common/test_iterator.py
""" Tests that work on both the Python and C engines but do not have a specific classification into the other test modules. """ from io import StringIO import pytest from pandas import ( DataFrame, concat, ) import pandas._testing as tm pytestmark = pytest.mark.filterwarnings( "ignore:Passing a BlockMan...
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/io/parser/common/test_read_errors.py
pandas/tests/io/parser/common/test_read_errors.py
""" Tests that work on the Python, C and PyArrow engines but do not have a specific classification into the other test modules. """ import codecs import csv from io import StringIO import os from pathlib import Path import numpy as np import pytest from pandas.errors import ( EmptyDataError, ParserError, ...
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/io/parser/common/test_common_basic.py
pandas/tests/io/parser/common/test_common_basic.py
""" Tests that work on both the Python and C engines but do not have a specific classification into the other test modules. """ from datetime import datetime from inspect import signature from io import StringIO import os import sys import numpy as np import pytest from pandas._config import using_string_dtype 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/io/parser/common/test_ints.py
pandas/tests/io/parser/common/test_ints.py
""" Tests that work on both the Python and C engines but do not have a specific classification into the other test modules. """ from io import StringIO import numpy as np import pytest from pandas import ( DataFrame, Series, ) import pandas._testing as tm pytestmark = pytest.mark.filterwarnings( "ignore...
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/io/parser/common/test_inf.py
pandas/tests/io/parser/common/test_inf.py
""" Tests that work on both the Python and C engines but do not have a specific classification into the other test modules. """ from io import StringIO import pytest from pandas import DataFrame import pandas._testing as tm pytestmark = pytest.mark.filterwarnings( "ignore:Passing a BlockManager to DataFrame:Dep...
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/io/parser/common/test_file_buffer_url.py
pandas/tests/io/parser/common/test_file_buffer_url.py
""" Tests that work on both the Python and C engines but do not have a specific classification into the other test modules. """ from io import ( BytesIO, StringIO, ) import os import platform from urllib.error import URLError import uuid import numpy as np import pytest from pandas.compat import WASM 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/tests/io/parser/common/__init__.py
pandas/tests/io/parser/common/__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/io/parser/common/test_chunksize.py
pandas/tests/io/parser/common/test_chunksize.py
""" Tests that work on both the Python and C engines but do not have a specific classification into the other test modules. """ from io import StringIO import numpy as np import pytest from pandas._libs import parsers as libparsers from pandas.errors import DtypeWarning from pandas import ( DataFrame, conca...
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/series/test_reductions.py
pandas/tests/series/test_reductions.py
import numpy as np import pytest import pandas as pd from pandas import Series import pandas._testing as tm @pytest.mark.parametrize("operation, expected", [("min", "a"), ("max", "b")]) def test_reductions_series_strings(operation, expected): # GH#31746 ser = Series(["a", "b"], dtype="string") res_operat...
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/series/test_iteration.py
pandas/tests/series/test_iteration.py
class TestIteration: def test_keys(self, datetime_series): assert datetime_series.keys() is datetime_series.index def test_iter_datetimes(self, datetime_series): for i, val in enumerate(datetime_series): assert val == datetime_series.iloc[i] def test_iter_strings(self, string_s...
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/series/test_missing.py
pandas/tests/series/test_missing.py
from datetime import timedelta import numpy as np import pytest from pandas._libs import iNaT import pandas as pd from pandas import ( Categorical, Index, NaT, Series, isna, ) import pandas._testing as tm class TestSeriesMissingData: def test_categorical_nan_handling(self): # NaNs 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/series/test_ufunc.py
pandas/tests/series/test_ufunc.py
from collections import deque import re import string import numpy as np import pytest import pandas as pd import pandas._testing as tm from pandas.arrays import SparseArray @pytest.fixture(params=[np.add, np.logaddexp]) def ufunc(request): # dunder op return request.param @pytest.fixture( params=[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/series/test_constructors.py
pandas/tests/series/test_constructors.py
from collections import OrderedDict from collections.abc import Iterator from datetime import ( datetime, timedelta, ) from dateutil.tz import tzoffset import numpy as np from numpy import ma import pytest from pandas._libs import ( iNaT, lib, ) from pandas.compat import HAS_PYARROW from pandas.compat...
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/series/test_cumulative.py
pandas/tests/series/test_cumulative.py
""" Tests for Series cumulative operations. See also -------- tests.frame.test_cumulative """ import re import numpy as np import pytest import pandas as pd import pandas._testing as tm methods = { "cumsum": np.cumsum, "cumprod": np.cumprod, "cummin": np.minimum.accumulate, "cummax": np.maximum.acc...
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/series/test_formats.py
pandas/tests/series/test_formats.py
from datetime import ( datetime, timedelta, ) import numpy as np import pytest import pandas as pd from pandas import ( Categorical, DataFrame, Index, Series, date_range, option_context, period_range, timedelta_range, ) class TestSeriesRepr: def test_multilevel_name_print...
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/series/test_logical_ops.py
pandas/tests/series/test_logical_ops.py
from datetime import datetime import operator import numpy as np import pytest from pandas import ( DataFrame, Index, Series, bdate_range, ) import pandas._testing as tm from pandas.core import ops class TestSeriesLogicalOps: @pytest.mark.parametrize("bool_op", [operator.and_, operator.or_, oper...
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/series/test_api.py
pandas/tests/series/test_api.py
import inspect import pydoc import numpy as np import pytest import pandas as pd from pandas import ( DataFrame, Index, Series, date_range, period_range, timedelta_range, ) import pandas._testing as tm class TestSeriesMisc: def test_tab_completion(self): # GH 9910 s = Ser...
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/series/__init__.py
pandas/tests/series/__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/series/test_validate.py
pandas/tests/series/test_validate.py
import pytest @pytest.mark.parametrize( "func", [ "reset_index", "_set_name", "sort_values", "sort_index", "rename", "dropna", "drop_duplicates", ], ) @pytest.mark.parametrize("inplace", [1, "True", [1, 2, 3], 5.0]) def test_validate_bool_args(string...
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/series/test_arrow_interface.py
pandas/tests/series/test_arrow_interface.py
import ctypes import pytest import pandas.util._test_decorators as td import pandas as pd import pandas._testing as tm pa = pytest.importorskip("pyarrow", minversion="16.0") def test_series_arrow_interface(): s = pd.Series([1, 4, 2]) capsule = s.__arrow_c_stream__() assert ( ctypes.pythonapi....
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/series/test_arithmetic.py
pandas/tests/series/test_arithmetic.py
from datetime import ( date, timedelta, timezone, ) from decimal import Decimal from enum import ( Enum, auto, ) import operator import numpy as np import pytest from pandas._libs import lib import pandas as pd from pandas import ( Categorical, DatetimeTZDtype, Index, Series, ...
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/series/test_npfuncs.py
pandas/tests/series/test_npfuncs.py
""" Tests for np.foo applied to Series, not necessarily ufuncs. """ import numpy as np import pytest import pandas.util._test_decorators as td from pandas import Series import pandas._testing as tm class TestPtp: def test_ptp(self): # GH#21614 N = 1000 arr = np.random.default_rng(2).sta...
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/series/test_subclass.py
pandas/tests/series/test_subclass.py
import numpy as np import pytest import pandas as pd import pandas._testing as tm pytestmark = pytest.mark.filterwarnings( "ignore:Passing a BlockManager|Passing a SingleBlockManager:DeprecationWarning" ) class TestSeriesSubclassing: @pytest.mark.parametrize( "idx_method, indexer, exp_data, exp_idx"...
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/series/test_unary.py
pandas/tests/series/test_unary.py
import pytest from pandas import Series import pandas._testing as tm class TestSeriesUnaryOps: # __neg__, __pos__, __invert__ def test_neg(self): ser = Series(range(5), dtype="float64", name="series") tm.assert_series_equal(-ser, -1 * ser) def test_invert(self): ser = Series(ran...
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/series/accessors/test_struct_accessor.py
pandas/tests/series/accessors/test_struct_accessor.py
import re import pytest from pandas import ( ArrowDtype, DataFrame, Index, Series, ) import pandas._testing as tm pa = pytest.importorskip("pyarrow") pc = pytest.importorskip("pyarrow.compute") def test_struct_accessor_dtypes(): ser = Series( [], dtype=ArrowDtype( 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/tests/series/accessors/test_str_accessor.py
pandas/tests/series/accessors/test_str_accessor.py
import pytest from pandas import Series import pandas._testing as tm class TestStrAccessor: def test_str_attribute(self): # GH#9068 methods = ["strip", "rstrip", "lstrip"] ser = Series([" jack", "jill ", " jesse ", "frank"]) for method in methods: expected = Series([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/tests/series/accessors/test_sparse_accessor.py
pandas/tests/series/accessors/test_sparse_accessor.py
from pandas import Series class TestSparseAccessor: def test_sparse_accessor_updates_on_inplace(self): ser = Series([1, 1, 2, 3], dtype="Sparse[int]") return_value = ser.drop([0, 1], inplace=True) assert return_value is None assert ser.sparse.density == 1.0
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/series/accessors/test_cat_accessor.py
pandas/tests/series/accessors/test_cat_accessor.py
import numpy as np import pytest from pandas.errors import Pandas4Warning from pandas import ( Categorical, DataFrame, Index, Series, Timestamp, date_range, period_range, timedelta_range, ) import pandas._testing as tm from pandas.core.arrays.categorical import CategoricalAccessor 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/series/accessors/__init__.py
pandas/tests/series/accessors/__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/series/accessors/test_dt_accessor.py
pandas/tests/series/accessors/test_dt_accessor.py
import calendar from datetime import ( date, datetime, time, ) import locale import unicodedata import numpy as np import pytest from pandas._libs.tslibs.timezones import maybe_get_tz from pandas.errors import Pandas4Warning from pandas.core.dtypes.common import ( is_integer_dtype, is_list_like, ...
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/series/accessors/test_list_accessor.py
pandas/tests/series/accessors/test_list_accessor.py
import re import pytest from pandas import ( ArrowDtype, Series, ) import pandas._testing as tm pa = pytest.importorskip("pyarrow") @pytest.mark.parametrize( "list_dtype", ( pa.list_(pa.int64()), pa.list_(pa.int64(), list_size=3), pa.large_list(pa.int64()), ), ) def 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/series/methods/test_sort_index.py
pandas/tests/series/methods/test_sort_index.py
import numpy as np import pytest from pandas import ( DatetimeIndex, IntervalIndex, MultiIndex, Series, ) import pandas._testing as tm @pytest.fixture(params=["quicksort", "mergesort", "heapsort", "stable"]) def sort_kind(request): return request.param class TestSeriesSortIndex: def test_so...
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/series/methods/test_to_frame.py
pandas/tests/series/methods/test_to_frame.py
import pytest from pandas import ( DataFrame, Index, Series, ) import pandas._testing as tm class TestToFrame: def test_to_frame_respects_name_none(self): # GH#44212 if we explicitly pass name=None, then that should be respected, # not changed to 0 # GH-45448 this is first de...
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/series/methods/test_rename.py
pandas/tests/series/methods/test_rename.py
from datetime import datetime import re import numpy as np import pytest from pandas import ( Index, MultiIndex, Series, array, ) import pandas._testing as tm class TestRename: def test_rename(self, datetime_series): ts = datetime_series renamer = lambda x: x.strftime("%Y%m%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/series/methods/test_pop.py
pandas/tests/series/methods/test_pop.py
from pandas import Series import pandas._testing as tm def test_pop(): # GH#6600 ser = Series([0, 4, 0], index=["A", "B", "C"], name=4) result = ser.pop("B") assert result == 4 expected = Series([0, 0], index=["A", "C"], name=4) tm.assert_series_equal(ser, 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/series/methods/test_argsort.py
pandas/tests/series/methods/test_argsort.py
import numpy as np import pytest from pandas import ( Series, Timestamp, isna, ) import pandas._testing as tm class TestSeriesArgsort: def test_argsort_axis(self): # GH#54257 ser = Series(range(3)) msg = "No axis named 2 for object type Series" with pytest.raises(Valu...
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/series/methods/test_case_when.py
pandas/tests/series/methods/test_case_when.py
import numpy as np import pytest from pandas import ( DataFrame, Series, array as pd_array, date_range, ) import pandas._testing as tm @pytest.fixture def df(): """ base dataframe for testing """ return DataFrame({"a": [1, 2, 3], "b": [4, 5, 6]}) def test_case_when_caselist_is_not_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/series/methods/test_item.py
pandas/tests/series/methods/test_item.py
""" Series.item method, mainly testing that we get python scalars as opposed to numpy scalars. """ import pytest from pandas import ( Series, Timedelta, Timestamp, date_range, ) class TestItem: def test_item(self): # We are testing that we get python scalars as opposed to numpy scalars ...
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/series/methods/test_unique.py
pandas/tests/series/methods/test_unique.py
import numpy as np from pandas import ( Categorical, IntervalIndex, Series, date_range, ) import pandas._testing as tm class TestUnique: def test_unique_uint64(self): ser = Series([1, 2, 2**63, 2**63], dtype=np.uint64) res = ser.unique() exp = np.array([1, 2, 2**63], dtype...
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/series/methods/test_convert_dtypes.py
pandas/tests/series/methods/test_convert_dtypes.py
from itertools import product import numpy as np import pytest from pandas._libs import lib import pandas.util._test_decorators as td import pandas as pd import pandas._testing as tm class TestSeriesConvertDtypes: @pytest.mark.parametrize( "data, maindtype, expected_default, expected_other", [ ...
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/series/methods/test_tolist.py
pandas/tests/series/methods/test_tolist.py
import pytest import pandas.util._test_decorators as td from pandas import ( Interval, Period, Series, Timedelta, Timestamp, ) @pytest.mark.parametrize( "values, dtype, expected_dtype", ( ([1], "int64", int), ([1], "Int64", int), ([1.0], "float64", float), ...
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/series/methods/test_quantile.py
pandas/tests/series/methods/test_quantile.py
import numpy as np import pytest from pandas.core.dtypes.common import is_integer import pandas as pd from pandas import ( Index, Series, ) import pandas._testing as tm from pandas.core.indexes.datetimes import Timestamp class TestSeriesQuantile: def test_quantile(self, datetime_series): q = dat...
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/series/methods/test_unstack.py
pandas/tests/series/methods/test_unstack.py
import numpy as np import pytest import pandas as pd from pandas import ( DataFrame, Index, MultiIndex, Series, date_range, ) import pandas._testing as tm def test_unstack_preserves_object(): mi = MultiIndex.from_product([["bar", "foo"], ["one", "two"]]) ser = Series(np.arange(4.0), inde...
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/series/methods/test_matmul.py
pandas/tests/series/methods/test_matmul.py
import operator import numpy as np import pytest from pandas import ( DataFrame, Series, ) import pandas._testing as tm class TestMatmul: def test_matmul(self): # matmul test is for GH#10259 a = Series( np.random.default_rng(2).standard_normal(4), index=["p", "q", "r", "s"] ...
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/series/methods/test_equals.py
pandas/tests/series/methods/test_equals.py
import copy import numpy as np import pytest from pandas._libs.missing import is_matching_na from pandas.core.dtypes.common import is_float from pandas import ( Index, MultiIndex, Series, ) @pytest.mark.parametrize( "arr, idx", [ ([1, 2, 3, 4], [0, 2, 1, 3]), ([1, np.nan, 3, 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/series/methods/test_searchsorted.py
pandas/tests/series/methods/test_searchsorted.py
import numpy as np import pytest import pandas as pd from pandas import ( Series, Timestamp, date_range, ) import pandas._testing as tm from pandas.api.types import is_scalar class TestSeriesSearchSorted: def test_searchsorted(self): ser = Series([1, 2, 3]) result = ser.searchsorted(...
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/series/methods/test_nunique.py
pandas/tests/series/methods/test_nunique.py
import numpy as np from pandas import ( Categorical, Series, ) def test_nunique(): # basics.rst doc example series = Series(np.random.default_rng(2).standard_normal(500)) series[20:500] = np.nan series[10:20] = 5000 result = series.nunique() assert result == 11 def test_nunique_cate...
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/series/methods/test_repeat.py
pandas/tests/series/methods/test_repeat.py
import numpy as np import pytest from pandas import ( MultiIndex, Series, ) import pandas._testing as tm class TestRepeat: def test_repeat(self): ser = Series(np.random.default_rng(2).standard_normal(3), index=["a", "b", "c"]) reps = ser.repeat(5) exp = Series(ser.values.repeat(5...
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/series/methods/test_interpolate.py
pandas/tests/series/methods/test_interpolate.py
import numpy as np import pytest import pandas.util._test_decorators as td import pandas as pd from pandas import ( Index, MultiIndex, Series, date_range, isna, ) import pandas._testing as tm @pytest.fixture( params=[ "linear", "index", "values", "nearest", ...
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/series/methods/test_nlargest.py
pandas/tests/series/methods/test_nlargest.py
""" Note: for naming purposes, most tests are title with as e.g. "test_nlargest_foo" but are implicitly also testing nsmallest_foo. """ import numpy as np import pytest import pandas as pd from pandas import Series import pandas._testing as tm def assert_check_nselect_boundary(vals, dtype, method): # helper fun...
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/series/methods/test_explode.py
pandas/tests/series/methods/test_explode.py
import numpy as np import pytest import pandas as pd import pandas._testing as tm def test_basic(): s = pd.Series([[0, 1, 2], np.nan, [], (3, 4)], index=list("abcd"), name="foo") result = s.explode() expected = pd.Series( [0, 1, 2, np.nan, np.nan, 3, 4], index=list("aaabcdd"), dtype=object, name=...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false