Search is not available for this dataset
repo_id
stringlengths
12
110
file_path
stringlengths
24
164
content
stringlengths
3
89.3M
__index_level_0__
int64
0
0
public_repos/pandas/pandas/tests/indexing
public_repos/pandas/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, ...
0
public_repos/pandas/pandas/tests/indexing
public_repos/pandas/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 ...
0
public_repos/pandas/pandas/tests
public_repos/pandas/pandas/tests/reductions/test_reductions.py
from datetime import ( datetime, timedelta, ) from decimal import Decimal import numpy as np import pytest import pandas as pd from pandas import ( Categorical, DataFrame, DatetimeIndex, Index, NaT, Period, PeriodIndex, RangeIndex, Series, Timedelta, TimedeltaIndex,...
0
public_repos/pandas/pandas/tests
public_repos/pandas/pandas/tests/reductions/test_stat_reductions.py
""" Tests for statistical reductions of 2nd moment or higher: var, skew, kurt, ... """ import inspect import numpy as np import pytest import pandas as pd from pandas import ( DataFrame, Series, ) import pandas._testing as tm from pandas.core.arrays import ( DatetimeArray, PeriodArray, TimedeltaAr...
0
public_repos/pandas/pandas/tests
public_repos/pandas/pandas/tests/reductions/__init__.py
""" Tests for reductions where we want to test for matching behavior across Array, Index, Series, and DataFrame methods. """
0
public_repos/pandas/pandas/tests
public_repos/pandas/pandas/tests/arithmetic/test_array_ops.py
import operator import numpy as np import pytest import pandas._testing as tm from pandas.core.ops.array_ops import ( comparison_op, na_logical_op, ) def test_na_logical_op_2d(): left = np.arange(8).reshape(4, 2) right = left.astype(object) right[0, 0] = np.nan # Check that we fall back to ...
0
public_repos/pandas/pandas/tests
public_repos/pandas/pandas/tests/arithmetic/test_object.py
# Arithmetic tests for DataFrame/Series/Index/Array classes that should # behave identically. # Specifically for object dtype import datetime from decimal import Decimal import operator import numpy as np import pytest import pandas as pd from pandas import ( Series, Timestamp, ) import pandas._testing as tm ...
0
public_repos/pandas/pandas/tests
public_repos/pandas/pandas/tests/arithmetic/common.py
""" Assertion helpers for arithmetic tests. """ import numpy as np import pytest from pandas import ( DataFrame, Index, Series, array, ) import pandas._testing as tm from pandas.core.arrays import ( BooleanArray, NumpyExtensionArray, ) def assert_cannot_add(left, right, msg="cannot add"): ...
0
public_repos/pandas/pandas/tests
public_repos/pandas/pandas/tests/arithmetic/conftest.py
import numpy as np import pytest import pandas as pd from pandas import ( Index, RangeIndex, ) import pandas._testing as tm @pytest.fixture(params=[1, np.array(1, dtype=np.int64)]) def one(request): """ Several variants of integer value 1. The zero-dim integer array behaves like an integer. ...
0
public_repos/pandas/pandas/tests
public_repos/pandas/pandas/tests/arithmetic/test_period.py
# Arithmetic tests for DataFrame/Series/Index/Array classes that should # behave identically. # Specifically for Period dtype import operator import numpy as np import pytest from pandas._libs.tslibs import ( IncompatibleFrequency, Period, Timestamp, to_offset, ) from pandas.errors import PerformanceW...
0
public_repos/pandas/pandas/tests
public_repos/pandas/pandas/tests/arithmetic/test_timedelta64.py
# Arithmetic tests for DataFrame/Series/Index/Array classes that should # behave identically. from datetime import ( datetime, timedelta, ) import numpy as np import pytest from pandas.errors import ( OutOfBoundsDatetime, PerformanceWarning, ) import pandas as pd from pandas import ( DataFrame, ...
0
public_repos/pandas/pandas/tests
public_repos/pandas/pandas/tests/arithmetic/test_datetime64.py
# Arithmetic tests for DataFrame/Series/Index/Array classes that should # behave identically. # Specifically for datetime64 and datetime64tz dtypes from datetime import ( datetime, time, timedelta, ) from itertools import ( product, starmap, ) import operator import numpy as np import pytest import...
0
public_repos/pandas/pandas/tests
public_repos/pandas/pandas/tests/arithmetic/test_categorical.py
import numpy as np from pandas import ( Categorical, Series, ) import pandas._testing as tm class TestCategoricalComparisons: def test_categorical_nan_equality(self): cat = Series(Categorical(["a", "b", "c", np.nan])) expected = Series([True, True, True, False]) result = cat == ca...
0
public_repos/pandas/pandas/tests
public_repos/pandas/pandas/tests/arithmetic/test_numeric.py
# Arithmetic tests for DataFrame/Series/Index/Array classes that should # behave identically. # Specifically for numeric dtypes from __future__ import annotations from collections import abc from datetime import timedelta from decimal import Decimal import operator import numpy as np import pytest import pandas as p...
0
public_repos/pandas/pandas/tests
public_repos/pandas/pandas/tests/arithmetic/test_interval.py
import operator import numpy as np import pytest from pandas.core.dtypes.common import is_list_like import pandas as pd from pandas import ( Categorical, Index, Interval, IntervalIndex, Period, Series, Timedelta, Timestamp, date_range, period_range, timedelta_range, ) impo...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/util/_print_versions.py
from __future__ import annotations import codecs import json import locale import os import platform import struct import sys from typing import TYPE_CHECKING if TYPE_CHECKING: from pandas._typing import JSONSerializable from pandas.compat._optional import ( VERSIONS, get_version, import_optional_dep...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/util/_test_decorators.py
""" This module provides decorator functions which can be applied to test objects in order to skip those objects when certain conditions occur. A sample use case is to detect if the platform is missing ``matplotlib``. If so, any test objects which require ``matplotlib`` and decorated with ``@td.skip_if_no("matplotlib")...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/util/_doctools.py
from __future__ import annotations from typing import TYPE_CHECKING import numpy as np import pandas as pd if TYPE_CHECKING: from collections.abc import Iterable class TablePlotter: """ Layout some DataFrames in vertical/horizontal layout for explanation. Used in merging.rst """ def __ini...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/util/_decorators.py
from __future__ import annotations from functools import wraps import inspect from textwrap import dedent from typing import ( TYPE_CHECKING, Any, Callable, cast, ) import warnings from pandas._libs.properties import cache_readonly from pandas._typing import ( F, T, ) from pandas.util._excepti...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/util/_validators.py
""" Module that contains many useful utilities for validating data or function arguments """ from __future__ import annotations from collections.abc import ( Iterable, Sequence, ) from typing import ( TypeVar, overload, ) import numpy as np from pandas._libs import lib from pandas.core.dtypes.common...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/util/_tester.py
""" Entrypoint for testing from the top-level namespace. """ from __future__ import annotations import os import sys from pandas.compat._optional import import_optional_dependency PKG = os.path.dirname(os.path.dirname(__file__)) def test(extra_args: list[str] | None = None, run_doctests: bool = False) -> None: ...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/util/_exceptions.py
from __future__ import annotations import contextlib import inspect import os import re from typing import TYPE_CHECKING import warnings if TYPE_CHECKING: from collections.abc import Generator @contextlib.contextmanager def rewrite_exception(old_name: str, new_name: str) -> Generator[None, None, None]: """ ...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/util/__init__.py
def __getattr__(key: str): # These imports need to be lazy to avoid circular import errors if key == "hash_array": from pandas.core.util.hashing import hash_array return hash_array if key == "hash_pandas_object": from pandas.core.util.hashing import hash_pandas_object retur...
0
public_repos/pandas/pandas/util
public_repos/pandas/pandas/util/version/__init__.py
# Vendored from https://github.com/pypa/packaging/blob/main/packaging/_structures.py # and https://github.com/pypa/packaging/blob/main/packaging/_structures.py # changeset ae891fd74d6dd4c6063bb04f2faeadaac6fc6313 # 04/30/2021 # This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BS...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/api/__init__.py
""" public toolkit API """ from pandas.api import ( extensions, indexers, interchange, types, typing, ) __all__ = [ "interchange", "extensions", "indexers", "types", "typing", ]
0
public_repos/pandas/pandas/api
public_repos/pandas/pandas/api/indexers/__init__.py
""" Public API for Rolling Window Indexers. """ from pandas.core.indexers import check_array_indexer from pandas.core.indexers.objects import ( BaseIndexer, FixedForwardWindowIndexer, VariableOffsetWindowIndexer, ) __all__ = [ "check_array_indexer", "BaseIndexer", "FixedForwardWindowIndexer", ...
0
public_repos/pandas/pandas/api
public_repos/pandas/pandas/api/interchange/__init__.py
""" Public API for DataFrame interchange protocol. """ from pandas.core.interchange.dataframe_protocol import DataFrame from pandas.core.interchange.from_dataframe import from_dataframe __all__ = ["from_dataframe", "DataFrame"]
0
public_repos/pandas/pandas/api
public_repos/pandas/pandas/api/extensions/__init__.py
""" Public API for extending pandas objects. """ from pandas._libs.lib import no_default from pandas.core.dtypes.base import ( ExtensionDtype, register_extension_dtype, ) from pandas.core.accessor import ( register_dataframe_accessor, register_index_accessor, register_series_accessor, ) from pand...
0
public_repos/pandas/pandas/api
public_repos/pandas/pandas/api/typing/__init__.py
""" Public API classes that store intermediate results useful for type-hinting. """ from pandas._libs import NaTType from pandas._libs.missing import NAType from pandas.core.groupby import ( DataFrameGroupBy, SeriesGroupBy, ) from pandas.core.resample import ( DatetimeIndexResamplerGroupby, PeriodInde...
0
public_repos/pandas/pandas/api
public_repos/pandas/pandas/api/types/__init__.py
""" Public toolkit API. """ from pandas._libs.lib import infer_dtype from pandas.core.dtypes.api import * # noqa: F403 from pandas.core.dtypes.concat import union_categoricals from pandas.core.dtypes.dtypes import ( CategoricalDtype, DatetimeTZDtype, IntervalDtype, PeriodDtype, ) __all__ = [ "in...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/io/orc.py
""" orc compat """ from __future__ import annotations import io from types import ModuleType from typing import ( TYPE_CHECKING, Any, Literal, ) from pandas._config import using_pyarrow_string_dtype from pandas._libs import lib from pandas.compat._optional import import_optional_dependency from pandas.ut...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/io/gbq.py
""" Google BigQuery support """ from __future__ import annotations from typing import ( TYPE_CHECKING, Any, ) import warnings from pandas.compat._optional import import_optional_dependency from pandas.util._exceptions import find_stack_level if TYPE_CHECKING: import google.auth from pandas import Da...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/io/clipboards.py
""" io on the clipboard """ from __future__ import annotations from io import StringIO from typing import TYPE_CHECKING import warnings from pandas._libs import lib from pandas.util._exceptions import find_stack_level from pandas.util._validators import check_dtype_backend from pandas.core.dtypes.generic import ABCD...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/io/feather_format.py
""" feather-format compat """ from __future__ import annotations from typing import ( TYPE_CHECKING, Any, ) from pandas._config import using_pyarrow_string_dtype from pandas._libs import lib from pandas.compat._optional import import_optional_dependency from pandas.util._decorators import doc from pandas.uti...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/io/html.py
""" :mod:`pandas.io.html` is a module containing functionality for dealing with HTML IO. """ from __future__ import annotations from collections import abc import numbers import re from re import Pattern from typing import ( TYPE_CHECKING, Literal, cast, ) import warnings from pandas._libs import lib fr...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/io/xml.py
""" :mod:``pandas.io.xml`` is a module for reading XML. """ from __future__ import annotations import io from os import PathLike from typing import ( TYPE_CHECKING, Any, Callable, ) import warnings from pandas._libs import lib from pandas.compat._optional import import_optional_dependency from pandas.err...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/io/common.py
"""Common IO api utilities""" from __future__ import annotations from abc import ( ABC, abstractmethod, ) import codecs from collections import defaultdict from collections.abc import ( Hashable, Mapping, Sequence, ) import dataclasses import functools import gzip from io import ( BufferedIOBas...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/io/spss.py
from __future__ import annotations from typing import TYPE_CHECKING from pandas._libs import lib from pandas.compat._optional import import_optional_dependency from pandas.util._validators import check_dtype_backend from pandas.core.dtypes.inference import is_list_like from pandas.io.common import stringify_path i...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/io/pickle.py
""" pickle compat """ from __future__ import annotations import pickle from typing import ( TYPE_CHECKING, Any, ) import warnings from pandas.compat import pickle_compat as pc from pandas.util._decorators import doc from pandas.core.shared_docs import _shared_docs from pandas.io.common import get_handle if...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/io/pytables.py
""" High level interface to PyTables for reading and writing pandas data structures to disk """ from __future__ import annotations from contextlib import suppress import copy from datetime import ( date, tzinfo, ) import itertools import os import re from textwrap import dedent from typing import ( TYPE_CH...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/io/api.py
""" Data IO api """ from pandas.io.clipboards import read_clipboard from pandas.io.excel import ( ExcelFile, ExcelWriter, read_excel, ) from pandas.io.feather_format import read_feather from pandas.io.gbq import read_gbq from pandas.io.html import read_html from pandas.io.json import read_json from pandas....
0
public_repos/pandas/pandas
public_repos/pandas/pandas/io/parquet.py
""" parquet compat """ from __future__ import annotations import io import json import os from typing import ( TYPE_CHECKING, Any, Literal, ) import warnings from warnings import catch_warnings from pandas._config import using_pyarrow_string_dtype from pandas._config.config import _get_option from pandas...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/io/stata.py
""" Module contains tools for processing Stata files into DataFrames The StataReader below was originally written by Joe Presbrey as part of PyDTA. It has been extended and improved by Skipper Seabold from the Statsmodels project who also developed the StataWriter and was finally added to pandas in a once again improv...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/io/_util.py
from __future__ import annotations from typing import Callable from pandas.compat._optional import import_optional_dependency import pandas as pd def _arrow_dtype_mapping() -> dict: pa = import_optional_dependency("pyarrow") return { pa.int8(): pd.Int8Dtype(), pa.int16(): pd.Int16Dtype(), ...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/io/sql.py
""" Collection of query wrappers / abstractions to both facilitate data retrieval and to reduce dependency on DB-specific API. """ from __future__ import annotations from abc import ( ABC, abstractmethod, ) from contextlib import ( ExitStack, contextmanager, ) from datetime import ( date, date...
0
public_repos/pandas/pandas
public_repos/pandas/pandas/io/__init__.py
# ruff: noqa: TCH004 from typing import TYPE_CHECKING if TYPE_CHECKING: # import modules that have public classes/functions from pandas.io import ( formats, json, stata, ) # mark only those modules as public __all__ = ["formats", "json", "stata"]
0
public_repos/pandas/pandas/io
public_repos/pandas/pandas/io/clipboard/__init__.py
""" Pyperclip A cross-platform clipboard module for Python, with copy & paste functions for plain text. By Al Sweigart al@inventwithpython.com Licence at LICENSES/PYPERCLIP_LICENSE Usage: import pyperclip pyperclip.copy('The text to be copied to the clipboard.') spam = pyperclip.paste() if not pyperclip.is_a...
0
public_repos/pandas/pandas/io
public_repos/pandas/pandas/io/parsers/c_parser_wrapper.py
from __future__ import annotations from collections import defaultdict from typing import TYPE_CHECKING import warnings import numpy as np from pandas._libs import ( lib, parsers, ) from pandas.compat._optional import import_optional_dependency from pandas.errors import DtypeWarning from pandas.util._excepti...
0
public_repos/pandas/pandas/io
public_repos/pandas/pandas/io/parsers/base_parser.py
from __future__ import annotations from collections import defaultdict from copy import copy import csv import datetime from enum import Enum import itertools from typing import ( TYPE_CHECKING, Any, Callable, cast, final, overload, ) import warnings import numpy as np from pandas._libs impor...
0
public_repos/pandas/pandas/io
public_repos/pandas/pandas/io/parsers/python_parser.py
from __future__ import annotations from collections import ( abc, defaultdict, ) from collections.abc import ( Hashable, Iterator, Mapping, Sequence, ) import csv from io import StringIO import re from typing import ( IO, TYPE_CHECKING, DefaultDict, Literal, cast, ) import w...
0
public_repos/pandas/pandas/io
public_repos/pandas/pandas/io/parsers/readers.py
""" Module contains tools for processing files into DataFrames or other objects GH#48849 provides a convenient way of deprecating keyword arguments """ from __future__ import annotations from collections import abc import csv import sys from textwrap import fill from typing import ( IO, TYPE_CHECKING, Any...
0
public_repos/pandas/pandas/io
public_repos/pandas/pandas/io/parsers/arrow_parser_wrapper.py
from __future__ import annotations from typing import TYPE_CHECKING import warnings from pandas._config import using_pyarrow_string_dtype from pandas._libs import lib from pandas.compat._optional import import_optional_dependency from pandas.errors import ( ParserError, ParserWarning, ) from pandas.util._exc...
0
public_repos/pandas/pandas/io
public_repos/pandas/pandas/io/parsers/__init__.py
from pandas.io.parsers.readers import ( TextFileReader, TextParser, read_csv, read_fwf, read_table, ) __all__ = ["TextFileReader", "TextParser", "read_csv", "read_fwf", "read_table"]
0
public_repos/pandas/pandas/io
public_repos/pandas/pandas/io/json/_table_schema.py
""" Table Schema builders https://specs.frictionlessdata.io/table-schema/ """ from __future__ import annotations from typing import ( TYPE_CHECKING, Any, cast, ) import warnings from pandas._libs import lib from pandas._libs.json import ujson_loads from pandas._libs.tslibs import timezones from pandas._l...
0
public_repos/pandas/pandas/io
public_repos/pandas/pandas/io/json/_normalize.py
# --------------------------------------------------------------------- # JSON normalization routines from __future__ import annotations from collections import ( abc, defaultdict, ) import copy from typing import ( TYPE_CHECKING, Any, DefaultDict, ) import numpy as np from pandas._libs.writers i...
0
public_repos/pandas/pandas/io
public_repos/pandas/pandas/io/json/_json.py
from __future__ import annotations from abc import ( ABC, abstractmethod, ) from collections import abc from io import StringIO from itertools import islice from typing import ( TYPE_CHECKING, Any, Callable, Generic, Literal, TypeVar, overload, ) import warnings import numpy as np ...
0
public_repos/pandas/pandas/io
public_repos/pandas/pandas/io/json/__init__.py
from pandas.io.json._json import ( read_json, to_json, ujson_dumps, ujson_loads, ) from pandas.io.json._table_schema import build_table_schema __all__ = [ "ujson_dumps", "ujson_loads", "read_json", "to_json", "build_table_schema", ]
0
public_repos/pandas/pandas/io
public_repos/pandas/pandas/io/formats/console.py
""" Internal module for console introspection """ from __future__ import annotations from shutil import get_terminal_size def get_console_size() -> tuple[int | None, int | None]: """ Return console size as tuple = (width, height). Returns (None,None) in non-interactive session. """ from pandas i...
0
public_repos/pandas/pandas/io
public_repos/pandas/pandas/io/formats/html.py
""" Module for formatting output data in HTML. """ from __future__ import annotations from textwrap import dedent from typing import ( TYPE_CHECKING, Any, Final, cast, ) from pandas._config import get_option from pandas._libs import lib from pandas import ( MultiIndex, option_context, ) fro...
0
public_repos/pandas/pandas/io
public_repos/pandas/pandas/io/formats/xml.py
""" :mod:`pandas.io.formats.xml` is a module for formatting data in XML. """ from __future__ import annotations import codecs import io from typing import ( TYPE_CHECKING, Any, final, ) import warnings from pandas.errors import AbstractMethodError from pandas.util._decorators import ( cache_readonly, ...
0
public_repos/pandas/pandas/io
public_repos/pandas/pandas/io/formats/info.py
from __future__ import annotations from abc import ( ABC, abstractmethod, ) import sys from textwrap import dedent from typing import TYPE_CHECKING from pandas._config import get_option from pandas.io.formats import format as fmt from pandas.io.formats.printing import pprint_thing if TYPE_CHECKING: from...
0
public_repos/pandas/pandas/io
public_repos/pandas/pandas/io/formats/string.py
""" Module for formatting output data in console (to string). """ from __future__ import annotations from shutil import get_terminal_size from typing import TYPE_CHECKING import numpy as np from pandas.io.formats.printing import pprint_thing if TYPE_CHECKING: from collections.abc import Iterable from panda...
0
public_repos/pandas/pandas/io
public_repos/pandas/pandas/io/formats/_color_data.py
# GH37967: Enable the use of CSS named colors, as defined in # matplotlib.colors.CSS4_COLORS, when exporting to Excel. # This data has been copied here, instead of being imported from matplotlib, # not to have ``to_excel`` methods require matplotlib. # source: matplotlib._color_data (3.3.3) from __future__ import annot...
0
public_repos/pandas/pandas/io
public_repos/pandas/pandas/io/formats/style.py
""" Module for applying conditional formatting to DataFrames and Series. """ from __future__ import annotations from contextlib import contextmanager import copy from functools import partial import operator from typing import ( TYPE_CHECKING, Any, Callable, overload, ) import warnings import numpy as...
0
public_repos/pandas/pandas/io
public_repos/pandas/pandas/io/formats/style_render.py
from __future__ import annotations from collections import defaultdict from collections.abc import Sequence from functools import partial import re from typing import ( TYPE_CHECKING, Any, Callable, DefaultDict, Optional, TypedDict, Union, ) from uuid import uuid4 import numpy as np from ...
0
public_repos/pandas/pandas/io
public_repos/pandas/pandas/io/formats/printing.py
""" Printing tools. """ from __future__ import annotations from collections.abc import ( Iterable, Mapping, Sequence, ) import sys from typing import ( Any, Callable, TypeVar, Union, ) from unicodedata import east_asian_width from pandas._config import get_option from pandas.core.dtypes.i...
0
public_repos/pandas/pandas/io
public_repos/pandas/pandas/io/formats/excel.py
""" Utilities for conversion to writer-agnostic Excel representation. """ from __future__ import annotations from collections.abc import ( Hashable, Iterable, Mapping, Sequence, ) import functools import itertools import re from typing import ( TYPE_CHECKING, Any, Callable, cast, ) impo...
0
public_repos/pandas/pandas/io
public_repos/pandas/pandas/io/formats/csvs.py
""" Module for formatting output data into CSV files. """ from __future__ import annotations from collections.abc import ( Hashable, Iterable, Iterator, Sequence, ) import csv as csvlib import os from typing import ( TYPE_CHECKING, Any, cast, ) import numpy as np from pandas._libs import...
0
public_repos/pandas/pandas/io
public_repos/pandas/pandas/io/formats/css.py
""" Utilities for interpreting CSS from Stylers for formatting non-HTML outputs. """ from __future__ import annotations import re from typing import ( TYPE_CHECKING, Callable, ) import warnings from pandas.errors import CSSWarning from pandas.util._exceptions import find_stack_level if TYPE_CHECKING: fro...
0
public_repos/pandas/pandas/io
public_repos/pandas/pandas/io/formats/format.py
""" Internal module for formatting output data in csv, html, xml, and latex files. This module also applies to display formatting. """ from __future__ import annotations from collections.abc import ( Generator, Hashable, Mapping, Sequence, ) from contextlib import contextmanager from csv import QUOTE_N...
0
public_repos/pandas/pandas/io
public_repos/pandas/pandas/io/formats/__init__.py
# ruff: noqa: TCH004 from typing import TYPE_CHECKING if TYPE_CHECKING: # import modules that have public classes/functions from pandas.io.formats import style # and mark only those modules as public __all__ = ["style"]
0
public_repos/pandas/pandas/io/formats
public_repos/pandas/pandas/io/formats/templates/latex_table.tpl
{% if environment or parse_wrap(table_styles, caption) %} \begin{% raw %}{{% endraw %}{{environment if environment else "table"}}{% raw %}}{% endraw %} {%- set position = parse_table(table_styles, 'position') %} {%- if position is not none %} [{{position}}] {%- endif %} {% set position_float = parse_table(table_styles...
0
public_repos/pandas/pandas/io/formats
public_repos/pandas/pandas/io/formats/templates/string.tpl
{% for r in head %} {% for c in r %}{% if c["is_visible"] %} {{ c["display_value"] }}{% if not loop.last %}{{ delimiter }}{% endif %} {% endif %}{% endfor %} {% endfor %} {% for r in body %} {% for c in r %}{% if c["is_visible"] %} {{ c["display_value"] }}{% if not loop.last %}{{ delimiter }}{% endif %} {% endif %}{% ...
0
public_repos/pandas/pandas/io/formats
public_repos/pandas/pandas/io/formats/templates/latex.tpl
{% if environment == "longtable" %} {% include "latex_longtable.tpl" %} {% else %} {% include "latex_table.tpl" %} {% endif %}
0
public_repos/pandas/pandas/io/formats
public_repos/pandas/pandas/io/formats/templates/html_style.tpl
{%- block before_style -%}{%- endblock before_style -%} {% block style %} <style type="text/css"> {% block table_styles %} {% for s in table_styles %} #T_{{uuid}} {{s.selector}} { {% for p,val in s.props %} {{p}}: {{val}}; {% endfor %} } {% endfor %} {% endblock table_styles %} {% block before_cellstyle %}{% endblock...
0
public_repos/pandas/pandas/io/formats
public_repos/pandas/pandas/io/formats/templates/html.tpl
{# Update the html_style/table_structure.html documentation too #} {% if doctype_html %} <!DOCTYPE html> <html> <head> <meta charset="{{encoding}}"> {% if not exclude_styles %}{% include html_style_tpl %}{% endif %} </head> <body> {% include html_table_tpl %} </body> </html> {% elif not doctype_html %} {% if not exclud...
0
public_repos/pandas/pandas/io/formats
public_repos/pandas/pandas/io/formats/templates/html_table.tpl
{% block before_table %}{% endblock before_table %} {% block table %} {% if exclude_styles %} <table> {% else %} <table id="T_{{uuid}}"{% if table_attributes %} {{table_attributes}}{% endif %}> {% endif %} {% block caption %} {% if caption and caption is string %} <caption>{{caption}}</caption> {% elif caption and ca...
0
public_repos/pandas/pandas/io/formats
public_repos/pandas/pandas/io/formats/templates/latex_longtable.tpl
\begin{longtable} {%- set position = parse_table(table_styles, 'position') %} {%- if position is not none %} [{{position}}] {%- endif %} {%- set column_format = parse_table(table_styles, 'column_format') %} {% raw %}{{% endraw %}{{column_format}}{% raw %}}{% endraw %} {% for style in table_styles %} {% if style['selec...
0
public_repos/pandas/pandas/io
public_repos/pandas/pandas/io/excel/_base.py
from __future__ import annotations from collections.abc import ( Hashable, Iterable, Mapping, Sequence, ) import datetime from functools import partial from io import BytesIO import os from textwrap import fill from typing import ( IO, TYPE_CHECKING, Any, Callable, Generic, Lite...
0
public_repos/pandas/pandas/io
public_repos/pandas/pandas/io/excel/_xlrd.py
from __future__ import annotations from datetime import time import math from typing import TYPE_CHECKING import numpy as np from pandas.compat._optional import import_optional_dependency from pandas.util._decorators import doc from pandas.core.shared_docs import _shared_docs from pandas.io.excel._base import Base...
0
public_repos/pandas/pandas/io
public_repos/pandas/pandas/io/excel/_openpyxl.py
from __future__ import annotations import mmap from typing import ( TYPE_CHECKING, Any, cast, ) import numpy as np from pandas.compat._optional import import_optional_dependency from pandas.util._decorators import doc from pandas.core.shared_docs import _shared_docs from pandas.io.excel._base import ( ...
0
public_repos/pandas/pandas/io
public_repos/pandas/pandas/io/excel/_xlsxwriter.py
from __future__ import annotations import json from typing import ( TYPE_CHECKING, Any, ) from pandas.io.excel._base import ExcelWriter from pandas.io.excel._util import ( combine_kwargs, validate_freeze_panes, ) if TYPE_CHECKING: from pandas._typing import ( ExcelWriterIfSheetExists, ...
0
public_repos/pandas/pandas/io
public_repos/pandas/pandas/io/excel/_odswriter.py
from __future__ import annotations from collections import defaultdict import datetime import json from typing import ( TYPE_CHECKING, Any, DefaultDict, cast, overload, ) from pandas.io.excel._base import ExcelWriter from pandas.io.excel._util import ( combine_kwargs, validate_freeze_panes...
0
public_repos/pandas/pandas/io
public_repos/pandas/pandas/io/excel/_calamine.py
from __future__ import annotations from datetime import ( date, datetime, time, timedelta, ) from typing import ( TYPE_CHECKING, Any, Union, cast, ) from pandas._typing import Scalar from pandas.compat._optional import import_optional_dependency from pandas.util._decorators import doc ...
0
public_repos/pandas/pandas/io
public_repos/pandas/pandas/io/excel/_odfreader.py
from __future__ import annotations from typing import ( TYPE_CHECKING, cast, ) import numpy as np from pandas._typing import ( FilePath, ReadBuffer, Scalar, StorageOptions, ) from pandas.compat._optional import import_optional_dependency from pandas.util._decorators import doc import pandas ...
0
public_repos/pandas/pandas/io
public_repos/pandas/pandas/io/excel/_util.py
from __future__ import annotations from collections.abc import ( Hashable, Iterable, MutableMapping, Sequence, ) from typing import ( TYPE_CHECKING, Any, Callable, Literal, TypeVar, overload, ) from pandas.compat._optional import import_optional_dependency from pandas.core.dty...
0
public_repos/pandas/pandas/io
public_repos/pandas/pandas/io/excel/__init__.py
from pandas.io.excel._base import ( ExcelFile, ExcelWriter, read_excel, ) from pandas.io.excel._odswriter import ODSWriter as _ODSWriter from pandas.io.excel._openpyxl import OpenpyxlWriter as _OpenpyxlWriter from pandas.io.excel._util import register_writer from pandas.io.excel._xlsxwriter import XlsxWrite...
0
public_repos/pandas/pandas/io
public_repos/pandas/pandas/io/excel/_pyxlsb.py
# pyright: reportMissingImports=false from __future__ import annotations from typing import TYPE_CHECKING from pandas.compat._optional import import_optional_dependency from pandas.util._decorators import doc from pandas.core.shared_docs import _shared_docs from pandas.io.excel._base import BaseExcelReader if TYPE...
0
public_repos/pandas/pandas/io
public_repos/pandas/pandas/io/sas/sasreader.py
""" Read SAS sas7bdat or xport files. """ from __future__ import annotations from abc import ( ABC, abstractmethod, ) from typing import ( TYPE_CHECKING, overload, ) from pandas.util._decorators import doc from pandas.core.shared_docs import _shared_docs from pandas.io.common import stringify_path ...
0
public_repos/pandas/pandas/io
public_repos/pandas/pandas/io/sas/sas_constants.py
from __future__ import annotations from typing import Final magic: Final = ( b"\x00\x00\x00\x00\x00\x00\x00\x00" b"\x00\x00\x00\x00\xc2\xea\x81\x60" b"\xb3\x14\x11\xcf\xbd\x92\x08\x00" b"\x09\xc7\x31\x8c\x18\x1f\x10\x11" ) align_1_checker_value: Final = b"3" align_1_offset: Final = 32 align_1_length:...
0
public_repos/pandas/pandas/io
public_repos/pandas/pandas/io/sas/sas7bdat.py
""" Read SAS7BDAT files Based on code written by Jared Hobbs: https://bitbucket.org/jaredhobbs/sas7bdat See also: https://github.com/BioStatMatt/sas7bdat Partial documentation of the file format: https://cran.r-project.org/package=sas7bdat/vignettes/sas7bdat.pdf Reference for binary data compression: http:/...
0
public_repos/pandas/pandas/io
public_repos/pandas/pandas/io/sas/sas_xport.py
""" Read a SAS XPort format file into a Pandas DataFrame. Based on code from Jack Cushman (github.com/jcushman/xport). The file format is defined here: https://support.sas.com/content/dam/SAS/support/en/technical-papers/record-layout-of-a-sas-version-5-or-6-data-set-in-sas-transport-xport-format.pdf """ from __futur...
0
public_repos/pandas/pandas/io
public_repos/pandas/pandas/io/sas/__init__.py
from pandas.io.sas.sasreader import read_sas __all__ = ["read_sas"]
0
public_repos/pandas
public_repos/pandas/ci/code_checks.sh
#!/bin/bash # # Run checks related to code quality. # # This script is intended for both the CI and to check locally that code standards are # respected. We run doctests here (currently some files only), and we # validate formatting error in docstrings. # # Usage: # $ ./ci/code_checks.sh # run all check...
0
public_repos/pandas
public_repos/pandas/ci/run_tests.sh
#!/bin/bash -e # Workaround for pytest-xdist (it collects different tests in the workers if PYTHONHASHSEED is not set) # https://github.com/pytest-dev/pytest/issues/920 # https://github.com/pytest-dev/pytest/issues/1075 export PYTHONHASHSEED=$(python -c 'import random; print(random.randint(1, 4294967295))') # May hel...
0
public_repos/pandas
public_repos/pandas/ci/meta.yaml
{% set version = "2.0.1" %} package: name: pandas version: {{ version }} source: git_url: ../.. build: number: 1 script: - export PYTHONUNBUFFERED=1 # [ppc64le] - {{ PYTHON }} -m pip install -vv --no-deps --ignore-installed . # [not unix] - {{ PYTHON }} -m pip install -vv --no-deps --ignore-i...
0
public_repos/pandas
public_repos/pandas/ci/condarc.yml
# https://docs.conda.io/projects/conda/en/latest/configuration.html # always_yes (NoneType, bool) # aliases: yes # Automatically choose the 'yes' option whenever asked to proceed with a # conda operation, such as when running `conda install`. # always_yes: true # remote_connect_timeout_secs (float) # The numb...
0
public_repos/pandas
public_repos/pandas/ci/upload_wheels.sh
# Modified from numpy's https://github.com/numpy/numpy/blob/main/tools/wheels/upload_wheels.sh set_upload_vars() { echo "IS_PUSH is $IS_PUSH" echo "IS_SCHEDULE_DISPATCH is $IS_SCHEDULE_DISPATCH" if [[ "$IS_PUSH" == "true" ]]; then echo push and tag event export ANACONDA_ORG="multibuild-whee...
0
public_repos/pandas/ci
public_repos/pandas/ci/deps/circle-310-arm64.yaml
name: pandas-dev channels: - conda-forge dependencies: - python=3.10 # build dependencies - versioneer[toml] - cython>=0.29.33 - meson[ninja]=1.2.1 - meson-python=0.13.1 # test dependencies - pytest>=7.3.2 - pytest-cov - pytest-xdist>=2.2.0 - pytest-localserver>=0.7.1 - boto3 # required d...
0
public_repos/pandas/ci
public_repos/pandas/ci/deps/actions-311-numpydev.yaml
name: pandas-dev channels: - conda-forge dependencies: - python=3.11 # build dependencies - versioneer[toml] - meson[ninja]=1.2.1 - meson-python=0.13.1 - cython>=0.29.33 # test dependencies - pytest>=7.3.2 - pytest-cov # Once pytest-cov > 4 comes out, unpin this # Right now, a DeprecationWarni...
0