From 0aa15ddf9f6ec4c38b822306d3e05b45e22b6680 Mon Sep 17 00:00:00 2001 From: Graham Wheeler Date: Thu, 2 Jun 2022 18:30:05 -0700 Subject: [PATCH] Retire the pandas stubs (#208) * Update README.md * Retire the pandas stubs and the associated scripts. * Remove the pandas tests. * Update README.md --- .github/workflows/docify.yml | 42 - .github/workflows/test.yml | 52 - README.md | 2 + partial/pandas/__init__.pyi | 116 - partial/pandas/_libs/__init__.pyi | 4 - partial/pandas/_libs/interval.pyi | 153 -- partial/pandas/_libs/json.pyi | 4 - partial/pandas/_libs/missing.pyi | 48 - partial/pandas/_libs/properties.pyi | 13 - partial/pandas/_libs/tslibs/__init__.pyi | 24 - partial/pandas/_libs/tslibs/nattype.pyi | 123 - partial/pandas/_libs/tslibs/np_datetime.pyi | 1 - partial/pandas/_libs/tslibs/offsets.pyi | 241 -- partial/pandas/_libs/tslibs/period.pyi | 89 - partial/pandas/_libs/tslibs/timedeltas.pyi | 148 -- partial/pandas/_libs/tslibs/timestamps.pyi | 201 -- partial/pandas/_testing.pyi | 121 - partial/pandas/_typing.pyi | 141 -- partial/pandas/compat/pickle_compat.pyi | 8 - partial/pandas/core/__init__.pyi | 0 partial/pandas/core/accessor.pyi | 16 - partial/pandas/core/algorithms.pyi | 48 - partial/pandas/core/api.pyi | 52 - partial/pandas/core/arraylike.pyi | 38 - partial/pandas/core/arrays/__init__.pyi | 14 - partial/pandas/core/arrays/_arrow_utils.pyi | 0 partial/pandas/core/arrays/_ranges.pyi | 0 partial/pandas/core/arrays/base.pyi | 39 - partial/pandas/core/arrays/boolean.pyi | 30 - partial/pandas/core/arrays/categorical.pyi | 161 -- partial/pandas/core/arrays/datetimelike.pyi | 81 - partial/pandas/core/arrays/datetimes.pyi | 72 - partial/pandas/core/arrays/integer.pyi | 52 - partial/pandas/core/arrays/interval.pyi | 61 - partial/pandas/core/arrays/masked.pyi | 19 - partial/pandas/core/arrays/numpy_.pyi | 56 - partial/pandas/core/arrays/period.pyi | 43 - .../pandas/core/arrays/sparse/__init__.pyi | 3 - .../pandas/core/arrays/sparse/accessor.pyi | 22 - partial/pandas/core/arrays/sparse/array.pyi | 84 - partial/pandas/core/arrays/sparse/dtype.pyi | 31 - .../core/arrays/sparse/scipy_sparse.pyi | 2 - partial/pandas/core/arrays/string_.pyi | 20 - partial/pandas/core/arrays/timedeltas.pyi | 38 - partial/pandas/core/base.pyi | 77 - partial/pandas/core/computation/align.pyi | 2 - partial/pandas/core/computation/common.pyi | 3 - partial/pandas/core/computation/engines.pyi | 19 - .../pandas/core/computation/expressions.pyi | 6 - partial/pandas/core/computation/parsing.pyi | 12 - partial/pandas/core/config_init.pyi | 62 - partial/pandas/core/dtypes/__init__.pyi | 0 partial/pandas/core/dtypes/api.pyi | 42 - partial/pandas/core/dtypes/base.pyi | 23 - partial/pandas/core/dtypes/cast.pyi | 30 - partial/pandas/core/dtypes/common.pyi | 75 - partial/pandas/core/dtypes/concat.pyi | 5 - partial/pandas/core/dtypes/dtypes.pyi | 120 - partial/pandas/core/dtypes/generic.pyi | 76 - partial/pandas/core/dtypes/inference.pyi | 19 - partial/pandas/core/dtypes/missing.pyi | 33 - partial/pandas/core/frame.pyi | 2019 ----------------- partial/pandas/core/generic.pyi | 383 ---- partial/pandas/core/groupby/__init__.pyi | 2 - partial/pandas/core/groupby/categorical.pyi | 4 - partial/pandas/core/groupby/generic.pyi | 238 -- partial/pandas/core/groupby/groupby.pyi | 131 -- partial/pandas/core/groupby/ops.pyi | 82 - partial/pandas/core/indexes/__init__.pyi | 0 partial/pandas/core/indexes/accessors.pyi | 25 - partial/pandas/core/indexes/base.pyi | 190 -- partial/pandas/core/indexes/datetimelike.pyi | 34 - partial/pandas/core/indexes/datetimes.pyi | 66 - partial/pandas/core/indexes/extension.pyi | 16 - partial/pandas/core/indexes/frozen.pyi | 25 - partial/pandas/core/indexes/multi.pyi | 117 - partial/pandas/core/indexes/numeric.pyi | 36 - partial/pandas/core/indexes/timedeltas.pyi | 33 - partial/pandas/core/indexing.pyi | 50 - partial/pandas/core/internals/__init__.pyi | 17 - partial/pandas/core/internals/blocks.pyi | 182 -- partial/pandas/core/internals/concat.pyi | 15 - .../pandas/core/internals/construction.pyi | 12 - partial/pandas/core/internals/managers.pyi | 100 - partial/pandas/core/ops/__init__.pyi | 9 - partial/pandas/core/ops/array_ops.pyi | 13 - partial/pandas/core/ops/dispatch.pyi | 7 - partial/pandas/core/ops/docstrings.pyi | 1 - partial/pandas/core/ops/invalid.pyi | 2 - partial/pandas/core/ops/mask_ops.pyi | 23 - partial/pandas/core/ops/methods.pyi | 2 - partial/pandas/core/ops/missing.pyi | 3 - partial/pandas/core/ops/roperator.pyi | 12 - partial/pandas/core/resample.pyi | 58 - partial/pandas/core/reshape/__init__.pyi | 0 partial/pandas/core/reshape/api.pyi | 6 - partial/pandas/core/reshape/concat.pyi | 44 - partial/pandas/core/reshape/melt.pyi | 15 - partial/pandas/core/reshape/merge.pyi | 130 -- partial/pandas/core/reshape/pivot.pyi | 36 - partial/pandas/core/reshape/util.pyi | 1 - partial/pandas/core/series.pyi | 1592 ------------- partial/pandas/core/sorting.pyi | 24 - partial/pandas/core/strings.pyi | 94 - partial/pandas/core/tools/__init__.pyi | 3 - partial/pandas/core/tools/datetimes.pyi | 89 - partial/pandas/core/tools/numeric.pyi | 1 - partial/pandas/core/tools/timedeltas.pyi | 29 - partial/pandas/core/window/__init__.pyi | 3 - partial/pandas/core/window/ewm.pyi | 33 - partial/pandas/core/window/expanding.pyi | 19 - partial/pandas/core/window/numba_.pyi | 7 - partial/pandas/core/window/rolling.pyi | 88 - partial/pandas/io/__init__.pyi | 0 partial/pandas/io/api.pyi | 15 - partial/pandas/io/excel/_base.pyi | 173 -- partial/pandas/io/gcs.pyi | 5 - partial/pandas/io/json/__init__.pyi | 4 - partial/pandas/io/json/_json.pyi | 200 -- partial/pandas/io/json/_normalize.pyi | 17 - partial/pandas/io/json/_table_schema.pyi | 10 - partial/pandas/io/parsers.pyi | 597 ----- partial/pandas/io/s3.pyi | 12 - partial/pandas/io/sas/sas_constants.pyi | 108 - partial/pandas/io/stata.pyi | 159 -- partial/pandas/plotting/__init__.pyi | 2 - partial/pandas/plotting/_core.pyi | 36 - .../pandas/plotting/_matplotlib/__init__.pyi | 15 - .../pandas/plotting/_matplotlib/boxplot.pyi | 58 - .../pandas/plotting/_matplotlib/compat.pyi | 0 .../pandas/plotting/_matplotlib/converter.pyi | 101 - partial/pandas/plotting/_matplotlib/core.pyi | 117 - partial/pandas/plotting/_matplotlib/hist.pyi | 45 - partial/pandas/plotting/_matplotlib/misc.pyi | 32 - partial/pandas/plotting/_matplotlib/style.pyi | 0 .../plotting/_matplotlib/timeseries.pyi | 1 - partial/pandas/plotting/_matplotlib/tools.pyi | 2 - partial/pandas/plotting/_misc.pyi | 81 - partial/pandas/py.typed | 1 - partial/pandas/tseries/__init__.pyi | 0 partial/pandas/tseries/api.pyi | 1 - partial/pandas/tseries/frequencies.pyi | 9 - partial/pandas/tseries/offsets.pyi | 44 - tests/pandas/README.md | 3 - tests/pandas/__init__.py | 114 - tests/pandas/test_frame.py | 922 -------- tests/pandas/test_indexes.py | 41 - tests/pandas/test_interval.py | 85 - tests/pandas/test_merge.py | 8 - tests/pandas/test_pandas.py | 104 - tests/pandas/test_series.py | 661 ------ tests/pandas/test_testing.py | 13 - tests/pandas/test_timefuncs.py | 150 -- tests/requirements.txt | 1 - utils/build_bundle/build.sh | 16 +- utils/build_bundle/docify-pandas.cfg | 51 - utils/docify/README.md | 31 - utils/docify/docify/__init__.py | 2 - utils/docify/docify/cli.py | 95 - utils/docify/docify/docify.py | 88 - utils/docify/setup.cfg | 6 - utils/docify/setup.py | 15 - utils/requirements.txt | 2 - utils/stubsplit/ChangeLog | 170 -- utils/stubsplit/README.md | 22 - utils/stubsplit/setup.cfg | 6 - utils/stubsplit/setup.py | 15 - utils/stubsplit/stubsplit/__init__.py | 2 - utils/stubsplit/stubsplit/cli.py | 42 - utils/stubsplit/stubsplit/stubsplit.py | 238 -- utils/stubsplit/test/__init__.py | 0 utils/stubsplit/test/test_merge.py | 51 - utils/stubsplit/test/test_split.py | 130 -- 173 files changed, 3 insertions(+), 14164 deletions(-) delete mode 100644 .github/workflows/docify.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 partial/pandas/__init__.pyi delete mode 100644 partial/pandas/_libs/__init__.pyi delete mode 100644 partial/pandas/_libs/interval.pyi delete mode 100644 partial/pandas/_libs/json.pyi delete mode 100644 partial/pandas/_libs/missing.pyi delete mode 100644 partial/pandas/_libs/properties.pyi delete mode 100644 partial/pandas/_libs/tslibs/__init__.pyi delete mode 100644 partial/pandas/_libs/tslibs/nattype.pyi delete mode 100644 partial/pandas/_libs/tslibs/np_datetime.pyi delete mode 100644 partial/pandas/_libs/tslibs/offsets.pyi delete mode 100644 partial/pandas/_libs/tslibs/period.pyi delete mode 100644 partial/pandas/_libs/tslibs/timedeltas.pyi delete mode 100644 partial/pandas/_libs/tslibs/timestamps.pyi delete mode 100644 partial/pandas/_testing.pyi delete mode 100644 partial/pandas/_typing.pyi delete mode 100644 partial/pandas/compat/pickle_compat.pyi delete mode 100644 partial/pandas/core/__init__.pyi delete mode 100644 partial/pandas/core/accessor.pyi delete mode 100644 partial/pandas/core/algorithms.pyi delete mode 100644 partial/pandas/core/api.pyi delete mode 100644 partial/pandas/core/arraylike.pyi delete mode 100644 partial/pandas/core/arrays/__init__.pyi delete mode 100644 partial/pandas/core/arrays/_arrow_utils.pyi delete mode 100644 partial/pandas/core/arrays/_ranges.pyi delete mode 100644 partial/pandas/core/arrays/base.pyi delete mode 100644 partial/pandas/core/arrays/boolean.pyi delete mode 100644 partial/pandas/core/arrays/categorical.pyi delete mode 100644 partial/pandas/core/arrays/datetimelike.pyi delete mode 100644 partial/pandas/core/arrays/datetimes.pyi delete mode 100644 partial/pandas/core/arrays/integer.pyi delete mode 100644 partial/pandas/core/arrays/interval.pyi delete mode 100644 partial/pandas/core/arrays/masked.pyi delete mode 100644 partial/pandas/core/arrays/numpy_.pyi delete mode 100644 partial/pandas/core/arrays/period.pyi delete mode 100644 partial/pandas/core/arrays/sparse/__init__.pyi delete mode 100644 partial/pandas/core/arrays/sparse/accessor.pyi delete mode 100644 partial/pandas/core/arrays/sparse/array.pyi delete mode 100644 partial/pandas/core/arrays/sparse/dtype.pyi delete mode 100644 partial/pandas/core/arrays/sparse/scipy_sparse.pyi delete mode 100644 partial/pandas/core/arrays/string_.pyi delete mode 100644 partial/pandas/core/arrays/timedeltas.pyi delete mode 100644 partial/pandas/core/base.pyi delete mode 100644 partial/pandas/core/computation/align.pyi delete mode 100644 partial/pandas/core/computation/common.pyi delete mode 100644 partial/pandas/core/computation/engines.pyi delete mode 100644 partial/pandas/core/computation/expressions.pyi delete mode 100644 partial/pandas/core/computation/parsing.pyi delete mode 100644 partial/pandas/core/config_init.pyi delete mode 100644 partial/pandas/core/dtypes/__init__.pyi delete mode 100644 partial/pandas/core/dtypes/api.pyi delete mode 100644 partial/pandas/core/dtypes/base.pyi delete mode 100644 partial/pandas/core/dtypes/cast.pyi delete mode 100644 partial/pandas/core/dtypes/common.pyi delete mode 100644 partial/pandas/core/dtypes/concat.pyi delete mode 100644 partial/pandas/core/dtypes/dtypes.pyi delete mode 100644 partial/pandas/core/dtypes/generic.pyi delete mode 100644 partial/pandas/core/dtypes/inference.pyi delete mode 100644 partial/pandas/core/dtypes/missing.pyi delete mode 100644 partial/pandas/core/frame.pyi delete mode 100644 partial/pandas/core/generic.pyi delete mode 100644 partial/pandas/core/groupby/__init__.pyi delete mode 100644 partial/pandas/core/groupby/categorical.pyi delete mode 100644 partial/pandas/core/groupby/generic.pyi delete mode 100644 partial/pandas/core/groupby/groupby.pyi delete mode 100644 partial/pandas/core/groupby/ops.pyi delete mode 100644 partial/pandas/core/indexes/__init__.pyi delete mode 100644 partial/pandas/core/indexes/accessors.pyi delete mode 100644 partial/pandas/core/indexes/base.pyi delete mode 100644 partial/pandas/core/indexes/datetimelike.pyi delete mode 100644 partial/pandas/core/indexes/datetimes.pyi delete mode 100644 partial/pandas/core/indexes/extension.pyi delete mode 100644 partial/pandas/core/indexes/frozen.pyi delete mode 100644 partial/pandas/core/indexes/multi.pyi delete mode 100644 partial/pandas/core/indexes/numeric.pyi delete mode 100644 partial/pandas/core/indexes/timedeltas.pyi delete mode 100644 partial/pandas/core/indexing.pyi delete mode 100644 partial/pandas/core/internals/__init__.pyi delete mode 100644 partial/pandas/core/internals/blocks.pyi delete mode 100644 partial/pandas/core/internals/concat.pyi delete mode 100644 partial/pandas/core/internals/construction.pyi delete mode 100644 partial/pandas/core/internals/managers.pyi delete mode 100644 partial/pandas/core/ops/__init__.pyi delete mode 100644 partial/pandas/core/ops/array_ops.pyi delete mode 100644 partial/pandas/core/ops/dispatch.pyi delete mode 100644 partial/pandas/core/ops/docstrings.pyi delete mode 100644 partial/pandas/core/ops/invalid.pyi delete mode 100644 partial/pandas/core/ops/mask_ops.pyi delete mode 100644 partial/pandas/core/ops/methods.pyi delete mode 100644 partial/pandas/core/ops/missing.pyi delete mode 100644 partial/pandas/core/ops/roperator.pyi delete mode 100644 partial/pandas/core/resample.pyi delete mode 100644 partial/pandas/core/reshape/__init__.pyi delete mode 100644 partial/pandas/core/reshape/api.pyi delete mode 100644 partial/pandas/core/reshape/concat.pyi delete mode 100644 partial/pandas/core/reshape/melt.pyi delete mode 100644 partial/pandas/core/reshape/merge.pyi delete mode 100644 partial/pandas/core/reshape/pivot.pyi delete mode 100644 partial/pandas/core/reshape/util.pyi delete mode 100644 partial/pandas/core/series.pyi delete mode 100644 partial/pandas/core/sorting.pyi delete mode 100644 partial/pandas/core/strings.pyi delete mode 100644 partial/pandas/core/tools/__init__.pyi delete mode 100644 partial/pandas/core/tools/datetimes.pyi delete mode 100644 partial/pandas/core/tools/numeric.pyi delete mode 100644 partial/pandas/core/tools/timedeltas.pyi delete mode 100644 partial/pandas/core/window/__init__.pyi delete mode 100644 partial/pandas/core/window/ewm.pyi delete mode 100644 partial/pandas/core/window/expanding.pyi delete mode 100644 partial/pandas/core/window/numba_.pyi delete mode 100644 partial/pandas/core/window/rolling.pyi delete mode 100644 partial/pandas/io/__init__.pyi delete mode 100644 partial/pandas/io/api.pyi delete mode 100644 partial/pandas/io/excel/_base.pyi delete mode 100644 partial/pandas/io/gcs.pyi delete mode 100644 partial/pandas/io/json/__init__.pyi delete mode 100644 partial/pandas/io/json/_json.pyi delete mode 100644 partial/pandas/io/json/_normalize.pyi delete mode 100644 partial/pandas/io/json/_table_schema.pyi delete mode 100644 partial/pandas/io/parsers.pyi delete mode 100644 partial/pandas/io/s3.pyi delete mode 100644 partial/pandas/io/sas/sas_constants.pyi delete mode 100644 partial/pandas/io/stata.pyi delete mode 100644 partial/pandas/plotting/__init__.pyi delete mode 100644 partial/pandas/plotting/_core.pyi delete mode 100644 partial/pandas/plotting/_matplotlib/__init__.pyi delete mode 100644 partial/pandas/plotting/_matplotlib/boxplot.pyi delete mode 100644 partial/pandas/plotting/_matplotlib/compat.pyi delete mode 100644 partial/pandas/plotting/_matplotlib/converter.pyi delete mode 100644 partial/pandas/plotting/_matplotlib/core.pyi delete mode 100644 partial/pandas/plotting/_matplotlib/hist.pyi delete mode 100644 partial/pandas/plotting/_matplotlib/misc.pyi delete mode 100644 partial/pandas/plotting/_matplotlib/style.pyi delete mode 100644 partial/pandas/plotting/_matplotlib/timeseries.pyi delete mode 100644 partial/pandas/plotting/_matplotlib/tools.pyi delete mode 100644 partial/pandas/plotting/_misc.pyi delete mode 100644 partial/pandas/py.typed delete mode 100644 partial/pandas/tseries/__init__.pyi delete mode 100644 partial/pandas/tseries/api.pyi delete mode 100644 partial/pandas/tseries/frequencies.pyi delete mode 100644 partial/pandas/tseries/offsets.pyi delete mode 100644 tests/pandas/README.md delete mode 100644 tests/pandas/__init__.py delete mode 100644 tests/pandas/test_frame.py delete mode 100644 tests/pandas/test_indexes.py delete mode 100644 tests/pandas/test_interval.py delete mode 100644 tests/pandas/test_merge.py delete mode 100644 tests/pandas/test_pandas.py delete mode 100644 tests/pandas/test_series.py delete mode 100644 tests/pandas/test_testing.py delete mode 100644 tests/pandas/test_timefuncs.py delete mode 100644 utils/build_bundle/docify-pandas.cfg delete mode 100644 utils/docify/README.md delete mode 100644 utils/docify/docify/__init__.py delete mode 100644 utils/docify/docify/cli.py delete mode 100644 utils/docify/docify/docify.py delete mode 100644 utils/docify/setup.cfg delete mode 100644 utils/docify/setup.py delete mode 100644 utils/requirements.txt delete mode 100644 utils/stubsplit/ChangeLog delete mode 100644 utils/stubsplit/README.md delete mode 100644 utils/stubsplit/setup.cfg delete mode 100644 utils/stubsplit/setup.py delete mode 100644 utils/stubsplit/stubsplit/__init__.py delete mode 100644 utils/stubsplit/stubsplit/cli.py delete mode 100644 utils/stubsplit/stubsplit/stubsplit.py delete mode 100644 utils/stubsplit/test/__init__.py delete mode 100644 utils/stubsplit/test/test_merge.py delete mode 100644 utils/stubsplit/test/test_split.py diff --git a/.github/workflows/docify.yml b/.github/workflows/docify.yml deleted file mode 100644 index b690553..0000000 --- a/.github/workflows/docify.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: 'Docify' - -on: [push, pull_request] - -jobs: - test: - runs-on: ubuntu-18.04 - timeout-minutes: 10 - - steps: - - name: Check out code - uses: actions/checkout@v2 - - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: "3.9" - - - name: Cache pip - uses: actions/cache@v2 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Install dependencies - run: - python -m pip install -r utils/requirements.txt - - - name: Install partial pandas stubs - run: - cp -R partial/ typings - - - name: Install docify - run: - PBR_VERSION=1.0.0 pip install utils/docify - - - name: Run docify - run: - docify utils/build_bundle/docify-pandas.cfg typings/pandas - diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 050cc81..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: 'Test' - -on: [push, pull_request, workflow_dispatch] - -jobs: - test: - runs-on: ubuntu-18.04 - timeout-minutes: 10 - - steps: - - name: Check out code - uses: actions/checkout@v2 - - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: "3.9" - - - name: Cache pip - uses: actions/cache@v2 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Install dependencies - run: - python -m pip install -r tests/requirements.txt - - - name: Install partial pandas stubs - run: - cp -R partial/ typings - - - name: Run pyright tests - uses: gramster/pyright-action@main - with: - project: pyrighttestconfig.json - warn-partial: true - - - name: Run pytest - run: - pytest tests/pandas - - - name: rename matplotlib for mypy test - run: - mv matplotlib savmpl - - - name: Run mypy - run: - mypy tests/pandas - diff --git a/README.md b/README.md index 92a0ae9..c133870 100644 --- a/README.md +++ b/README.md @@ -40,10 +40,12 @@ and are no longer maintained here: - freezegun - markdown - packaging +- pandas (see https://github.com/pandas-dev/pandas-stubs; please open pandas stub issues there) - PIL - retry - slugify + # Trademarks This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies. diff --git a/partial/pandas/__init__.pyi b/partial/pandas/__init__.pyi deleted file mode 100644 index abf9239..0000000 --- a/partial/pandas/__init__.pyi +++ /dev/null @@ -1,116 +0,0 @@ -from ._config import ( - describe_option as describe_option, - get_option as get_option, - option_context as option_context, - options as options, - reset_option as reset_option, - set_option as set_option) -from .core.api import ( - BooleanDtype as BooleanDtype, - Categorical as Categorical, - CategoricalDtype as CategoricalDtype, - CategoricalIndex as CategoricalIndex, - DataFrame as DataFrame, - DateOffset as DateOffset, - DatetimeIndex as DatetimeIndex, - DatetimeTZDtype as DatetimeTZDtype, - Float64Index as Float64Index, - Grouper as Grouper, - Index as Index, - IndexSlice as IndexSlice, - Int16Dtype as Int16Dtype, - Int32Dtype as Int32Dtype, - Int64Dtype as Int64Dtype, - Int64Index as Int64Index, - Int8Dtype as Int8Dtype, - Interval as Interval, - IntervalDtype as IntervalDtype, - IntervalIndex as IntervalIndex, - MultiIndex as MultiIndex, - NA as NA, - NaT as NaT, - NamedAgg as NamedAgg, - Period as Period, - PeriodDtype as PeriodDtype, - PeriodIndex as PeriodIndex, - RangeIndex as RangeIndex, - Series as Series, - StringDtype as StringDtype, - Timedelta as Timedelta, - TimedeltaIndex as TimedeltaIndex, - Timestamp as Timestamp, - UInt16Dtype as UInt16Dtype, - UInt32Dtype as UInt32Dtype, - UInt64Dtype as UInt64Dtype, - UInt64Index as UInt64Index, - UInt8Dtype as UInt8Dtype, - array as array, - bdate_range as bdate_range, - date_range as date_range, - factorize as factorize, - interval_range as interval_range, - isna as isna, - isnull as isnull, - notna as notna, - notnull as notnull, - period_range as period_range, - set_eng_float_format as set_eng_float_format, - timedelta_range as timedelta_range, - to_numeric as to_numeric, - unique as unique, - value_counts as value_counts) -from .core.tools import ( - to_datetime as to_datetime, - to_timedelta as to_timedelta -) -from .core.arrays.sparse import SparseDtype as SparseDtype -from .tseries import offsets as offsets -from .tseries.api import infer_freq as infer_freq -from .core.computation.api import eval as eval -from .core.reshape.api import ( - concat as concat, - crosstab as crosstab, - cut as cut, - get_dummies as get_dummies, - lreshape as lreshape, - melt as melt, - merge as merge, - merge_asof as merge_asof, - merge_ordered as merge_ordered, - pivot as pivot, - pivot_table as pivot_table, - qcut as qcut, - wide_to_long as wide_to_long) -from .util._print_versions import show_versions as show_versions -from .io.json import json_normalize as json_normalize -from .io.api import ( - ExcelFile as ExcelFile, - ExcelWriter as ExcelWriter, - HDFStore as HDFStore, - read_clipboard as read_clipboard, - read_csv as read_csv, - read_excel as read_excel, - read_feather as read_feather, - read_fwf as read_fwf, - read_gbq as read_gbq, - read_hdf as read_hdf, - read_html as read_html, - read_json as read_json, - read_orc as read_orc, - read_parquet as read_parquet, - read_pickle as read_pickle, - read_sas as read_sas, - read_spss as read_spss, - read_sql as read_sql, - read_sql_query as read_sql_query, - read_sql_table as read_sql_table, - read_stata as read_stata, - read_table as read_table, - to_pickle as to_pickle) - - -from .util._tester import test as test - -import pandas.testing as testing - -__version__ : str diff --git a/partial/pandas/_libs/__init__.pyi b/partial/pandas/_libs/__init__.pyi deleted file mode 100644 index cdea846..0000000 --- a/partial/pandas/_libs/__init__.pyi +++ /dev/null @@ -1,4 +0,0 @@ -from .tslibs import NaT as NaT, NaTType as NaTType, OutOfBoundsDatetime as OutOfBoundsDatetime, Period as Period, Timedelta as Timedelta, Timestamp as Timestamp, iNaT as iNaT -from .interval import Interval as Interval - - diff --git a/partial/pandas/_libs/interval.pyi b/partial/pandas/_libs/interval.pyi deleted file mode 100644 index 87738c8..0000000 --- a/partial/pandas/_libs/interval.pyi +++ /dev/null @@ -1,153 +0,0 @@ -from __future__ import annotations - -from typing import ( - Any, - Generic, - TypeVar, - Union, - overload, -) - -import numpy as np - -from pandas._typing import npt - -from pandas._typing import ( - IntervalClosedType, - Timedelta, - Timestamp, -) - -VALID_CLOSED: frozenset[str] - -_OrderableScalarT = TypeVar("_OrderableScalarT", int, float) -_OrderableTimesT = TypeVar("_OrderableTimesT", Timestamp, Timedelta) -_OrderableT = TypeVar("_OrderableT", int, float, Timestamp, Timedelta) - -class _LengthDescriptor: - @overload - def __get__(self, instance: Interval[_OrderableScalarT], owner: Any) -> _OrderableScalarT: ... - @overload - def __get__(self, instance: Interval[_OrderableTimesT], owner: Any) -> Timedelta: ... - @overload - def __get__(self, instance: IntervalTree, owner: Any) -> np.ndarray: ... - -class _MidDescriptor: - @overload - def __get__(self, instance: Interval[_OrderableScalarT], owner: Any) -> float: ... - @overload - def __get__(self, instance: Interval[_OrderableTimesT], owner: Any) -> _OrderableTimesT: ... - @overload - def __get__(self, instance: IntervalTree, owner: Any) -> np.ndarray: ... - -class IntervalMixin: - @property - def closed_left(self) -> bool: ... - @property - def closed_right(self) -> bool: ... - @property - def open_left(self) -> bool: ... - @property - def open_right(self) -> bool: ... - @property - def is_empty(self) -> bool: ... - def _check_closed_matches(self, other: IntervalMixin, name: str = ...) -> None: ... - -class Interval(IntervalMixin, Generic[_OrderableT]): - @property - def left(self: Interval[_OrderableT]) -> _OrderableT: ... - @property - def right(self: Interval[_OrderableT]) -> _OrderableT: ... - @property - def closed(self) -> IntervalClosedType: ... - mid: _MidDescriptor - length: _LengthDescriptor - def __init__( - self, - left: _OrderableT, - right: _OrderableT, - closed: IntervalClosedType = ..., - ): ... - def __hash__(self) -> int: ... - @overload - def __contains__(self: Interval[_OrderableTimesT], _OrderableTimesT) -> bool: ... - @overload - def __contains__(self: Interval[_OrderableScalarT], key: Union[int, float]) -> bool: ... - def __repr__(self) -> str: ... - def __str__(self) -> str: ... - @overload - def __add__(self: Interval[_OrderableTimesT], y: Timedelta) -> Interval[_OrderableTimesT]: ... - @overload - def __add__(self: Interval[int], y: int) -> Interval[int]: ... - @overload - def __add__(self: Interval[int], y: float) -> Interval[float]: ... - @overload - def __add__(self: Interval[float], y: Union[int, float]) -> Interval[float]: ... - @overload - def __radd__(self: Interval[_OrderableTimesT], y: Timedelta) -> Interval[_OrderableTimesT]: ... - @overload - def __radd__(self: Interval[int], y: int) -> Interval[int]: ... - @overload - def __radd__(self: Interval[int], y: float) -> Interval[float]: ... - @overload - def __radd__(self: Interval[float], y: Union[int, float]) -> Interval[float]: ... - @overload - def __sub__(self: Interval[_OrderableTimesT], y: Timedelta) -> Interval[_OrderableTimesT]: ... - @overload - def __sub__(self: Interval[int], y: int) -> Interval[int]: ... - @overload - def __sub__(self: Interval[int], y: float) -> Interval[float]: ... - @overload - def __sub__(self: Interval[float], y: Union[int, float]) -> Interval[float]: ... - @overload - def __rsub__(self: Interval[_OrderableTimesT], y: Timedelta) -> Interval[_OrderableTimesT]: ... - @overload - def __rsub__(self: Interval[int], y: int) -> Interval[int]: ... - @overload - def __rsub__(self: Interval[int], y: float) -> Interval[float]: ... - @overload - def __rsub__(self: Interval[float], y: Union[int, float]) -> Interval[float]: ... - @overload - def __mul__(self: Interval[int], y: int) -> Interval[int]: ... - @overload - def __mul__(self: Interval[int], y: float) -> Interval[float]: ... - @overload - def __mul__(self: Interval[float], y: Union[int, float]) -> Interval[float]: ... - @overload - def __rmul__(self: Interval[int], y: int) -> Interval[int]: ... - @overload - def __rmul__(self: Interval[int], y: float) -> Interval[float]: ... - @overload - def __rmul__(self: Interval[float], y: Union[int, float]) -> Interval[float]: ... - @overload - def __truediv__(self: Interval[int], y: int) -> Interval[int]: ... - @overload - def __truediv__(self: Interval[int], y: float) -> Interval[float]: ... - @overload - def __truediv__(self: Interval[float], y: Union[int, float]) -> Interval[float]: ... - @overload - def __floordiv__(self: Interval[int], y: int) -> Interval[int]: ... - @overload - def __floordiv__(self: Interval[int], y: float) -> Interval[float]: ... - @overload - def __floordiv__(self: Interval[float], y: Union[int, float]) -> Interval[float]: ... - def overlaps(self: Interval[_OrderableT], other: Interval[_OrderableT]) -> bool: ... - -def intervals_to_interval_bounds(intervals: np.ndarray, validate_closed: bool = ...) -> tuple[np.ndarray, np.ndarray, str]: ... - -class IntervalTree(IntervalMixin): - def __init__( - self, - left: np.ndarray, - right: np.ndarray, - closed: IntervalClosedType = ..., - leaf_size: int = ..., - ): ... - def get_indexer(self, target) -> npt.NDArray[np.intp]: ... - def get_indexer_non_unique(self, target) -> tuple[npt.NDArray[np.intp], npt.NDArray[np.intp]]: ... - _na_count: int - @property - def is_overlapping(self) -> bool: ... - @property - def is_monotonic_increasing(self) -> bool: ... - def clear_mapping(self) -> None: ... diff --git a/partial/pandas/_libs/json.pyi b/partial/pandas/_libs/json.pyi deleted file mode 100644 index 59086a4..0000000 --- a/partial/pandas/_libs/json.pyi +++ /dev/null @@ -1,4 +0,0 @@ -def decode(*args, **kwargs): ... -def dumps(*args, **kwargs): ... -def encode(*args, **kwargs): ... -def loads(*args, **kwargs): ... diff --git a/partial/pandas/_libs/missing.pyi b/partial/pandas/_libs/missing.pyi deleted file mode 100644 index 2f5cae4..0000000 --- a/partial/pandas/_libs/missing.pyi +++ /dev/null @@ -1,48 +0,0 @@ -from __future__ import annotations -from typing import Union - -class NAType: - def __new__(cls, *args, **kwargs) -> NAType: ... - def __repr__(self) -> str: ... - def __format__(self, format_spec: str) -> str: ... - def __bool__(self) -> None: ... - def __hash__(self) -> int: ... - def __reduce__(self) -> str: ... - def __add__(self, other) -> NAType: ... - def __radd__(self, other) -> NAType: ... - def __sub__(self, other) -> NAType: ... - def __rsub__(self, other) -> NAType: ... - def __mul__(self, other) -> NAType: ... - def __rmul__(self, other) -> NAType: ... - def __matmul__(self, other) -> NAType: ... - def __rmatmul__(self, other) -> NAType: ... - def __truediv__(self, other) -> NAType: ... - def __rtruediv__(self, other) -> NAType: ... - def __floordiv__(self, other) -> NAType: ... - def __rfloordiv__(self, other) -> NAType: ... - def __mod__(self, other) -> NAType: ... - def __rmod__(self, other) -> NAType: ... - def __divmod__(self, other) -> NAType: ... - def __rdivmod__(self, other) -> NAType: ... - def __eq__(self, other) -> bool: ... - def __ne__(self, other) -> bool: ... - def __le__(self, other) -> bool: ... - def __lt__(self, other) -> bool: ... - def __gt__(self, other) -> bool: ... - def __ge__(self, other) -> bool: ... - def __neg__(self, other) -> NAType: ... - def __pos__(self, other) -> NAType: ... - def __abs__(self, other) -> NAType: ... - def __invert__(self, other) -> NAType: ... - def __pow__(self, other) -> NAType: ... - def __rpow__(self, other) -> NAType: ... - def __and__(self, other) -> Union[None, NAType]: ... - __rand__ = __and__ - def __or__(self, other) -> Union[bool, NAType]: ... - __ror__ = __or__ - def __xor__(self, other) -> NAType: ... - __rxor__ = __xor__ - __array_priority__: int - def __array_ufunc__(self, ufunc, method, *inputs, **kwargs): ... - -NA: NAType = ... diff --git a/partial/pandas/_libs/properties.pyi b/partial/pandas/_libs/properties.pyi deleted file mode 100644 index 78eabdc..0000000 --- a/partial/pandas/_libs/properties.pyi +++ /dev/null @@ -1,13 +0,0 @@ -from typing import Callable - -class CachedProperty: - def __init__(self, func: Callable) -> None: ... - def __get__(self, obj, typ): ... - def __set__(self, obj, value) -> None: ... - -cache_readonly: CachedProperty = ... - -class AxisProperty: - def __init__(self, axis: int = ..., doc: str = ...) -> None: ... - def __get__(self, obj, typ): ... - def __set__(self, obj, value) -> None: ... diff --git a/partial/pandas/_libs/tslibs/__init__.pyi b/partial/pandas/_libs/tslibs/__init__.pyi deleted file mode 100644 index 06694f5..0000000 --- a/partial/pandas/_libs/tslibs/__init__.pyi +++ /dev/null @@ -1,24 +0,0 @@ -__all__ = [ - "Period", - "Timestamp", - "Timedelta", - "NaT", - "NaTType", - "iNaT", - "nat_strings", - "BaseOffset", - "Tick", - "OutofBoundsDatetime", -] - -from .period import Period -from .timestamps import Timestamp -from .timedeltas import Timedelta -from .nattype import ( - NaT, - NaTType, - iNaT, - nat_strings, -) -from .offsets import BaseOffset, Tick -from np_datetime import OutOfBoundsDatetime as OutOfBoundsDatetime diff --git a/partial/pandas/_libs/tslibs/nattype.pyi b/partial/pandas/_libs/tslibs/nattype.pyi deleted file mode 100644 index 18b9bc2..0000000 --- a/partial/pandas/_libs/tslibs/nattype.pyi +++ /dev/null @@ -1,123 +0,0 @@ -from datetime import ( - datetime, - timedelta, - tzinfo as _tzinfo, -) -from typing import ( - Any, - Union, -) - -import numpy as np - -from pandas._libs.tslibs.period import Period - -NaT: NaTType -iNaT: int -nat_strings: set[str] - -def is_null_datetimelike(val: object, inat_is_null: bool = ...) -> bool: ... - -_NaTComparisonTypes = Union[datetime, timedelta, Period, np.datetime64, np.timedelta64] - -class _NatComparison: - def __call__(self, other: _NaTComparisonTypes) -> bool: ... - -class NaTType: - value: np.int64 - def asm8(self) -> np.datetime64: ... - def to_datetime64(self) -> np.datetime64: ... - def to_numpy(self, dtype: np.dtype | str | None = ..., copy: bool = ...) -> np.datetime64 | np.timedelta64: ... - @property - def is_leap_year(self) -> bool: ... - @property - def is_month_start(self) -> bool: ... - @property - def is_quarter_start(self) -> bool: ... - @property - def is_year_start(self) -> bool: ... - @property - def is_month_end(self) -> bool: ... - @property - def is_quarter_end(self) -> bool: ... - @property - def is_year_end(self) -> bool: ... - @property - def day_of_year(self) -> float: ... - @property - def dayofyear(self) -> float: ... - @property - def days_in_month(self) -> float: ... - @property - def daysinmonth(self) -> float: ... - @property - def day_of_week(self) -> float: ... - @property - def dayofweek(self) -> float: ... - @property - def week(self) -> float: ... - @property - def weekofyear(self) -> float: ... - def day_name(self) -> float: ... - def month_name(self) -> float: ... - def weekday(self) -> float: ... - def isoweekday(self) -> float: ... - def total_seconds(self) -> float: ... - def today(self, *args, **kwargs) -> NaTType: ... - def now(self, *args, **kwargs) -> NaTType: ... - def to_pydatetime(self) -> NaTType: ... - def date(self) -> NaTType: ... - def round(self) -> NaTType: ... - def floor(self) -> NaTType: ... - def ceil(self) -> NaTType: ... - def tz_convert(self) -> NaTType: ... - def tz_localize(self) -> NaTType: ... - def replace( - self, - year: int | None = ..., - month: int | None = ..., - day: int | None = ..., - hour: int | None = ..., - minute: int | None = ..., - second: int | None = ..., - microsecond: int | None = ..., - nanosecond: int | None = ..., - tzinfo: _tzinfo | None = ..., - fold: int | None = ..., - ) -> NaTType: ... - @property - def year(self) -> float: ... - @property - def quarter(self) -> float: ... - @property - def month(self) -> float: ... - @property - def day(self) -> float: ... - @property - def hour(self) -> float: ... - @property - def minute(self) -> float: ... - @property - def second(self) -> float: ... - @property - def millisecond(self) -> float: ... - @property - def microsecond(self) -> float: ... - @property - def nanosecond(self) -> float: ... - # inject Timedelta properties - @property - def days(self) -> float: ... - @property - def microseconds(self) -> float: ... - @property - def nanoseconds(self) -> float: ... - # inject Period properties - @property - def qyear(self) -> float: ... - def __eq__(self, other: Any) -> bool: ... - def __ne__(self, other: Any) -> bool: ... - __lt__: _NatComparison - __le__: _NatComparison - __gt__: _NatComparison - __ge__: _NatComparison diff --git a/partial/pandas/_libs/tslibs/np_datetime.pyi b/partial/pandas/_libs/tslibs/np_datetime.pyi deleted file mode 100644 index db0c277..0000000 --- a/partial/pandas/_libs/tslibs/np_datetime.pyi +++ /dev/null @@ -1 +0,0 @@ -class OutOfBoundsDatetime(ValueError): ... diff --git a/partial/pandas/_libs/tslibs/offsets.pyi b/partial/pandas/_libs/tslibs/offsets.pyi deleted file mode 100644 index dec81af..0000000 --- a/partial/pandas/_libs/tslibs/offsets.pyi +++ /dev/null @@ -1,241 +0,0 @@ -from __future__ import annotations - -from datetime import ( - datetime, - timedelta, -) -from typing import ( - TYPE_CHECKING, - Any, - Collection, - Literal, - Tuple, - TypeVar, - Union, - overload, -) - -import numpy as np -from pandas._typing import npt - -from .timedeltas import Timedelta - -if TYPE_CHECKING: - from pandas.core.indexes.datetimes import DatetimeIndex -_BaseOffsetT = TypeVar("_BaseOffsetT", bound="BaseOffset") -_DatetimeT = TypeVar("_DatetimeT", bound=datetime) -_TimedeltaT = TypeVar("_TimedeltaT", bound=timedelta) - -_relativedelta_kwds: set[str] -prefix_mapping: dict[str, type] - -class ApplyTypeError(TypeError): ... - -class BaseOffset: - n: int - def __init__(self, n: int = ..., normalize: bool = ...) -> None: ... - def __eq__(self, other) -> bool: ... - def __ne__(self, other) -> bool: ... - def __hash__(self) -> int: ... - @property - def kwds(self) -> dict: ... - @property - def base(self) -> BaseOffset: ... - @overload - def __add__(self, other: npt.NDArray[np.object_]) -> npt.NDArray[np.object_]: ... - @overload - def __add__(self: _BaseOffsetT, other: BaseOffset) -> _BaseOffsetT: ... - @overload - def __add__(self, other: _DatetimeT) -> _DatetimeT: ... - @overload - def __add__(self, other: _TimedeltaT) -> _TimedeltaT: ... - @overload - def __radd__(self, other: npt.NDArray[np.object_]) -> npt.NDArray[np.object_]: ... - @overload - def __radd__(self: _BaseOffsetT, other: BaseOffset) -> _BaseOffsetT: ... - @overload - def __radd__(self, other: _DatetimeT) -> _DatetimeT: ... - @overload - def __radd__(self, other: _TimedeltaT) -> _TimedeltaT: ... - def __sub__(self: _BaseOffsetT, other: BaseOffset) -> _BaseOffsetT: ... - @overload - def __rsub__(self, other: npt.NDArray[np.object_]) -> npt.NDArray[np.object_]: ... - @overload - def __rsub__(self: _BaseOffsetT, other: BaseOffset) -> _BaseOffsetT: ... - @overload - def __rsub__(self, other: _DatetimeT) -> _DatetimeT: ... - @overload - def __rsub__(self, other: _TimedeltaT) -> _TimedeltaT: ... - def __call__(self, other): ... - @overload - def __mul__(self, other: np.ndarray) -> np.ndarray: ... - @overload - def __mul__(self: _BaseOffsetT, other: int) -> _BaseOffsetT: ... - @overload - def __rmul__(self, other: np.ndarray) -> np.ndarray: ... - @overload - def __rmul__(self: _BaseOffsetT, other: int) -> _BaseOffsetT: ... - def __neg__(self: _BaseOffsetT) -> _BaseOffsetT: ... - def copy(self: _BaseOffsetT) -> _BaseOffsetT: ... - def __repr__(self) -> str: ... - @property - def name(self) -> str: ... - @property - def rule_code(self) -> str: ... - def freqstr(self) -> str: ... - def apply_index(self, dtindex: "DatetimeIndex") -> "DatetimeIndex": ... - def _apply_array(self, dtarr) -> None: ... - def rollback(self, dt: datetime) -> datetime: ... - def rollforward(self, dt: datetime) -> datetime: ... - def is_on_offset(self, dt: datetime) -> bool: ... - def __setstate__(self, state) -> None: ... - def __getstate__(self): ... - @property - def nanos(self) -> int: ... - def onOffset(self, dt: datetime) -> bool: ... - def isAnchored(self) -> bool: ... - def is_anchored(self) -> bool: ... - -def _get_offset(name: str) -> BaseOffset: ... - -class SingleConstructorOffset(BaseOffset): - @classmethod - def _from_name(cls, suffix=...): ... - def __reduce__(self): ... - -@overload -def to_offset(freq: None) -> None: ... -@overload -def to_offset(freq: timedelta | BaseOffset | str) -> BaseOffset: ... - -class Tick(SingleConstructorOffset): - def __init__(self, n: int = ..., normalize: bool = ...) -> None: ... - @property - def delta(self) -> Timedelta: ... - @property - def nanos(self) -> int: ... - -def delta_to_tick(delta: timedelta) -> Tick: ... - -class Day(Tick): ... -class Hour(Tick): ... -class Minute(Tick): ... -class Second(Tick): ... -class Milli(Tick): ... -class Micro(Tick): ... -class Nano(Tick): ... - -class RelativeDeltaOffset(BaseOffset): - def __init__(self, n: int = ..., normalize: bool = ..., **kwds: Any) -> None: ... - -class BusinessMixin(SingleConstructorOffset): - def __init__(self, n: int = ..., normalize: bool = ..., offset: timedelta = ...): ... - -class BusinessDay(BusinessMixin): ... - -class BusinessHour(BusinessMixin): - def __init__( - self, - n: int = ..., - normalize: bool = ..., - start: str | Collection[str] = ..., - end: str | Collection[str] = ..., - offset: timedelta = ..., - ): ... - -class WeekOfMonthMixin(SingleConstructorOffset): ... - -class YearOffset(SingleConstructorOffset): - def __init__(self, n: int = ..., normalize: bool = ..., month: int | None = ...): ... - -class BYearEnd(YearOffset): ... -class BYearBegin(YearOffset): ... -class YearEnd(YearOffset): ... -class YearBegin(YearOffset): ... - -class QuarterOffset(SingleConstructorOffset): - def __init__(self, n: int = ..., normalize: bool = ..., startingMonth: int | None = ...) -> None: ... - -class BQuarterEnd(QuarterOffset): ... -class BQuarterBegin(QuarterOffset): ... -class QuarterEnd(QuarterOffset): ... -class QuarterBegin(QuarterOffset): ... -class MonthOffset(SingleConstructorOffset): ... -class MonthEnd(MonthOffset): ... -class MonthBegin(MonthOffset): ... -class BusinessMonthEnd(MonthOffset): ... -class BusinessMonthBegin(MonthOffset): ... - -class SemiMonthOffset(SingleConstructorOffset): - def __init__(self, n: int = ..., normalize: bool = ..., day_of_month: int | None = ...) -> None: ... - -class SemiMonthEnd(SemiMonthOffset): ... -class SemiMonthBegin(SemiMonthOffset): ... - -class Week(SingleConstructorOffset): - def __init__(self, n: int = ..., normalize: bool = ..., weekday: int | None = ...) -> None: ... - -class WeekOfMonth(WeekOfMonthMixin): ... -class LastWeekOfMonth(WeekOfMonthMixin): ... - -class FY5253Mixin(SingleConstructorOffset): - def __init__( - self, - n: int = ..., - normalize: bool = ..., - weekday: int = ..., - startingMonth: int = ..., - variation: str = ..., - ) -> None: ... - -class FY5253(FY5253Mixin): ... -class FY5253Quarter(FY5253Mixin): ... -class Easter(SingleConstructorOffset): ... - -class _CustomBusinessMonth(BusinessMixin): - def __init__( - self, - n: int = ..., - normalize: bool = ..., - offset: timedelta = ..., - holidays: None | list = ..., - ): ... - -class CustomBusinessDay(BusinessDay): - def __init__( - self, - n: int = ..., - normalize: bool = ..., - offset: timedelta = ..., - weekmask: str = ..., - ): ... - -class CustomBusinessHour(BusinessHour): - def __init__( - self, - n: int = ..., - normalize: bool = ..., - start: str = ..., - end: str = ..., - offset: timedelta = ..., - holidays: None | list = ..., - ): ... - -class CustomBusinessMonthEnd(_CustomBusinessMonth): ... -class CustomBusinessMonthBegin(_CustomBusinessMonth): ... -class DateOffset(RelativeDeltaOffset): ... - -BDay = BusinessDay -BMonthEnd = BusinessMonthEnd -BMonthBegin = BusinessMonthBegin -CBMonthEnd = CustomBusinessMonthEnd -CBMonthBegin = CustomBusinessMonthBegin -CDay = CustomBusinessDay - -def roll_qtrday(other: datetime, n: int, month: int, day_opt: str, modby: int) -> int: ... - -INVALID_FREQ_ERR_MSG: Literal["Invalid frequency: {0}"] - -def shift_months(dtindex: npt.NDArray[np.int64], months: int, day_opt: str | None = ...) -> npt.NDArray[np.int64]: ... - -_offset_map: dict[str, BaseOffset] diff --git a/partial/pandas/_libs/tslibs/period.pyi b/partial/pandas/_libs/tslibs/period.pyi deleted file mode 100644 index 8a30309..0000000 --- a/partial/pandas/_libs/tslibs/period.pyi +++ /dev/null @@ -1,89 +0,0 @@ -from __future__ import annotations -from datetime import datetime -from typing import Any - -def is_period_object(obj: object) -> bool: ... -def get_period_ordinal(dts: datetime, freq: int) -> int: ... - -class IncompatibleFrequency(ValueError): ... - -class Period: - def __init__( - self, - value: Any = ..., - freqstr: Any = ..., - ordinal: Any = ..., - year: Any = ..., - month: int = ..., - quarter: Any = ..., - day: int = ..., - hour: int = ..., - minute: int = ..., - second: int = ..., - ) -> None: ... - def __add__(self, other) -> Period: ... - def __eq__(self, other) -> bool: ... - def __ge__(self, other) -> bool: ... - def __gt__(self, other) -> bool: ... - def __hash__(self) -> int: ... - def __le__(self, other) -> bool: ... - def __lt__(self, other) -> bool: ... - def __new__(cls, *args, **kwargs) -> Period: ... - def __ne__(self, other) -> bool: ... - def __radd__(self, other) -> Period: ... - def __reduce__(self, *args, **kwargs) -> Any: ... # what should this be? - def __repr__(self) -> str: ... - def __rsub__(self, other) -> Period: ... - def __setstate__(self, *args, **kwargs) -> Any: ... # what should this be? - def __str__(self) -> str: ... - @property - def day(self) -> int: ... - @property - def dayofweek(self) -> int: ... - @property - def dayofyear(self) -> int: ... - @property - def daysinmonth(self) -> int: ... - @property - def days_in_month(self) -> int: ... - @property - def end_time(self) -> Timestamp: ... - @property - def freq(self) -> Any: ... - @property - def freqstr(self) -> str: ... - @property - def hour(self) -> int: ... - @property - def minute(self) -> int: ... - @property - def month(self) -> int: ... - @property - def quarter(self) -> int: ... - @property - def qyear(self) -> int: ... - @property - def second(self) -> int: ... - @property - def ordinal(self) -> int: ... - @property - def is_leap_year(self) -> bool: ... - @property - def start_time(self) -> Timestamp: ... - @property - def week(self) -> int: ... - @property - def weekday(self) -> int: ... - @property - def weekofyear(self) -> int: ... - @property - def year(self) -> int: ... - # Static methods - @classmethod - def now(cls) -> Period: ... - # Methods - def asfreq(self, freq: str, how: str = ...) -> Period: ... - def strftime(self, fmt: str) -> str: ... - def to_timestamp(self, freq: str, how: str = ...) -> Timestamp: ... - -from .timestamps import Timestamp diff --git a/partial/pandas/_libs/tslibs/timedeltas.pyi b/partial/pandas/_libs/tslibs/timedeltas.pyi deleted file mode 100644 index 28c2f7d..0000000 --- a/partial/pandas/_libs/tslibs/timedeltas.pyi +++ /dev/null @@ -1,148 +0,0 @@ -from datetime import timedelta -from typing import ( - ClassVar, - Literal, - Type, - TypeVar, - overload, -) - -import numpy as np - -from pandas._libs.tslibs import ( - NaTType, - Tick, -) -from pandas._typing import npt - -# This should be kept consistent with the keys in the dict timedelta_abbrevs -# in pandas/_libs/tslibs/timedeltas.pyx -UnitChoices = Literal[ - "Y", - "y", - "M", - "W", - "w", - "D", - "d", - "days", - "day", - "hours", - "hour", - "hr", - "h", - "m", - "minute", - "min", - "minutes", - "t", - "s", - "seconds", - "sec", - "second", - "ms", - "milliseconds", - "millisecond", - "milli", - "millis", - "l", - "us", - "microseconds", - "microsecond", - "µs", - "micro", - "micros", - "u", - "ns", - "nanoseconds", - "nano", - "nanos", - "nanosecond", - "n", -] -_S = TypeVar("_S", bound=timedelta) - -def ints_to_pytimedelta( - arr: npt.NDArray[np.int64], # const int64_t[:] - box: bool = ..., -) -> npt.NDArray[np.object_]: ... -def array_to_timedelta64( - values: npt.NDArray[np.object_], - unit: str | None = ..., - errors: str = ..., -) -> np.ndarray: ... # np.ndarray[m8ns] -def parse_timedelta_unit(unit: str | None) -> UnitChoices: ... -def delta_to_nanoseconds(delta: np.timedelta64 | timedelta | Tick) -> int: ... - -class Timedelta(timedelta): - min: ClassVar[Timedelta] - max: ClassVar[Timedelta] - resolution: ClassVar[Timedelta] - value: int # np.int64 - def __new__( - cls: Type[_S], - value=..., - unit: str = ..., - **kwargs: int | float | np.integer | np.floating, - ) -> _S: ... - # GH 46171 - # While Timedelta can return pd.NaT, having the constructor return - # a Union with NaTType makes things awkward for users of pandas - @property - def days(self) -> int: ... - @property - def seconds(self) -> int: ... - @property - def microseconds(self) -> int: ... - def total_seconds(self) -> float: ... - def to_pytimedelta(self) -> timedelta: ... - def to_timedelta64(self) -> np.timedelta64: ... - @property - def asm8(self) -> np.timedelta64: ... - # TODO: round/floor/ceil could return NaT? - def round(self: _S, freq: str) -> _S: ... - def floor(self: _S, freq: str) -> _S: ... - def ceil(self: _S, freq: str) -> _S: ... - @property - def resolution_string(self) -> str: ... - def __add__(self, other: timedelta) -> Timedelta: ... - def __radd__(self, other: timedelta) -> Timedelta: ... - def __sub__(self, other: timedelta) -> Timedelta: ... - def __rsub__(self, other: timedelta) -> Timedelta: ... - def __neg__(self) -> Timedelta: ... - def __pos__(self) -> Timedelta: ... - def __abs__(self) -> Timedelta: ... - def __mul__(self, other: float) -> Timedelta: ... - def __rmul__(self, other: float) -> Timedelta: ... - # error: Signature of "__floordiv__" incompatible with supertype "timedelta" - @overload # type: ignore[override] - def __floordiv__(self, other: timedelta) -> int: ... - @overload - def __floordiv__(self, other: int | float) -> Timedelta: ... - @overload - def __floordiv__( - self, other: npt.NDArray[np.timedelta64] - ) -> npt.NDArray[np.intp]: ... - @overload - def __floordiv__( - self, other: npt.NDArray[np.number] - ) -> npt.NDArray[np.timedelta64] | Timedelta: ... - @overload - def __rfloordiv__(self, other: timedelta | str) -> int: ... - @overload - def __rfloordiv__(self, other: None | NaTType) -> NaTType: ... - @overload - def __rfloordiv__(self, other: np.ndarray) -> npt.NDArray[np.timedelta64]: ... - @overload - def __truediv__(self, other: timedelta) -> float: ... - @overload - def __truediv__(self, other: float) -> Timedelta: ... - def __mod__(self, other: timedelta) -> Timedelta: ... - def __divmod__(self, other: timedelta) -> tuple[int, Timedelta]: ... - def __le__(self, other: timedelta) -> bool: ... - def __lt__(self, other: timedelta) -> bool: ... - def __ge__(self, other: timedelta) -> bool: ... - def __gt__(self, other: timedelta) -> bool: ... - def __hash__(self) -> int: ... - def isoformat(self) -> str: ... - def to_numpy(self) -> np.timedelta64: ... diff --git a/partial/pandas/_libs/tslibs/timestamps.pyi b/partial/pandas/_libs/tslibs/timestamps.pyi deleted file mode 100644 index 11b61f6..0000000 --- a/partial/pandas/_libs/tslibs/timestamps.pyi +++ /dev/null @@ -1,201 +0,0 @@ -from datetime import ( - date as _date, - datetime, - time as _time, - timedelta, - tzinfo as _tzinfo, -) -from time import struct_time -from typing import ( - ClassVar, - TypeVar, - overload, -) - -import numpy as np - -from pandas._libs.tslibs import ( - BaseOffset, - NaTType, - Period, - Tick, - Timedelta, -) - -_DatetimeT = TypeVar("_DatetimeT", bound=datetime) - -def integer_op_not_supported(obj: object) -> TypeError: ... - -class Timestamp(datetime): - min: ClassVar[Timestamp] - max: ClassVar[Timestamp] - - resolution: ClassVar[Timedelta] - value: int # np.int64 - def __new__( - cls: type[_DatetimeT], - ts_input: int | np.integer | float | str | _date | datetime | np.datetime64 = ..., - freq: int | None | str | BaseOffset = ..., - tz: str | _tzinfo | None | int = ..., - unit: str | int | None = ..., - year: int | None = ..., - month: int | None = ..., - day: int | None = ..., - hour: int | None = ..., - minute: int | None = ..., - second: int | None = ..., - microsecond: int | None = ..., - nanosecond: int | None = ..., - tzinfo: _tzinfo | None = ..., - *, - fold: int | None = ..., - ) -> _DatetimeT: ... - # GH 46171 - # While Timestamp can return pd.NaT, having the constructor return - # a Union with NaTType makes things awkward for users of pandas - def _set_freq(self, freq: BaseOffset | None) -> None: ... - @property - def year(self) -> int: ... - @property - def month(self) -> int: ... - @property - def day(self) -> int: ... - @property - def hour(self) -> int: ... - @property - def minute(self) -> int: ... - @property - def second(self) -> int: ... - @property - def microsecond(self) -> int: ... - @property - def tzinfo(self) -> _tzinfo | None: ... - @property - def tz(self) -> _tzinfo | None: ... - @property - def fold(self) -> int: ... - @classmethod - def fromtimestamp(cls: type[_DatetimeT], t: float, tz: _tzinfo | None = ...) -> _DatetimeT: ... - @classmethod - def utcfromtimestamp(cls: type[_DatetimeT], t: float) -> _DatetimeT: ... - @classmethod - def today(cls: type[_DatetimeT], tz: _tzinfo | str | None = ...) -> _DatetimeT: ... - @classmethod - def fromordinal( - cls: type[_DatetimeT], - ordinal: int, - freq: str | BaseOffset | None = ..., - tz: _tzinfo | str | None = ..., - ) -> _DatetimeT: ... - @classmethod - def now(cls: type[_DatetimeT], tz: _tzinfo | str | None = ...) -> _DatetimeT: ... - @classmethod - def utcnow(cls: type[_DatetimeT]) -> _DatetimeT: ... - # error: Signature of "combine" incompatible with supertype "datetime" - @classmethod - def combine(cls, date: _date, time: _time) -> datetime: ... # type: ignore[override] - @classmethod - def fromisoformat(cls: type[_DatetimeT], date_string: str) -> _DatetimeT: ... - def strftime(self, format: str) -> str: ... - def __format__(self, fmt: str) -> str: ... - def toordinal(self) -> int: ... - def timetuple(self) -> struct_time: ... - def timestamp(self) -> float: ... - def utctimetuple(self) -> struct_time: ... - def date(self) -> _date: ... - def time(self) -> _time: ... - def timetz(self) -> _time: ... - def replace( - self, - year: int = ..., - month: int = ..., - day: int = ..., - hour: int = ..., - minute: int = ..., - second: int = ..., - microsecond: int = ..., - tzinfo: _tzinfo | None = ..., - fold: int = ..., - ) -> Timestamp: ... - def astimezone(self: _DatetimeT, tz: _tzinfo | None = ...) -> _DatetimeT: ... - def ctime(self) -> str: ... - def isoformat(self, sep: str = ..., timespec: str = ...) -> str: ... - @classmethod - def strptime(cls, date_string: str, format: str) -> datetime: ... - def utcoffset(self) -> timedelta | None: ... - def tzname(self) -> str | None: ... - def dst(self) -> timedelta | None: ... - def __le__(self, other: datetime) -> bool: ... # type: ignore[override] - def __lt__(self, other: datetime) -> bool: ... # type: ignore[override] - def __ge__(self, other: datetime) -> bool: ... # type: ignore[override] - def __gt__(self, other: datetime) -> bool: ... # type: ignore[override] - # error: Signature of "__add__" incompatible with supertype "date"/"datetime" - @overload # type: ignore[override] - def __add__(self, other: np.ndarray) -> np.ndarray: ... - @overload - def __add__(self: _DatetimeT, other: timedelta | np.timedelta64 | Tick) -> _DatetimeT: ... - def __radd__(self: _DatetimeT, other: timedelta) -> _DatetimeT: ... - @overload # type: ignore[override] - def __sub__(self, other: datetime) -> Timedelta: ... - @overload - def __sub__(self: _DatetimeT, other: timedelta | np.timedelta64 | Tick) -> _DatetimeT: ... - def __hash__(self) -> int: ... - def weekday(self) -> int: ... - def isoweekday(self) -> int: ... - def isocalendar(self) -> tuple[int, int, int]: ... - @property - def is_leap_year(self) -> bool: ... - @property - def is_month_start(self) -> bool: ... - @property - def is_quarter_start(self) -> bool: ... - @property - def is_year_start(self) -> bool: ... - @property - def is_month_end(self) -> bool: ... - @property - def is_quarter_end(self) -> bool: ... - @property - def is_year_end(self) -> bool: ... - def to_pydatetime(self, warn: bool = ...) -> datetime: ... - def to_datetime64(self) -> np.datetime64: ... - def to_period(self, freq: BaseOffset | str | None = ...) -> Period: ... - def to_julian_date(self) -> np.float64: ... - @property - def asm8(self) -> np.datetime64: ... - def tz_convert(self: _DatetimeT, tz: _tzinfo | str | None) -> _DatetimeT: ... - # TODO: could return NaT? - def tz_localize( - self: _DatetimeT, - tz: _tzinfo | str | None, - ambiguous: str = ..., - nonexistent: str = ..., - ) -> _DatetimeT: ... - def normalize(self: _DatetimeT) -> _DatetimeT: ... - # TODO: round/floor/ceil could return NaT? - def round(self: _DatetimeT, freq: str, ambiguous: bool | str = ..., nonexistent: str = ...) -> _DatetimeT: ... - def floor(self: _DatetimeT, freq: str, ambiguous: bool | str = ..., nonexistent: str = ...) -> _DatetimeT: ... - def ceil(self: _DatetimeT, freq: str, ambiguous: bool | str = ..., nonexistent: str = ...) -> _DatetimeT: ... - def day_name(self, locale: str | None = ...) -> str: ... - def month_name(self, locale: str | None = ...) -> str: ... - @property - def day_of_week(self) -> int: ... - @property - def dayofweek(self) -> int: ... - @property - def day_of_month(self) -> int: ... - @property - def day_of_year(self) -> int: ... - @property - def dayofyear(self) -> int: ... - @property - def quarter(self) -> int: ... - @property - def week(self) -> int: ... - def to_numpy(self, dtype: np.dtype | None = ..., copy: bool = ...) -> np.datetime64: ... - @property - def _date_repr(self) -> str: ... - @property - def days_in_month(self) -> int: ... - @property - def daysinmonth(self) -> int: ... diff --git a/partial/pandas/_testing.pyi b/partial/pandas/_testing.pyi deleted file mode 100644 index 57f463a..0000000 --- a/partial/pandas/_testing.pyi +++ /dev/null @@ -1,121 +0,0 @@ -from pandas.core.frame import DataFrame -from pandas.core.indexes.base import Index -from pandas.core.series import Series -from pandas._typing import FilePathOrBuffer as FilePathOrBuffer, FrameOrSeries as FrameOrSeries -from typing import Any, List, Optional, Union - -lzma = ... -N: int = ... -K: int = ... - -def set_testing_mode() -> None: ... -def reset_testing_mode() -> None: ... -def reset_display_options() -> None: ... -def round_trip_pickle(obj, path: Optional[FilePathOrBuffer]=...) -> FrameOrSeries: ... -def round_trip_pathlib(writer, reader, path: Optional[str]=...) : ... -def round_trip_localpath(writer, reader, path: Optional[str]=...) : ... -def decompress_file(path, compression) -> None: ... -def write_to_compressed(compression, path, data, dest: str = ...) -> None: ... -def assert_almost_equal(left, right, check_dtype: Union[bool, str]=..., check_less_precise: Union[bool, int]=..., **kwargs) : ... -def assert_dict_equal(left, right, compare_keys: bool=...) : ... -def randbool(size=..., p: float=...) : ... - -RANDS_CHARS = ... -RANDU_CHARS = ... - -def rands_array(nchars, size, dtype: str = ...): ... -def randu_array(nchars, size, dtype: str = ...): ... -def rands(nchars): ... -def randu(nchars): ... -def close(fignum = ...) -> None: ... -def ensure_clean(filename = ..., return_filelike: bool = ...) -> None: ... -def ensure_clean_dir() -> None: ... -def ensure_safe_environment_variables() -> None: ... -def equalContents(arr1, arr2) -> bool: ... -def assert_index_equal(left: Index[Any], right: Index[Any]) -> None: ... -def assert_class_equal(left, right, exact: Union[bool, str]=..., obj=...) : ... -def assert_attr_equal(attr, left, right, obj: str = ...): ... -def assert_is_valid_plot_return_object(objs) -> None: ... -def isiterable(obj) -> bool: ... -def assert_is_sorted(seq) -> None: ... -def assert_categorical_equal(left, right, check_dtype: bool = ..., check_category_order: bool = ..., obj: str = ...) -> None: ... -def assert_interval_array_equal(left, right, exact: str = ..., obj: str = ...) -> None: ... -def assert_period_array_equal(left, right, obj: str = ...) -> None: ... -def assert_datetime_array_equal(left, right, obj: str = ...) -> None: ... -def assert_timedelta_array_equal(left, right, obj: str = ...) -> None: ... -def raise_assert_detail(obj, message, left, right, diff = ...) -> None: ... -def assert_numpy_array_equal(left, right, strict_nan: bool = ..., check_dtype: bool = ..., err_msg = ..., check_same = ..., obj: str = ...): ... -def assert_extension_array_equal( - left, right, check_dtype: bool = ..., check_less_precise: bool = ..., check_exact: bool = ..., -) -> None: ... -def assert_series_equal(left: Series, right: Series, - check_dtype: bool = ..., - check_index_type: bool|str = ..., - check_series_type: bool = ..., - check_less_precise: bool|int = ..., - check_names : bool = ..., - check_exact: bool = ..., - check_datetimelike_compat: bool = ..., - check_categorical: bool = ..., - check_category_order: bool = ..., - check_freq: bool = ..., - check_flags: bool = ..., - rtol: float = ..., - atol: float = ..., - obj: str = ..., - *, - check_index: bool = ...) -> None: ... -def assert_frame_equal(left: DataFrame, right: DataFrame, check_like: Optional[bool] = ...) -> None: ... -def assert_equal(left, right, **kwargs) -> None: ... -def box_expected(expected, box_cls, transpose: bool = ...): ... -def to_array(obj): ... -def assert_sp_array_equal(left, right, check_dtype: bool = ..., check_kind: bool = ..., check_fill_value: bool = ..., consolidate_block_indices: bool = ...) -> None: ... -def assert_contains_all(iterable, dic) -> None: ... -def assert_copy(iter1, iter2, **eql_kwargs) -> None: ... -def getCols(k): ... -def makeStringIndex(k: int = ..., name = ...): ... -def makeUnicodeIndex(k: int = ..., name = ...): ... -def makeCategoricalIndex(k: int = ..., n: int = ..., name = ..., **kwargs): ... -def makeIntervalIndex(k: int = ..., name = ..., **kwargs): ... -def makeBoolIndex(k: int = ..., name = ...): ... -def makeIntIndex(k: int = ..., name = ...): ... -def makeUIntIndex(k: int = ..., name = ...): ... -def makeRangeIndex(k: int = ..., name = ..., **kwargs): ... -def makeFloatIndex(k: int = ..., name = ...): ... -def makeDateIndex(k: int = ..., freq: str = ..., name = ..., **kwargs): ... -def makeTimedeltaIndex(k: int = ..., freq: str = ..., name = ..., **kwargs): ... -def makePeriodIndex(k: int = ..., name = ..., **kwargs): ... -def makeMultiIndex(k: int = ..., names = ..., **kwargs): ... -def all_index_generator(k: int = ...) -> None: ... -def index_subclass_makers_generator() -> None: ... -def all_timeseries_index_generator(k: int = ...) -> None: ... -def makeFloatSeries(name = ...): ... -def makeStringSeries(name = ...): ... -def makeObjectSeries(name = ...): ... -def getSeriesData(): ... -def makeTimeSeries(nper = ..., freq: str = ..., name = ...): ... -def makePeriodSeries(nper = ..., name = ...): ... -def getTimeSeriesData(nper = ..., freq: str = ...): ... -def getPeriodData(nper = ...): ... -def makeTimeDataFrame(nper = ..., freq: str = ...): ... -def makeDataFrame(): ... -def getMixedTypeDict(): ... -def makeMixedDataFrame(): ... -def makePeriodFrame(nper = ...): ... -def makeCustomIndex(nentries, nlevels, prefix: str = ..., names: bool = ..., ndupe_l = ..., idx_type = ...): ... -def makeCustomDataframe(nrows, ncols, c_idx_names: bool = ..., r_idx_names: bool = ..., c_idx_nlevels: int = ..., r_idx_nlevels: int = ..., data_gen_f = ..., c_ndupe_l = ..., r_ndupe_l = ..., dtype = ..., c_idx_type = ..., r_idx_type = ...): ... -def makeMissingCustomDataframe(nrows, ncols, density: float = ..., random_state = ..., c_idx_names: bool = ..., r_idx_names: bool = ..., c_idx_nlevels: int = ..., r_idx_nlevels: int = ..., data_gen_f = ..., c_ndupe_l = ..., r_ndupe_l = ..., dtype = ..., c_idx_type = ..., r_idx_type = ...): ... -def makeMissingDataframe(density: float = ..., random_state = ...): ... -def optional_args(decorator): ... -def can_connect(url, error_classes = ...): ... -def network(t, url: str = ..., raise_on_error = ..., check_before_test: bool = ..., error_classes = ..., skip_errnos = ..., _skip_on_messages = ...): ... -with_connectivity_check = network - -def assert_produces_warning(expected_warning = ..., filter_level: str = ..., clear = ..., check_stacklevel: bool = ..., raise_on_extra_warnings: bool = ...) -> None: ... - -def with_csv_dialect(name, **kwargs) -> None: ... -def use_numexpr(use, min_elements = ...) -> None: ... -def test_parallel(num_threads: int = ..., kwargs_list = ...): ... - -def set_timezone(tz: str) : ... -def convert_rows_list_to_csv_str(rows_list: List[str]) : ... diff --git a/partial/pandas/_typing.pyi b/partial/pandas/_typing.pyi deleted file mode 100644 index 5dc293c..0000000 --- a/partial/pandas/_typing.pyi +++ /dev/null @@ -1,141 +0,0 @@ -import datetime -from io import BufferedIOBase, RawIOBase, TextIOBase, TextIOWrapper -from mmap import mmap -import numpy as np -from numpy import typing as npt -import sys -from os import PathLike -from pathlib import Path -from typing import ( - Any, - AnyStr, - Callable, - Collection, - Dict, - Hashable, - IO, - List, - Mapping, - NewType, - Optional, - Protocol, - Sequence, - Tuple, - Type, - TypeVar, - Union, -) - -from pandas.core.generic import NDFrame -from pandas._libs.tslibs import Period, Timedelta as Timedelta, Timestamp as Timestamp -from pandas.core.arrays import ExtensionArray as ExtensionArray -from pandas.core.series import Series as Series -from pandas.core.frame import DataFrame as DataFrame -from pandas.core.indexes.base import Index as Index -from pandas.core.dtypes.dtypes import ExtensionDtype - -if sys.version_info >= (3, 8): - from typing import Literal -else: - from typing_extensions import Literal - -ArrayLike = Union[ExtensionArray, np.ndarray] -AnyArrayLike = Union[Index, Series] -PythonScalar = Union[str, int, float, bool, complex] -DatetimeLikeScalar = TypeVar("DatetimeLikeScalar", Period, Timestamp, Timedelta) -PandasScalar = Union[bytes, datetime.date, datetime.datetime, datetime.timedelta] -# Scalar = Union[PythonScalar, PandasScalar] - -# dtypes -NpDtype = Union[str, np.dtype[np.generic], Type[Union[str, float, int, complex, bool, object]]] -Dtype = Union[ExtensionDtype, NpDtype] -AstypeArg = Union[ExtensionDtype, npt.DTypeLike] -# DtypeArg specifies all allowable dtypes in a functions its dtype argument -DtypeArg = Union[Dtype, Dict[Any, Dtype]] -DtypeObj = Union[np.dtype[np.generic], "ExtensionDtype"] - -# filenames and file-like-objects -AnyStr_cov = TypeVar("AnyStr_cov", str, bytes, covariant=True) -AnyStr_con = TypeVar("AnyStr_con", str, bytes, contravariant=True) - -class BaseBuffer(Protocol): ... -class ReadBuffer(BaseBuffer, Protocol[AnyStr_cov]): ... -class WriteBuffer(BaseBuffer, Protocol[AnyStr_cov]): ... - -FilePath = Union[str, PathLike[str]] - -Buffer = Union[IO[AnyStr], RawIOBase, BufferedIOBase, TextIOBase, TextIOWrapper, mmap] -FileOrBuffer = Union[str, Buffer[AnyStr]] -FilePathOrBuffer = Union["PathLike[str]", FileOrBuffer[AnyStr]] -FilePathOrBytesBuffer = Union[PathLike[str], WriteBuffer[bytes]] - -FrameOrSeries = TypeVar("FrameOrSeries", bound=NDFrame) -FrameOrSeriesUnion = Union[DataFrame, Series] -Axis = Union[str, int] -IndexLevel = Union[Hashable, Sequence[Hashable]] -Label = Optional[Hashable] -Level = Union[Hashable, int] -Ordered = Optional[bool] -JSONSerializable = Union[PythonScalar, List, Dict] -Axes = Collection -Renamer = Union[Mapping[Any, Label], Callable[[Any], Label]] -T = TypeVar("T") -FuncType = Callable[..., Any] -F = TypeVar("F", bound=FuncType) - -AggFuncTypeBase = Union[Callable, str] -AggFuncTypeDict = Dict[Hashable, Union[AggFuncTypeBase, List[AggFuncTypeBase]]] -AggFuncType = Union[ - AggFuncTypeBase, - List[AggFuncTypeBase], - AggFuncTypeDict, -] - -num = Union[int, float] -SeriesAxisType = Literal["index", 0] # Restricted subset of _AxisType for series -AxisType = Literal["columns", "index", 0, 1] -DtypeNp = TypeVar("DtypeNp", bound=np.dtype[np.generic]) -KeysArgType = Any -ListLike = TypeVar("ListLike", Sequence, np.ndarray, "Series") -StrLike = Union[str, np.str_] -Scalar = Union[str, bytes, datetime.date, datetime.datetime, datetime.timedelta, bool, int, float, complex, Timestamp, Timedelta] -# Refine the next 3 in 3.9 to use the specialized type. -np_ndarray_int64 = npt.NDArray[np.int64] -np_ndarray_bool = npt.NDArray[np.bool_] -np_ndarray_str = npt.NDArray[np.str_] -IndexType = Union[slice, np_ndarray_int64, Index, List[int], Series[int]] -MaskType = Union[Series[bool], np_ndarray_bool, List[bool]] -# Scratch types for generics -S1 = TypeVar( - "S1", - str, - bytes, - datetime.date, - datetime.datetime, - datetime.timedelta, - bool, - int, - float, - complex, - Timestamp, - Timedelta, - np.datetime64, -) -T1 = TypeVar("T1", str, int, np.int64, np.uint64, np.float64, float, np.dtype[np.generic]) -T2 = TypeVar("T2", str, int) - -# Interval closed type - -IntervalClosedType = Literal["left", "right", "both", "neither"] - -DateTimeErrorChoices = Literal["ignore", "raise", "coerce"] - -# Shared by functions such as drop and astype -IgnoreRaise = Literal["ignore", "raise"] - -# for arbitrary kwargs passed during reading/writing files -StorageOptions = Optional[Dict[str, Any]] - -# compression keywords and compression -CompressionDict = Dict[str, Any] -CompressionOptions = Optional[Union[Literal["infer", "gzip", "bz2", "zip", "xz", "zstd"], CompressionDict]] diff --git a/partial/pandas/compat/pickle_compat.pyi b/partial/pandas/compat/pickle_compat.pyi deleted file mode 100644 index c96ec9b..0000000 --- a/partial/pandas/compat/pickle_compat.pyi +++ /dev/null @@ -1,8 +0,0 @@ -import pickle as pkl -from pandas import DataFrame as DataFrame, Index as Index, Series as Series -from typing import Optional - -def load_reduce(self) -> None: ... -def load_newobj(self) -> None: ... -def load_newobj_ex(self) -> None: ... -def load(fh, encoding: Optional[str] = ..., is_verbose: bool = ...): ... diff --git a/partial/pandas/core/__init__.pyi b/partial/pandas/core/__init__.pyi deleted file mode 100644 index e69de29..0000000 diff --git a/partial/pandas/core/accessor.pyi b/partial/pandas/core/accessor.pyi deleted file mode 100644 index 4a323fd..0000000 --- a/partial/pandas/core/accessor.pyi +++ /dev/null @@ -1,16 +0,0 @@ -from typing import Any - -class DirNamesMixin: - def __dir__(self): ... - -class PandasDelegate: ... - -def delegate_names(delegate: Any, accessors: Any, typ: str, overwrite: bool=...) -> Any: ... - -class CachedAccessor: - def __init__(self, name: str, accessor: Any) -> None: ... - def __get__(self, obj: Any, cls: Any): ... - -def register_dataframe_accessor(name: Any): ... -def register_series_accessor(name: Any): ... -def register_index_accessor(name: Any): ... diff --git a/partial/pandas/core/algorithms.pyi b/partial/pandas/core/algorithms.pyi deleted file mode 100644 index 2dc480d..0000000 --- a/partial/pandas/core/algorithms.pyi +++ /dev/null @@ -1,48 +0,0 @@ -from __future__ import annotations -import numpy as np -from pandas.core.dtypes.generic import ABCIndex as ABCIndex -from pandas.core.indexes.base import Index -from typing import Any, Tuple, Union - -def unique(values): ... -unique1d = unique - -def isin(comps, values) -> np.ndarray: ... -def factorize( - values: Any, sort: bool = ..., na_sentinel: int = ..., size_hint: Union[int, None] = None, -) -> Tuple[np.ndarray, Union[np.ndarray, Index]]: ... -def value_counts(values, sort: bool=..., ascending: bool=..., normalize: bool=..., bins=..., dropna: bool=...) -> Series: ... -def duplicated(values, keep=...) -> np.ndarray: ... -def mode(values, dropna: bool=...) -> Series: ... -def rank(values, axis: int=..., method: str=..., na_option: str=..., ascending: bool=..., pct: bool=...) : ... -def checked_add_with_arr(arr, b, arr_mask = ..., b_mask = ...): ... -def quantile(x, q, interpolation_method: str = ...): ... - -class SelectN: - obj = ... - n = ... - keep = ... - def __init__(self, obj, n: int, keep: str) -> None: ... - def nlargest(self): ... - def nsmallest(self): ... - @staticmethod - def is_valid_dtype_n_method(dtype) -> bool: ... - -class SelectNSeries(SelectN): - def compute(self, method): ... - -class SelectNFrame(SelectN): - columns = ... - def __init__(self, obj, n: int, keep: str, columns) -> None: ... - def compute(self, method): ... - -def take(arr, indices, axis: int=..., allow_fill: bool=..., fill_value=...) : ... -def take_nd(arr, indexer, axis: int=..., out=..., fill_value=..., allow_fill: bool=...) : ... -take_1d = take_nd - -def take_2d_multi(arr, indexer, fill_value = ...): ... -def searchsorted(arr, value, side: str = ..., sorter = ...): ... -def diff(arr, n: int, axis: int=..., stacklevel=...) : ... -def safe_sort(values, codes=..., na_sentinel: int=..., assume_unique: bool=..., verify: bool=...) -> Union[np.ndarray, Tuple[np.ndarray, np.ndarray]]: ... - -from pandas import Series as Series diff --git a/partial/pandas/core/api.pyi b/partial/pandas/core/api.pyi deleted file mode 100644 index 4501329..0000000 --- a/partial/pandas/core/api.pyi +++ /dev/null @@ -1,52 +0,0 @@ -from pandas._libs import NaT as NaT, Period as Period, Timedelta as Timedelta -from pandas._libs.tslibs import Timestamp as Timestamp -from pandas._libs.missing import NA as NA -from pandas.core.arrays.boolean import BooleanDtype as BooleanDtype -from pandas.core.arrays.integer import ( - Int16Dtype as Int16Dtype, - Int32Dtype as Int32Dtype, - Int64Dtype as Int64Dtype, - Int8Dtype as Int8Dtype, - UInt16Dtype as UInt16Dtype, - UInt32Dtype as UInt32Dtype, - UInt64Dtype as UInt64Dtype, - UInt8Dtype as UInt8Dtype, -) -from pandas.core.arrays.string_ import StringDtype as StringDtype -from pandas.core.construction import array as array -from pandas.core.dtypes.dtypes import ( - CategoricalDtype as CategoricalDtype, - DatetimeTZDtype as DatetimeTZDtype, - IntervalDtype as IntervalDtype, - PeriodDtype as PeriodDtype, -) -from pandas.core.dtypes.missing import isna as isna, isnull as isnull, notna as notna, notnull as notnull -from pandas.core.indexes.datetimes import bdate_range as bdate_range, date_range as date_range -from pandas.core.tools import to_datetime as to_datetime -from pandas.core.tools.numeric import to_numeric as to_numeric -from pandas.core.tools.timedeltas import to_timedelta as to_timedelta -from pandas.io.formats.format import set_eng_float_format as set_eng_float_format -from pandas.core.indexes.interval import Interval as Interval, interval_range as interval_range -from pandas.core.indexes.period import period_range as period_range -from pandas.core.indexes.timedeltas import timedelta_range as timedelta_range -from pandas.core.arrays import Categorical as Categorical - -from pandas.core.groupby import Grouper as Grouper, NamedAgg as NamedAgg -from pandas.core.indexes.api import ( - CategoricalIndex as CategoricalIndex, - DatetimeIndex as DatetimeIndex, - Float64Index as Float64Index, - Index as Index, - Int64Index as Int64Index, - IntervalIndex as IntervalIndex, - MultiIndex as MultiIndex, - PeriodIndex as PeriodIndex, - RangeIndex as RangeIndex, - TimedeltaIndex as TimedeltaIndex, - UInt64Index as UInt64Index, -) -from pandas.core.indexing import IndexSlice as IndexSlice -from pandas.core.series import Series as Series -from pandas.core.frame import DataFrame as DataFrame -from pandas.tseries.offsets import DateOffset as DateOffset -from pandas.core.algorithms import factorize as factorize, unique as unique, value_counts as value_counts diff --git a/partial/pandas/core/arraylike.pyi b/partial/pandas/core/arraylike.pyi deleted file mode 100644 index 2e30e44..0000000 --- a/partial/pandas/core/arraylike.pyi +++ /dev/null @@ -1,38 +0,0 @@ -from typing import Any, Protocol, Tuple -from pandas._typing import FrameOrSeries, DataFrame - -class OpsMixinProtocol(Protocol): ... - -class OpsMixin: - def __eq__(self: OpsMixinProtocol, other: Any) -> DataFrame: ... # type: ignore - def __ne__(self: OpsMixinProtocol, other: Any) -> DataFrame: ... # type: ignore - def __lt__(self: OpsMixinProtocol, other: Any) -> DataFrame: ... - def __le__(self: OpsMixinProtocol, other: Any) -> DataFrame: ... - def __gt__(self: OpsMixinProtocol, other: Any) -> DataFrame: ... - def __ge__(self: OpsMixinProtocol, other: Any) -> DataFrame: ... - # ------------------------------------------------------------- - # Logical Methods - def __and__(self: OpsMixinProtocol, other: Any) -> DataFrame: ... - def __rand__(self: OpsMixinProtocol, other: Any) -> DataFrame: ... - def __or__(self: OpsMixinProtocol, other: Any) -> DataFrame: ... - def __ror__(self: OpsMixinProtocol, other: Any) -> DataFrame: ... - def __xor__(self: OpsMixinProtocol, other: Any) -> DataFrame: ... - def __rxor__(self: OpsMixinProtocol, other: Any) -> DataFrame: ... - # ------------------------------------------------------------- - # Arithmetic Methods - def __add__(self: OpsMixinProtocol, other: Any) -> DataFrame: ... - def __radd__(self: OpsMixinProtocol, other: Any) -> DataFrame: ... - def __sub__(self: OpsMixinProtocol, other: Any) -> DataFrame: ... - def __rsub__(self: OpsMixinProtocol, other: Any) -> DataFrame: ... - def __mul__(self: OpsMixinProtocol, other: Any) -> DataFrame: ... - def __rmul__(self: OpsMixinProtocol, other: Any) -> DataFrame: ... - def __truediv__(self: OpsMixinProtocol, other: Any) -> DataFrame: ... - def __rtruediv__(self: OpsMixinProtocol, other: Any) -> DataFrame: ... - def __floordiv__(self: OpsMixinProtocol, other: Any) -> DataFrame: ... - def __rfloordiv__(self: OpsMixinProtocol, other: Any) -> DataFrame: ... - def __mod__(self: OpsMixinProtocol, other: Any) -> DataFrame: ... - def __rmod__(self: OpsMixinProtocol, other: Any) -> DataFrame: ... - def __divmod__(self: OpsMixinProtocol, other: DataFrame) -> Tuple[DataFrame, DataFrame]: ... - def __rdivmod__(self: OpsMixinProtocol, other: DataFrame) -> Tuple[DataFrame, DataFrame]: ... - def __pow__(self: OpsMixinProtocol, other: Any) -> DataFrame: ... - def __rpow__(self: OpsMixinProtocol, other: Any) -> DataFrame: ... diff --git a/partial/pandas/core/arrays/__init__.pyi b/partial/pandas/core/arrays/__init__.pyi deleted file mode 100644 index d5c0cab..0000000 --- a/partial/pandas/core/arrays/__init__.pyi +++ /dev/null @@ -1,14 +0,0 @@ -from .base import ( - ExtensionArray as ExtensionArray, - ExtensionOpsMixin as ExtensionOpsMixin, - ExtensionScalarOpsMixin as ExtensionScalarOpsMixin) -from .boolean import BooleanArray as BooleanArray -from .categorical import Categorical as Categorical -from .datetimes import DatetimeArray as DatetimeArray -from .integer import IntegerArray as IntegerArray, integer_array as integer_array -from .interval import IntervalArray as IntervalArray -from .numpy_ import PandasArray as PandasArray, PandasDtype as PandasDtype -from .period import PeriodArray as PeriodArray, period_array as period_array -from .sparse import SparseArray as SparseArray -from .string_ import StringArray as StringArray -from .timedeltas import TimedeltaArray as TimedeltaArray diff --git a/partial/pandas/core/arrays/_arrow_utils.pyi b/partial/pandas/core/arrays/_arrow_utils.pyi deleted file mode 100644 index e69de29..0000000 diff --git a/partial/pandas/core/arrays/_ranges.pyi b/partial/pandas/core/arrays/_ranges.pyi deleted file mode 100644 index e69de29..0000000 diff --git a/partial/pandas/core/arrays/base.pyi b/partial/pandas/core/arrays/base.pyi deleted file mode 100644 index 0631d2f..0000000 --- a/partial/pandas/core/arrays/base.pyi +++ /dev/null @@ -1,39 +0,0 @@ -import numpy as np -from pandas._typing import ArrayLike as ArrayLike -from pandas.core.dtypes.dtypes import ExtensionDtype as ExtensionDtype -from pandas.core.dtypes.generic import ABCExtensionArray as ABCExtensionArray -from typing import Sequence, Tuple, Union - -def try_cast_to_ea(cls_or_instance, obj, dtype=...): ... - -class ExtensionArray: - def __getitem__(self, item) -> None: ... - def __setitem__(self, key: Union[int, slice, np.ndarray], value) -> None: ... - def __len__(self) -> int: ... - def __iter__(self): ... - def to_numpy(self, dtype=..., copy: bool = ..., na_value=...): ... - @property - def dtype(self) -> ExtensionDtype: ... - @property - def shape(self) -> Tuple[int, ...]: ... - @property - def ndim(self) -> int: ... - @property - def nbytes(self) -> int: ... - def astype(self, dtype, copy: bool = ...): ... - def isna(self) -> ArrayLike: ... - def argsort(self, ascending: bool = ..., kind: str = ..., *args, **kwargs) -> np.ndarray: ... - def fillna(self, value=..., method=..., limit=...): ... - def dropna(self): ... - def shift(self, periods: int = ..., fill_value: object = ...) -> ABCExtensionArray: ... - def unique(self): ... - def searchsorted(self, value, side: str = ..., sorter=...): ... - def factorize(self, na_sentinel: int = ...) -> Tuple[np.ndarray, ABCExtensionArray]: ... - def repeat(self, repeats, axis=...): ... - def take(self, indices: Sequence[int], allow_fill: bool = ..., fill_value=...) -> ABCExtensionArray: ... - def copy(self) -> ABCExtensionArray: ... - def view(self, dtype=...) -> Union[ABCExtensionArray, np.ndarray]: ... - def ravel(self, order=...) -> ABCExtensionArray: ... - -class ExtensionOpsMixin: ... -class ExtensionScalarOpsMixin(ExtensionOpsMixin): ... diff --git a/partial/pandas/core/arrays/boolean.pyi b/partial/pandas/core/arrays/boolean.pyi deleted file mode 100644 index 5605f44..0000000 --- a/partial/pandas/core/arrays/boolean.pyi +++ /dev/null @@ -1,30 +0,0 @@ -from __future__ import annotations -import numpy as np -from .masked import BaseMaskedArray as BaseMaskedArray -from pandas._typing import Scalar as Scalar -from pandas.core.dtypes.base import ExtensionDtype as ExtensionDtype -from typing import Type - -class BooleanDtype(ExtensionDtype): - name: str = ... - @property - def na_value(self) -> Scalar: ... - @property - def type(self) -> Type: ... - @property - def kind(self) -> str: ... - @classmethod - def construct_array_type(cls) -> Type[BooleanArray]: ... - def __from_arrow__(self, array): ... - -def coerce_to_array(values, mask=..., copy: bool=...) : ... - -class BooleanArray(BaseMaskedArray): - def __init__(self, values: np.ndarray, mask: np.ndarray, copy: bool=...) -> None: ... - @property - def dtype(self): ... - def __array_ufunc__(self, ufunc, method, *inputs, **kwargs): ... - def __setitem__(self, key, value) -> None: ... - def astype(self, dtype, copy: bool = ...): ... - def any(self, skipna: bool=..., **kwargs) : ... - def all(self, skipna: bool=..., **kwargs) : ... diff --git a/partial/pandas/core/arrays/categorical.pyi b/partial/pandas/core/arrays/categorical.pyi deleted file mode 100644 index 4660e7d..0000000 --- a/partial/pandas/core/arrays/categorical.pyi +++ /dev/null @@ -1,161 +0,0 @@ -import numpy as np -from pandas._typing import ArrayLike as ArrayLike, Dtype as Dtype, Ordered as Ordered, Scalar as Scalar, np_ndarray_bool -from pandas.core.accessor import PandasDelegate as PandasDelegate -from pandas.core.arrays.base import ExtensionArray as ExtensionArray -from pandas.core.base import NoNewAttributesMixin as NoNewAttributesMixin -from pandas.core.base import PandasObject as PandasObject -from pandas.core.dtypes.dtypes import CategoricalDtype as CategoricalDtype -from pandas.core.indexes.base import Index -from typing import List, Literal, Optional, Sequence, Union, overload - -def contains(cat, key, container): ... - -class Categorical(ExtensionArray, PandasObject): - __array_priority__: int = ... - def __init__( - self, - values: Sequence, - categories=..., - ordered: Optional[bool] = ..., - dtype: Optional[CategoricalDtype] = ..., - fastpath: bool = ..., - ) -> None: ... - @property - def categories(self): ... - @categories.setter - def categories(self, categories) -> None: ... - @property - def ordered(self) -> Ordered: ... - @property - def dtype(self) -> CategoricalDtype: ... - def astype(self, dtype: Dtype, copy: bool = ...) -> ArrayLike: ... - def size(self) -> int: ... - def itemsize(self) -> int: ... - def tolist(self) -> List[Scalar]: ... - to_list = ... - @classmethod - def from_codes( - cls, - codes: Sequence[int], - categories: Optional[Index] = ..., - ordered: Optional[bool] = ..., - dtype: Optional[CategoricalDtype] = ..., - fastpath: bool = ..., - ) -> Categorical: ... - @property - def codes(self) -> List[int]: ... - @overload - def set_ordered(self, value, inplace: Literal[True]) -> None: ... - @overload - def set_ordered(self, value, inplace: Literal[False]) -> Categorical: ... - @overload - def set_ordered(self, value, inplace: bool) -> Union[None, Categorical]: ... - @overload - def as_ordered(self, inplace: Literal[True]) -> None: ... - @overload - def as_ordered(self, inplace: Literal[False]) -> Categorical: ... - @overload - def as_ordered(self, inplace: bool) -> Union[None, Categorical]: ... - @overload - def as_unordered(self, inplace: Literal[True]) -> None: ... - @overload - def as_unordered(self, inplace: Literal[False] = ...) -> Categorical: ... - @overload - def set_categories(self, new_categories, ordered=..., rename: bool = ..., *, inplace: Literal[True]) -> None: ... - @overload - def set_categories(self, new_categories, ordered=..., rename: bool = ..., inplace: Literal[False] = ...) -> Categorical: ... - @overload - def set_categories( - self, new_categories, ordered=..., rename: bool = ..., inplace: bool = ... - ) -> Union[None, Categorical]: ... - @overload - def rename_categories(self, new_categories, inplace: Literal[True]) -> None: ... - @overload - def rename_categories(self, new_categories, inplace: Literal[False] = ...) -> Categorical: ... - @overload - def rename_categories(self, new_categories, inplace: bool = ...) -> Union[None, Categorical]: ... - @overload - def reorder_categories(self, new_categories, ordered=..., *, inplace: Literal[True]) -> None: ... - @overload - def reorder_categories(self, new_categories, ordered=..., inplace: Literal[False] = ...) -> Categorical: ... - @overload - def reorder_categories(self, new_categories, ordered=..., inplace: bool = ...) -> Union[None, Categorical]: ... - @overload - def add_categories(self, new_categories, inplace: Literal[True]) -> None: ... - @overload - def add_categories(self, new_categories, inplace: Literal[False] = ...) -> Categorical: ... - @overload - def add_categories(self, new_categories, inplace: bool = ...) -> Union[None, Categorical]: ... - @overload - def remove_categories(self, removals, inplace: Literal[True]) -> None: ... - @overload - def remove_categories(self, removals, inplace: Literal[False] = ...) -> Categorical: ... - @overload - def remove_categories(self, removals, inplace: bool = ...) -> Union[None, Categorical]: ... - @overload - def remove_unused_categories(self, inplace: Literal[True]) -> None: ... - @overload - def remove_unused_categories(self, inplace: Literal[False] = ...) -> Categorical: ... - @overload - def remove_unused_categories(self, inplace: bool = ...) -> Union[None, Categorical]: ... - def map(self, mapper): ... - def __eq__(self, other) -> bool: ... - def __ne__(self, other) -> bool: ... - def __lt__(self, other) -> bool: ... - def __gt__(self, other) -> bool: ... - def __le__(self, other) -> bool: ... - def __ge__(self, other) -> bool: ... - @property - def shape(self): ... - def shift(self, periods, fill_value=...): ... - def __array__(self, dtype=...) -> np.ndarray: ... - def __array_ufunc__(self, ufunc, method, *inputs, **kwargs): ... - @property - def T(self): ... - @property - def nbytes(self) -> int: ... - def memory_usage(self, deep: bool = ...): ... - def searchsorted(self, value, side: str = ..., sorter=...): ... - def isna(self) -> np_ndarray_bool: ... - def isnull(self) -> np_ndarray_bool: ... - def notna(self) -> np_ndarray_bool: ... - def notnull(self) -> np_ndarray_bool: ... - def put(self, *args, **kwargs) -> None: ... - def dropna(self): ... - def value_counts(self, dropna: bool = ...): ... - def check_for_ordered(self, op) -> None: ... - def argsort(self, ascending: bool = ..., kind: str = ..., *args, **kwargs): ... - def sort_values(self, inplace: bool = ..., ascending: bool = ..., na_position: str = ...): ... - def view(self, dtype=...): ... - def to_dense(self): ... - def fillna(self, value=..., method=..., limit=...): ... - def take(self, indexer, allow_fill: bool = ..., fill_value=...): ... - def take_nd(self, indexer, allow_fill: bool = ..., fill_value=...): ... - def __len__(self) -> int: ... - def __iter__(self): ... - def __contains__(self, key) -> bool: ... - def __getitem__(self, key): ... - def __setitem__(self, key, value) -> None: ... - def min(self, skipna: bool = ...): ... - def max(self, skipna: bool = ...): ... - def mode(self, dropna: bool = ...): ... - def unique(self): ... - def equals(self, other): ... - def is_dtype_equal(self, other): ... - def describe(self): ... - def repeat(self, repeats, axis=...): ... - def isin(self, values): ... - @overload - def replace(self, to_replace, value, inplace: Literal[True]) -> None: ... - @overload - def replace(self, to_replace, value, inplace: Literal[False]) -> Categorical: ... - @overload - def replace(self, to_replace, value, inplace: bool = ...) -> Union[None, Categorical]: ... - -class CategoricalAccessor(PandasDelegate, PandasObject, NoNewAttributesMixin): - def __init__(self, data) -> None: ... - @property - def codes(self) -> Sequence[int]: ... - -def factorize_from_iterable(values): ... -def factorize_from_iterables(iterables): ... diff --git a/partial/pandas/core/arrays/datetimelike.pyi b/partial/pandas/core/arrays/datetimelike.pyi deleted file mode 100644 index 5419567..0000000 --- a/partial/pandas/core/arrays/datetimelike.pyi +++ /dev/null @@ -1,81 +0,0 @@ -import numpy as np -from pandas._libs import NaT as NaT, NaTType as NaTType, Timestamp as Timestamp -from pandas.core.arrays.base import ExtensionArray as ExtensionArray, ExtensionOpsMixin as ExtensionOpsMixin -from typing import Sequence, Union - -class AttributesMixin: ... - -class DatelikeOps: - def strftime(self, date_format): ... - -class TimelikeOps: - def round(self, freq, ambiguous: str = ..., nonexistent: str = ...): ... - def floor(self, freq, ambiguous: str = ..., nonexistent: str = ...): ... - def ceil(self, freq, ambiguous: str = ..., nonexistent: str = ...): ... - -class DatetimeLikeArrayMixin(ExtensionOpsMixin, AttributesMixin, ExtensionArray): - @property - def ndim(self) -> int: ... - @property - def shape(self): ... - def reshape(self, *args, **kwargs): ... - def ravel(self, *args, **kwargs): ... - def __iter__(self): ... - @property - def asi8(self) -> np.ndarray: ... - @property - def nbytes(self): ... - def __array__(self, dtype=...) -> np.ndarray: ... - @property - def size(self) -> int: ... - def __len__(self) -> int: ... - def __getitem__(self, key): ... - def __setitem__(self, key: Union[int, Sequence[int], Sequence[bool], slice], value) -> None: ... # type: ignore[override] - def astype(self, dtype, copy: bool = ...): ... - def view(self, dtype=...): ... - def unique(self): ... - def take(self, indices, allow_fill: bool = ..., fill_value=...): ... - def copy(self): ... - def shift(self, periods: int = ..., fill_value=..., axis: int = ...): ... - def searchsorted(self, value, side: str = ..., sorter=...): ... - def repeat(self, repeats, *args, **kwargs): ... - def value_counts(self, dropna: bool = ...): ... - def map(self, mapper): ... - def isna(self): ... - def fillna(self, value=..., method=..., limit=...): ... - @property - def freq(self): ... - @freq.setter - def freq(self, value) -> None: ... - @property - def freqstr(self): ... - @property - def inferred_freq(self): ... - @property - def resolution(self): ... - __pow__ = ... - __rpow__ = ... - __mul__ = ... - __rmul__ = ... - __truediv__ = ... - __rtruediv__ = ... - __floordiv__ = ... - __rfloordiv__ = ... - __mod__ = ... - __rmod__ = ... - __divmod__ = ... - __rdivmod__ = ... - def __add__(self, other): ... - def __radd__(self, other): ... - def __sub__(self, other): ... - def __rsub__(self, other): ... - def __iadd__(self, other): ... - def __isub__(self, other): ... - def min(self, axis=..., skipna: bool = ..., *args, **kwargs): ... - def max(self, axis=..., skipna: bool = ..., *args, **kwargs): ... - def mean(self, skipna: bool = ...): ... - -def validate_periods(periods): ... -def validate_endpoints(closed): ... -def validate_inferred_freq(freq, inferred_freq, freq_infer): ... -def maybe_infer_freq(freq): ... diff --git a/partial/pandas/core/arrays/datetimes.pyi b/partial/pandas/core/arrays/datetimes.pyi deleted file mode 100644 index 198c7ef..0000000 --- a/partial/pandas/core/arrays/datetimes.pyi +++ /dev/null @@ -1,72 +0,0 @@ -import numpy as np -from pandas.core.arrays import datetimelike as dtl -from pandas.core.dtypes.dtypes import DatetimeTZDtype as DatetimeTZDtype -from typing import Union - -def tz_to_dtype(tz): ... - -class DatetimeArray(dtl.DatetimeLikeArrayMixin, dtl.TimelikeOps, dtl.DatelikeOps): - __array_priority__: int = ... - def __init__(self, values, dtype=..., freq=..., copy: bool = ...) -> None: ... - # ignore in dtype() is from the pandas source - @property - def dtype(self) -> Union[np.dtype, DatetimeTZDtype]: ... # type: ignore[override] - @property - def tz(self): ... - @tz.setter - def tz(self, value) -> None: ... - @property - def tzinfo(self): ... - @property - def is_normalized(self): ... - def __array__(self, dtype=...) -> np.ndarray: ... - def __iter__(self): ... - def astype(self, dtype, copy: bool = ...): ... - def tz_convert(self, tz): ... - def tz_localize(self, tz, ambiguous: str = ..., nonexistent: str = ...): ... - def to_pydatetime(self): ... - def normalize(self): ... - def to_period(self, freq=...): ... - def to_perioddelta(self, freq): ... - def month_name(self, locale=...): ... - def day_name(self, locale=...): ... - @property - def time(self): ... - @property - def timetz(self): ... - @property - def date(self): ... - year = ... - month = ... - day = ... - hour = ... - minute = ... - second = ... - microsecond = ... - nanosecond = ... - weekofyear = ... - week = ... - dayofweek = ... - weekday = ... - dayofyear = ... - quarter = ... - days_in_month = ... - daysinmonth = ... - is_month_start = ... - is_month_end = ... - is_quarter_start = ... - is_quarter_end = ... - is_year_start = ... - is_year_end = ... - is_leap_year = ... - def to_julian_date(self): ... - -def sequence_to_dt64ns( - data, dtype=..., copy: bool = ..., tz=..., dayfirst: bool = ..., yearfirst: bool = ..., ambiguous: str = ... -): ... -def objects_to_datetime64ns( - data, dayfirst, yearfirst, utc: bool = ..., errors: str = ..., require_iso8601: bool = ..., allow_object: bool = ... -): ... -def maybe_convert_dtype(data, copy): ... -def maybe_infer_tz(tz, inferred_tz): ... -def validate_tz_from_dtype(dtype, tz): ... diff --git a/partial/pandas/core/arrays/integer.pyi b/partial/pandas/core/arrays/integer.pyi deleted file mode 100644 index bac9f6a..0000000 --- a/partial/pandas/core/arrays/integer.pyi +++ /dev/null @@ -1,52 +0,0 @@ -from .masked import BaseMaskedArray as BaseMaskedArray -from pandas.core.dtypes.base import ExtensionDtype as ExtensionDtype -from typing import Type - -class _IntegerDtype(ExtensionDtype): - name: str - base = ... - type: Type - na_value = ... - def is_signed_integer(self): ... - def is_unsigned_integer(self): ... - def numpy_dtype(self): ... - def kind(self): ... - def itemsize(self): ... - @classmethod - def construct_array_type(cls): ... - def __from_arrow__(self, array): ... - -def integer_array(values, dtype = ..., copy: bool = ...): ... -def safe_cast(values, dtype, copy): ... -def coerce_to_array(values, dtype, mask = ..., copy: bool = ...): ... - -class IntegerArray(BaseMaskedArray): - def dtype(self): ... - def __init__(self, values, mask, copy: bool = ...) -> None: ... - def __array_ufunc__(self, ufunc, method, *inputs, **kwargs): ... - def __setitem__(self, key, value) -> None: ... - def astype(self, dtype, copy: bool = ...): ... - -class Int8Dtype: - ... - -class Int16Dtype: - ... - -class Int32Dtype: - ... - -class Int64Dtype: - ... - -class UInt8Dtype: - ... - -class UInt16Dtype: - ... - -class UInt32Dtype: - ... - -class UInt64Dtype: - ... diff --git a/partial/pandas/core/arrays/interval.pyi b/partial/pandas/core/arrays/interval.pyi deleted file mode 100644 index 7e27ef4..0000000 --- a/partial/pandas/core/arrays/interval.pyi +++ /dev/null @@ -1,61 +0,0 @@ -from __future__ import annotations -import numpy as np -from pandas._libs.interval import ( - Interval as Interval, - IntervalMixin as IntervalMixin, -) -from pandas.core.arrays.base import ExtensionArray as ExtensionArray -from pandas.core.dtypes.generic import ABCExtensionArray as ABCExtensionArray -from pandas._typing import Axis, Scalar, Index as Index -from typing import Optional - -class IntervalArray(IntervalMixin, ExtensionArray): - ndim: int = ... - can_hold_na: bool = ... - def __new__(cls, data, closed=..., dtype=..., copy: bool = ..., verify_integrity: bool = ...): ... - @classmethod - def from_breaks(cls, breaks, closed: str = ..., copy: bool = ..., dtype=...): ... - @classmethod - def from_arrays(cls, left, right, closed: str = ..., copy: bool = ..., dtype=...): ... - @classmethod - def from_tuples(cls, data, closed: str = ..., copy: bool = ..., dtype=...): ... - def __iter__(self): ... - def __len__(self) -> int: ... - def __getitem__(self, value): ... - def __setitem__(self, key, value) -> None: ... - def __eq__(self, other): ... - def __ne__(self, other): ... - def fillna(self, value=..., method=..., limit=...): ... - @property - def dtype(self): ... - def astype(self, dtype, copy: bool = ...): ... - def copy(self): ... - def isna(self): ... - @property - def nbytes(self) -> int: ... - @property - def size(self) -> int: ... - def shift(self, periods: int = ..., fill_value: object = ...) -> ABCExtensionArray: ... - def take(self, indices, allow_fill: bool = ..., fill_value=..., axis=..., **kwargs): ... - def value_counts(self, dropna: bool = ...): ... - @property - def left(self) -> Index: ... - @property - def right(self) -> Index: ... - @property - def closed(self) -> bool: ... - def set_closed(self, closed): ... - @property - def length(self) -> Index: ... - @property - def mid(self) -> Index: ... - @property - def is_non_overlapping_monotonic(self) -> bool: ... - def __array__(self, dtype=...) -> np.ndarray: ... - def __arrow_array__(self, type=...): ... - def to_tuples(self, na_tuple: bool = ...): ... - def repeat(self, repeats, axis: Optional[Axis] = ...): ... - def contains(self, other): ... - def overlaps(self, other: Interval) -> bool: ... - -def maybe_convert_platform_interval(values): ... diff --git a/partial/pandas/core/arrays/masked.pyi b/partial/pandas/core/arrays/masked.pyi deleted file mode 100644 index 114eef7..0000000 --- a/partial/pandas/core/arrays/masked.pyi +++ /dev/null @@ -1,19 +0,0 @@ -import numpy as np -from pandas._typing import Scalar as Scalar -from pandas.core.arrays import ExtensionArray as ExtensionArray, ExtensionOpsMixin as ExtensionOpsMixin - -class BaseMaskedArray(ExtensionArray, ExtensionOpsMixin): - def __getitem__(self, item): ... - def __iter__(self) : ... - def __len__(self) -> int: ... - def __invert__(self): ... - def to_numpy(self, dtype=..., copy=..., na_value: Scalar=...) : ... - __array_priority__: int = ... - def __array__(self, dtype=...) -> np.ndarray: ... - def __arrow_array__(self, type = ...): ... - def isna(self): ... - @property - def nbytes(self) -> int: ... - def take(self, indexer, allow_fill: bool = ..., fill_value = ...): ... - def copy(self): ... - def value_counts(self, dropna: bool = ...): ... diff --git a/partial/pandas/core/arrays/numpy_.pyi b/partial/pandas/core/arrays/numpy_.pyi deleted file mode 100644 index 2f1653a..0000000 --- a/partial/pandas/core/arrays/numpy_.pyi +++ /dev/null @@ -1,56 +0,0 @@ -import numpy as np -from numpy.lib.mixins import NDArrayOperatorsMixin -from pandas.core.arrays.base import ExtensionArray as ExtensionArray, ExtensionOpsMixin as ExtensionOpsMixin -from pandas.core.dtypes.dtypes import ExtensionDtype as ExtensionDtype -from typing import Union - -class PandasDtype(ExtensionDtype): - def __init__(self, dtype) -> None: ... - @property - def numpy_dtype(self): ... - @property - def name(self): ... - @property - def type(self): ... - @classmethod - def construct_from_string(cls, string): ... - @classmethod - def construct_array_type(cls): ... - @property - def kind(self): ... - @property - def itemsize(self): ... - -class PandasArray(ExtensionArray, ExtensionOpsMixin, NDArrayOperatorsMixin): - __array_priority__: int = ... - def __init__(self, values: Union[np.ndarray, PandasArray], copy: bool=...) -> None: ... - @property - def dtype(self): ... - def __array__(self, dtype=...) -> np.ndarray: ... - def __array_ufunc__(self, ufunc, method, *inputs, **kwargs): ... - def __getitem__(self, item): ... - def __setitem__(self, key, value) -> None: ... - def __len__(self) -> int: ... - @property - def nbytes(self) -> int: ... - def isna(self): ... - def fillna(self, value = ..., method = ..., limit = ...): ... - def take(self, indices, allow_fill: bool = ..., fill_value = ...): ... - def copy(self): ... - def unique(self): ... - def any(self, axis = ..., out = ..., keepdims: bool = ..., skipna: bool = ...): ... - def all(self, axis = ..., out = ..., keepdims: bool = ..., skipna: bool = ...): ... - def min(self, axis = ..., out = ..., keepdims: bool = ..., skipna: bool = ...): ... - def max(self, axis = ..., out = ..., keepdims: bool = ..., skipna: bool = ...): ... - def sum(self, axis = ..., dtype = ..., out = ..., keepdims: bool = ..., initial = ..., skipna: bool = ..., min_count: int = ...): ... - def prod(self, axis = ..., dtype = ..., out = ..., keepdims: bool = ..., initial = ..., skipna: bool = ..., min_count: int = ...): ... - def mean(self, axis = ..., dtype = ..., out = ..., keepdims: bool = ..., skipna: bool = ...): ... - def median(self, axis = ..., out = ..., overwrite_input: bool = ..., keepdims: bool = ..., skipna: bool = ...): ... - def std(self, axis = ..., dtype = ..., out = ..., ddof: int = ..., keepdims: bool = ..., skipna: bool = ...): ... - def var(self, axis = ..., dtype = ..., out = ..., ddof: int = ..., keepdims: bool = ..., skipna: bool = ...): ... - def sem(self, axis = ..., dtype = ..., out = ..., ddof: int = ..., keepdims: bool = ..., skipna: bool = ...): ... - def kurt(self, axis = ..., dtype = ..., out = ..., keepdims: bool = ..., skipna: bool = ...): ... - def skew(self, axis = ..., dtype = ..., out = ..., keepdims: bool = ..., skipna: bool = ...): ... - def to_numpy(self, dtype = ..., copy: bool = ..., na_value = ...): ... - def searchsorted(self, value, side: str = ..., sorter = ...): ... - def __invert__(self): ... diff --git a/partial/pandas/core/arrays/period.pyi b/partial/pandas/core/arrays/period.pyi deleted file mode 100644 index c30b0f5..0000000 --- a/partial/pandas/core/arrays/period.pyi +++ /dev/null @@ -1,43 +0,0 @@ -import numpy as np -from pandas._libs.tslibs import Timestamp -from pandas._libs.tslibs.period import Period as Period -from pandas.core.arrays import datetimelike as dtl -from pandas.tseries.offsets import Tick as Tick -from typing import Optional, Sequence, Union - -class PeriodArray(dtl.DatetimeLikeArrayMixin, dtl.DatelikeOps): - __array_priority__: int = ... - def __init__(self, values, freq = ..., dtype = ..., copy: bool = ...) -> None: ... - def dtype(self): ... - def __array__(self, dtype=...) -> np.ndarray: ... - def __arrow_array__(self, type = ...): ... - year: int = ... - month: int = ... - day: int = ... - hour: int = ... - minute: int = ... - second: int = ... - weekofyear: int = ... - week: int = ... - dayofweek: int = ... - weekday: int = ... - dayofyear: int = ... - day_of_year = ... - quarter: int = ... - qyear: int = ... - days_in_month: int = ... - daysinmonth: int = ... - @property - def is_leap_year(self) -> bool: ... - @property - def start_time(self) -> Timestamp: ... - @property - def end_time(self) -> Timestamp: ... - def to_timestamp(self, freq: Optional[str] = ..., how: str = ...) -> Timestamp: ... - def asfreq(self, freq: Optional[str] = ..., how: str = ...) -> Period: ... - def astype(self, dtype, copy: bool = ...): ... - -def raise_on_incompatible(left, right): ... -def period_array(data: Sequence[Optional[Period]], freq: Optional[Union[str, Tick]]=..., copy: bool=...) -> PeriodArray: ... -def validate_dtype_freq(dtype, freq): ... -def dt64arr_to_periodarr(data, freq, tz = ...): ... diff --git a/partial/pandas/core/arrays/sparse/__init__.pyi b/partial/pandas/core/arrays/sparse/__init__.pyi deleted file mode 100644 index 1195daa..0000000 --- a/partial/pandas/core/arrays/sparse/__init__.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from .accessor import SparseAccessor as SparseAccessor, SparseFrameAccessor as SparseFrameAccessor -from .array import BlockIndex as BlockIndex, IntIndex as IntIndex, SparseArray as SparseArray -from .dtype import SparseDtype as SparseDtype diff --git a/partial/pandas/core/arrays/sparse/accessor.pyi b/partial/pandas/core/arrays/sparse/accessor.pyi deleted file mode 100644 index bad4cbf..0000000 --- a/partial/pandas/core/arrays/sparse/accessor.pyi +++ /dev/null @@ -1,22 +0,0 @@ -from pandas.compat._optional import import_optional_dependency as import_optional_dependency -from pandas.core.accessor import PandasDelegate as PandasDelegate, delegate_names as delegate_names -from pandas.core.arrays.sparse.array import SparseArray as SparseArray -from pandas.core.arrays.sparse.dtype import SparseDtype as SparseDtype -from pandas.core.dtypes.cast import find_common_type as find_common_type - -class BaseAccessor: - def __init__(self, data = ...) -> None: ... - -class SparseAccessor(BaseAccessor, PandasDelegate): - @classmethod - def from_coo(cls, A, dense_index: bool = ...): ... - def to_coo(self, row_levels = ..., column_levels = ..., sort_labels: bool = ...): ... - def to_dense(self): ... - -class SparseFrameAccessor(BaseAccessor, PandasDelegate): - @classmethod - def from_spmatrix(cls, data, index = ..., columns = ...): ... - def to_dense(self): ... - def to_coo(self): ... - @property - def density(self) -> float: ... diff --git a/partial/pandas/core/arrays/sparse/array.pyi b/partial/pandas/core/arrays/sparse/array.pyi deleted file mode 100644 index fe52eb4..0000000 --- a/partial/pandas/core/arrays/sparse/array.pyi +++ /dev/null @@ -1,84 +0,0 @@ -import numpy as np -from pandas._libs.sparse import BlockIndex as BlockIndex, IntIndex as IntIndex, SparseIndex as SparseIndex -from pandas._libs.tslibs import NaT as NaT -from pandas.core.arrays import ExtensionArray as ExtensionArray, ExtensionOpsMixin as ExtensionOpsMixin -from pandas.core.arrays.sparse.dtype import SparseDtype as SparseDtype -from pandas.core.base import PandasObject as PandasObject -from pandas.core.construction import sanitize_array as sanitize_array -from pandas.core.dtypes.cast import ( - astype_nansafe as astype_nansafe, - construct_1d_arraylike_from_scalar as construct_1d_arraylike_from_scalar, - find_common_type as find_common_type, - infer_dtype_from_scalar as infer_dtype_from_scalar, -) -from pandas.core.dtypes.common import ( - is_array_like as is_array_like, - is_bool_dtype as is_bool_dtype, - is_datetime64_any_dtype as is_datetime64_any_dtype, - is_dtype_equal as is_dtype_equal, - is_integer as is_integer, - is_object_dtype as is_object_dtype, - is_scalar as is_scalar, - is_string_dtype as is_string_dtype, - pandas_dtype as pandas_dtype, -) -from pandas.core.dtypes.generic import ABCIndexClass as ABCIndexClass, ABCSeries as ABCSeries, ABCSparseArray as ABCSparseArray -from pandas.core.dtypes.missing import isna as isna, na_value_for_dtype as na_value_for_dtype, notna as notna -from pandas.core.indexers import check_array_indexer as check_array_indexer -from pandas.core.missing import interpolate_2d as interpolate_2d -from pandas.core.ops.common import unpack_zerodim_and_defer as unpack_zerodim_and_defer -from pandas.errors import PerformanceWarning as PerformanceWarning - -class SparseArray(PandasObject, ExtensionArray, ExtensionOpsMixin): - def __init__( - self, data, sparse_index=..., index=..., fill_value=..., kind: str = ..., dtype=..., copy: bool = ... - ) -> None: ... - @classmethod - def from_spmatrix(cls, data): ... - def __array__(self, dtype=..., copy=...) -> np.ndarray: ... - def __setitem__(self, key, value) -> None: ... - @property - def sp_index(self): ... - @property - def sp_values(self): ... - @property - def dtype(self): ... - @property - def fill_value(self): ... - @fill_value.setter - def fill_value(self, value) -> None: ... - @property - def kind(self) -> str: ... - def __len__(self) -> int: ... - @property - def nbytes(self) -> int: ... - @property - def density(self): ... - @property - def npoints(self) -> int: ... - def isna(self): ... - def fillna(self, value=..., method=..., limit=...): ... - def shift(self, periods: int = ..., fill_value=...): ... - def unique(self): ... - def factorize(self, na_sentinel: int = ...): ... - def value_counts(self, dropna: bool = ...): ... - def __getitem__(self, key): ... - def take(self, indices, allow_fill: bool = ..., fill_value=...): ... - def searchsorted(self, v, side: str = ..., sorter=...): ... - def copy(self): ... - def astype(self, dtype=..., copy: bool = ...): ... - def map(self, mapper): ... - def to_dense(self): ... - def nonzero(self): ... - def all(self, axis=..., *args, **kwargs): ... - def any(self, axis: int = ..., *args, **kwargs): ... - def sum(self, axis: int = ..., *args, **kwargs): ... - def cumsum(self, axis: int = ..., *args, **kwargs): ... - def mean(self, axis: int = ..., *args, **kwargs): ... - def transpose(self, *axes): ... - @property - def T(self): ... - def __array_ufunc__(self, ufunc, method, *inputs, **kwargs): ... - def __abs__(self): ... - -def make_sparse(arr, kind: str = ..., fill_value=..., dtype=..., copy: bool = ...): ... diff --git a/partial/pandas/core/arrays/sparse/dtype.pyi b/partial/pandas/core/arrays/sparse/dtype.pyi deleted file mode 100644 index 674ea09..0000000 --- a/partial/pandas/core/arrays/sparse/dtype.pyi +++ /dev/null @@ -1,31 +0,0 @@ -# merged types from pylance - -from pandas._typing import Dtype as Dtype, Scalar -from pandas.core.dtypes.base import ExtensionDtype as ExtensionDtype -from pandas.core.dtypes.cast import astype_nansafe as astype_nansafe -from pandas.core.dtypes.common import is_bool_dtype as is_bool_dtype, is_object_dtype as is_object_dtype, is_scalar as is_scalar, is_string_dtype as is_string_dtype, pandas_dtype as pandas_dtype -from pandas.core.dtypes.dtypes import register_extension_dtype as register_extension_dtype -from pandas.core.dtypes.missing import isna as isna, na_value_for_dtype as na_value_for_dtype -from typing import Optional - -class SparseDtype(ExtensionDtype): - def __init__(self, dtype: Dtype=..., fill_value: Optional[Scalar]=...) -> None: ... - def __hash__(self) : ... - def __eq__(self, other) -> bool: ... - @property - def fill_value(self): ... - @property - def kind(self): ... - @property - def type(self): ... - @property - def subtype(self): ... - @property - def name(self): ... - @classmethod - def construct_array_type(cls): ... - @classmethod - def construct_from_string(cls, string): ... - @classmethod - def is_dtype(cls, dtype): ... - def update_dtype(self, dtype): ... diff --git a/partial/pandas/core/arrays/sparse/scipy_sparse.pyi b/partial/pandas/core/arrays/sparse/scipy_sparse.pyi deleted file mode 100644 index c6fc6b1..0000000 --- a/partial/pandas/core/arrays/sparse/scipy_sparse.pyi +++ /dev/null @@ -1,2 +0,0 @@ -from pandas.core.indexes.api import Index as Index, MultiIndex as MultiIndex -from pandas.core.series import Series as Series diff --git a/partial/pandas/core/arrays/string_.pyi b/partial/pandas/core/arrays/string_.pyi deleted file mode 100644 index a6b0b4d..0000000 --- a/partial/pandas/core/arrays/string_.pyi +++ /dev/null @@ -1,20 +0,0 @@ -from pandas.core.arrays import PandasArray as PandasArray -from pandas.core.dtypes.base import ExtensionDtype as ExtensionDtype -from typing import Type - -class StringDtype(ExtensionDtype): - name: str = ... - na_value = ... - @property - def type(self) -> Type: ... - @classmethod - def construct_array_type(cls) -> Type[StringArray]: ... - def __from_arrow__(self, array): ... - -class StringArray(PandasArray): - def __init__(self, values, copy: bool = ...) -> None: ... - def __arrow_array__(self, type = ...): ... - def __setitem__(self, key, value) -> None: ... - def fillna(self, value = ..., method = ..., limit = ...): ... - def astype(self, dtype, copy: bool = ...): ... - def value_counts(self, dropna: bool = ...): ... diff --git a/partial/pandas/core/arrays/timedeltas.pyi b/partial/pandas/core/arrays/timedeltas.pyi deleted file mode 100644 index 822e3b9..0000000 --- a/partial/pandas/core/arrays/timedeltas.pyi +++ /dev/null @@ -1,38 +0,0 @@ -from datetime import timedelta -from pandas.core.arrays import datetimelike as dtl -from typing import Sequence - -class TimedeltaArray(dtl.DatetimeLikeArrayMixin, dtl.TimelikeOps): - __array_priority__: int = ... - @property - def dtype(self): ... - def __init__(self, values, dtype = ..., freq = ..., copy: bool = ...) -> None: ... - def astype(self, dtype, copy: bool = ...): ... - def sum(self, axis=..., dtype=..., out=..., keepdims: bool=..., initial=..., skipna: bool=..., min_count: int=...) : ... - def std(self, axis=..., dtype=..., out=..., ddof: int=..., keepdims: bool=..., skipna: bool=...) : ... - def median(self, axis=..., out=..., overwrite_input: bool=..., keepdims: bool=..., skipna: bool=...) : ... - def __mul__(self, other): ... - __rmul__ = ... - def __truediv__(self, other): ... - def __rtruediv__(self, other): ... - def __floordiv__(self, other): ... - def __rfloordiv__(self, other): ... - def __mod__(self, other): ... - def __rmod__(self, other): ... - def __divmod__(self, other): ... - def __rdivmod__(self, other): ... - def __neg__(self): ... - def __pos__(self): ... - def __abs__(self): ... - def total_seconds(self) -> int: ... - def to_pytimedelta(self) -> Sequence[timedelta]: ... - days: int = ... - seconds: int = ... - microseconds: int = ... - nanoseconds: int = ... - @property - def components(self) -> int: ... - -def sequence_to_td64ns(data, copy: bool = ..., unit: str = ..., errors: str = ...): ... -def ints_to_td64ns(data, unit: str = ...): ... -def objects_to_td64ns(data, unit: str = ..., errors: str = ...): ... diff --git a/partial/pandas/core/base.pyi b/partial/pandas/core/base.pyi deleted file mode 100644 index 42295ed..0000000 --- a/partial/pandas/core/base.pyi +++ /dev/null @@ -1,77 +0,0 @@ -from __future__ import annotations -import numpy as np - -from pandas.core.arrays.categorical import Categorical -from pandas._typing import ( - Scalar, - SeriesAxisType, - T1 as T1, - np_ndarray_int64, - np_ndarray_str, - Index as Index, - Series as Series, - DataFrame as DataFrame, -) - -from pandas.core.accessor import DirNamesMixin as DirNamesMixin -from pandas.core.arrays import ExtensionArray as ExtensionArray -from typing import Callable, Generic, List, Literal, Optional, Tuple, Union, overload - -class PandasObject(DirNamesMixin): - def __sizeof__(self) -> int: ... - -class NoNewAttributesMixin: - def __setattr__(self, key, value) -> None: ... - -class GroupByError(Exception): ... -class DataError(GroupByError): ... -class SpecificationError(GroupByError): ... - -class SelectionMixin: - def ndim(self) -> int: ... - def __getitem__(self, key): ... - def aggregate(self, func: Optional[Callable] = ..., *args, **kwargs) -> Union[Scalar, Series, DataFrame]: ... - agg = aggregate - -class ShallowMixin: ... - -class IndexOpsMixin: - __array_priority__: int = ... - def transpose(self, *args, **kwargs) -> IndexOpsMixin: ... - @property - def T(self) -> IndexOpsMixin: ... - @property - def shape(self) -> tuple: ... - @property - def ndim(self) -> int: ... - def item(self): ... - @property - def nbytes(self) -> int: ... - @property - def size(self) -> int: ... - @property - def array(self) -> ExtensionArray: ... - def to_numpy(self) -> np.ndarray: ... - @property - def empty(self) -> bool: ... - def max(self, axis=..., skipna: bool = ..., **kwargs): ... - def min(self, axis=..., skipna: bool = ..., **kwargs): ... - def argmax(self, axis: Optional[SeriesAxisType] = ..., skipna: bool = ..., *args, **kwargs) -> np.ndarray: ... - def argmin(self, axis: Optional[SeriesAxisType] = ..., skipna: bool = ..., *args, **kwargs) -> np.ndarray: ... - def tolist(self) -> List: ... - def to_list(self) -> List: ... - def __iter__(self): ... - def hasnans(self) -> bool: ... - def value_counts(self, normalize: bool = ..., sort: bool = ..., ascending: bool = ..., bins=..., dropna: bool = ...): ... - def nunique(self, dropna: bool = ...) -> int: ... - @property - def is_unique(self) -> bool: ... - @property - def is_monotonic(self) -> bool: ... - @property - def is_monotonic_decreasing(self) -> bool: ... - @property - def is_monotonic_increasing(self) -> bool: ... - def factorize(self, sort: bool = ..., na_sentinel: int = ...) -> Tuple[np.ndarray, Union[np.ndarray, Index, Categorical]]: ... - def searchsorted(self, value, side: str = ..., sorter=...) -> Union[int, List[int]]: ... - def drop_duplicates(self, keep: Literal["first", "last", False] = ...) -> IndexOpsMixin: ... diff --git a/partial/pandas/core/computation/align.pyi b/partial/pandas/core/computation/align.pyi deleted file mode 100644 index 47830ca..0000000 --- a/partial/pandas/core/computation/align.pyi +++ /dev/null @@ -1,2 +0,0 @@ -def align_terms(terms): ... -def reconstruct_object(typ, obj, axes, dtype): ... diff --git a/partial/pandas/core/computation/common.pyi b/partial/pandas/core/computation/common.pyi deleted file mode 100644 index 1b9ef7e..0000000 --- a/partial/pandas/core/computation/common.pyi +++ /dev/null @@ -1,3 +0,0 @@ -def result_type_many(*arrays_and_dtypes): ... - -class NameResolutionError(NameError): ... diff --git a/partial/pandas/core/computation/engines.pyi b/partial/pandas/core/computation/engines.pyi deleted file mode 100644 index 9df5876..0000000 --- a/partial/pandas/core/computation/engines.pyi +++ /dev/null @@ -1,19 +0,0 @@ -import abc - -class NumExprClobberingError(NameError): ... - -class AbstractEngine(metaclass=abc.ABCMeta): - has_neg_frac: bool = ... - expr = ... - aligned_axes = ... - result_type = ... - def __init__(self, expr) -> None: ... - def convert(self) -> str: ... - def evaluate(self) -> object: ... - -class NumExprEngine(AbstractEngine): - has_neg_frac: bool = ... - -class PythonEngine(AbstractEngine): - has_neg_frac: bool = ... - def evaluate(self): ... diff --git a/partial/pandas/core/computation/expressions.pyi b/partial/pandas/core/computation/expressions.pyi deleted file mode 100644 index 90d1243..0000000 --- a/partial/pandas/core/computation/expressions.pyi +++ /dev/null @@ -1,6 +0,0 @@ -def set_use_numexpr(v: bool = ...) -> None: ... -def set_numexpr_threads(n=...) -> None: ... -def evaluate(op, op_str, a, b, use_numexpr: bool = ...): ... -def where(cond, a, b, use_numexpr: bool = ...): ... -def set_test_mode(v: bool = ...) -> None: ... -def get_test_result(): ... diff --git a/partial/pandas/core/computation/parsing.pyi b/partial/pandas/core/computation/parsing.pyi deleted file mode 100644 index 1020ba4..0000000 --- a/partial/pandas/core/computation/parsing.pyi +++ /dev/null @@ -1,12 +0,0 @@ -import tokenize -from typing import Iterator, Tuple - -BACKTICK_QUOTED_STRING: int - -def create_valid_python_identifier(name: str) -> str: ... -def clean_backtick_quoted_toks(tok: Tuple[int, str]) -> Tuple[int, str]: ... -def clean_column_name(name: str) -> str: ... -def tokenize_backtick_quoted_string( - token_generator: Iterator[tokenize.TokenInfo], source: str, string_start: int -) -> Tuple[int, str]: ... -def tokenize_string(source: str) -> Iterator[Tuple[int, str]]: ... diff --git a/partial/pandas/core/config_init.pyi b/partial/pandas/core/config_init.pyi deleted file mode 100644 index 773f3f6..0000000 --- a/partial/pandas/core/config_init.pyi +++ /dev/null @@ -1,62 +0,0 @@ -use_bottleneck_doc: str = ... - -def use_bottleneck_cb(key) -> None: ... - -use_numexpr_doc: str = ... - -def use_numexpr_cb(key) -> None: ... - -pc_precision_doc: str = ... -pc_colspace_doc: str = ... -pc_max_rows_doc: str = ... -pc_min_rows_doc: str = ... -pc_max_cols_doc: str = ... -pc_max_categories_doc: str = ... -pc_max_info_cols_doc: str = ... -pc_nb_repr_h_doc: str = ... -pc_pprint_nest_depth: str = ... -pc_multi_sparse_doc: str = ... -float_format_doc: str = ... -max_colwidth_doc: str = ... -colheader_justify_doc: str = ... -pc_expand_repr_doc: str = ... -pc_show_dimensions_doc: str = ... -pc_east_asian_width_doc: str = ... -pc_ambiguous_as_wide_doc: str = ... -pc_latex_repr_doc: str = ... -pc_table_schema_doc: str = ... -pc_html_border_doc: str = ... -pc_html_use_mathjax_doc: str = ... -pc_width_doc: str = ... -pc_chop_threshold_doc: str = ... -pc_max_seq_items: str = ... -pc_max_info_rows_doc: str = ... -pc_large_repr_doc: str = ... -pc_memory_usage_doc: str = ... -pc_latex_escape: str = ... -pc_latex_longtable: str = ... -pc_latex_multicolumn: str = ... -pc_latex_multicolumn_format: str = ... -pc_latex_multirow: str = ... - -def table_schema_cb(key) -> None: ... -def is_terminal() -> bool: ... - -max_cols: int = ... -tc_sim_interactive_doc: str = ... -use_inf_as_null_doc: str = ... -use_inf_as_na_doc: str = ... - -def use_inf_as_na_cb(key) -> None: ... - -chained_assignment: str = ... -reader_engine_doc: str = ... -writer_engine_doc: str = ... -parquet_engine_doc: str = ... -plotting_backend_doc: str = ... - -def register_plotting_backend_cb(key) -> None: ... - -register_converter_doc: str = ... - -def register_converter_cb(key) -> None: ... diff --git a/partial/pandas/core/dtypes/__init__.pyi b/partial/pandas/core/dtypes/__init__.pyi deleted file mode 100644 index e69de29..0000000 diff --git a/partial/pandas/core/dtypes/api.pyi b/partial/pandas/core/dtypes/api.pyi deleted file mode 100644 index 01e826e..0000000 --- a/partial/pandas/core/dtypes/api.pyi +++ /dev/null @@ -1,42 +0,0 @@ -from pandas.core.dtypes.common import ( - is_array_like as is_array_like, - is_bool as is_bool, - is_bool_dtype as is_bool_dtype, - is_categorical as is_categorical, - is_categorical_dtype as is_categorical_dtype, - is_complex as is_complex, - is_complex_dtype as is_complex_dtype, - is_datetime64_any_dtype as is_datetime64_any_dtype, - is_datetime64_dtype as is_datetime64_dtype, - is_datetime64_ns_dtype as is_datetime64_ns_dtype, - is_datetime64tz_dtype as is_datetime64tz_dtype, - is_dict_like as is_dict_like, - is_dtype_equal as is_dtype_equal, - is_extension_array_dtype as is_extension_array_dtype, - is_extension_type as is_extension_type, - is_file_like as is_file_like, - is_float as is_float, - is_float_dtype as is_float_dtype, - is_hashable as is_hashable, - is_int64_dtype as is_int64_dtype, - is_integer as is_integer, - is_integer_dtype as is_integer_dtype, - is_interval as is_interval, - is_interval_dtype as is_interval_dtype, - is_iterator as is_iterator, - is_list_like as is_list_like, - is_named_tuple as is_named_tuple, - is_number as is_number, - is_numeric_dtype as is_numeric_dtype, - is_object_dtype as is_object_dtype, - is_period_dtype as is_period_dtype, - is_re as is_re, - is_re_compilable as is_re_compilable, - is_scalar as is_scalar, - is_signed_integer_dtype as is_signed_integer_dtype, - is_sparse as is_sparse, - is_string_dtype as is_string_dtype, - is_timedelta64_dtype as is_timedelta64_dtype, - is_timedelta64_ns_dtype as is_timedelta64_ns_dtype, - is_unsigned_integer_dtype as is_unsigned_integer_dtype, - pandas_dtype as pandas_dtype) diff --git a/partial/pandas/core/dtypes/base.pyi b/partial/pandas/core/dtypes/base.pyi deleted file mode 100644 index 0b0d5e8..0000000 --- a/partial/pandas/core/dtypes/base.pyi +++ /dev/null @@ -1,23 +0,0 @@ -from typing import List, Optional, Type -from pandas._typing import ExtensionArray - -class ExtensionDtype: - def __eq__(self, other) -> bool: ... - def __hash__(self) -> int: ... - def __ne__(self, other) -> bool: ... - @property - def na_value(self): ... - @property - def type(self) -> Type: ... - @property - def kind(self) -> str: ... - @property - def name(self) -> str: ... - @property - def names(self) -> Optional[List[str]]: ... - @classmethod - def construct_array_type(cls) -> Type[ExtensionArray]: ... - @classmethod - def construct_from_string(cls, string: str): ... - @classmethod - def is_dtype(cls, dtype) -> bool: ... diff --git a/partial/pandas/core/dtypes/cast.pyi b/partial/pandas/core/dtypes/cast.pyi deleted file mode 100644 index 1a29920..0000000 --- a/partial/pandas/core/dtypes/cast.pyi +++ /dev/null @@ -1,30 +0,0 @@ -import numpy as np -from pandas._typing import Dtype as Dtype - -def maybe_convert_platform(values): ... -def is_nested_object(obj) -> bool: ... -def maybe_downcast_to_dtype(result, dtype): ... -def maybe_downcast_numeric(result, dtype, do_round: bool=...) : ... -def maybe_upcast_putmask(result: np.ndarray, mask: np.ndarray, other) : ... -def maybe_promote(dtype, fill_value = ...): ... -def infer_dtype_from(val, pandas_dtype: bool=...) : ... -def infer_dtype_from_scalar(val, pandas_dtype: bool=...) : ... -def infer_dtype_from_array(arr, pandas_dtype: bool=...) : ... -def maybe_infer_dtype_type(element): ... -def maybe_upcast(values, fill_value=..., dtype=..., copy: bool=...) : ... -def invalidate_string_dtypes(dtype_set) -> None: ... -def coerce_indexer_dtype(indexer, categories): ... -def coerce_to_dtypes(result, dtypes): ... -def astype_nansafe(arr, dtype, copy: bool=..., skipna: bool=...) : ... -def maybe_convert_objects(values: np.ndarray, convert_numeric: bool=...) : ... -def soft_convert_objects(values: np.ndarray, datetime: bool=..., numeric: bool=..., timedelta: bool=..., coerce: bool=..., copy: bool=...) : ... -def convert_dtypes(input_array, convert_string: bool=..., convert_integer: bool=..., convert_boolean: bool=...) -> Dtype: ... -def maybe_castable(arr) -> bool: ... -def maybe_infer_to_datetimelike(value, convert_dates: bool=...) : ... -def maybe_cast_to_datetime(value, dtype, errors: str=...) : ... -def find_common_type(types): ... -def cast_scalar_to_array(shape, value, dtype = ...): ... -def construct_1d_arraylike_from_scalar(value, length: int, dtype) : ... -def construct_1d_object_array_from_listlike(values): ... -def construct_1d_ndarray_preserving_na(values, dtype=..., copy: bool=...) : ... -def maybe_cast_to_integer_array(arr, dtype, copy: bool=...) : ... diff --git a/partial/pandas/core/dtypes/common.pyi b/partial/pandas/core/dtypes/common.pyi deleted file mode 100644 index 4a06888..0000000 --- a/partial/pandas/core/dtypes/common.pyi +++ /dev/null @@ -1,75 +0,0 @@ -import numpy as np -from pandas._typing import ArrayLike as ArrayLike -from pandas.core.dtypes.inference import ( - is_array_like as is_array_like, - is_bool as is_bool, - is_complex as is_complex, - is_dict_like as is_dict_like, - is_file_like as is_file_like, - is_float as is_float, - is_hashable as is_hashable, - is_integer as is_integer, - is_interval as is_interval, - is_iterator as is_iterator, - is_list_like as is_list_like, - is_named_tuple as is_named_tuple, - is_number as is_number, - is_re as is_re, - is_re_compilable as is_re_compilable, - is_scalar as is_scalar, -) -from typing import Callable, Union - -ensure_float64 = ... -ensure_float32 = ... - -def ensure_float(arr): ... - -ensure_uint64 = ... -ensure_int64 = ... -ensure_int32 = ... -ensure_int16 = ... -ensure_int8 = ... -ensure_platform_int = ... -ensure_object = ... - -def ensure_str(value) -> str: ... -def ensure_categorical(arr): ... -def ensure_python_int(value: Union[int, np.integer]) -> int: ... -def classes(*klasses) -> Callable: ... -def classes_and_not_datetimelike(*klasses) -> Callable: ... -def is_object_dtype(arr_or_dtype) -> bool: ... -def is_sparse(arr) -> bool: ... -def is_scipy_sparse(arr) -> bool: ... -def is_categorical(arr) -> bool: ... -def is_datetime64_dtype(arr_or_dtype) -> bool: ... -def is_datetime64tz_dtype(arr_or_dtype) -> bool: ... -def is_timedelta64_dtype(arr_or_dtype) -> bool: ... -def is_period_dtype(arr_or_dtype) -> bool: ... -def is_interval_dtype(arr_or_dtype) -> bool: ... -def is_categorical_dtype(arr_or_dtype) -> bool: ... -def is_string_dtype(arr_or_dtype) -> bool: ... -def is_period_arraylike(arr) -> bool: ... -def is_datetime_arraylike(arr) -> bool: ... -def is_dtype_equal(source, target) -> bool: ... -def is_any_int_dtype(arr_or_dtype) -> bool: ... -def is_integer_dtype(arr_or_dtype) -> bool: ... -def is_signed_integer_dtype(arr_or_dtype) -> bool: ... -def is_unsigned_integer_dtype(arr_or_dtype) -> bool: ... -def is_int64_dtype(arr_or_dtype) -> bool: ... -def is_datetime64_any_dtype(arr_or_dtype) -> bool: ... -def is_datetime64_ns_dtype(arr_or_dtype) -> bool: ... -def is_timedelta64_ns_dtype(arr_or_dtype) -> bool: ... -def is_datetime_or_timedelta_dtype(arr_or_dtype) -> bool: ... -def is_numeric_v_string_like(a, b): ... -def is_datetimelike_v_numeric(a, b): ... -def needs_i8_conversion(arr_or_dtype) -> bool: ... -def is_numeric_dtype(arr_or_dtype) -> bool: ... -def is_string_like_dtype(arr_or_dtype) -> bool: ... -def is_float_dtype(arr_or_dtype) -> bool: ... -def is_bool_dtype(arr_or_dtype) -> bool: ... -def is_extension_type(arr) -> bool: ... -def is_extension_array_dtype(arr_or_dtype) -> bool: ... -def is_complex_dtype(arr_or_dtype) -> bool: ... -def infer_dtype_from_object(dtype): ... -def pandas_dtype(dtype): ... diff --git a/partial/pandas/core/dtypes/concat.pyi b/partial/pandas/core/dtypes/concat.pyi deleted file mode 100644 index e6f1bf4..0000000 --- a/partial/pandas/core/dtypes/concat.pyi +++ /dev/null @@ -1,5 +0,0 @@ -def get_dtype_kinds(l): ... -def concat_compat(to_concat, axis: int=...) : ... -def concat_categorical(to_concat, axis: int=...) : ... -def union_categoricals(to_union, sort_categories: bool=..., ignore_order: bool=...) : ... -def concat_datetime(to_concat, axis: int = ..., typs = ...): ... diff --git a/partial/pandas/core/dtypes/dtypes.pyi b/partial/pandas/core/dtypes/dtypes.pyi deleted file mode 100644 index 660e401..0000000 --- a/partial/pandas/core/dtypes/dtypes.pyi +++ /dev/null @@ -1,120 +0,0 @@ -from pandas._typing import Ordered as Ordered -from .base import ExtensionDtype as ExtensionDtype -from pandas._libs.tslibs import NaT as NaT, Period as Period, Timestamp as Timestamp # , timezones as timezones -from pandas.core.indexes.base import Index -from typing import Any, Optional, Sequence, Tuple, Type, Union - -_str = str - -def register_extension_dtype(cls: Type[ExtensionDtype]) -> Type[ExtensionDtype]: ... - -class Registry: - dtypes = ... - def __init__(self) -> None: ... - def register(self, dtype: Type[ExtensionDtype]) -> None: ... - def find(self, dtype: Union[Type[ExtensionDtype], str]) -> Optional[Type[ExtensionDtype]]: ... - -registry = ... - -class PandasExtensionDtype(ExtensionDtype): - subdtype = ... - str: Optional[_str] = ... - num: int = ... - shape: Tuple[int, ...] = ... - itemsize: int = ... - base = ... - isbuiltin: int = ... - isnative: int = ... - def __hash__(self) -> int: ... - @classmethod - def reset_cache(cls) -> None: ... - -class CategoricalDtypeType(type): ... - -class CategoricalDtype(PandasExtensionDtype, ExtensionDtype): - name: _str = ... - type: Type[CategoricalDtypeType] = ... - kind: _str = ... - str: _str = ... - base = ... - def __init__(self, categories: Optional[Sequence[Any]] = ..., ordered: Ordered = ...) -> None: ... - @classmethod - def construct_from_string(cls, string: _str) -> CategoricalDtype: ... - def __hash__(self) -> int: ... - def __eq__(self, other) -> bool: ... - @classmethod - def construct_array_type(cls): ... - @staticmethod - def validate_ordered(ordered: Ordered) -> None: ... - @staticmethod - def validate_categories(categories, fastpath: bool = ...): ... - def update_dtype(self, dtype: Union[_str, CategoricalDtype]) -> CategoricalDtype: ... - @property - def categories(self) -> Index: ... - @property - def ordered(self) -> Ordered: ... - -class DatetimeTZDtype(PandasExtensionDtype): - type: Type[Timestamp] = ... - kind: _str = ... - str: _str = ... - num: int = ... - base = ... - na_value = ... - def __init__(self, unit: _str = ..., tz=...) -> None: ... - @property - def unit(self): ... - @property - def tz(self): ... - @classmethod - def construct_array_type(cls): ... - @classmethod - def construct_from_string(cls, string: _str): ... - @property - def name(self) -> _str: ... - def __hash__(self) -> int: ... - def __eq__(self, other) -> bool: ... - -class PeriodDtype(PandasExtensionDtype): - type: Type[Period] = ... - kind: _str = ... - str: _str = ... - base = ... - num: int = ... - def __new__(cls, freq=...): ... - @property - def freq(self): ... - @classmethod - def construct_from_string(cls, string: _str): ... - @property - def name(self) -> _str: ... - @property - def na_value(self): ... - def __hash__(self) -> int: ... - def __eq__(self, other) -> bool: ... - @classmethod - def is_dtype(cls, dtype) -> bool: ... - @classmethod - def construct_array_type(cls): ... - def __from_arrow__(self, array): ... - -class IntervalDtype(PandasExtensionDtype): - name: _str = ... - kind: _str = ... - str: _str = ... - base = ... - num: int = ... - def __new__(cls, subtype=...): ... - @property - def subtype(self): ... - @classmethod - def construct_array_type(cls): ... - @classmethod - def construct_from_string(cls, string: _str): ... - @property - def type(self): ... - def __hash__(self) -> int: ... - def __eq__(self, other) -> bool: ... - @classmethod - def is_dtype(cls, dtype) -> bool: ... - def __from_arrow__(self, array): ... diff --git a/partial/pandas/core/dtypes/generic.pyi b/partial/pandas/core/dtypes/generic.pyi deleted file mode 100644 index b719b2e..0000000 --- a/partial/pandas/core/dtypes/generic.pyi +++ /dev/null @@ -1,76 +0,0 @@ -def create_pandas_abc_type(name, attr, comp): ... - -class ABCIndex: ... - -class ABCInt64Index: ... - -class ABCUInt64Index: ... - -class ABCRangeIndex: ... - -class ABCFloat64Index: - ... - -class ABCMultiIndex: - ... - -class ABCDatetimeIndex: - ... - -class ABCTimedeltaIndex: - ... - -class ABCPeriodIndex: - ... - -class ABCCategoricalIndex: - ... - -class ABCIntervalIndex: - ... - -class ABCIndexClass: - ... - -class ABCSeries: - ... - -class ABCDataFrame: - ... - -class ABCSparseArray: - ... - -class ABCCategorical: - ... - -class ABCDatetimeArray: - ... - -class ABCTimedeltaArray: - ... - -class ABCPeriodArray: - ... - -class ABCPeriod: - ... - -class ABCDateOffset: - ... - -class ABCInterval: - ... - -class ABCExtensionArray: - ... - -class ABCPandasArray: - ... - -class _ABCGeneric(type): - def __instancecheck__(cls, inst) -> bool: ... - -class ABCGeneric: - ... - diff --git a/partial/pandas/core/dtypes/inference.pyi b/partial/pandas/core/dtypes/inference.pyi deleted file mode 100644 index c20e63a..0000000 --- a/partial/pandas/core/dtypes/inference.pyi +++ /dev/null @@ -1,19 +0,0 @@ -def is_bool(obj) -> bool: ... -def is_integer(obj) -> bool: ... -def is_float(obj) -> bool: ... -def is_complex(obj) -> bool: ... -def is_scalar(obj) -> bool: ... -def is_decimal(obj) -> bool: ... -def is_interval(obj) -> bool: ... -def is_list_like(obj) -> bool: ... -def is_number(obj) -> bool: ... -def is_iterator(obj) -> bool: ... -def is_file_like(obj) -> bool: ... -def is_re(obj) -> bool: ... -def is_re_compilable(obj) -> bool: ... -def is_array_like(obj) -> bool: ... -def is_nested_list_like(obj) -> bool: ... -def is_dict_like(obj) -> bool: ... -def is_named_tuple(obj) -> bool: ... -def is_hashable(obj) -> bool: ... -def is_sequence(obj) -> bool: ... diff --git a/partial/pandas/core/dtypes/missing.pyi b/partial/pandas/core/dtypes/missing.pyi deleted file mode 100644 index ae289df..0000000 --- a/partial/pandas/core/dtypes/missing.pyi +++ /dev/null @@ -1,33 +0,0 @@ -import numpy as np -from typing import Union, overload, List -from pandas._typing import Scalar as Scalar, Series as Series, Index as Index, ArrayLike as ArrayLike, DataFrame as DataFrame - -isposinf_scalar = ... -isneginf_scalar = ... - -@overload -def isna(obj: DataFrame) -> DataFrame: ... -@overload -def isna(obj: Series) -> Series[bool]: ... -@overload -def isna(obj: Union[Index, List, ArrayLike]) -> np.ndarray: ... -@overload -def isna(obj: Scalar) -> bool: ... - -isnull = isna - -@overload -def notna(obj: DataFrame) -> DataFrame: ... -@overload -def notna(obj: Series) -> Series[bool]: ... -@overload -def notna(obj: Union[Index, List, ArrayLike]) -> np.ndarray: ... -@overload -def notna(obj: Scalar) -> bool: ... - -notnull = notna - -def array_equivalent(left, right, strict_nan: bool = ...) -> bool: ... -def na_value_for_dtype(dtype, compat: bool = ...): ... -def remove_na_arraylike(arr): ... -def is_valid_nat_for_dtype(obj, dtype) -> bool: ... diff --git a/partial/pandas/core/frame.pyi b/partial/pandas/core/frame.pyi deleted file mode 100644 index 95d3d4c..0000000 --- a/partial/pandas/core/frame.pyi +++ /dev/null @@ -1,2019 +0,0 @@ -from __future__ import annotations -import datetime -import numpy as np -import sys - -from pandas.core.indexing import _iLocIndexer, _LocIndexer -from matplotlib.axes import Axes as PlotAxes -from pandas._typing import ( - Axes as Axes, - Axis as Axis, - FilePathOrBuffer as FilePathOrBuffer, - FilePathOrBytesBuffer as FilePathOrBytesBuffer, - Level as Level, - Renamer as Renamer, -) -from pandas._typing import ( - num, - SeriesAxisType, - AxisType, - Dtype, - DtypeNp, - Label, - StrLike, - Scalar as Scalar, - IndexType, - MaskType, - S1, - T as TType, -) -from pandas._typing import ArrayLike as ArrayLike, np_ndarray_str, np_ndarray_bool, Timestamp as Timestamp, Timedelta as Timedelta -from pandas._typing import IndexLevel as IndexLevel, IgnoreRaise as IgnoreRaise -from pandas.core.arraylike import OpsMixin -from pandas.core.generic import NDFrame as NDFrame -from pandas.core.groupby.generic import DataFrameGroupBy as DataFrameGroupBy -from pandas.core.groupby.grouper import Grouper -from pandas.core.indexes.base import Index as Index -from pandas.core.indexes.multi import MultiIndex as MultiIndex -from pandas.core.resample import Resampler -from pandas.core.window.rolling import Rolling, Window -from pandas.core.series import Series as Series -from pandas.io.formats import console as console, format as fmt -from pandas.io.formats.style import Styler as Styler -from pandas.plotting import PlotAccessor -from typing import ( - Any, - Callable, - Dict, - Hashable, - Iterable, - Iterator, - List, - Mapping, - Optional, - Sequence, - Set, - Tuple, - Type, - Union, - overload, - Pattern, -) - -if sys.version_info >= (3, 8): - from typing import Literal -else: - from typing_extensions import Literal - -import numpy as _np -import datetime as _dt - -_str = str -_bool = bool - -class _iLocIndexerFrame(_iLocIndexer): - @overload - def __getitem__(self, idx: Tuple[int, int]) -> Scalar: ... - @overload - def __getitem__(self, idx: int) -> Series: ... - @overload - def __getitem__(self, idx: Tuple[Union[IndexType, MaskType], int]) -> Series: ... - @overload - def __getitem__(self, idx: Tuple[int, Union[IndexType, MaskType]]) -> Series: ... - @overload - def __getitem__(self, idx: Union[IndexType, MaskType, - Tuple[Union[IndexType, MaskType], - Union[IndexType, MaskType]]]) -> DataFrame: ... - def __setitem__( - self, - idx: Union[ - int, - IndexType, - Tuple[int, int], - Tuple[IndexType, int], - Tuple[IndexType, IndexType], - Tuple[int, IndexType], - ], - value: Union[float, Series, DataFrame], - ) -> None: ... - -class _LocIndexerFrame(_LocIndexer): - @overload - def __getitem__( - self, - idx: Union[ - Union[IndexType, MaskType], - List[StrLike], - Tuple[ - Union[IndexType, MaskType, slice, List[StrLike], Tuple[Union[str, int, slice], ...]], - Union[List[StrLike], slice, Series[bool], Callable], - ], - ], - ) -> DataFrame: ... - @overload - def __getitem__( - self, - idx: Tuple[Union[StrLike, Tuple[StrLike, ...]], StrLike], - ) -> Scalar: ... - @overload - def __getitem__( - self, - idx: Union[int, StrLike], - ) -> Series: ... - @overload - def __getitem__( - self, - idx: Tuple[Union[IndexType, MaskType], StrLike], - ) -> Series: ... - @overload - def __getitem__( - self, - idx: Tuple[Tuple[slice, ...], StrLike], - ) -> Series: ... - @overload - def __setitem__( - self, - idx: Union[ - MaskType, - StrLike, - Tuple[Union[MaskType, Index, Sequence[Scalar], Scalar, slice], ...], - ], - value: Union[S1, ArrayLike, Series, DataFrame], - ) -> None: ... - @overload - def __setitem__( - self, idx: Tuple[Tuple[Union[StrLike, Scalar, slice], ...], StrLike], value: Union[S1, ArrayLike, Series[S1], List] - ) -> None: ... - @overload - def __setitem__( - self, idx: Tuple[Tuple[Union[StrLike, Scalar, slice], ...], StrLike], value: Union[S1, ArrayLike, Series[S1], List] - ) -> None: ... - -class DataFrame(NDFrame, OpsMixin): - _ListLike = Union[ - np.ndarray, - List[Dtype], - Dict[_str, _np.ndarray], - Sequence, - Index, - Series, - ] - def __new__( - cls, - data: Optional[Union[_ListLike, DataFrame, Dict[Any, Any]]] = ..., - index: Optional[Union[Index, _ListLike]] = ..., - columns: Optional[_ListLike] = ..., - dtype=..., - copy: _bool = ..., - ) -> DataFrame: ... - @property - def axes(self) -> List[Index]: ... - @property - def shape(self) -> Tuple[int, int]: ... - @property - def style(self) -> Styler: ... - def items(self) -> Iterable[Tuple[Hashable, Series]]: ... - def iteritems(self) -> Iterable[Tuple[Label, Series]]: ... - def iterrows(self) -> Iterable[Tuple[Label, Series]]: ... - def itertuples(self, index: _bool = ..., name: Optional[str] = ...): ... - def __len__(self) -> int: ... - @overload - def dot(self, other: Union[DataFrame, ArrayLike]) -> DataFrame: ... - @overload - def dot(self, other: Series) -> Series: ... - def __matmul__(self, other): ... - def __rmatmul__(self, other): ... - @classmethod - def from_dict(cls, data, orient=..., dtype=..., columns=...) -> DataFrame: ... - def to_numpy( - self, dtype: Optional[Union[Type[DtypeNp], Dtype]] = ..., copy: _bool = ..., na_value: Optional[Any] = ... - ) -> _np.ndarray: ... - @overload - def to_dict( - self, - orient: Literal["records"], - into: Hashable = ..., - ) -> List[Dict[_str, Any]]: ... - @overload - def to_dict( - self, - orient: Literal["dict", "list", "series", "split", "index"] = ..., - into: Hashable = ..., - ) -> Dict[_str, Any]: ... - def to_gbq( - self, - destination_table, - project_id=..., - chunksize=..., - reauth=..., - if_exists=..., - auth_local_webserver=..., - table_schema=..., - location=..., - progress_bar=..., - credentials=..., - ) -> None: ... - @classmethod - def from_records(cls, data, index=..., exclude=..., columns=..., coerce_float=..., nrows=...) -> DataFrame: ... - def to_records( - self, - index: _bool = ..., - columnDTypes: Optional[Union[_str, Dict]] = ..., - indexDTypes: Optional[Union[_str, Dict]] = ..., - ) -> np.recarray: ... - def to_stata( - self, - path: FilePathOrBuffer, - convert_dates: Optional[Dict] = ..., - write_index: _bool = ..., - byteorder: Optional[Union[_str, Literal["<", ">", "little", "big"]]] = ..., - time_stamp=..., - data_label: Optional[_str] = ..., - variable_labels: Optional[Dict] = ..., - version: int = ..., - convert_strl: Optional[List[_str]] = ..., - ) -> None: ... - def to_feather(self, path: FilePathOrBuffer, **kwargs) -> None: ... - @overload - def to_markdown(self, buf: Optional[FilePathOrBuffer], mode: Optional[_str] = ..., **kwargs) -> None: ... - @overload - def to_markdown(self, mode: Optional[_str] = ..., **kwargs) -> _str: ... - @overload - def to_parquet( - self, - path: FilePathOrBytesBuffer, - *, - engine: Union[_str, Literal["auto", "pyarrow", "fastparquet"]] = ..., - compression: Union[_str, Literal["snappy", "gzip", "brotli"]] = ..., - index: Optional[_bool] = ..., - partition_cols: Optional[List] = ..., - **kwargs, - ) -> None: ... - @overload - def to_parquet( - self, - *, - path: None = ..., - engine: Union[_str, Literal["auto", "pyarrow", "fastparquet"]] = ..., - compression: Union[_str, Literal["snappy", "gzip", "brotli"]] = ..., - index: Optional[_bool] = ..., - partition_cols: Optional[List] = ..., - **kwargs, - ) -> bytes: ... - @overload - def to_html( - self, - buf: Optional[FilePathOrBuffer], - columns: Optional[Sequence[_str]] = ..., - col_space: Optional[Union[int, List[int], Dict[Union[_str, int], int]]] = ..., - header: _bool = ..., - index: _bool = ..., - na_rep: _str = ..., - formatters=..., - float_format=..., - sparsify: Optional[_bool] = ..., - index_names: _bool = ..., - justify: Optional[_str] = ..., - max_rows: Optional[int] = ..., - max_cols: Optional[int] = ..., - show_dimensions: _bool = ..., - decimal: _str = ..., - bold_rows: _bool = ..., - classes: Optional[Union[_str, List, Tuple]] = ..., - escape: _bool = ..., - notebook: _bool = ..., - border: Optional[int] = ..., - table_id: Optional[_str] = ..., - render_links: _bool = ..., - encoding: Optional[_str] = ..., - ) -> None: ... - @overload - def to_html( - self, - columns: Optional[Sequence[_str]] = ..., - col_space: Optional[Union[int, List[int], Dict[Union[_str, int], int]]] = ..., - header: _bool = ..., - index: _bool = ..., - na_rep: _str = ..., - formatters=..., - float_format=..., - sparsify: Optional[_bool] = ..., - index_names: _bool = ..., - justify: Optional[_str] = ..., - max_rows: Optional[int] = ..., - max_cols: Optional[int] = ..., - show_dimensions: _bool = ..., - decimal: _str = ..., - bold_rows: _bool = ..., - classes: Optional[Union[_str, List, Tuple]] = ..., - escape: _bool = ..., - notebook: _bool = ..., - border: Optional[int] = ..., - table_id: Optional[_str] = ..., - render_links: _bool = ..., - encoding: Optional[_str] = ..., - ) -> _str: ... - def info(self, verbose=..., buf=..., max_cols=..., memory_usage=..., null_counts=...) -> None: ... - def memory_usage(self, index: _bool = ..., deep: _bool = ...) -> Series: ... - def transpose(self, *args, copy: _bool = ...) -> DataFrame: ... - @property - def T(self) -> DataFrame: ... - @overload - def __getitem__(self, idx: Scalar) -> Series: ... - @overload - def __getitem__(self, rows: slice) -> DataFrame: ... - @overload - def __getitem__( - self, - idx: Union[ - Tuple, - Series[_bool], - DataFrame, - List[_str], - List[Hashable], - Index, - np_ndarray_str, - np_ndarray_bool, - Sequence[Tuple[Scalar, ...]], - ], - ) -> DataFrame: ... - def __setitem__(self, key, value): ... - @overload - def query(self, expr: _str, *, inplace: Literal[True], **kwargs) -> None: ... - @overload - def query(self, expr: _str, *, inplace: Literal[False] = ..., **kwargs) -> DataFrame: ... - def eval(self, expr: _str, inplace: _bool = ..., **kwargs): ... - def select_dtypes( - self, - include: Optional[Union[_str, List[_str]]] = ..., - exclude: Optional[Union[_str, List[_str]]] = ..., - ) -> DataFrame: ... - def insert( - self, - loc: int, - column, - value: Union[int, _ListLike], - allow_duplicates: _bool = ..., - ) -> None: ... - def assign(self, **kwargs) -> DataFrame: ... - def lookup(self, row_labels: Sequence, col_labels: Sequence) -> np.ndarray: ... - def align( - self, - other: Union[DataFrame, Series], - join: Union[_str, Literal["inner", "outer", "left", "right"]] = ..., - axis: Optional[AxisType] = ..., - level: Optional[Level] = ..., - copy: _bool = ..., - fill_value=..., - method: Optional[Union[_str, Literal["backfill", "bfill", "pad", "ffill"]]] = ..., - limit: Optional[int] = ..., - fill_axis: AxisType = ..., - broadcast_axis: Optional[AxisType] = ..., - ) -> DataFrame: ... - def reindex(**kwargs) -> DataFrame: ... - @overload - def drop( - self, - labels: Hashable | list[Hashable] = ..., - *, - axis: Axis = ..., - index: Hashable | list[Hashable] = ..., - columns: Hashable | list[Hashable] = ..., - level: Optional[Level] = ..., - inplace: Literal[True], - errors: IgnoreRaise = ..., - ) -> None: ... - @overload - def drop( - self, - labels: Hashable | list[Hashable] = ..., - *, - axis: Axis = ..., - index: Hashable | list[Hashable] = ..., - columns: Hashable | list[Hashable] = ..., - level: Optional[Level] = ..., - inplace: Literal[False] = ..., - errors: IgnoreRaise = ..., - ) -> DataFrame: ... - @overload - def drop( - self, - labels: Hashable | list[Hashable] = ..., - *, - axis: Axis = ..., - index: Hashable | list[Hashable] = ..., - columns: Hashable | list[Hashable] = ..., - level: Optional[Level] = ..., - inplace: bool = ..., - errors: IgnoreRaise = ..., - ) -> DataFrame | None: ... - @overload - def rename( - self, - mapper: Optional[Renamer] = ..., - *, - index: Optional[Renamer] = ..., - columns: Optional[Renamer] = ..., - axis: Optional[Axis] = ..., - copy: bool = ..., - inplace: Literal[True], - level: Optional[Level] = ..., - errors: IgnoreRaise = ..., - ) -> None: ... - @overload - def rename( - self, - mapper: Optional[Renamer] = ..., - *, - index: Optional[Renamer] = ..., - columns: Optional[Renamer] = ..., - axis: Optional[Axis] = ..., - copy: bool = ..., - inplace: Literal[False] = ..., - level: Optional[Level] = ..., - errors: IgnoreRaise = ..., - ) -> DataFrame: ... - @overload - def rename( - self, - mapper: Optional[Renamer] = ..., - *, - index: Optional[Renamer] = ..., - columns: Optional[Renamer] = ..., - axis: Optional[Axis] = ..., - copy: bool = ..., - inplace: bool = ..., - level: Optional[Level] = ..., - errors: IgnoreRaise = ..., - ) -> Optional[DataFrame]: ... - @overload - def fillna( - self, - value: Optional[Union[Scalar, Dict, Series, DataFrame]] = ..., - method: Optional[Literal["backfill", "bfill", "ffill", "pad"]] = ..., - axis: Optional[AxisType] = ..., - limit: int = ..., - downcast: Optional[Dict] = ..., - *, - inplace: Literal[True], - ) -> None: ... - @overload - def fillna( - self, - value: Optional[Union[Scalar, Dict, Series, DataFrame]] = ..., - method: Optional[Literal["backfill", "bfill", "ffill", "pad"]] = ..., - axis: Optional[AxisType] = ..., - limit: int = ..., - downcast: Optional[Dict] = ..., - *, - inplace: Literal[False] = ..., - ) -> DataFrame: ... - @overload - def fillna( - self, - value: Optional[Union[Scalar, Dict, Series, DataFrame]] = ..., - method: Optional[Union[_str, Literal["backfill", "bfill", "ffill", "pad"]]] = ..., - axis: Optional[AxisType] = ..., - *, - limit: int = ..., - downcast: Optional[Dict] = ..., - ) -> Union[None, DataFrame]: ... - @overload - def fillna( - self, - value: Optional[Union[Scalar, Dict, Series, DataFrame]] = ..., - method: Optional[Union[_str, Literal["backfill", "bfill", "ffill", "pad"]]] = ..., - axis: Optional[AxisType] = ..., - inplace: Optional[_bool] = ..., - limit: int = ..., - downcast: Optional[Dict] = ..., - ) -> Union[None, DataFrame]: ... - @overload - def replace( - self, - to_replace=..., - value: Optional[Union[Scalar, Sequence, Mapping, Pattern]] = ..., - limit: Optional[int] = ..., - regex=..., - method: Optional[_str] = ..., - *, - inplace: Literal[True], - ) -> None: ... - @overload - def replace( - self, - to_replace=..., - value: Optional[Union[Scalar, Sequence, Mapping, Pattern]] = ..., - limit: Optional[int] = ..., - regex=..., - method: Optional[_str] = ..., - *, - inplace: Literal[False], - ) -> DataFrame: ... - @overload - def replace( - self, - to_replace=..., - value: Optional[Union[Scalar, Sequence, Mapping, Pattern]] = ..., - *, - limit: Optional[int] = ..., - regex=..., - method: Optional[_str] = ..., - ) -> DataFrame: ... - @overload - def replace( - self, - to_replace=..., - value: Optional[Union[Scalar, Sequence, Mapping, Pattern]] = ..., - inplace: Optional[_bool] = ..., - limit: Optional[int] = ..., - regex=..., - method: Optional[_str] = ..., - ) -> Union[None, DataFrame]: ... - def shift( - self, - periods: int = ..., - freq=..., - axis: AxisType = ..., - fill_value: Optional[Hashable] = ..., - ) -> DataFrame: ... - @overload - def set_index( - self, - keys: Union[Label, Sequence], - drop: _bool = ..., - append: _bool = ..., - verify_integrity: _bool = ..., - *, - inplace: Literal[True], - ) -> None: ... - @overload - def set_index( - self, - keys: Union[Label, Sequence], - drop: _bool = ..., - append: _bool = ..., - verify_integrity: _bool = ..., - *, - inplace: Literal[False], - ) -> DataFrame: ... - @overload - def set_index( - self, - keys: Union[Label, Sequence], - drop: _bool = ..., - append: _bool = ..., - *, - verify_integrity: _bool = ..., - ) -> DataFrame: ... - @overload - def set_index( - self, - keys: Union[Label, Sequence], - drop: _bool = ..., - append: _bool = ..., - inplace: Optional[_bool] = ..., - verify_integrity: _bool = ..., - ) -> Union[None, DataFrame]: ... - @overload - def reset_index( - self, - level: Union[Level, Sequence[Level]] = ..., - drop: _bool = ..., - col_level: Union[int, _str] = ..., - col_fill: Hashable = ..., - *, - inplace: Literal[True], - ) -> None: ... - @overload - def reset_index( - self, - level: Union[Level, Sequence[Level]] = ..., - drop: _bool = ..., - col_level: Union[int, _str] = ..., - col_fill: Hashable = ..., - *, - inplace: Literal[False], - ) -> DataFrame: ... - @overload - def reset_index( - self, - level: Union[Level, Sequence[Level]] = ..., - drop: _bool = ..., - *, - col_level: Union[int, _str] = ..., - col_fill: Hashable = ..., - ) -> DataFrame: ... - @overload - def reset_index( - self, - level: Union[Level, Sequence[Level]] = ..., - drop: _bool = ..., - inplace: Optional[_bool] = ..., - col_level: Union[int, _str] = ..., - col_fill: Hashable = ..., - ) -> Union[None, DataFrame]: ... - def isna(self) -> DataFrame: ... - def isnull(self) -> DataFrame: ... - def notna(self) -> DataFrame: ... - def notnull(self) -> DataFrame: ... - @overload - def dropna( - self, - axis: AxisType = ..., - how: Union[_str, Literal["any", "all"]] = ..., - thresh: Optional[int] = ..., - subset: Optional[List] = ..., - *, - inplace: Literal[True], - ) -> None: ... - @overload - def dropna( - self, - axis: AxisType = ..., - how: Union[_str, Literal["any", "all"]] = ..., - thresh: Optional[int] = ..., - subset: Optional[List] = ..., - *, - inplace: Literal[False], - ) -> DataFrame: ... - @overload - def dropna( - self, - axis: AxisType = ..., - how: Union[_str, Literal["any", "all"]] = ..., - thresh: Optional[int] = ..., - subset: Optional[List] = ..., - ) -> DataFrame: ... - @overload - def dropna( - self, - axis: AxisType = ..., - how: Union[_str, Literal["any", "all"]] = ..., - thresh: Optional[int] = ..., - subset: Optional[List] = ..., - inplace: Optional[_bool] = ..., - ) -> Union[None, DataFrame]: ... - def drop_duplicates( - self, - subset=..., - keep: Union[_str, Literal["first", "last"], _bool] = ..., - inplace: _bool = ..., - ignore_index: _bool = ..., - ) -> DataFrame: ... - def duplicated( - self, - subset: Optional[Union[Hashable, Sequence[Hashable]]] = ..., - keep: Union[_str, Literal["first", "last"], _bool] = ..., - ) -> Series: ... - @overload - def sort_values( - self, - by: Union[_str, Sequence[_str]], - axis: AxisType = ..., - ascending: Union[_bool, Sequence[_bool]] = ..., - kind: Union[_str, Literal["quicksort", "mergesort", "heapsort"]] = ..., - na_position: Union[_str, Literal["first", "last"]] = ..., - ignore_index: _bool = ..., - *, - inplace: Literal[True], - key: Optional[Callable] = ..., - ) -> None: ... - @overload - def sort_values( - self, - by: Union[_str, Sequence[_str]], - axis: AxisType = ..., - ascending: Union[_bool, Sequence[_bool]] = ..., - kind: Union[_str, Literal["quicksort", "mergesort", "heapsort"]] = ..., - na_position: Union[_str, Literal["first", "last"]] = ..., - ignore_index: _bool = ..., - *, - inplace: Literal[False], - key: Optional[Callable] = ..., - ) -> DataFrame: ... - @overload - def sort_values( - self, - by: Union[_str, Sequence[_str]], - axis: AxisType = ..., - ascending: Union[_bool, Sequence[_bool]] = ..., - *, - kind: Union[_str, Literal["quicksort", "mergesort", "heapsort"]] = ..., - na_position: Union[_str, Literal["first", "last"]] = ..., - ignore_index: _bool = ..., - key: Optional[Callable] = ..., - ) -> DataFrame: ... - @overload - def sort_values( - self, - by: Union[_str, Sequence[_str]], - axis: AxisType = ..., - ascending: Union[_bool, Sequence[_bool]] = ..., - inplace: Optional[_bool] = ..., - kind: Union[_str, Literal["quicksort", "mergesort", "heapsort"]] = ..., - na_position: Union[_str, Literal["first", "last"]] = ..., - ignore_index: _bool = ..., - key: Optional[Callable] = ..., - ) -> Union[None, DataFrame]: ... - @overload - def sort_index( - self, - axis: AxisType = ..., - level: Optional[Level] = ..., - ascending: Union[_bool, Sequence[_bool]] = ..., - kind: Union[_str, Literal["quicksort", "mergesort", "heapsort"]] = ..., - na_position: Union[_str, Literal["first", "last"]] = ..., - sort_remaining: _bool = ..., - ignore_index: _bool = ..., - *, - inplace: Literal[True], - key: Optional[Callable] = ..., - ) -> None: ... - @overload - def sort_index( - self, - axis: AxisType = ..., - level: Optional[Union[Level, List[int], List[_str]]] = ..., - ascending: Union[_bool, Sequence[_bool]] = ..., - kind: Union[_str, Literal["quicksort", "mergesort", "heapsort"]] = ..., - na_position: Union[_str, Literal["first", "last"]] = ..., - sort_remaining: _bool = ..., - ignore_index: _bool = ..., - *, - inplace: Literal[False], - key: Optional[Callable] = ..., - ) -> DataFrame: ... - @overload - def sort_index( - self, - axis: AxisType = ..., - level: Optional[Union[Level, List[int], List[_str]]] = ..., - ascending: Union[_bool, Sequence[_bool]] = ..., - *, - kind: Union[_str, Literal["quicksort", "mergesort", "heapsort"]] = ..., - na_position: Union[_str, Literal["first", "last"]] = ..., - sort_remaining: _bool = ..., - ignore_index: _bool = ..., - key: Optional[Callable] = ..., - ) -> DataFrame: ... - @overload - def sort_index( - self, - axis: AxisType = ..., - level: Optional[Union[Level, List[int], List[_str]]] = ..., - ascending: Union[_bool, Sequence[_bool]] = ..., - inplace: Optional[_bool] = ..., - kind: Union[_str, Literal["quicksort", "mergesort", "heapsort"]] = ..., - na_position: Union[_str, Literal["first", "last"]] = ..., - sort_remaining: _bool = ..., - ignore_index: _bool = ..., - key: Optional[Callable] = ..., - ) -> Union[None, DataFrame]: ... - def value_counts( - self, - subset: Optional[Sequence[Hashable]] = ..., - normalize: _bool = ..., - sort: _bool = ..., - ascending: _bool = ..., - dropna: _bool = ..., - ) -> Series[int]: ... - def nlargest( - self, - n: int, - columns: Union[_str, List[_str]], - keep: Union[_str, Literal["first", "last", "all"]] = ..., - ) -> DataFrame: ... - def nsmallest( - self, - n: int, - columns: Union[_str, List[_str]], - keep: Union[_str, Literal["first", "last", "all"]] = ..., - ) -> DataFrame: ... - def swaplevel(self, i: Level = ..., j: Level = ..., axis: AxisType = ...) -> DataFrame: ... - def reorder_levels(self, order: List, axis: AxisType = ...) -> DataFrame: ... - def compare( - self, - other: DataFrame, - align_axis: Axis = ..., - keep_shape: bool = ..., - keep_equal: bool = ..., - ) -> DataFrame: ... - def combine( - self, - other: DataFrame, - func: Callable, - fill_value=..., - overwrite: _bool = ..., - ) -> DataFrame: ... - def combine_first(self, other: DataFrame) -> DataFrame: ... - def update( - self, - other: Union[DataFrame, Series], - join: _str = ..., - overwrite: _bool = ..., - filter_func: Optional[Callable] = ..., - errors: Union[_str, Literal["raise", "ignore"]] = ..., - ) -> None: ... - def groupby( - self, - by: Optional[Union[List[_str], _str]] = ..., - axis: AxisType = ..., - level: Optional[Level] = ..., - as_index: _bool = ..., - sort: _bool = ..., - group_keys: _bool = ..., - squeeze: _bool = ..., - observed: _bool = ..., - dropna: _bool = ..., - ) -> DataFrameGroupBy: ... - def pivot( - self, - index=..., - columns=..., - values=..., - ) -> DataFrame: ... - def pivot_table( - self, - values: Optional[_str] = ..., - index: Optional[Union[_str, Grouper, Sequence]] = ..., - columns: Optional[Union[_str, Grouper, Sequence]] = ..., - aggfunc=..., - fill_value: Optional[Scalar] = ..., - margins: _bool = ..., - dropna: _bool = ..., - margins_name: _str = ..., - observed: _bool = ..., - ) -> DataFrame: ... - def stack(self, level: Level = ..., dropna: _bool = ...) -> Union[DataFrame, Series]: ... - def explode(self, column: Union[_str, Tuple], ignore_index: _bool = ...) -> DataFrame: ... - def unstack( - self, - level: Level = ..., - fill_value: Optional[Union[int, _str, Dict]] = ..., - ) -> Union[DataFrame, Series]: ... - def melt( - self, - id_vars: Optional[Union[Tuple, Sequence, np.ndarray]] = ..., - value_vars: Optional[Union[Tuple, Sequence, np.ndarray]] = ..., - var_name: Optional[Scalar] = ..., - value_name: Scalar = ..., - col_level: Optional[Union[int, _str]] = ..., - ignore_index: _bool = ..., - ) -> DataFrame: ... - def diff(self, periods: int = ..., axis: AxisType = ...) -> DataFrame: ... - @overload - def agg(self, func: Union[Callable, _str], axis: AxisType = ..., **kwargs) -> Series: ... - @overload - def agg(self, func: Union[List[Callable], Dict[_str, Callable]] = ..., axis: AxisType = ..., **kwargs) -> DataFrame: ... - @overload - def aggregate(self, func: Union[Callable, _str], axis: AxisType = ..., **kwargs) -> Series: ... - @overload - def aggregate(self, func: Union[List[Callable], Dict[_str, Callable]], axis: AxisType = ..., **kwargs) -> DataFrame: ... - def transform( - self, func: Union[List[Callable], Dict[_str, Callable]], axis: AxisType = ..., *args, **kwargs - ) -> DataFrame: ... - @overload - def apply(self, f: Callable) -> Series: ... - @overload - def apply( - self, f: Callable, axis: AxisType, raw: _bool = ..., result_type: Optional[_str] = ..., args=..., **kwargs - ) -> DataFrame: ... - def applymap(self, func: Callable, na_action: Optional[Literal["ignore"]] = None, **kwargs) -> DataFrame: ... - def append( - self, - other: Union[DataFrame, Series, Dict[Any, Any], Sequence[Scalar], Sequence[_ListLike]], - ignore_index: _bool = ..., - verify_integrity: _bool = ..., - sort: _bool = ..., - ) -> DataFrame: ... - def join( - self, - other: Union[DataFrame, Series, List[DataFrame]], - on: Optional[Union[_str, List[_str]]] = ..., - how: Union[_str, Literal["left", "right", "outer", "inner"]] = ..., - lsuffix: _str = ..., - rsuffix: _str = ..., - sort: _bool = ..., - ) -> DataFrame: ... - def merge( - self, - right: Union[DataFrame, Series], - how: Union[_str, Literal["left", "right", "inner", "outer"]] = ..., - on: Optional[IndexLevel] = ..., - left_on: Optional[Union[Level, Sequence[Level]]] = ..., - right_on: Optional[Union[Level, Sequence[Level]]] = ..., - left_index: _bool = ..., - right_index: _bool = ..., - sort: _bool = ..., - suffixes: Tuple[Optional[_str], Optional[_str]] = ..., - copy: _bool = ..., - indicator: Union[_bool, _str] = ..., - validate: Optional[_str] = ..., - ) -> DataFrame: ... - def round(self, decimals: Union[int, Dict, Series] = ..., *args, **kwargs) -> DataFrame: ... - def corr( - self, - method: Union[_str, Literal["pearson", "kendall", "spearman"]] = ..., - min_periods: int = ..., - ) -> DataFrame: ... - def cov(self, min_periods: Optional[int] = ..., ddof: int = 1) -> DataFrame: ... - def corrwith( - self, - other: Union[DataFrame, Series], - axis: Optional[AxisType] = ..., - drop: _bool = ..., - method: Union[_str, Literal["pearson", "kendall", "spearman"]] = ..., - ) -> Series: ... - @overload - def count(self, axis: AxisType = ..., numeric_only: _bool = ..., *, level: Level) -> DataFrame: ... - @overload - def count(self, axis: AxisType = ..., level: None = ..., numeric_only: _bool = ...) -> Series: ... - def nunique(self, axis: AxisType = ..., dropna=True) -> Series: ... - def idxmax(self, axis: AxisType = ..., skipna: _bool = ...) -> Series: ... - def idxmin(self, axis: AxisType = ..., skipna: _bool = ...) -> Series: ... - @overload - def mode( - self, axis: AxisType = ..., skipna: _bool = ..., numeric_only: _bool = ..., *, level: Level, **kwargs - ) -> DataFrame: ... - @overload - def mode( - self, axis: AxisType = ..., skipna: _bool = ..., level: None = ..., numeric_only: _bool = ..., **kwargs - ) -> Series: ... - @overload - def quantile( - self, - q: float = ..., - axis: AxisType = ..., - numeric_only: _bool = ..., - interpolation: Union[_str, Literal["linear", "lower", "higher", "midpoint", "nearest"]] = ..., - ) -> Series: ... - @overload - def quantile( - self, - q: List[float], - axis: AxisType = ..., - numeric_only: _bool = ..., - interpolation: Union[_str, Literal["linear", "lower", "higher", "midpoint", "nearest"]] = ..., - ) -> DataFrame: ... - def to_timestamp( - self, - freq=..., - how: Union[_str, Literal["start", "end", "s", "e"]] = ..., - axis: AxisType = ..., - copy: _bool = ..., - ) -> DataFrame: ... - def to_period(self, freq: Optional[_str] = ..., axis: AxisType = ..., copy: _bool = ...) -> DataFrame: ... - def isin(self, values: Union[Iterable, Series, DataFrame, Dict]) -> DataFrame: ... - def plot(self, *args, **kwargs) -> PlotAccessor: ... - def hist( - self, - column: Optional[Union[_str, List[_str]]] = ..., - by: Optional[Union[_str, _ListLike]] = ..., - grid: _bool = ..., - xlabelsize: Optional[int] = ..., - xrot: Optional[float] = ..., - ylabelsize: Optional[int] = ..., - yrot: Optional[float] = ..., - ax: Optional[PlotAxes] = ..., - sharex: _bool = ..., - sharey: _bool = ..., - figsize: Optional[Tuple[float, float]] = ..., - layout: Optional[Tuple[int, int]] = ..., - bins: Union[int, List] = ..., - backend: Optional[_str] = ..., - **kwargs, - ): ... - def boxplot( - self, - column: Optional[Union[_str, List[_str]]] = ..., - by: Optional[Union[_str, _ListLike]] = ..., - ax: Optional[PlotAxes] = ..., - fontsize: Optional[Union[float, _str]] = ..., - rot: int = ..., - grid: _bool = ..., - figsize: Optional[Tuple[float, float]] = ..., - layout: Optional[Tuple[int, int]] = ..., - return_type: Optional[Union[_str, Literal["axes", "dict", "both"]]] = ..., - backend: Optional[_str] = ..., - **kwargs, - ): ... - sparse = ... - - # The rest of these are remnants from the - # stubs shipped at preview. They may belong in - # base classes, or stubgen just failed to generate - # these. - - Name: _str - # - # dunder methods - def __exp__( - self, - other: Union[num, _ListLike, DataFrame], - axis: AxisType = ..., - level: Level = ..., - fill_value: Union[None, float] = ..., - ) -> DataFrame: ... - def __iter__(self) -> Iterator: ... - # properties - @property - def at(self): ... # Not sure what to do with this yet; look at source - @property - def bool(self) -> _bool: ... - @property - def columns(self) -> Index: ... - @columns.setter # setter needs to be right next to getter; otherwise mypy complains - def columns(self, cols: Union[List[_str], Index[_str]]) -> None: ... # type:ignore - @property - def dtypes(self) -> Series: ... - @property - def empty(self) -> _bool: ... - @property - def iat(self): ... # Not sure what to do with this yet; look at source - @property - def iloc(self) -> _iLocIndexerFrame: ... - @property - def index(self) -> Index: ... - @index.setter - def index(self, idx: Index) -> None: ... - @property - def loc(self) -> _LocIndexerFrame: ... - @property - def ndim(self) -> int: ... - @property - def size(self) -> int: ... - @property - def values(self) -> _np.ndarray: ... - # methods - def abs(self) -> DataFrame: ... - def add( - self, - other: Union[num, _ListLike, DataFrame], - axis: Optional[AxisType] = ..., - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - ) -> DataFrame: ... - def add_prefix(self, prefix: _str) -> DataFrame: ... - def add_suffix(self, suffix: _str) -> DataFrame: ... - @overload - def all( - self, axis: AxisType = ..., bool_only: Optional[_bool] = ..., skipna: _bool = ..., level: None = ..., **kwargs - ) -> Series: ... - @overload - def all( - self, axis: AxisType = ..., bool_only: Optional[_bool] = ..., skipna: _bool = ..., *, level: Level, **kwargs - ) -> DataFrame: ... - @overload - def any( - self, axis: AxisType = ..., bool_only: Optional[_bool] = ..., skipna: _bool = ..., level: None = ..., **kwargs - ) -> Series: ... - @overload - def any(self, axis: AxisType = ..., bool_only: _bool = ..., skipna: _bool = ..., *, level: Level, **kwargs) -> DataFrame: ... - def asof(self, where, subset: Optional[Union[_str, List[_str]]] = ...) -> DataFrame: ... - def asfreq( - self, - freq, - method: Optional[Union[_str, Literal["backfill", "bfill", "pad", "ffill"]]] = ..., - how: Optional[Union[_str, Literal["start", "end"]]] = ..., - normalize: _bool = ..., - fill_value: Optional[Scalar] = ..., - ) -> DataFrame: ... - def astype( - self, - dtype: Union[_str, Dtype, Dict[_str, Union[_str, Dtype]]], - copy: _bool = ..., - errors: _str = ..., - ) -> DataFrame: ... - def at_time( - self, - time: Union[_str, datetime.time], - asof: _bool = ..., - axis: Optional[AxisType] = ..., - ) -> DataFrame: ... - def between_time( - self, - start_time: Union[_str, datetime.time], - end_time: Union[_str, datetime.time], - include_start: _bool = ..., - include_end: _bool = ..., - axis: Optional[AxisType] = ..., - ) -> DataFrame: ... - @overload - def bfill( - self, - axis: Optional[AxisType] = ..., - *, - inplace: Literal[True], - limit: Optional[int] = ..., - downcast: Optional[Dict] = ..., - ) -> None: ... - @overload - def bfill( - self, - axis: Optional[AxisType] = ..., - *, - inplace: Literal[False], - limit: Optional[int] = ..., - downcast: Optional[Dict] = ..., - ) -> DataFrame: ... - def clip( - self, - lower: Optional[float] = ..., - upper: Optional[float] = ..., - axis: Optional[AxisType] = ..., - inplace: _bool = ..., - *args, - **kwargs, - ) -> DataFrame: ... - def copy(self, deep: _bool = ...) -> DataFrame: ... - def cummax(self, axis: Optional[AxisType] = ..., skipna: _bool = ..., *args, **kwargs) -> DataFrame: ... - def cummin(self, axis: Optional[AxisType] = ..., skipna: _bool = ..., *args, **kwargs) -> DataFrame: ... - def cumprod(self, axis: Optional[AxisType] = ..., skipna: _bool = ..., *args, **kwargs) -> DataFrame: ... - def cumsum(self, axis: Optional[AxisType] = ..., skipna: _bool = ..., *args, **kwargs) -> DataFrame: ... - def describe( - self, - percentiles: Optional[List[float]] = ..., - include: Optional[Union[_str, Literal["all"], List[Dtype]]] = ..., - exclude: Optional[List[Dtype]] = ..., - datetime_is_numeric: Optional[_bool] = ..., - ) -> DataFrame: ... - def div( - self, - other: Union[num, _ListLike, DataFrame], - axis: Optional[AxisType] = ..., - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - ) -> DataFrame: ... - def divide( - self, - other: Union[num, _ListLike, DataFrame], - axis: Optional[AxisType] = ..., - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - ) -> DataFrame: ... - def droplevel(self, level: Union[Level, List[Level]] = ..., axis: AxisType = ...) -> DataFrame: ... - def eq(self, other, axis: AxisType = ..., level: Optional[Level] = ...) -> DataFrame: ... - def equals(self, other: Union[Series, DataFrame]) -> _bool: ... - def ewm( - self, - com: Optional[float] = ..., - span: Optional[float] = ..., - halflife: Optional[float] = ..., - alpha: Optional[float] = ..., - min_periods: int = ..., - adjust: _bool = ..., - ignore_na: _bool = ..., - axis: AxisType = ..., - ) -> DataFrame: ... - def exp( - self, - other: Union[num, _ListLike, DataFrame], - axis: Optional[AxisType] = ..., - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - ) -> DataFrame: ... - def expanding(self, min_periods: int = ..., center: _bool = ..., axis: AxisType = ...): ... # for now - @overload - def ffill( - self, - axis: Optional[AxisType] = ..., - *, - inplace: Literal[True], - limit: Optional[int] = ..., - downcast: Optional[Dict] = ..., - ) -> None: ... - @overload - def ffill( - self, - axis: Optional[AxisType] = ..., - *, - inplace: Literal[False], - limit: Optional[int] = ..., - downcast: Optional[Dict] = ..., - ) -> DataFrame: ... - def filter( - self, - items: Optional[List] = ..., - like: Optional[_str] = ..., - regex: Optional[_str] = ..., - axis: Optional[AxisType] = ..., - ) -> DataFrame: ... - def first(self, offset) -> DataFrame: ... - def first_valid_index(self) -> Scalar: ... - def floordiv( - self, - other: Union[num, _ListLike, DataFrame], - axis: Optional[AxisType] = ..., - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - ) -> DataFrame: ... - # def from_dict - # def from_records - def fulldiv( - self, - other: Union[num, _ListLike, DataFrame], - axis: Optional[AxisType] = ..., - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - ) -> DataFrame: ... - def ge(self, other, axis: AxisType = ..., level: Optional[Level] = ...) -> DataFrame: ... - # def get - def gt(self, other, axis: AxisType = ..., level: Optional[Level] = ...) -> DataFrame: ... - def head(self, n: int = ...) -> DataFrame: ... - def infer_objects(self) -> DataFrame: ... - # def info - @overload - def interpolate( - self, - method: _str = ..., - axis: AxisType = ..., - limit: Optional[int] = ..., - limit_direction: Union[_str, Literal["forward", "backward", "both"]] = ..., - limit_area: Union[_str, Optional[Literal["inside", "outside"]]] = ..., - downcast: Optional[Union[_str, Literal["infer"]]] = ..., - *, - inplace: Literal[True], - **kwargs, - ) -> None: ... - @overload - def interpolate( - self, - method: _str = ..., - axis: AxisType = ..., - limit: Optional[int] = ..., - limit_direction: Union[_str, Literal["forward", "backward", "both"]] = ..., - limit_area: Union[_str, Optional[Literal["inside", "outside"]]] = ..., - downcast: Optional[Union[_str, Literal["infer"]]] = ..., - *, - inplace: Literal[False], - **kwargs, - ) -> DataFrame: ... - @overload - def interpolate( - self, - method: _str = ..., - axis: AxisType = ..., - limit: Optional[int] = ..., - limit_direction: Union[_str, Literal["forward", "backward", "both"]] = ..., - limit_area: Union[_str, Optional[Literal["inside", "outside"]]] = ..., - downcast: Optional[Union[_str, Literal["infer"]]] = ..., - ) -> DataFrame: ... - @overload - def interpolate( - self, - method: _str = ..., - axis: AxisType = ..., - limit: Optional[int] = ..., - inplace: Optional[_bool] = ..., - limit_direction: Union[_str, Literal["forward", "backward", "both"]] = ..., - limit_area: Optional[Union[_str, Literal["inside", "outside"]]] = ..., - downcast: Optional[Union[_str, Literal["infer"]]] = ..., - **kwargs, - ) -> DataFrame: ... - def keys(self) -> Index: ... - @overload - def kurt( - self, - axis: Optional[AxisType] = ..., - skipna: Optional[_bool] = ..., - numeric_only: Optional[_bool] = ..., - *, - level: Level, - **kwargs, - ) -> DataFrame: ... - @overload - def kurt( - self, - axis: Optional[AxisType] = ..., - skipna: Optional[_bool] = ..., - level: None = ..., - numeric_only: Optional[_bool] = ..., - **kwargs, - ) -> Series: ... - @overload - def kurtosis( - self, - axis: Optional[AxisType] = ..., - skipna: Optional[_bool] = ..., - numeric_only: Optional[_bool] = ..., - *, - level: Level, - **kwargs, - ) -> DataFrame: ... - @overload - def kurtosis( - self, - axis: Optional[AxisType] = ..., - skipna: Optional[_bool] = ..., - level: None = ..., - numeric_only: Optional[_bool] = ..., - **kwargs, - ) -> Series: ... - def last(self, offset) -> DataFrame: ... - def last_valid_index(self) -> Scalar: ... - def le(self, other, axis: AxisType = ..., level: Optional[Level] = ...) -> DataFrame: ... - def lt(self, other, axis: AxisType = ..., level: Optional[Level] = ...) -> DataFrame: ... - @overload - def mad( - self, - axis: Optional[AxisType] = ..., - skipna: Optional[_bool] = ..., - level: None = ..., - ) -> Series: ... - @overload - def mad(self, axis: Optional[AxisType] = ..., skipna: Optional[_bool] = ..., *, level: Level, **kwargs) -> DataFrame: ... - def mask( - self, - cond: Union[Series, DataFrame, _np.ndarray], - other=..., - inplace: _bool = ..., - axis: Optional[AxisType] = ..., - level: Optional[Level] = ..., - errors: _str = ..., - try_cast: _bool = ..., - ) -> DataFrame: ... - @overload - def max( - self, - axis: Optional[AxisType] = ..., - skipna: Optional[_bool] = ..., - numeric_only: Optional[_bool] = ..., - *, - level: Level, - **kwargs, - ) -> DataFrame: ... - @overload - def max( - self, - axis: Optional[AxisType] = ..., - skipna: Optional[_bool] = ..., - level: None = ..., - numeric_only: Optional[_bool] = ..., - **kwargs, - ) -> Series: ... - @overload - def mean( - self, - axis: Optional[AxisType] = ..., - skipna: Optional[_bool] = ..., - numeric_only: Optional[_bool] = ..., - *, - level: Level, - **kwargs, - ) -> DataFrame: ... - @overload - def mean( - self, - axis: Optional[AxisType] = ..., - skipna: Optional[_bool] = ..., - level: None = ..., - numeric_only: Optional[_bool] = ..., - **kwargs, - ) -> Series: ... - @overload - def median( - self, - axis: Optional[AxisType] = ..., - skipna: Optional[_bool] = ..., - numeric_only: Optional[_bool] = ..., - *, - level: Level, - **kwargs, - ) -> DataFrame: ... - @overload - def median( - self, - axis: Optional[AxisType] = ..., - skipna: Optional[_bool] = ..., - level: None = ..., - numeric_only: Optional[_bool] = ..., - **kwargs, - ) -> Series: ... - @overload - def min( - self, - axis: Optional[AxisType] = ..., - skipna: Optional[_bool] = ..., - numeric_only: Optional[_bool] = ..., - *, - level: Level, - **kwargs, - ) -> DataFrame: ... - @overload - def min( - self, - axis: Optional[AxisType] = ..., - skipna: Optional[_bool] = ..., - level: None = ..., - numeric_only: Optional[_bool] = ..., - **kwargs, - ) -> Series: ... - def mod( - self, - other: Union[num, _ListLike, DataFrame], - axis: Optional[AxisType] = ..., - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - ) -> DataFrame: ... - def mul( - self, - other: Union[num, _ListLike, DataFrame], - axis: Optional[AxisType] = ..., - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - ) -> DataFrame: ... - def multiply( - self, - other: Union[num, _ListLike, DataFrame], - axis: Optional[AxisType] = ..., - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - ) -> DataFrame: ... - def ne(self, other, axis: AxisType = ..., level: Optional[Level] = ...) -> DataFrame: ... - def pct_change( - self, periods: int = ..., fill_method: _str = ..., limit: Optional[int] = ..., freq=..., **kwargs - ) -> DataFrame: ... - def pipe(self, func: Callable[..., TType] | tuple[Callable[..., TType], str], *args, **kwargs) -> TType: ... - def pop(self, item: _str) -> Series: ... - def pow( - self, - other: Union[num, _ListLike, DataFrame], - axis: Optional[AxisType] = ..., - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - ) -> DataFrame: ... - @overload - def prod( - self, - axis: Optional[AxisType] = ..., - skipna: Optional[_bool] = ..., - numeric_only: Optional[_bool] = ..., - min_count: int = ..., - *, - level: Level, - **kwargs, - ) -> DataFrame: ... - @overload - def prod( - self, - axis: Optional[AxisType] = ..., - skipna: Optional[_bool] = ..., - level: None = ..., - numeric_only: Optional[_bool] = ..., - min_count: int = ..., - **kwargs, - ) -> Series: ... - def product( - self, - axis: Optional[AxisType] = ..., - skipna: _bool = ..., - level: Optional[Level] = ..., - numeric_only: Optional[_bool] = ..., - min_count: int = ..., - **kwargs, - ) -> DataFrame: ... - def radd( - self, - other, - axis: AxisType = ..., - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - ) -> DataFrame: ... - def rank( - self, - axis: AxisType = ..., - method: Union[_str, Literal["average", "min", "max", "first", "dense"]] = ..., - numeric_only: Optional[_bool] = ..., - na_option: Union[_str, Literal["keep", "top", "bottom"]] = ..., - ascending: _bool = ..., - pct: _bool = ..., - ) -> DataFrame: ... - def rdiv( - self, - other, - axis: AxisType = ..., - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - ) -> DataFrame: ... - def reindex_like( - self, - other: DataFrame, - method: Optional[Union[_str, Literal["backfill", "bfill", "pad", "ffill", "nearest"]]] = ..., - copy: _bool = ..., - limit: Optional[int] = ..., - tolerance=..., - ) -> DataFrame: ... - @overload - def rename_axis(self, mapper=..., *, inplace: Literal[True], axis: Optional[AxisType] = ..., copy: _bool = ...) -> None: ... - @overload - def rename_axis( - self, mapper=..., *, inplace: Literal[False] = ..., axis: Optional[AxisType] = ..., copy: _bool = ... - ) -> DataFrame: ... - @overload - def rename_axis( - self, - *, - inplace: Literal[True], - index: Optional[Union[_str, Sequence[_str], Dict[Union[_str, int], _str], Callable]] = ..., - columns: Optional[Union[_str, Sequence[_str], Dict[Union[_str, int], _str], Callable]] = ..., - copy: _bool = ..., - ) -> None: ... - @overload - def rename_axis( - self, - *, - inplace: Literal[False] = ..., - index: Optional[Union[_str, Sequence[_str], Dict[Union[_str, int], _str], Callable]] = ..., - columns: Optional[Union[_str, Sequence[_str], Dict[Union[_str, int], _str], Callable]] = ..., - copy: _bool = ..., - ) -> DataFrame: ... - def resample( - self, - rule, - axis: AxisType = ..., - closed: Optional[_str] = ..., - label: Optional[_str] = ..., - convention: Union[_str, Literal["start", "end", "s", "e"]] = ..., - kind: Union[_str, Optional[Literal["timestamp", "period"]]] = ..., - loffset=..., - base: int = ..., - on: Optional[_str] = ..., - level: Optional[Level] = ..., - origin: Union[Timestamp, Literal["epoch", "start", "start_day", "end", "end_day"]] = ..., - offset: Optional[Union[Timedelta, _str]] = None, - ) -> Resampler: ... - def rfloordiv( - self, - other, - axis: AxisType = ..., - level: Optional[Level] = ..., - fill_value: Optional[Union[float, None]] = ..., - ) -> DataFrame: ... - def rmod( - self, - other, - axis: AxisType = ..., - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - ) -> DataFrame: ... - def rmul( - self, - other, - axis: AxisType = ..., - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - ) -> DataFrame: ... - @overload - def rolling( - self, - window, - min_periods: Optional[int] = ..., - center: _bool = ..., - *, - win_type: _str, - on: Optional[_str] = ..., - axis: AxisType = ..., - closed: Optional[_str] = ..., - ) -> Window: ... - @overload - def rolling( - self, - window, - min_periods: Optional[int] = ..., - center: _bool = ..., - *, - on: Optional[_str] = ..., - axis: AxisType = ..., - closed: Optional[_str] = ..., - ) -> Rolling: ... - def rpow( - self, - other, - axis: AxisType = ..., - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - ) -> DataFrame: ... - def rsub( - self, - other, - axis: AxisType = ..., - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - ) -> DataFrame: ... - def rtruediv( - self, - other, - axis: AxisType = ..., - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - ) -> DataFrame: ... - # sample is missing a weights arg - def sample( - self, - n: Optional[int] = ..., - frac: Optional[float] = ..., - replace: _bool = ..., - weights: Optional[Union[_str, _ListLike, np.ndarray]] = ..., - random_state: Optional[int] = ..., - axis: Optional[SeriesAxisType] = ..., - ignore_index: _bool = ..., - ) -> Series[S1]: ... - @overload - def sem( - self, - axis: Optional[AxisType] = ..., - skipna: Optional[_bool] = ..., - ddof: int = ..., - numeric_only: Optional[_bool] = ..., - *, - level: Level, - **kwargs, - ) -> DataFrame: ... - @overload - def sem( - self, - axis: Optional[AxisType] = ..., - skipna: Optional[_bool] = ..., - level: None = ..., - ddof: int = ..., - numeric_only: Optional[_bool] = ..., - **kwargs, - ) -> Series: ... - @overload - def set_axis(self, labels, inplace: Literal[True], axis: AxisType = ...) -> None: ... - @overload - def set_axis(self, labels, inplace: Literal[False], axis: AxisType = ...) -> DataFrame: ... - @overload - def set_axis(self, labels, *, axis: AxisType = ...) -> DataFrame: ... - @overload - def set_axis( - self, - labels, - axis: AxisType = ..., - inplace: Optional[_bool] = ..., - ) -> Union[None, DataFrame]: ... - @overload - def skew( - self, - axis: Optional[AxisType] = ..., - skipna: Optional[_bool] = ..., - numeric_only: Optional[_bool] = ..., - *, - level: Level, - **kwargs, - ) -> DataFrame: ... - @overload - def skew( - self, - axis: Optional[AxisType] = ..., - skipna: Optional[_bool] = ..., - level: None = ..., - numeric_only: Optional[_bool] = ..., - **kwargs, - ) -> Series: ... - def slice_shift(self, periods: int = ..., axis: AxisType = ...) -> DataFrame: ... - def squeeze(self, axis: Optional[AxisType] = ...): ... - @overload - def std( - self, axis: AxisType = ..., skipna: _bool = ..., ddof: int = ..., numeric_only: _bool = ..., *, level: Level, **kwargs - ) -> DataFrame: ... - @overload - def std( - self, axis: AxisType = ..., skipna: _bool = ..., level: None = ..., ddof: int = ..., numeric_only: _bool = ..., **kwargs - ) -> Series: ... - def sub( - self, - other: Union[num, _ListLike, DataFrame], - axis: Optional[AxisType] = ..., - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - ) -> DataFrame: ... - def subtract( - self, - other: Union[num, _ListLike, DataFrame], - axis: Optional[AxisType] = ..., - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - ) -> DataFrame: ... - @overload - def sum( - self, - axis: Optional[AxisType] = ..., - skipna: Optional[_bool] = ..., - numeric_only: Optional[_bool] = ..., - min_count: int = ..., - *, - level: Level, - **kwargs, - ) -> DataFrame: ... - @overload - def sum( - self, - axis: Optional[AxisType] = ..., - skipna: Optional[_bool] = ..., - level: None = ..., - numeric_only: Optional[_bool] = ..., - min_count: int = ..., - **kwargs, - ) -> Series: ... - def swapaxes(self, axis1: AxisType, axis2: AxisType, copy: _bool = ...) -> DataFrame: ... - def tail(self, n: int = ...) -> DataFrame: ... - def take(self, indices: List, axis: AxisType = ..., is_copy: Optional[_bool] = ..., **kwargs) -> DataFrame: ... - def tshift(self, periods: int = ..., freq=..., axis: AxisType = ...) -> DataFrame: ... - def to_clipboard(self, excel: _bool = ..., sep: Optional[_str] = ..., **kwargs) -> None: ... - @overload - def to_csv( - self, - path_or_buf: Optional[FilePathOrBuffer], - sep: _str = ..., - na_rep: _str = ..., - float_format: Optional[_str] = ..., - columns: Optional[Sequence[Hashable]] = ..., - header: Union[_bool, List[_str]] = ..., - index: _bool = ..., - index_label: Optional[Union[_bool, _str, Sequence[Hashable]]] = ..., - mode: _str = ..., - encoding: Optional[_str] = ..., - compression: Union[_str, Mapping[_str, _str]] = ..., - quoting: Optional[int] = ..., - quotechar: _str = ..., - line_terminator: Optional[_str] = ..., - chunksize: Optional[int] = ..., - date_format: Optional[_str] = ..., - doublequote: _bool = ..., - escapechar: Optional[_str] = ..., - decimal: _str = ..., - errors: _str = ..., - storage_options: Optional[Dict[_str, Any]] = ..., - ) -> None: ... - @overload - def to_csv( - self, - sep: _str = ..., - na_rep: _str = ..., - float_format: Optional[_str] = ..., - columns: Optional[Sequence[Hashable]] = ..., - header: Union[_bool, List[_str]] = ..., - index: _bool = ..., - index_label: Optional[Union[_bool, _str, Sequence[Hashable]]] = ..., - mode: _str = ..., - encoding: Optional[_str] = ..., - compression: Union[_str, Mapping[_str, _str]] = ..., - quoting: Optional[int] = ..., - quotechar: _str = ..., - line_terminator: Optional[_str] = ..., - chunksize: Optional[int] = ..., - date_format: Optional[_str] = ..., - doublequote: _bool = ..., - escapechar: Optional[_str] = ..., - decimal: _str = ..., - errors: _str = ..., - storage_options: Optional[Dict[_str, Any]] = ..., - ) -> _str: ... - def to_excel( - self, - excel_writer, - sheet_name: _str = ..., - na_rep: _str = ..., - float_format: Optional[_str] = ..., - columns: Optional[Union[_str, Sequence[_str]]] = ..., - header: _bool = ..., - index: _bool = ..., - index_label: Optional[Union[_str, Sequence[_str]]] = ..., - startrow: int = ..., - startcol: int = ..., - engine: Optional[_str] = ..., - merge_cells: _bool = ..., - encoding: Optional[_str] = ..., - inf_rep: _str = ..., - verbose: _bool = ..., - freeze_panes: Optional[Tuple[int, int]] = ..., - ) -> None: ... - def to_hdf( - self, - path_or_buf: FilePathOrBuffer, - key: _str, - mode: _str = ..., - complevel: Optional[int] = ..., - complib: Optional[_str] = ..., - append: _bool = ..., - format: Optional[_str] = ..., - index: _bool = ..., - min_itemsize: Optional[Union[int, Dict[_str, int]]] = ..., - nan_rep=..., - dropna: Optional[_bool] = ..., - data_columns: Optional[List[_str]] = ..., - errors: _str = ..., - encoding: _str = ..., - ) -> None: ... - @overload - def to_json( - self, - path_or_buf: Optional[FilePathOrBuffer], - orient: Optional[Union[_str, Literal["split", "records", "index", "columns", "values", "table"]]] = ..., - date_format: Optional[Union[_str, Literal["epoch", "iso"]]] = ..., - double_precision: int = ..., - force_ascii: _bool = ..., - date_unit: Union[_str, Literal["s", "ms", "us", "ns"]] = ..., - default_handler: Optional[Callable[[Any], Union[_str, int, float, _bool, List, Dict]]] = ..., - lines: _bool = ..., - compression: Union[_str, None, Literal["infer", "gzip", "bz2", "zip", "xz"]] = ..., - index: _bool = ..., - indent: Optional[int] = ..., - ) -> None: ... - @overload - def to_json( - self, - orient: Optional[Union[_str, Literal["split", "records", "index", "columns", "values", "table"]]] = ..., - date_format: Optional[Union[_str, Literal["epoch", "iso"]]] = ..., - double_precision: int = ..., - force_ascii: _bool = ..., - date_unit: Union[_str, Literal["s", "ms", "us", "ns"]] = ..., - default_handler: Optional[Callable[[Any], Union[_str, int, float, _bool, List, Dict]]] = ..., - lines: _bool = ..., - compression: Union[_str, None, Literal["infer", "gzip", "bz2", "zip", "xz"]] = ..., - index: _bool = ..., - indent: Optional[int] = ..., - ) -> _str: ... - @overload - def to_latex( - self, - buf: Optional[FilePathOrBuffer], - columns: Optional[List[_str]] = ..., - col_space: Optional[int] = ..., - header: _bool = ..., - index: _bool = ..., - na_rep: _str = ..., - formatters=..., - float_format=..., - sparsify: Optional[_bool] = ..., - index_names: _bool = ..., - bold_rows: _bool = ..., - column_format: Optional[_str] = ..., - longtable: Optional[_bool] = ..., - escape: Optional[_bool] = ..., - encoding: Optional[_str] = ..., - decimal: _str = ..., - multicolumn: Optional[_bool] = ..., - multicolumn_format: Optional[_str] = ..., - multirow: Optional[_bool] = ..., - caption: Optional[Union[_str, Tuple[_str, _str]]] = ..., - label: Optional[_str] = ..., - position: Optional[str] = ..., - ) -> None: ... - @overload - def to_latex( - self, - columns: Optional[List[_str]] = ..., - col_space: Optional[int] = ..., - header: _bool = ..., - index: _bool = ..., - na_rep: _str = ..., - formatters=..., - float_format=..., - sparsify: Optional[_bool] = ..., - index_names: _bool = ..., - bold_rows: _bool = ..., - column_format: Optional[_str] = ..., - longtable: Optional[_bool] = ..., - escape: Optional[_bool] = ..., - encoding: Optional[_str] = ..., - decimal: _str = ..., - multicolumn: Optional[_bool] = ..., - multicolumn_format: Optional[_str] = ..., - multirow: Optional[_bool] = ..., - caption: Optional[Union[_str, Tuple[_str, _str]]] = ..., - label: Optional[_str] = ..., - position: Optional[str] = ..., - ) -> _str: ... - def to_pickle( - self, - path: _str, - compression: Union[_str, Literal["infer", "gzip", "bz2", "zip", "xz"]] = ..., - protocol: int = ..., - ) -> None: ... - def to_sql( - self, - name: _str, - con, - schema: Optional[_str] = ..., - if_exists: _str = ..., - index: _bool = ..., - index_label: Optional[Union[_str, Sequence[_str]]] = ..., - chunksize: Optional[int] = ..., - dtype: Optional[Union[Dict, Scalar]] = ..., - method: Optional[Union[_str, Callable]] = ..., - ) -> None: ... - @overload - def to_string( - self, - buf: Optional[FilePathOrBuffer], - columns: Optional[Sequence[_str]] = ..., - col_space: Optional[Union[int, List[int], Dict[Union[_str, int], int]]] = ..., - header: Union[_bool, Sequence[_str]] = ..., - index: _bool = ..., - na_rep: _str = ..., - formatters=..., - float_format=..., - sparsify: Optional[_bool] = ..., - index_names: _bool = ..., - justify: Optional[_str] = ..., - max_rows: Optional[int] = ..., - min_rows: Optional[int] = ..., - max_cols: Optional[int] = ..., - show_dimensions: _bool = ..., - decimal: _str = ..., - line_width: Optional[int] = ..., - max_colwidth: Optional[int] = ..., - encoding: Optional[_str] = ..., - ) -> None: ... - @overload - def to_string( - self, - columns: Optional[Sequence[_str]] = ..., - col_space: Optional[Union[int, List[int], Dict[Union[_str, int], int]]] = ..., - header: Union[_bool, Sequence[_str]] = ..., - index: _bool = ..., - na_rep: _str = ..., - formatters=..., - float_format=..., - sparsify: Optional[_bool] = ..., - index_names: _bool = ..., - justify: Optional[_str] = ..., - max_rows: Optional[int] = ..., - min_rows: Optional[int] = ..., - max_cols: Optional[int] = ..., - show_dimensions: _bool = ..., - decimal: _str = ..., - line_width: Optional[int] = ..., - max_colwidth: Optional[int] = ..., - encoding: Optional[_str] = ..., - ) -> _str: ... - def to_xarray(self): ... - def truediv( - self, - other: Union[num, _ListLike, DataFrame], - axis: Optional[AxisType] = ..., - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - ) -> DataFrame: ... - def truncate( - self, - before: Optional[Union[datetime.date, _str, int]] = ..., - after: Optional[Union[datetime.date, _str, int]] = ..., - axis: Optional[AxisType] = ..., - copy: _bool = ..., - ) -> DataFrame: ... - # def tshift - def tz_convert( - self, - tz, - axis: AxisType = ..., - level: Optional[Level] = ..., - copy: _bool = ..., - ) -> DataFrame: ... - def tz_localize( - self, - tz, - axis: AxisType = ..., - level: Optional[Level] = ..., - copy: _bool = ..., - ambiguous=..., - nonexistent: _str = ..., - ) -> DataFrame: ... - def unique(self) -> DataFrame: ... - @overload - def var( - self, - axis: Optional[AxisType] = ..., - skipna: Optional[_bool] = ..., - ddof: int = ..., - numeric_only: Optional[_bool] = ..., - *, - level: Level, - **kwargs, - ) -> DataFrame: ... - @overload - def var( - self, - axis: Optional[AxisType] = ..., - skipna: Optional[_bool] = ..., - level: None = ..., - ddof: int = ..., - numeric_only: Optional[_bool] = ..., - **kwargs, - ) -> Series: ... - def where( - self, - cond: Union[Series, DataFrame, _np.ndarray], - other=..., - inplace: _bool = ..., - axis: Optional[AxisType] = ..., - level: Optional[Level] = ..., - errors: _str = ..., - try_cast: _bool = ..., - ) -> DataFrame: ... - # Move from generic because Series is Generic and it returns Series[bool] there - def __invert__(self) -> DataFrame: ... - \ No newline at end of file diff --git a/partial/pandas/core/generic.pyi b/partial/pandas/core/generic.pyi deleted file mode 100644 index 797e64a..0000000 --- a/partial/pandas/core/generic.pyi +++ /dev/null @@ -1,383 +0,0 @@ -import numpy as np -import sys -import pandas.core.indexing as indexing -from pandas._typing import ( - ArrayLike as ArrayLike, - Axis as Axis, - AxisType as AxisType, - Dtype as Dtype, - FilePathOrBuffer as FilePathOrBuffer, - FrameOrSeriesUnion as FrameOrSeriesUnion, - IgnoreRaise as IgnoreRaise, - JSONSerializable as JSONSerializable, - Level as Level, - Renamer as Renamer, - ListLike as ListLike, - Scalar as Scalar, - SeriesAxisType as SeriesAxisType, - FrameOrSeries as FrameOrSeries, - S1 as S1, - Timestamp as Timestamp, - Timedelta as Timedelta, - T, -) -from pandas.core.base import PandasObject as PandasObject -from pandas.core.indexes.base import Index as Index -from pandas.core.internals import BlockManager as BlockManager -from pandas.core.resample import Resampler -from typing import Any, Callable, Dict, Hashable, Iterator, List, Mapping, Optional, Sequence, Tuple, TypeVar, Union, overload - -if sys.version_info >= (3, 8): - from typing import Literal -else: - from typing_extensions import Literal - -_bool = bool -_str = str - -class NDFrame(PandasObject, indexing.IndexingMixin): - def __new__( - cls, - data: BlockManager, - axes: Optional[List[Index]] = ..., - copy: _bool = ..., - dtype: Optional[Dtype] = ..., - attrs: Optional[Mapping[Optional[Hashable], Any]] = ..., - fastpath: _bool = ..., - ) -> NDFrame: ... - def set_flags(self: FrameOrSeries, *, copy: bool = ..., allows_duplicate_labels: Optional[bool] = ...) -> FrameOrSeries: ... - @property - def attrs(self) -> Dict[Optional[Hashable], Any]: ... - @attrs.setter - def attrs(self, value: Mapping[Optional[Hashable], Any]) -> None: ... - @property - def shape(self) -> Tuple[int, ...]: ... - @property - def axes(self) -> List[Index]: ... - @property - def ndim(self) -> int: ... - @property - def size(self) -> int: ... - def swapaxes(self, axis1: SeriesAxisType, axis2: SeriesAxisType, copy: _bool = ...) -> NDFrame: ... - def droplevel(self, level: Level, axis: SeriesAxisType = ...) -> NDFrame: ... - def pop(self, item: _str) -> NDFrame: ... - def squeeze(self, axis=...): ... - def swaplevel(self, i=..., j=..., axis=...) -> NDFrame: ... - def equals(self, other: Series[S1]) -> _bool: ... - def __neg__(self) -> None: ... - def __pos__(self) -> None: ... - def __nonzero__(self) -> None: ... - def bool(self) -> _bool: ... - def __abs__(self) -> NDFrame: ... - def __round__(self, decimals: int = ...) -> NDFrame: ... - def __hash__(self): ... - def __iter__(self) -> Iterator: ... - def keys(self): ... - def iteritems(self): ... - def __len__(self) -> int: ... - def __contains__(self, key) -> _bool: ... - @property - def empty(self) -> _bool: ... - __array_priority__: int = ... - def __array__(self, dtype=...) -> np.ndarray: ... - def __array_wrap__(self, result, context=...): ... - def to_excel( - self, - excel_writer, - sheet_name: _str = ..., - na_rep: _str = ..., - float_format: Optional[_str] = ..., - columns: Optional[Union[_str, Sequence[_str]]] = ..., - header: _bool = ..., - index: _bool = ..., - index_label: Optional[Union[_str, Sequence[_str]]] = ..., - startrow: int = ..., - startcol: int = ..., - engine: Optional[_str] = ..., - merge_cells: _bool = ..., - encoding: Optional[_str] = ..., - inf_rep: _str = ..., - verbose: _bool = ..., - freeze_panes: Optional[Tuple[int, int]] = ..., - ) -> None: ... - @overload - def to_json( - self, - path_or_buf: Optional[FilePathOrBuffer], - orient: Optional[Union[_str, Literal["split", "records", "index", "columns", "values", "table"]]] = ..., - date_format: Optional[Union[_str, Literal["epoch", "iso"]]] = ..., - double_precision: int = ..., - force_ascii: _bool = ..., - date_unit: Union[_str, Literal["s", "ms", "us", "ns"]] = ..., - default_handler: Optional[Callable[[Any], Union[_str, int, float, _bool, List, Dict]]] = ..., - lines: _bool = ..., - compression: Union[_str, Literal["infer", "gzip", "bz2", "zip", "xz"]] = ..., - index: _bool = ..., - indent: Optional[int] = ..., - ) -> None: ... - @overload - def to_json( - self, - orient: Optional[Union[_str, Literal["split", "records", "index", "columns", "values", "table"]]] = ..., - date_format: Optional[Union[_str, Literal["epoch", "iso"]]] = ..., - double_precision: int = ..., - force_ascii: _bool = ..., - date_unit: Union[_str, Literal["s", "ms", "us", "ns"]] = ..., - default_handler: Optional[Callable[[Any], Union[_str, int, float, _bool, List, Dict]]] = ..., - lines: _bool = ..., - compression: Optional[Union[_str, Literal["infer", "gzip", "bz2", "zip", "xz"]]] = ..., - index: _bool = ..., - indent: Optional[int] = ..., - ) -> _str: ... - def to_hdf( - self, - path_or_buf: FilePathOrBuffer, - key: _str, - mode: _str = ..., - complevel: Optional[int] = ..., - complib: Optional[_str] = ..., - append: _bool = ..., - format: Optional[_str] = ..., - index: _bool = ..., - min_itemsize: Optional[Union[int, Dict[_str, int]]] = ..., - nan_rep=..., - dropna: Optional[_bool] = ..., - data_columns: Optional[List[_str]] = ..., - errors: _str = ..., - encoding: _str = ..., - ) -> None: ... - def to_sql( - self, - name: _str, - con, - schema: Optional[_str] = ..., - if_exists: _str = ..., - index: _bool = ..., - index_label: Optional[Union[_str, Sequence[_str]]] = ..., - chunksize: Optional[int] = ..., - dtype: Optional[Union[Dict, Scalar]] = ..., - method: Optional[Union[_str, Callable]] = ..., - ) -> None: ... - def to_pickle( - self, - path: _str, - compression: Union[_str, Literal["infer", "gzip", "bz2", "zip", "xz"]] = ..., - protocol: int = ..., - ) -> None: ... - def to_clipboard(self, excel: _bool = ..., sep: Optional[_str] = ..., **kwargs) -> None: ... - def to_xarray(self): ... - @overload - def to_latex( - self, - buf: Optional[FilePathOrBuffer], - columns: Optional[List[_str]] = ..., - col_space: Optional[int] = ..., - header: _bool = ..., - index: _bool = ..., - na_rep: _str = ..., - formatters=..., - float_format=..., - sparsify: Optional[_bool] = ..., - index_names: _bool = ..., - bold_rows: _bool = ..., - column_format: Optional[_str] = ..., - longtable: Optional[_bool] = ..., - escape: Optional[_bool] = ..., - encoding: Optional[_str] = ..., - decimal: _str = ..., - multicolumn: Optional[_bool] = ..., - multicolumn_format: Optional[_str] = ..., - multirow: Optional[_bool] = ..., - caption: Optional[Union[_str, Tuple[_str, _str]]] = ..., - label: Optional[_str] = ..., - position: Optional[_str] = ..., - ) -> None: ... - @overload - def to_latex( - self, - columns: Optional[List[_str]] = ..., - col_space: Optional[int] = ..., - header: _bool = ..., - index: _bool = ..., - na_rep: _str = ..., - formatters=..., - float_format=..., - sparsify: Optional[_bool] = ..., - index_names: _bool = ..., - bold_rows: _bool = ..., - column_format: Optional[_str] = ..., - longtable: Optional[_bool] = ..., - escape: Optional[_bool] = ..., - encoding: Optional[_str] = ..., - decimal: _str = ..., - multicolumn: Optional[_bool] = ..., - multicolumn_format: Optional[_str] = ..., - multirow: Optional[_bool] = ..., - caption: Optional[Union[_str, Tuple[_str, _str]]] = ..., - label: Optional[_str] = ..., - position: Optional[_str] = ..., - ) -> _str: ... - @overload - def to_csv( - self, - path_or_buf: Optional[FilePathOrBuffer], - sep: _str = ..., - na_rep: _str = ..., - float_format: Optional[_str] = ..., - columns: Optional[Sequence[Hashable]] = ..., - header: Union[_bool, List[_str]] = ..., - index: _bool = ..., - index_label: Optional[Union[_bool, _str, Sequence[Hashable]]] = ..., - mode: _str = ..., - encoding: Optional[_str] = ..., - compression: Union[_str, Mapping[_str, _str]] = ..., - quoting: Optional[int] = ..., - quotechar: _str = ..., - line_terminator: Optional[_str] = ..., - chunksize: Optional[int] = ..., - date_format: Optional[_str] = ..., - doublequote: _bool = ..., - escapechar: Optional[_str] = ..., - decimal: _str = ..., - errors: _str = ..., - storage_options: Optional[Dict[_str, Any]] = ..., - ) -> None: ... - @overload - def to_csv( - self, - sep: _str = ..., - na_rep: _str = ..., - float_format: Optional[_str] = ..., - columns: Optional[Sequence[Hashable]] = ..., - header: Union[_bool, List[_str]] = ..., - index: _bool = ..., - index_label: Optional[Union[_bool, _str, Sequence[Hashable]]] = ..., - mode: _str = ..., - encoding: Optional[_str] = ..., - compression: Union[_str, Mapping[_str, _str]] = ..., - quoting: Optional[int] = ..., - quotechar: _str = ..., - line_terminator: Optional[_str] = ..., - chunksize: Optional[int] = ..., - date_format: Optional[_str] = ..., - doublequote: _bool = ..., - escapechar: Optional[_str] = ..., - decimal: _str = ..., - errors: _str = ..., - storage_options: Optional[Dict[_str, Any]] = ..., - ) -> _str: ... - def take(self, indices, axis=..., is_copy: Optional[_bool] = ..., **kwargs) -> NDFrame: ... - def xs( - self, - key: Union[_str, Tuple[_str]], - axis: SeriesAxisType = ..., - level: Optional[Level] = ..., - drop_level: _bool = ..., - ) -> FrameOrSeriesUnion: ... - def __delitem__(self, idx: Hashable): ... - def get(self, key: object, default: Optional[Dtype] = ...) -> Dtype: ... - def reindex_like(self, other, method: Optional[_str] = ..., copy: _bool = ..., limit=..., tolerance=...) -> NDFrame: ... - @overload - def drop( - self, - labels: Hashable | list[Hashable] = ..., - *, - axis: Axis = ..., - index: Hashable | list[Hashable] = ..., - columns: Hashable | list[Hashable] = ..., - level: Level | None = ..., - inplace: Literal[True], - errors: IgnoreRaise = ..., - ) -> None: ... - @overload - def drop( - self: NDFrame, - labels: Hashable | list[Hashable] = ..., - *, - axis: Axis = ..., - index: Hashable | list[Hashable] = ..., - columns: Hashable | list[Hashable] = ..., - level: Level | None = ..., - inplace: Literal[False] = ..., - errors: IgnoreRaise = ..., - ) -> NDFrame: ... - @overload - def drop( - self: NDFrame, - labels: Hashable | list[Hashable] = ..., - *, - axis: Axis = ..., - index: Hashable | list[Hashable] = ..., - columns: Hashable | list[Hashable] = ..., - level: Level | None = ..., - inplace: _bool = ..., - errors: IgnoreRaise = ..., - ) -> NDFrame | None: ... - def add_prefix(self, prefix: _str) -> NDFrame: ... - def add_suffix(self, suffix: _str) -> NDFrame: ... - def sort_index( - self, - axis=..., - level=..., - ascending: _bool = ..., - inplace: _bool = ..., - kind: _str = ..., - na_position: _str = ..., - sort_remaining: _bool = ..., - ignore_index: _bool = ..., - ): ... - def filter(self, items=..., like: Optional[_str] = ..., regex: Optional[_str] = ..., axis=...) -> NDFrame: ... - def head(self: FrameOrSeries, n: int = ...) -> FrameOrSeries: ... - def tail(self: FrameOrSeries, n: int = ...) -> FrameOrSeries: ... - def pipe(self, func: Callable[..., T] | tuple[Callable[..., T], str], *args, **kwargs) -> T: ... - def __finalize__(self, other, method=..., **kwargs) -> NDFrame: ... - def __getattr__(self, name: _str): ... - def __setattr__(self, name: _str, value) -> None: ... - @property - def values(self) -> ArrayLike: ... - @property - def dtypes(self): ... - def astype(self: FrameOrSeries, dtype, copy: _bool = ..., errors: str = ...) -> FrameOrSeries: ... - def copy(self: FrameOrSeries, deep: _bool = ...) -> FrameOrSeries: ... - def __copy__(self, deep: _bool = ...) -> NDFrame: ... - def __deepcopy__(self, memo=...) -> NDFrame: ... - def infer_objects(self) -> NDFrame: ... - def convert_dtypes(self:FrameOrSeries, infer_objects: _bool = ..., convert_string: _bool = ..., convert_integer: _bool = ..., convert_boolean: _bool = ...) -> FrameOrSeries: ... - def fillna(self, value=..., method=..., axis=..., inplace: _bool = ..., limit=..., downcast=...) -> Optional[NDFrame]: ... - def replace(self, to_replace=..., value=..., inplace: _bool = ..., limit=..., regex: _bool = ..., method: _str = ...): ... - def asof(self, where, subset=...): ... - def isna(self) -> NDFrame: ... - def isnull(self) -> NDFrame: ... - def notna(self) -> NDFrame: ... - def notnull(self) -> NDFrame: ... - def clip(self, lower=..., upper=..., axis=..., inplace: _bool = ..., *args, **kwargs) -> NDFrame: ... - def asfreq(self, freq, method=..., how: Optional[_str] = ..., normalize: _bool = ..., fill_value=...) -> NDFrame: ... - def at_time(self, time, asof: _bool = ..., axis=...) -> NDFrame: ... - def between_time(self, start_time, end_time, include_start: _bool = ..., include_end: _bool = ..., axis=...) -> NDFrame: ... - def first(self, offset) -> NDFrame: ... - def last(self, offset) -> NDFrame: ... - def rank( - self, - axis=..., - method: _str = ..., - numeric_only: Optional[_bool] = ..., - na_option: _str = ..., - ascending: _bool = ..., - pct: _bool = ..., - ) -> NDFrame: ... - def where(self, cond, other=..., inplace: _bool = ..., axis=..., level=..., errors: _str = ..., try_cast: _bool = ...): ... - def mask(self, cond, other=..., inplace: _bool = ..., axis=..., level=..., errors: _str = ..., try_cast: _bool = ...): ... - def shift(self, periods=..., freq=..., axis=..., fill_value=...) -> NDFrame: ... - def slice_shift(self, periods: int = ..., axis=...) -> NDFrame: ... - def tshift(self, periods: int = ..., freq=..., axis=...) -> NDFrame: ... - def truncate(self, before=..., after=..., axis=..., copy: _bool = ...) -> NDFrame: ... - def tz_convert(self, tz, axis=..., level=..., copy: _bool = ...) -> NDFrame: ... - def tz_localize(self, tz, axis=..., level=..., copy: _bool = ..., ambiguous=..., nonexistent: str = ...) -> NDFrame: ... - def abs(self) -> NDFrame: ... - def describe(self, percentiles=..., include=..., exclude=..., datetime_is_numeric: Optional[_bool] = ...) -> NDFrame: ... - def pct_change(self, periods=..., fill_method=..., limit=..., freq=..., **kwargs) -> NDFrame: ... - def transform(self, func, *args, **kwargs): ... - def first_valid_index(self): ... - def last_valid_index(self): ... - -from pandas.core.series import Series as Series diff --git a/partial/pandas/core/groupby/__init__.pyi b/partial/pandas/core/groupby/__init__.pyi deleted file mode 100644 index 178542b..0000000 --- a/partial/pandas/core/groupby/__init__.pyi +++ /dev/null @@ -1,2 +0,0 @@ -from pandas.core.groupby.generic import NamedAgg as NamedAgg -from pandas.core.groupby.grouper import Grouper as Grouper diff --git a/partial/pandas/core/groupby/categorical.pyi b/partial/pandas/core/groupby/categorical.pyi deleted file mode 100644 index ed968b1..0000000 --- a/partial/pandas/core/groupby/categorical.pyi +++ /dev/null @@ -1,4 +0,0 @@ -from pandas.core.arrays.categorical import Categorical as Categorical # , CategoricalDtype as CategoricalDtype - -def recode_for_groupby(c: Categorical, sort: bool, observed: bool): ... -def recode_from_groupby(c: Categorical, sort: bool, ci): ... diff --git a/partial/pandas/core/groupby/generic.pyi b/partial/pandas/core/groupby/generic.pyi deleted file mode 100644 index cd9f9bd..0000000 --- a/partial/pandas/core/groupby/generic.pyi +++ /dev/null @@ -1,238 +0,0 @@ -from matplotlib.axes import Axes as PlotAxes, SubplotBase as AxesSubplot -import numpy as np -import sys -from pandas._typing import FrameOrSeries as FrameOrSeries, AxisType, Dtype, Level, F, AggFuncType, S1 -from pandas.core.frame import DataFrame as DataFrame -from pandas.core.groupby.groupby import GroupBy as GroupBy # , get_groupby as get_groupby -from pandas.core.groupby.grouper import Grouper as Grouper -from pandas.core.series import Series as Series -from typing import Any, Callable, Dict, FrozenSet, List, NamedTuple, Optional, Sequence, Tuple, Type, Union, overload - -if sys.version_info >= (3, 8): - from typing import Literal -else: - from typing_extensions import Literal - -AggScalar = Union[str, Callable[..., Any]] -ScalarResult = ... - -class NamedAgg(NamedTuple): - column: str = ... - aggfunc: AggScalar = ... - -def generate_property(name: str, klass: Type[FrameOrSeries]): ... -def pin_whitelisted_properties(klass: Type[FrameOrSeries], whitelist: FrozenSet[str]): ... - -class SeriesGroupBy(GroupBy): - def any(self, skipna: bool = ...) -> Series[bool]: ... - def all(self, skipna: bool = ...) -> Series[bool]: ... - def apply(self, func, *args, **kwargs) -> Series: ... - @overload - def aggregate(self, func: Union[List, Dict], *args, **kwargs) -> DataFrame: ... - @overload - def aggregate(self, func: Union[str, Callable], *args, **kwargs) -> Series: ... - agg = aggregate - def transform(self, func, *args, **kwargs): ... - def filter(self, func, dropna: bool = ..., *args, **kwargs): ... - def nunique(self, dropna: bool = ...) -> Series: ... - def describe(self, **kwargs) -> DataFrame: ... - def value_counts( - self, - normalize: bool = ..., - sort: bool = ..., - ascending: bool = ..., - bins=..., - dropna: bool = ..., - ) -> DataFrame: ... - def count(self) -> Series[int]: ... - def pct_change( - self, - periods: int = ..., - fill_method: str = ..., - limit=..., - freq=..., - axis: AxisType = ..., - ) -> Series[float]: ... - # Overrides and others from original pylance stubs - @property - def is_monotonic_increasing(self) -> bool: ... - @property - def is_monotonic_decreasing(self) -> bool: ... - def bfill(self, limit: Optional[int] = ...) -> Series[S1]: ... - def cummax(self, axis: AxisType = ..., **kwargs) -> Series[S1]: ... - def cummin(self, axis: AxisType = ..., **kwargs) -> Series[S1]: ... - def cumprod(self, axis: AxisType = ..., **kwargs) -> Series[S1]: ... - def cumsum(self, axis: AxisType = ..., **kwargs) -> Series[S1]: ... - def ffill(self, limit: Optional[int] = ...) -> Series[S1]: ... - def first(self, **kwargs) -> Series[S1]: ... - def head(self, n: int = ...) -> Series[S1]: ... - def last(self, **kwargs) -> Series[S1]: ... - def max(self, **kwargs) -> Series[S1]: ... - def mean(self, **kwargs) -> Series[S1]: ... - def median(self, **kwargs) -> Series[S1]: ... - def min(self, **kwargs) -> Series[S1]: ... - def nlargest(self, n: int = ..., keep: str = ...) -> Series[S1]: ... - def nsmallest(self, n: int = ..., keep: str = ...) -> Series[S1]: ... - def nth(self, n: Union[int, Sequence[int]], dropna: Optional[str] = ...) -> Series[S1]: ... - -class DataFrameGroupBy(GroupBy): - def any(self, skipna: bool = ...) -> DataFrame: ... - def all(self, skipna: bool = ...) -> DataFrame: ... - def apply(self, func, *args, **kwargs) -> DataFrame: ... - @overload - def aggregate(self, arg: str, *args, **kwargs) -> DataFrame: ... - @overload - def aggregate(self, arg: Dict, *args, **kwargs) -> DataFrame: ... - @overload - def aggregate(self, arg: Callable[[], Any], *args, **kwargs) -> DataFrame: ... - @overload - def agg(self, arg: str, *args, **kwargs) -> DataFrame: ... - @overload - def agg(self, arg: Dict, *args, **kwargs) -> DataFrame: ... - @overload - def agg(self, arg: F, *args, **kwargs) -> DataFrame: ... - def transform(self, func, *args, **kwargs): ... - def filter(self, func: Callable, dropna: bool = ..., *args, **kwargs) -> DataFrame: ... - def nunique(self, dropna: bool = ...) -> DataFrame: ... - @overload - def __getitem__(self, item: str) -> SeriesGroupBy: ... - @overload - def __getitem__(self, item: List[str]) -> DataFrameGroupBy: ... - def count(self) -> DataFrame: ... - def boxplot( - self, - grouped: DataFrame, - subplots: bool = ..., - column: Optional[Union[str, Sequence]] = ..., - fontsize: Union[int, str] = ..., - rot: float = ..., - grid: bool = ..., - ax: Optional[PlotAxes] = ..., - figsize: Optional[Tuple[float, float]] = ..., - layout: Optional[Tuple[int, int]] = ..., - sharex: bool = ..., - sharey: bool = ..., - bins: Union[int, Sequence] = ..., - backend: Optional[str] = ..., - **kwargs, - ) -> Union[AxesSubplot, Sequence[AxesSubplot]]: ... - # Overrides and others from original pylance stubs - ## These are "properties" but properties can't have all these arguments?! - def corr(self, method: Union[str, Callable], min_periods: int = ...) -> DataFrame: ... - def cov(self, min_periods: int = ...) -> DataFrame: ... - def diff(self, periods: int = ..., axis: AxisType = ...) -> DataFrame: ... - def bfill(self, limit: Optional[int] = ...) -> DataFrame: ... - def corrwith( - self, - other: DataFrame, - axis: AxisType = ..., - drop: bool = ..., - method: str = ..., - ) -> Series: ... - def cummax(self, axis: AxisType = ..., **kwargs) -> DataFrame: ... - def cummin(self, axis: AxisType = ..., **kwargs) -> DataFrame: ... - def cumprod(self, axis: AxisType = ..., **kwargs) -> DataFrame: ... - def cumsum(self, axis: AxisType = ..., **kwargs) -> DataFrame: ... - def describe(self, **kwargs) -> DataFrame: ... - def ffill(self, limit: Optional[int] = ...) -> DataFrame: ... - @overload - def fillna( - self, - value, - method: Optional[str] = ..., - axis: AxisType = ..., - limit: Optional[int] = ..., - downcast: Optional[Dict] = ..., - *, - inplace: Literal[True], - ) -> None: ... - @overload - def fillna( - self, - value, - method: Optional[str] = ..., - axis: AxisType = ..., - limit: Optional[int] = ..., - downcast: Optional[Dict] = ..., - *, - inplace: Literal[False], - ) -> DataFrame: ... - @overload - def fillna( - self, - value, - method: Optional[str] = ..., - axis: AxisType = ..., - inplace: bool = ..., - limit: Optional[int] = ..., - downcast: Optional[Dict] = ..., - ) -> Union[None, DataFrame]: ... - def first(self, **kwargs) -> DataFrame: ... - def head(self, n: int = ...) -> DataFrame: ... - def hist( - self, - data: DataFrame, - column: Optional[Union[str, Sequence]] = ..., - by=..., - grid: bool = ..., - xlabelsize: Optional[int] = ..., - xrot: Optional[float] = ..., - ylabelsize: Optional[int] = ..., - yrot: Optional[float] = ..., - ax: Optional[PlotAxes] = ..., - sharex: bool = ..., - sharey: bool = ..., - figsize: Optional[Tuple[float, float]] = ..., - layout: Optional[Tuple[int, int]] = ..., - bins: Union[int, Sequence] = ..., - backend: Optional[str] = ..., - **kwargs, - ) -> Union[AxesSubplot, Sequence[AxesSubplot]]: ... - def idxmax(self, axis: AxisType = ..., skipna: bool = ...) -> Series: ... - def idxmin(self, axis: AxisType = ..., skipna: bool = ...) -> Series: ... - def last(self, **kwargs) -> DataFrame: ... - @overload - def mad( - self, axis: AxisType = ..., skipna: bool = ..., numeric_only: Optional[bool] = ..., *, level: Level, **kwargs - ) -> DataFrame: ... - @overload - def mad( - self, axis: AxisType = ..., skipna: bool = ..., level: None = ..., numeric_only: Optional[bool] = ..., **kwargs - ) -> Series: ... - def max(self, **kwargs) -> DataFrame: ... - def mean(self, **kwargs) -> DataFrame: ... - def median(self, **kwargs) -> DataFrame: ... - def min(self, **kwargs) -> DataFrame: ... - def nth(self, n: Union[int, Sequence[int]], dropna: Optional[str] = ...) -> DataFrame: ... - def pct_change( - self, - periods: int = ..., - fill_method: str = ..., - limit=..., - freq=..., - axis: AxisType = ..., - ) -> DataFrame: ... - def prod(self, **kwargs) -> DataFrame: ... - def quantile(self, q: float = ..., interpolation: str = ...) -> DataFrame: ... - def resample(self, rule, *args, **kwargs) -> Grouper: ... - def sem(self, ddof: int = ...) -> DataFrame: ... - def shift( - self, - periods: int = ..., - freq: str = ..., - axis: AxisType = ..., - fill_value=..., - ) -> DataFrame: ... - def size(self) -> Series[int]: ... - @overload - def skew( - self, axis: AxisType = ..., skipna: bool = ..., numeric_only: bool = ..., *, level: Level, **kwargs - ) -> DataFrame: ... - @overload - def skew(self, axis: AxisType = ..., skipna: bool = ..., level: None = ..., numeric_only: bool = ..., **kwargs) -> Series: ... - def std(self, ddof: int = ...) -> DataFrame: ... - def sum(self, **kwargs) -> DataFrame: ... - def tail(self, n: int = ...) -> DataFrame: ... - def take(self, indices: Sequence, axis: AxisType = ..., **kwargs) -> DataFrame: ... - def tshift(self, periods: int, freq=..., axis: AxisType = ...) -> DataFrame: ... - def var(self, ddof: int = ...) -> DataFrame: ... diff --git a/partial/pandas/core/groupby/groupby.pyi b/partial/pandas/core/groupby/groupby.pyi deleted file mode 100644 index d3b6d32..0000000 --- a/partial/pandas/core/groupby/groupby.pyi +++ /dev/null @@ -1,131 +0,0 @@ -from pandas._typing import ( - FrameOrSeries as FrameOrSeries, - FrameOrSeriesUnion as FrameOrSeriesUnion, - Scalar as Scalar, - AxisType as AxisType, - KeysArgType, -) -from pandas.core.base import PandasObject as PandasObject, SelectionMixin as SelectionMixin -from pandas.core.frame import DataFrame as DataFrame -from pandas.core.generic import NDFrame as NDFrame - -from pandas.core.groupby import ops as ops -from pandas.core.indexes.api import Index as Index -from pandas.core.series import Series as Series -from typing import Any, Callable, Dict, Generator, List, Optional, Tuple, Union - -class GroupByPlot(PandasObject): - def __init__(self, groupby) -> None: ... - def __call__(self, *args, **kwargs): ... - def __getattr__(self, name: str): ... - -class _GroupBy(PandasObject): - level = ... - as_index = ... - keys = ... - sort = ... - group_keys = ... - squeeze = ... - observed = ... - mutated = ... - obj = ... - axis = ... - grouper = ... - exclusions = ... - def __init__( - self, - obj: NDFrame, - keys: Optional[KeysArgType] = ..., - axis: int = ..., - level=..., - grouper: Optional[ops.BaseGrouper] = ..., - exclusions=..., - selection=..., - as_index: bool = ..., - sort: bool = ..., - group_keys: bool = ..., - squeeze: bool = ..., - observed: bool = ..., - mutated: bool = ..., - ) -> None: ... - def __len__(self) -> int: ... - @property - def groups(self) -> Dict[str, str]: ... - @property - def ngroups(self): ... - @property - def indices(self) -> Dict[str, Index]: ... - def __getattr__(self, attr: str): ... - def pipe(self, func: Callable, *args, **kwargs): ... - plot = ... - def get_group(self, name, obj: Optional[DataFrame] = ...) -> DataFrame: ... - def __iter__(self) -> Generator[Tuple[str, Any], None, None]: ... - def apply(self, func: Callable, *args, **kwargs) -> FrameOrSeriesUnion: ... - -class GroupBy(_GroupBy): - def count(self) -> FrameOrSeriesUnion: ... - def mean(self, **kwargs) -> FrameOrSeriesUnion: ... - def median(self, **kwargs) -> FrameOrSeriesUnion: ... - def std(self, ddof: int = ...) -> FrameOrSeriesUnion: ... - def var(self, ddof: int = ...) -> FrameOrSeriesUnion: ... - def sem(self, ddof: int = ...) -> FrameOrSeriesUnion: ... - def size(self) -> Series: ... - def ohlc(self) -> DataFrame: ... - def describe(self, **kwargs) -> FrameOrSeriesUnion: ... - def resample(self, rule, *args, **kwargs): ... - def rolling(self, *args, **kwargs): ... - def expanding(self, *args, **kwargs): ... - def pad(self, limit: Optional[int] = ...): ... - def ffill(self, limit: Optional[int] = ...) -> FrameOrSeriesUnion: ... - def backfill(self, limit: Optional[int] = ...) -> FrameOrSeriesUnion: ... - def bfill(self, limit: Optional[int] = ...) -> FrameOrSeriesUnion: ... - def nth(self, n: Union[int, List[int]], dropna: Optional[str] = ...) -> FrameOrSeriesUnion: ... - def quantile(self, q=..., interpolation: str = ...): ... - def ngroup(self, ascending: bool = ...) -> Series: ... - def cumcount(self, ascending: bool = ...) -> Series: ... - def rank( - self, - method: str = ..., - ascending: bool = ..., - na_option: str = ..., - pct: bool = ..., - axis: int = ..., - ) -> DataFrame: ... - def cummax(self, axis: AxisType = ..., **kwargs) -> FrameOrSeriesUnion: ... - def cummin(self, axis: AxisType = ..., **kwargs) -> FrameOrSeriesUnion: ... - def cumprod(self, axis: AxisType = ..., **kwargs) -> FrameOrSeriesUnion: ... - def cumsum(self, axis: AxisType = ..., **kwargs) -> FrameOrSeriesUnion: ... - def shift(self, periods: int = ..., freq=..., axis: AxisType = ..., fill_value=...): ... - def pct_change( - self, - periods: int = ..., - fill_method: str = ..., - limit=..., - freq=..., - axis: AxisType = ..., - ) -> FrameOrSeriesUnion: ... - def head(self, n: int = ...) -> FrameOrSeriesUnion: ... - def tail(self, n: int = ...) -> FrameOrSeriesUnion: ... - # Surplus methodss from original pylance stubs; should they go away? - def first(self, **kwargs) -> FrameOrSeriesUnion: ... - def last(self, **kwargs) -> FrameOrSeriesUnion: ... - def max(self, **kwargs) -> FrameOrSeriesUnion: ... - def min(self, **kwargs) -> FrameOrSeriesUnion: ... - def prod(self, **kwargs) -> FrameOrSeriesUnion: ... - def sum(self, **kwargs) -> FrameOrSeriesUnion: ... - -def get_groupby( - obj: NDFrame, - by: Optional[KeysArgType] = ..., - axis: int = ..., - level=..., - grouper: Optional[ops.BaseGrouper] = ..., - exclusions=..., - selection=..., - as_index: bool = ..., - sort: bool = ..., - group_keys: bool = ..., - squeeze: bool = ..., - observed: bool = ..., - mutated: bool = ..., -) -> GroupBy: ... diff --git a/partial/pandas/core/groupby/ops.pyi b/partial/pandas/core/groupby/ops.pyi deleted file mode 100644 index 58a34d0..0000000 --- a/partial/pandas/core/groupby/ops.pyi +++ /dev/null @@ -1,82 +0,0 @@ -import numpy as np -from pandas._typing import FrameOrSeries as FrameOrSeries -from pandas.core.groupby import grouper as grouper -from pandas.core.indexes.api import Index as Index -from pandas.core.series import Series as Series -from typing import List, Optional, Sequence, Tuple - -class BaseGrouper: - axis = ... - sort = ... - group_keys = ... - mutated = ... - indexer = ... - def __init__(self, axis: Index, groupings: Sequence[grouper.Grouping], sort: bool=..., group_keys: bool=..., mutated: bool=..., indexer: Optional[np.ndarray]=...) -> None: ... - @property - def groupings(self) -> List[grouper.Grouping]: ... - @property - def shape(self): ... - def __iter__(self) : ... - @property - def nkeys(self) -> int: ... - def get_iterator(self, data: FrameOrSeries, axis: int=...) : ... - def apply(self, f, data: FrameOrSeries, axis: int=...) : ... - def indices(self): ... - @property - def codes(self) -> List[np.ndarray]: ... - @property - def levels(self) -> List[Index]: ... - @property - def names(self): ... - def size(self) -> Series: ... - def groups(self): ... - def is_monotonic(self) -> bool: ... - def group_info(self): ... - def codes_info(self) -> np.ndarray: ... - def ngroups(self) -> int: ... - @property - def reconstructed_codes(self) -> List[np.ndarray]: ... - def result_index(self) -> Index: ... - def get_group_levels(self): ... - def aggregate(self, values, how: str, axis: int=..., min_count: int=...) -> Tuple[np.ndarray, Optional[List[str]]]: ... - def transform(self, values, how: str, axis: int=..., **kwargs) : ... - def agg_series(self, obj: Series, func) : ... - -class BinGrouper(BaseGrouper): - bins = ... - binlabels = ... - mutated = ... - indexer = ... - def __init__(self, bins, binlabels, filter_empty: bool=..., mutated: bool=..., indexer=...) -> None: ... - def groups(self): ... - @property - def nkeys(self) -> int: ... - def get_iterator(self, data: FrameOrSeries, axis: int=...) : ... - def indices(self): ... - def group_info(self): ... - def reconstructed_codes(self) -> List[np.ndarray]: ... - def result_index(self): ... - @property - def levels(self): ... - @property - def names(self): ... - @property - def groupings(self) -> List[grouper.Grouping]: ... - def agg_series(self, obj: Series, func) : ... - -class DataSplitter: - data = ... - labels = ... - ngroups = ... - axis = ... - def __init__(self, data: FrameOrSeries, labels, ngroups: int, axis: int=...) -> None: ... - def slabels(self): ... - def sort_idx(self): ... - def __iter__(self) : ... - -class SeriesSplitter(DataSplitter): ... - -class FrameSplitter(DataSplitter): - def fast_apply(self, f, names): ... - -def get_splitter(data: FrameOrSeries, *args, **kwargs) -> DataSplitter: ... diff --git a/partial/pandas/core/indexes/__init__.pyi b/partial/pandas/core/indexes/__init__.pyi deleted file mode 100644 index e69de29..0000000 diff --git a/partial/pandas/core/indexes/accessors.pyi b/partial/pandas/core/indexes/accessors.pyi deleted file mode 100644 index 3a72aa1..0000000 --- a/partial/pandas/core/indexes/accessors.pyi +++ /dev/null @@ -1,25 +0,0 @@ -from pandas.core.accessor import PandasDelegate as PandasDelegate -from pandas.core.base import NoNewAttributesMixin as NoNewAttributesMixin, PandasObject as PandasObject -from pandas.core.series import Series - -class Properties(PandasDelegate, PandasObject, NoNewAttributesMixin): - orig = ... - name = ... - def __init__(self, data: Series, orig) -> None: ... - -class DatetimeProperties(Properties): - def to_pydatetime(self): ... - @property - def freq(self): ... - -class TimedeltaProperties(Properties): - def to_pytimedelta(self): ... - @property - def components(self): ... - @property - def freq(self): ... - -class PeriodProperties(Properties): ... - -class CombinedDatetimelikeProperties(DatetimeProperties, TimedeltaProperties, PeriodProperties): - def __new__(cls, data: Series): ... diff --git a/partial/pandas/core/indexes/base.pyi b/partial/pandas/core/indexes/base.pyi deleted file mode 100644 index b503c65..0000000 --- a/partial/pandas/core/indexes/base.pyi +++ /dev/null @@ -1,190 +0,0 @@ -import numpy as np -from pandas._typing import ( - Dtype as Dtype, - DtypeArg as DtypeArg, - Label as Label, - Level as Level, - Scalar as Scalar, - T1 as T1, - np_ndarray_str, - np_ndarray_int64, - np_ndarray_bool, -) - -from pandas._typing import Series as Series, DataFrame as DataFrame, DtypeObj as DtypeObj - -from pandas.core.arrays import ExtensionArray - -from pandas.core.base import IndexOpsMixin, PandasObject - -from pandas.core.strings import StringMethods - -from typing import ( - Callable, - Dict, - Generic, - Hashable, - Iterable, - Iterator, - List, - Literal, - Optional, - Sequence, - Tuple, - Union, - overload, -) - -class InvalidIndexError(Exception): ... - -_str = str - -class Index(IndexOpsMixin, PandasObject): - def __new__( - cls, data: Iterable = ..., dtype=..., copy: bool = ..., name=..., tupleize_cols: bool = ..., **kwargs - ) -> Index: ... - def __init__( - self, - data: Iterable, - dtype=..., - copy: bool = ..., - name=..., - tupleize_cols: bool = ..., - ): ... - @property - def str(self) -> StringMethods[Index]: ... - @property - def asi8(self) -> np_ndarray_int64: ... - def is_(self, other) -> bool: ... - def __len__(self) -> int: ... - def __array__(self, dtype=...) -> np.ndarray: ... - def __array_wrap__(self, result, context=...): ... - @property - def dtype(self) -> DtypeObj: ... - def ravel(self, order: _str = ...): ... - def view(self, cls=...): ... - @overload - def astype(self, dtype: DtypeArg) -> Index: ... - @overload - def astype(self, dtype: T1) -> Index: ... - def take(self, indices, axis: int = ..., allow_fill: bool = ..., fill_value=..., **kwargs): ... - def repeat(self, repeats, axis=...): ... - def copy(self, name=..., deep: bool = ...) -> Index: ... - def __copy__(self, **kwargs): ... - def __deepcopy__(self, memo=...): ... - def format(self, name: bool = ..., formatter: Optional[Callable] = ..., na_rep: _str = ...) -> List[_str]: ... - def to_native_types(self, slicer=..., **kwargs): ... - def to_flat_index(self): ... - def to_series(self, index=..., name=...): ... - def to_frame(self, index: bool = ..., name=...) -> DataFrame: ... - @property - def name(self): ... - @name.setter - def name(self, value) -> None: ... - @property - def names(self) -> List[_str]: ... - @names.setter - def names(self, names: List[_str]): ... - def set_names(self, names, level=..., inplace: bool = ...): ... - def rename(self, name, inplace: bool = ...): ... - @property - def nlevels(self) -> int: ... - def sortlevel(self, level=..., ascending: bool = ..., sort_remaining=...): ... - def get_level_values(self, level: Union[int, _str]) -> Index: ... - def droplevel(self, level: Union[Level, List[Level]] = ...): ... - @property - def is_monotonic(self) -> bool: ... - @property - def is_monotonic_increasing(self) -> bool: ... - @property - def is_monotonic_decreasing(self) -> bool: ... - def is_unique(self) -> bool: ... - @property - def has_duplicates(self) -> bool: ... - def is_boolean(self) -> bool: ... - def is_integer(self) -> bool: ... - def is_floating(self) -> bool: ... - def is_numeric(self) -> bool: ... - def is_object(self) -> bool: ... - def is_categorical(self) -> bool: ... - def is_interval(self) -> bool: ... - def is_mixed(self) -> bool: ... - def holds_integer(self): ... - def inferred_type(self): ... - def is_all_dates(self) -> bool: ... - def __reduce__(self): ... - def hasnans(self) -> bool: ... - def isna(self): ... - isnull = ... - def notna(self): ... - notnull = ... - def fillna(self, value=..., downcast=...): ... - def dropna(self, how: _str = ...): ... - def unique(self, level=...) -> Index: ... - def drop_duplicates(self, keep: Literal["first", "last", False] = ...) -> IndexOpsMixin: ... - def duplicated(self, keep: _str = ...): ... - def __add__(self, other) -> Index: ... - def __radd__(self, other) -> Index: ... - def __iadd__(self, other) -> Index: ... - def __sub__(self, other) -> Index: ... - def __rsub__(self, other) -> Index: ... - def __and__(self, other) -> Index: ... - def __or__(self, other) -> Index: ... - def __xor__(self, other) -> Index: ... - def __nonzero__(self) -> None: ... - __bool__ = ... - def union(self, other: Union[List[T1], Index], sort=...) -> Index: ... - def intersection(self, other: Union[List[T1], Index], sort: bool = ...) -> Index: ... - def difference(self, other: Union[List[T1], Index]) -> Index: ... - def symmetric_difference(self, other: Union[List[T1], Index], result_name=..., sort=...) -> Index: ... - def get_loc(self, key, method=..., tolerance=...): ... - def get_indexer(self, target, method=..., limit=..., tolerance=...): ... - def reindex(self, target, method=..., level=..., limit=..., tolerance=...): ... - def join(self, other, how: _str = ..., level=..., return_indexers: bool = ..., sort: bool = ...): ... - @property - def values(self) -> np.ndarray: ... - def array(self) -> ExtensionArray: ... - def memory_usage(self, deep: bool = ...): ... - def where(self, cond, other=...): ... - def is_type_compatible(self, kind) -> bool: ... - def __contains__(self, key) -> bool: ... - def __hash__(self) -> int: ... - def __setitem__(self, key, value) -> None: ... - @overload - def __getitem__(self, idx: Union[slice, np_ndarray_int64, Index]) -> Index: ... - @overload - def __getitem__(self, idx: Union[int, Tuple[np_ndarray_int64, ...]]) -> Hashable: ... - def append(self, other): ... - def putmask(self, mask, value): ... - def equals(self, other) -> bool: ... - def identical(self, other) -> bool: ... - def asof(self, label): ... - def asof_locs(self, where, mask): ... - def sort_values(self, return_indexer: bool = ..., ascending: bool = ...): ... - def sort(self, *args, **kwargs) -> None: ... - def shift(self, periods: int = ..., freq=...) -> None: ... - def argsort(self, *args, **kwargs): ... - def get_value(self, series, key): ... - def set_value(self, arr, key, value) -> None: ... - def get_indexer_non_unique(self, target): ... - def get_indexer_for(self, target, **kwargs): ... - def groupby(self, values) -> Dict[Hashable, np.ndarray]: ... - def map(self, mapper, na_action=...) -> Index: ... - def isin(self, values, level=...) -> np_ndarray_bool: ... - def slice_indexer(self, start=..., end=..., step=..., kind=...): ... - def get_slice_bound(self, label, side, kind): ... - def slice_locs(self, start=..., end=..., step=..., kind=...): ... - def delete(self, loc): ... - def insert(self, loc, item): ... - def drop(self, labels, *, errors: _str = ...) -> Index: ... - @property - def shape(self) -> Tuple[int, ...]: ... - # Extra methods from old stubs - def __eq__(self, other: object) -> bool: ... # Series: ... # type: ignore - def __iter__(self) -> Iterator: ... - def __ne__(self, other: _str) -> Index: ... # type: ignore - def to_numpy(self) -> np.ndarray: ... - -def ensure_index_from_sequences(sequences: Sequence[Sequence[Dtype]], names: Sequence[str] = ...) -> Index: ... -def ensure_index(index_like: Union[Sequence, Index], copy: bool = ...) -> Index: ... -def maybe_extract_name(name, obj, cls) -> Label: ... diff --git a/partial/pandas/core/indexes/datetimelike.pyi b/partial/pandas/core/indexes/datetimelike.pyi deleted file mode 100644 index fcec02d..0000000 --- a/partial/pandas/core/indexes/datetimelike.pyi +++ /dev/null @@ -1,34 +0,0 @@ -from pandas.core.accessor import PandasDelegate as PandasDelegate -from pandas.core.indexes.extension import ExtensionIndex as ExtensionIndex -from pandas.core.indexes.numeric import Int64Index as Int64Index -from pandas.tseries.frequencies import DateOffset as DateOffset -from typing import List, Optional - -class DatetimeIndexOpsMixin(ExtensionIndex): - freq: Optional[DateOffset] - freqstr: Optional[str] - @property - def is_all_dates(self) -> bool: ... - @property - def values(self): ... - def __array_wrap__(self, result, context=...): ... - def equals(self, other) -> bool: ... - def __contains__(self, key): ... - def sort_values(self, return_indexer: bool = ..., ascending: bool = ...): ... - def take(self, indices, axis: int = ..., allow_fill: bool = ..., fill_value=..., **kwargs): ... - def tolist(self) -> List: ... - def min(self, axis=..., skipna: bool = ..., *args, **kwargs): ... - def argmin(self, axis=..., skipna: bool = ..., *args, **kwargs): ... - def max(self, axis=..., skipna: bool = ..., *args, **kwargs): ... - def argmax(self, axis=..., skipna: bool = ..., *args, **kwargs): ... - def isin(self, values, level=...): ... - def where(self, cond, other=...): ... - def shift(self, periods: int = ..., freq=...): ... - def delete(self, loc): ... - -class DatetimeTimedeltaMixin(DatetimeIndexOpsMixin, Int64Index): - def difference(self, other, sort=...): ... - def intersection(self, other, sort: bool = ...): ... - def join(self, other, how: str = ..., level=..., return_indexers=..., sort=...): ... - -class DatetimelikeDelegateMixin(PandasDelegate): ... diff --git a/partial/pandas/core/indexes/datetimes.pyi b/partial/pandas/core/indexes/datetimes.pyi deleted file mode 100644 index dfb7b46..0000000 --- a/partial/pandas/core/indexes/datetimes.pyi +++ /dev/null @@ -1,66 +0,0 @@ -import numpy as np -from datetime import tzinfo as tzinfo -from pandas.core.indexes.datetimelike import ( - DatetimeTimedeltaMixin as DatetimeTimedeltaMixin, - DatetimelikeDelegateMixin as DatetimelikeDelegateMixin, -) -from pandas.core.indexes.timedeltas import TimedeltaIndex as TimedeltaIndex -from pandas.core.series import Series as Series, TimedeltaSeries, TimestampSeries -from pandas._typing import Timestamp as Timestamp, Timedelta as Timedelta -from typing import Optional, Union, overload - -class DatetimeDelegateMixin(DatetimelikeDelegateMixin): ... - -class DatetimeIndex(DatetimeTimedeltaMixin, DatetimeDelegateMixin): - tz: Optional[tzinfo] - def __init__( - self, - data=..., - freq=..., - tz=..., - normalize: bool = ..., - closed=..., - ambiguous: str = ..., - dayfirst: bool = ..., - yearfirst: bool = ..., - dtype=..., - copy: bool = ..., - name=..., - ): ... - def __array__(self, dtype=...) -> np.ndarray: ... - def __reduce__(self): ... - @overload - def __add__(self, other: TimedeltaSeries) -> TimestampSeries: ... - @overload - def __add__(self, other: Union[Timedelta, TimedeltaIndex]) -> DatetimeIndex: ... - def union_many(self, others): ... - def to_series(self, keep_tz=..., index=..., name=...): ... - def snap(self, freq: str = ...): ... - def get_value(self, series, key): ... - def get_value_maybe_box(self, series, key): ... - def get_loc(self, key, method=..., tolerance=...): ... - def slice_indexer(self, start=..., end=..., step=..., kind=...): ... - def searchsorted(self, value, side: str = ..., sorter=...): ... - def is_type_compatible(self, typ) -> bool: ... - @property - def inferred_type(self) -> str: ... - def insert(self, loc, item): ... - def indexer_at_time(self, time, asof: bool = ...): ... - def indexer_between_time(self, start_time, end_time, include_start: bool = ..., include_end: bool = ...): ... - def strftime(self, date_format: str = ...) -> np.ndarray: ... - -def date_range( - start=..., end=..., periods=..., freq=..., tz=..., normalize=..., name=..., closed=..., **kwargs -) -> DatetimeIndex: ... -def bdate_range( - start=..., - end=..., - periods=..., - freq: str = ..., - tz=..., - normalize: bool = ..., - name=..., - weekmask=..., - holidays=..., - closed=..., -) -> DatetimeIndex: ... diff --git a/partial/pandas/core/indexes/extension.pyi b/partial/pandas/core/indexes/extension.pyi deleted file mode 100644 index ceed6be..0000000 --- a/partial/pandas/core/indexes/extension.pyi +++ /dev/null @@ -1,16 +0,0 @@ -from pandas.core.indexes.base import Index as Index -from typing import List - -def inherit_from_data(name: str, delegate, cache: bool = ..., wrap: bool = ...): ... -def inherit_names(names: List[str], delegate, cache: bool = ..., wrap: bool = ...): ... -def make_wrapped_arith_op(opname): ... - -class ExtensionIndex(Index): - def __getitem__(self, key): ... - def __iter__(self): ... - def dropna(self, how: str = ...): ... - def repeat(self, repeats, axis=...): ... - def take(self, indices, axis: int = ..., allow_fill: bool = ..., fill_value=..., **kwargs): ... - def unique(self, level=...): ... - def map(self, mapper, na_action=...): ... - def astype(self, dtype, copy: bool = ...): ... diff --git a/partial/pandas/core/indexes/frozen.pyi b/partial/pandas/core/indexes/frozen.pyi deleted file mode 100644 index 93d9d51..0000000 --- a/partial/pandas/core/indexes/frozen.pyi +++ /dev/null @@ -1,25 +0,0 @@ -from pandas.core.base import PandasObject as PandasObject - -class FrozenList(PandasObject, list): - def union(self, other) -> FrozenList: ... - def difference(self, other) -> FrozenList: ... - __add__ = ... - __iadd__ = ... - def __getitem__(self, n): ... - def __radd__(self, other): ... - def __eq__(self, other) -> bool: ... - __req__ = ... - def __mul__(self, other): ... - __imul__ = ... - def __reduce__(self): ... - def __hash__(self): ... - __setitem__ = ... - __setslice__ = ... - __delitem__ = ... - __delslice__ = ... - pop = ... - append = ... - extend = ... - remove = ... - sort = ... - insert = ... diff --git a/partial/pandas/core/indexes/multi.pyi b/partial/pandas/core/indexes/multi.pyi deleted file mode 100644 index 38a2f86..0000000 --- a/partial/pandas/core/indexes/multi.pyi +++ /dev/null @@ -1,117 +0,0 @@ -import numpy as np -from pandas.core.indexes.base import Index as Index -from typing import Callable, Hashable, List, Optional, Sequence, Union -from pandas._typing import np_ndarray_bool, DtypeArg as DtypeArg, T1 as T1 - -class MultiIndex(Index): - def __new__( - cls, - levels=..., - codes=..., - sortorder=..., - names=..., - dtype=..., - copy=..., - name=..., - verify_integrity: bool = ..., - _set_identity: bool = ..., - ) -> MultiIndex: ... - def __init__( - self, - levels=..., - codes=..., - sortorder=..., - names=..., - dtype=..., - copy=..., - name=..., - verify_integrity: bool = ..., - _set_identity: bool = ..., - ) -> None: ... - @classmethod - def from_arrays(cls, arrays, sortorder=..., names=...) -> MultiIndex: ... - @classmethod - def from_tuples(cls, tuples, sortorder=..., names=...) -> MultiIndex: ... - @classmethod - def from_product(cls, iterables, sortorder=..., names=...) -> MultiIndex: ... - @classmethod - def from_frame(cls, df, sortorder=..., names=...) -> MultiIndex: ... - @property - def shape(self): ... - @property # Should be read-only - def levels(self) -> List[Index]: ... - def set_levels(self, levels, level=..., inplace: bool = ..., verify_integrity: bool = ...): ... - @property - def codes(self): ... - def set_codes(self, codes, level=..., inplace: bool = ..., verify_integrity: bool = ...): ... - def copy(self, names=..., deep: bool = ...) -> MultiIndex: ... - def __array__(self, dtype=...) -> np.ndarray: ... - def view(self, cls=...): ... - def __contains__(self, key) -> bool: ... - def dtype(self) -> np.dtype: ... - def memory_usage(self, deep: bool = ...) -> int: ... - def nbytes(self) -> int: ... - def format( - self, - name: Optional[bool] = ..., - formatter: Optional[Callable] = ..., - na_rep: Optional[str] = ..., - names: bool = ..., - space: int = ..., - sparsify: Optional[bool] = ..., - adjoin: bool = ..., - ) -> List: ... - def __len__(self) -> int: ... - def inferred_type(self) -> str: ... - @property - def values(self): ... - def is_monotonic_increasing(self) -> bool: ... - def is_monotonic_decreasing(self) -> bool: ... - def duplicated(self, keep: str = ...): ... - def fillna(self, value=..., downcast=...) -> None: ... - def dropna(self, how: str = ...): ... - def get_value(self, series, key): ... - def get_level_values(self, level: Union[str, int]) -> Index: ... - def unique(self, level=...): ... - def to_frame(self, index: bool = ..., name=...): ... - def to_flat_index(self): ... - @property - def is_all_dates(self) -> bool: ... - def is_lexsorted(self) -> bool: ... - def lexsort_depth(self): ... - def remove_unused_levels(self): ... - @property - def nlevels(self) -> int: ... - @property - def levshape(self): ... - def __reduce__(self): ... - def __getitem__(self, key): ... - def take(self, indices, axis: int = ..., allow_fill: bool = ..., fill_value=..., **kwargs): ... - def append(self, other): ... - def argsort(self, *args, **kwargs): ... - def repeat(self, repeats, axis=...): ... - def where(self, cond, other=...) -> None: ... - def drop(self, codes, *, level=..., errors: str = ...) -> MultiIndex: ... - def swaplevel(self, i: int = ..., j: int = ...): ... - def reorder_levels(self, order): ... - def sortlevel(self, level: int = ..., ascending: bool = ..., sort_remaining: bool = ...): ... - def get_indexer(self, target, method=..., limit=..., tolerance=...): ... - def get_indexer_non_unique(self, target): ... - def reindex(self, target, method=..., level=..., limit=..., tolerance=...): ... - def get_slice_bound(self, label: Union[Hashable, Sequence[Hashable]], side: str, kind: str) -> int: ... - def slice_locs(self, start=..., end=..., step=..., kind=...): ... - def get_loc(self, key, method=...): ... - def get_loc_level(self, key, level=..., drop_level: bool = ...): ... - def get_locs(self, seq): ... - def truncate(self, before=..., after=...): ... - def equals(self, other) -> bool: ... - def equal_levels(self, other): ... - def union(self, other, sort=...): ... - def intersection(self, other, sort: bool = ...): ... - def difference(self, other, sort=...): ... - def astype(self, dtype: Union[DtypeArg, T1], copy: bool = ...) -> MultiIndex: ... - def insert(self, loc, item): ... - def delete(self, loc): ... - def isin(self, values, level=...) -> np_ndarray_bool: ... - -def maybe_droplevels(index, key): ... diff --git a/partial/pandas/core/indexes/numeric.pyi b/partial/pandas/core/indexes/numeric.pyi deleted file mode 100644 index d777c08..0000000 --- a/partial/pandas/core/indexes/numeric.pyi +++ /dev/null @@ -1,36 +0,0 @@ -import numpy as np -from pandas.core.indexes.base import Index as Index -from typing import Iterable, TypeVar -from pandas._typing import T1 as T1, np_ndarray_int64 - -class NumericIndex(Index): - def __init__(self, data: Iterable = ..., dtype=..., copy: bool = ..., name=...): ... - @property - def is_all_dates(self) -> bool: ... - def insert(self, loc, item): ... - -class IntegerIndex(NumericIndex): - def __contains__(self, key) -> bool: ... - -class Int64Index(IntegerIndex): - @property - def inferredT1ype(self) -> str: ... - @property - def asi8(self) -> np_ndarray_int64: ... - -class UInt64Index(IntegerIndex): - @property - def inferredT1ype(self) -> str: ... - @property - def asi8(self) -> np_ndarray_int64: ... - -class Float64Index(NumericIndex): - @property - def inferredT1ype(self) -> str: ... - def astype(self, dtype, copy: bool = ...): ... - def get_value(self, series, key): ... - def equals(self, other) -> bool: ... - def __contains__(self, other) -> bool: ... - def get_loc(self, key, method=..., tolerance=...): ... - def is_unique(self) -> bool: ... - def isin(self, values, level=...): ... diff --git a/partial/pandas/core/indexes/timedeltas.pyi b/partial/pandas/core/indexes/timedeltas.pyi deleted file mode 100644 index 161394e..0000000 --- a/partial/pandas/core/indexes/timedeltas.pyi +++ /dev/null @@ -1,33 +0,0 @@ -from typing import Union, overload -from pandas._libs import Timedelta as Timedelta -from pandas.core.arrays import datetimelike as dtl -from pandas.core.indexes.datetimelike import ( - DatetimeIndexOpsMixin as DatetimeIndexOpsMixin, - DatetimeTimedeltaMixin as DatetimeTimedeltaMixin, - DatetimelikeDelegateMixin as DatetimelikeDelegateMixin, -) -from pandas.core.indexes.datetimes import DatetimeIndex as DatetimeIndex -from pandas._typing import num - -class TimedeltaDelegateMixin(DatetimelikeDelegateMixin): ... - -class TimedeltaIndex(DatetimeTimedeltaMixin, dtl.TimelikeOps, TimedeltaDelegateMixin): - def __new__(cls, data=..., unit=..., freq=..., closed=..., dtype=..., copy: bool = ..., name=...): ... - @overload - def __add__(self, other: DatetimeIndex) -> DatetimeIndex: ... - @overload - def __add__(self, other: Union[Timedelta, TimedeltaIndex]) -> TimedeltaIndex: ... - def __sub__(self, other: Union[Timedelta, TimedeltaIndex]) -> TimedeltaIndex: ... - def __mul__(self, other: num) -> TimedeltaIndex: ... - def __truediv__(self, other: num) -> TimedeltaIndex: ... - def astype(self, dtype, copy: bool = ...): ... - def get_value(self, series, key): ... - def get_value_maybe_box(self, series, key: Timedelta): ... - def get_loc(self, key, method=..., tolerance=...): ... - def searchsorted(self, value, side: str = ..., sorter=...): ... - def is_type_compatible(self, typ) -> bool: ... - @property - def inferred_type(self) -> str: ... - def insert(self, loc, item): ... - -def timedelta_range(start=..., end=..., periods=..., freq=..., name=..., closed=...) -> TimedeltaIndex: ... diff --git a/partial/pandas/core/indexing.pyi b/partial/pandas/core/indexing.pyi deleted file mode 100644 index c5762e3..0000000 --- a/partial/pandas/core/indexing.pyi +++ /dev/null @@ -1,50 +0,0 @@ -import numpy as np -from pandas._libs.indexing import _NDFrameIndexerBase -from pandas.core.indexes.api import Index as Index -from pandas._typing import StrLike, Scalar -from typing import Tuple, Union - -class _IndexSlice: - def __getitem__(self, arg) -> Tuple[Union[StrLike, Scalar, slice], ...]: ... - -IndexSlice: _IndexSlice - -class IndexingError(Exception): ... - -class IndexingMixin: - @property - def iloc(self) -> _iLocIndexer: ... - @property - def loc(self) -> _LocIndexer: ... - @property - def at(self) -> _AtIndexer: ... - @property - def iat(self) -> _iAtIndexer: ... - -class _NDFrameIndexer(_NDFrameIndexerBase): - axis = ... - def __call__(self, axis=...): ... - def __getitem__(self, key): ... - def __setitem__(self, key, value) -> None: ... - -class _LocationIndexer(_NDFrameIndexer): - def __getitem__(self, key): ... - -class _LocIndexer(_LocationIndexer): ... -class _iLocIndexer(_LocationIndexer): ... - -class _ScalarAccessIndexer(_NDFrameIndexerBase): - def __getitem__(self, key): ... - def __setitem__(self, key, value) -> None: ... - -class _AtIndexer(_ScalarAccessIndexer): ... -class _iAtIndexer(_ScalarAccessIndexer): ... - -def convert_to_index_sliceable(obj, key): ... -def check_bool_indexer(index: Index, key) -> np.ndarray: ... -def convert_missing_indexer(indexer): ... -def convert_from_missing_indexer_tuple(indexer, axes): ... -def maybe_convert_ix(*args): ... -def is_nested_tuple(tup, labels) -> bool: ... -def is_label_like(key) -> bool: ... -def need_slice(obj) -> bool: ... diff --git a/partial/pandas/core/internals/__init__.pyi b/partial/pandas/core/internals/__init__.pyi deleted file mode 100644 index 296698c..0000000 --- a/partial/pandas/core/internals/__init__.pyi +++ /dev/null @@ -1,17 +0,0 @@ -from .blocks import ( - Block as Block, - BoolBlock as BoolBlock, - CategoricalBlock as CategoricalBlock, - DatetimeBlock as DatetimeBlock, - DatetimeTZBlock as DatetimeTZBlock, - ExtensionBlock as ExtensionBlock, - ObjectBlock as ObjectBlock, - make_block as make_block, -) -from .managers import ( - BlockManager as BlockManager, - SingleBlockManager as SingleBlockManager, - concatenate_block_managers as concatenate_block_managers, - create_block_manager_from_arrays as create_block_manager_from_arrays, - create_block_manager_from_blocks as create_block_manager_from_blocks, -) diff --git a/partial/pandas/core/internals/blocks.pyi b/partial/pandas/core/internals/blocks.pyi deleted file mode 100644 index ac5d950..0000000 --- a/partial/pandas/core/internals/blocks.pyi +++ /dev/null @@ -1,182 +0,0 @@ -from pandas.core.arrays import ExtensionArray as ExtensionArray -from pandas.core.base import PandasObject as PandasObject -from typing import List - -class Block(PandasObject): - is_numeric: bool = ... - is_float: bool = ... - is_integer: bool = ... - is_complex: bool = ... - is_datetime: bool = ... - is_datetimetz: bool = ... - is_timedelta: bool = ... - is_bool: bool = ... - is_object: bool = ... - is_categorical: bool = ... - is_extension: bool = ... - ndim = ... - values = ... - def __init__(self, values, placement, ndim=...) -> None: ... - @property - def is_view(self): ... - @property - def is_datelike(self): ... - def is_categorical_astype(self, dtype): ... - def external_values(self, dtype=...): ... - def internal_values(self, dtype=...): ... - def array_values(self) -> ExtensionArray: ... - def get_values(self, dtype=...): ... - def get_block_values(self, dtype=...): ... - def to_dense(self): ... - @property - def fill_value(self): ... - @property - def mgr_locs(self): ... - @mgr_locs.setter - def mgr_locs(self, new_mgr_locs) -> None: ... - @property - def array_dtype(self): ... - def make_block(self, values, placement=...) -> Block: ... - def make_block_same_class(self, values, placement=..., ndim=...): ... - def __len__(self) -> int: ... - def getitem_block(self, slicer, new_mgr_locs=...): ... - @property - def shape(self): ... - @property - def dtype(self): ... - @property - def ftype(self): ... - def merge(self, other): ... - def concat_same_type(self, to_concat, placement=...): ... - def iget(self, i): ... - def set(self, locs, values) -> None: ... - def delete(self, loc) -> None: ... - def apply(self, func, **kwargs): ... - def fillna(self, value, limit=..., inplace: bool = ..., downcast=...): ... - def split_and_operate(self, mask, f, inplace: bool): ... - def downcast(self, dtypes=...): ... - def astype(self, dtype, copy: bool = ..., errors: str = ...): ... - def convert(self, copy: bool = ..., datetime: bool = ..., numeric: bool = ..., timedelta: bool = ..., coerce: bool = ...): ... - def to_native_types(self, slicer=..., na_rep: str = ..., quoting=..., **kwargs): ... - def copy(self, deep: bool = ...): ... - def replace(self, to_replace, value, inplace: bool = ..., filter=..., regex: bool = ..., convert: bool = ...): ... - def setitem(self, indexer, value): ... - def putmask(self, mask, new, align: bool = ..., inplace: bool = ..., axis: int = ..., transpose: bool = ...): ... - def coerce_to_target_dtype(self, other): ... - def interpolate( - self, - *, - method: str = ..., - axis: int = ..., - index=..., - inplace: bool = ..., - limit=..., - limit_direction: str = ..., - limit_area=..., - fill_value=..., - downcast=..., - **kwargs, - ): ... - def take_nd(self, indexer, axis, new_mgr_locs=..., fill_tuple=...): ... - def diff(self, n: int, axis: int = ...) -> List[Block]: ... - def shift(self, periods, axis: int = ..., fill_value=...): ... - def where(self, other, cond, align=..., errors=..., try_cast: bool = ..., axis: int = ...) -> List[Block]: ... - def equals(self, other) -> bool: ... - def quantile(self, qs, interpolation: str = ..., axis: int = ...): ... - -class NonConsolidatableMixIn: - def __init__(self, values, placement, ndim=...) -> None: ... - @property - def shape(self): ... - def iget(self, col): ... - def should_store(self, value): ... - values = ... - def set(self, locs, values, check: bool = ...) -> None: ... - def putmask(self, mask, new, align: bool = ..., inplace: bool = ..., axis: int = ..., transpose: bool = ...): ... - -class ExtensionBlock(NonConsolidatableMixIn, Block): - is_extension: bool = ... - def __init__(self, values, placement, ndim=...) -> None: ... - @property - def fill_value(self): ... - @property - def is_view(self): ... - @property - def is_numeric(self): ... - def setitem(self, indexer, value): ... - def get_values(self, dtype=...): ... - def array_values(self) -> ExtensionArray: ... - def to_dense(self): ... - def to_native_types(self, slicer=..., na_rep: str = ..., quoting=..., **kwargs): ... - def take_nd(self, indexer, axis: int = ..., new_mgr_locs=..., fill_tuple=...): ... - def concat_same_type(self, to_concat, placement=...): ... - def fillna(self, value, limit=..., inplace: bool = ..., downcast=...): ... - def interpolate(self, *, method: str = ..., axis: int = ..., inplace: bool = ..., limit=..., fill_value=..., **kwargs): ... - def diff(self, n: int, axis: int = ...) -> List[Block]: ... - def shift(self, periods: int, axis: int = ..., fill_value=...) -> List[ExtensionBlock]: ... - def where(self, other, cond, align=..., errors=..., try_cast: bool = ..., axis: int = ...) -> List[Block]: ... - -class ObjectValuesExtensionBlock(ExtensionBlock): - def external_values(self, dtype=...): ... - -class NumericBlock(Block): - is_numeric: bool = ... - -class DatetimeLikeBlockMixin: - @property - def fill_value(self): ... - def get_values(self, dtype=...): ... - def iget(self, key): ... - def shift(self, periods, axis: int = ..., fill_value=...): ... - -class DatetimeBlock(DatetimeLikeBlockMixin, Block): - is_datetime: bool = ... - def __init__(self, values, placement, ndim=...) -> None: ... - def astype(self, dtype, copy: bool = ..., errors: str = ...): ... - def to_native_types(self, slicer=..., na_rep=..., date_format=..., quoting=..., **kwargs): ... - def should_store(self, value): ... - def set(self, locs, values) -> None: ... - def external_values(self): ... - def array_values(self) -> ExtensionArray: ... - -class DatetimeTZBlock(DatetimeBlock): - is_datetimetz: bool = ... - is_extension: bool = ... - fill_value = ... - @property - def is_view(self): ... - def get_values(self, dtype=...): ... - def to_dense(self): ... - def diff(self, n: int, axis: int = ...) -> List[Block]: ... - def concat_same_type(self, to_concat, placement=...): ... - def fillna(self, value, limit=..., inplace: bool = ..., downcast=...): ... - def setitem(self, indexer, value): ... - def equals(self, other) -> bool: ... - def quantile(self, qs, interpolation: str = ..., axis: int = ...): ... - -class BoolBlock(NumericBlock): - is_bool: bool = ... - def should_store(self, value): ... - def replace(self, to_replace, value, inplace: bool = ..., filter=..., regex: bool = ..., convert: bool = ...): ... - -class ObjectBlock(Block): - is_object: bool = ... - def __init__(self, values, placement=..., ndim: int = ...) -> None: ... - @property - def is_bool(self): ... - def convert(self, copy: bool = ..., datetime: bool = ..., numeric: bool = ..., timedelta: bool = ..., coerce: bool = ...): ... - def should_store(self, value): ... - def replace(self, to_replace, value, inplace: bool = ..., filter=..., regex: bool = ..., convert: bool = ...): ... - -class CategoricalBlock(ExtensionBlock): - is_categorical: bool = ... - def __init__(self, values, placement, ndim=...) -> None: ... - @property - def array_dtype(self): ... - def to_dense(self): ... - def to_native_types(self, slicer=..., na_rep: str = ..., quoting=..., **kwargs): ... - def concat_same_type(self, to_concat, placement=...): ... - def replace(self, to_replace, value, inplace: bool = ..., filter=..., regex: bool = ..., convert: bool = ...): ... - -def get_block_type(values, dtype=...): ... -def make_block(values, placement, klass=..., ndim=..., dtype=...): ... diff --git a/partial/pandas/core/internals/concat.pyi b/partial/pandas/core/internals/concat.pyi deleted file mode 100644 index ccdc47d..0000000 --- a/partial/pandas/core/internals/concat.pyi +++ /dev/null @@ -1,15 +0,0 @@ -def get_mgr_concatenation_plan(mgr, indexers): ... - -class JoinUnit: - block = ... - indexers = ... - shape = ... - def __init__(self, block, shape, indexers=...) -> None: ... - def needs_filling(self): ... - def dtype(self): ... - def is_na(self): ... - def get_reindexed_values(self, empty_dtype, upcasted_na): ... - -def concatenate_join_units(join_units, concat_axis, copy): ... -def is_uniform_join_units(join_units): ... -def combine_concat_plans(plans, concat_axis): ... diff --git a/partial/pandas/core/internals/construction.pyi b/partial/pandas/core/internals/construction.pyi deleted file mode 100644 index 2bb94f8..0000000 --- a/partial/pandas/core/internals/construction.pyi +++ /dev/null @@ -1,12 +0,0 @@ -import numpy as np - -def arrays_to_mgr(arrays, arr_names, index, columns, dtype=...): ... -def masked_rec_array_to_mgr(data, index, columns, dtype, copy): ... -def init_ndarray(values, index, columns, dtype=..., copy: bool = ...): ... -def init_dict(data, index, columns, dtype=...): ... -def prep_ndarray(values, copy=...) -> np.ndarray: ... -def extract_index(data): ... -def reorder_arrays(arrays, arr_columns, columns): ... -def get_names_from_index(data): ... -def to_arrays(data, columns, coerce_float: bool = ..., dtype=...): ... -def sanitize_index(data, index, copy: bool = ...): ... diff --git a/partial/pandas/core/internals/managers.pyi b/partial/pandas/core/internals/managers.pyi deleted file mode 100644 index 86ceb96..0000000 --- a/partial/pandas/core/internals/managers.pyi +++ /dev/null @@ -1,100 +0,0 @@ -from pandas.core.base import PandasObject as PandasObject -from pandas.core.indexes.api import Index as Index -from pandas.core.internals.blocks import Block as Block -from typing import List, Sequence, Union - -class BlockManager(PandasObject): - axes = ... - blocks = ... - def __init__(self, blocks: Sequence[Block], axes: Sequence[Index], do_integrity_check: bool=...) -> None: ... - def make_empty(self, axes = ...): ... - def __nonzero__(self): ... - __bool__ = ... - @property - def shape(self): ... - @property - def ndim(self) -> int: ... - def set_axis(self, axis, new_labels) -> None: ... - def rename_axis(self, mapper, axis, copy: bool = ..., level = ...): ... - @property - def items(self): ... - def get_dtype_counts(self): ... - def get_dtypes(self): ... - def __len__(self) -> int: ... - def reduce(self, func, *args, **kwargs): ... - def apply(self, f, filter = ..., **kwargs): ... - def quantile(self, axis: int = ..., consolidate: bool = ..., transposed: bool = ..., interpolation: str = ..., qs = ..., numeric_only = ...): ... - def isna(self, func): ... - def where(self, **kwargs): ... - def setitem(self, **kwargs): ... - def putmask(self, **kwargs): ... - def diff(self, **kwargs): ... - def interpolate(self, **kwargs): ... - def shift(self, **kwargs): ... - def fillna(self, **kwargs): ... - def downcast(self, **kwargs): ... - def astype(self, dtype, copy: bool=..., errors: str=...) : ... - def convert(self, **kwargs): ... - def replace(self, value, **kwargs): ... - def replace_list(self, src_list, dest_list, inplace: bool = ..., regex: bool = ...): ... - def is_consolidated(self): ... - @property - def is_mixed_type(self): ... - @property - def is_numeric_mixed_type(self): ... - @property - def is_datelike_mixed_type(self): ... - @property - def any_extension_types(self): ... - @property - def is_view(self): ... - def get_bool_data(self, copy: bool = ...): ... - def get_numeric_data(self, copy: bool = ...): ... - def combine(self, blocks, copy: bool = ...): ... - def get_slice(self, slobj: slice, axis: int=...) : ... - def __contains__(self, item) -> bool: ... - @property - def nblocks(self) -> int: ... - def copy(self, deep: bool = ...): ... - def as_array(self, transpose: bool = ..., items = ...): ... - def to_dict(self, copy: bool = ...): ... - def fast_xs(self, loc): ... - def consolidate(self): ... - def get(self, item): ... - def iget(self, i): ... - def delete(self, item) -> None: ... - def set(self, item, value): ... - def insert(self, loc: int, item, value, allow_duplicates: bool=...) : ... - def reindex_axis(self, new_index, axis, method = ..., limit = ..., fill_value = ..., copy: bool = ...): ... - def reindex_indexer(self, new_axis, indexer, axis, fill_value = ..., allow_dups: bool = ..., copy: bool = ...): ... - def take(self, indexer, axis: int = ..., verify: bool = ..., convert: bool = ...): ... - def equals(self, other): ... - def unstack(self, unstacker_func, fill_value): ... - -class SingleBlockManager(BlockManager): - ndim: int = ... - axes = ... - blocks = ... - def __init__(self, block: Block, axis: Union[Index, List[Index]], do_integrity_check: bool=..., fastpath: bool=...) -> None: ... - def get_slice(self, slobj, axis: int = ...): ... - @property - def index(self): ... - @property - def dtype(self): ... - @property - def array_dtype(self): ... - def get_dtype_counts(self): ... - def get_dtypes(self): ... - def external_values(self): ... - def internal_values(self): ... - def get_values(self): ... - def is_consolidated(self): ... - def delete(self, item) -> None: ... - def fast_xs(self, loc): ... - def concat(self, to_concat, new_axis): ... - -def create_block_manager_from_blocks(blocks, axes): ... -def create_block_manager_from_arrays(arrays, names, axes): ... -def construction_error(tot_items, block_shape, axes, e = ...) -> None: ... -def form_blocks(arrays, names, axes): ... -def concatenate_block_managers(mgrs_indexers, axes, concat_axis, copy): ... diff --git a/partial/pandas/core/ops/__init__.pyi b/partial/pandas/core/ops/__init__.pyi deleted file mode 100644 index fc2d79a..0000000 --- a/partial/pandas/core/ops/__init__.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing import Any, Optional, Set, Tuple - -ARITHMETIC_BINOPS: Set[str] = ... -COMPARISON_BINOPS: Set[str] = ... - -def get_op_result_name(left: Any, right: Any): ... -def maybe_upcast_for_op(obj: Any, shape: Tuple[int, ...]) -> Any: ... -def fill_binop(left: Any, right: Any, fill_value: Any): ... -def dispatch_to_series(left: Any, right: Any, func: Any, str_rep: Optional[Any] = ..., axis: Optional[Any] = ...): ... diff --git a/partial/pandas/core/ops/array_ops.pyi b/partial/pandas/core/ops/array_ops.pyi deleted file mode 100644 index 30994f8..0000000 --- a/partial/pandas/core/ops/array_ops.pyi +++ /dev/null @@ -1,13 +0,0 @@ -import numpy as np -from pandas.core.dtypes.generic import ABCExtensionArray as ABCExtensionArray -from typing import Optional, Union - -def comp_method_OBJECT_ARRAY(op, x, y): ... -def masked_arith_op(x, y, op): ... -def define_na_arithmetic_op(op, str_rep: str): ... -def na_arithmetic_op(left, right, op, str_rep: str): ... -def arithmetic_op(left: Union[np.ndarray, ABCExtensionArray], right, op, str_rep: str): ... -def comparison_op(left: Union[np.ndarray, ABCExtensionArray], right, op) -> Union[np.ndarray, ABCExtensionArray]: ... -def na_logical_op(x: np.ndarray, y, op): ... -def logical_op(left: Union[np.ndarray, ABCExtensionArray], right, op) -> Union[np.ndarray, ABCExtensionArray]: ... -def get_array_op(op, str_rep: Optional[str] = ...): ... diff --git a/partial/pandas/core/ops/dispatch.pyi b/partial/pandas/core/ops/dispatch.pyi deleted file mode 100644 index a6def64..0000000 --- a/partial/pandas/core/ops/dispatch.pyi +++ /dev/null @@ -1,7 +0,0 @@ -import numpy as np -from pandas.core.dtypes.generic import ABCExtensionArray as ABCExtensionArray, ABCSeries as ABCSeries -from typing import Union - -def should_extension_dispatch(left: ABCSeries, right) -> bool: ... -def should_series_dispatch(left, right, op): ... -def dispatch_to_extension_op(op, left: Union[ABCExtensionArray, np.ndarray], right): ... diff --git a/partial/pandas/core/ops/docstrings.pyi b/partial/pandas/core/ops/docstrings.pyi deleted file mode 100644 index af4811e..0000000 --- a/partial/pandas/core/ops/docstrings.pyi +++ /dev/null @@ -1 +0,0 @@ -reverse_op = ... diff --git a/partial/pandas/core/ops/invalid.pyi b/partial/pandas/core/ops/invalid.pyi deleted file mode 100644 index 9c40d55..0000000 --- a/partial/pandas/core/ops/invalid.pyi +++ /dev/null @@ -1,2 +0,0 @@ -def invalid_comparison(left, right, op): ... -def make_invalid_op(name: str): ... diff --git a/partial/pandas/core/ops/mask_ops.pyi b/partial/pandas/core/ops/mask_ops.pyi deleted file mode 100644 index 2c86116..0000000 --- a/partial/pandas/core/ops/mask_ops.pyi +++ /dev/null @@ -1,23 +0,0 @@ -import numpy as np -from pandas._libs import lib as lib, missing as libmissing -from typing import Optional, Union - -def kleene_or( - left: Union[bool, np.ndarray], - right: Union[bool, np.ndarray], - left_mask: Optional[np.ndarray], - right_mask: Optional[np.ndarray], -): ... -def kleene_xor( - left: Union[bool, np.ndarray], - right: Union[bool, np.ndarray], - left_mask: Optional[np.ndarray], - right_mask: Optional[np.ndarray], -): ... -def kleene_and( - left: Union[bool, libmissing.NAType, np.ndarray], - right: Union[bool, libmissing.NAType, np.ndarray], - left_mask: Optional[np.ndarray], - right_mask: Optional[np.ndarray], -): ... -def raise_for_nan(value, method) -> None: ... diff --git a/partial/pandas/core/ops/methods.pyi b/partial/pandas/core/ops/methods.pyi deleted file mode 100644 index 2ffac10..0000000 --- a/partial/pandas/core/ops/methods.pyi +++ /dev/null @@ -1,2 +0,0 @@ -def add_special_arithmetic_methods(cls): ... -def add_flex_arithmetic_methods(cls) -> None: ... diff --git a/partial/pandas/core/ops/missing.pyi b/partial/pandas/core/ops/missing.pyi deleted file mode 100644 index 9810e74..0000000 --- a/partial/pandas/core/ops/missing.pyi +++ /dev/null @@ -1,3 +0,0 @@ -def fill_zeros(result, x, y): ... -def mask_zero_div_zero(x, y, result): ... -def dispatch_fill_zeros(op, left, right, result): ... diff --git a/partial/pandas/core/ops/roperator.pyi b/partial/pandas/core/ops/roperator.pyi deleted file mode 100644 index ec88904..0000000 --- a/partial/pandas/core/ops/roperator.pyi +++ /dev/null @@ -1,12 +0,0 @@ -def radd(left, right): ... -def rsub(left, right): ... -def rmul(left, right): ... -def rdiv(left, right): ... -def rtruediv(left, right): ... -def rfloordiv(left, right): ... -def rmod(left, right): ... -def rdivmod(left, right): ... -def rpow(left, right): ... -def rand_(left, right): ... -def ror_(left, right): ... -def rxor(left, right): ... diff --git a/partial/pandas/core/resample.pyi b/partial/pandas/core/resample.pyi deleted file mode 100644 index 98581ee..0000000 --- a/partial/pandas/core/resample.pyi +++ /dev/null @@ -1,58 +0,0 @@ -from pandas.core.base import ShallowMixin as ShallowMixin -from pandas.core.groupby.base import GroupByMixin as GroupByMixin -from pandas.core.groupby.groupby import _GroupBy -from pandas.core.groupby.grouper import Grouper as Grouper -from pandas._typing import FrameOrSeriesUnion - -class Resampler(_GroupBy, ShallowMixin): - def __init__(self, obj, groupby=..., axis: int = ..., kind=..., **kwargs) -> None: ... - def __getattr__(self, attr: str): ... - def __iter__(self): ... - @property - def obj(self): ... - @property - def ax(self): ... - def pipe(self, func, *args, **kwargs): ... - def aggregate(self, func, *args, **kwargs): ... - agg = aggregate - def transform(self, arg, *args, **kwargs): ... - def pad(self, limit=...): ... - def nearest(self, limit=...): ... - def backfill(self, limit=...): ... - bfill = backfill - def fillna(self, method, limit=...): ... - def interpolate( - self, - method: str = ..., - axis: int = ..., - limit=..., - inplace: bool = ..., - limit_direction: str = ..., - limit_area=..., - downcast=..., - **kwargs, - ): ... - def asfreq(self, fill_value=...): ... - def std(self, ddof: int = ..., *args, **kwargs): ... - def var(self, ddof: int = ..., *args, **kwargs): ... - def size(self): ... - def count(self): ... - def quantile(self, q: float = ..., **kwargs): ... - def sum(self, _method=..., min_count: int = ..., *args, **kwargs) -> FrameOrSeriesUnion: ... - def prod(self, _method=..., min_count: int = ..., *args, **kwargs) -> FrameOrSeriesUnion: ... - def min(self, _method=..., min_count: int = ..., *args, **kwargs) -> FrameOrSeriesUnion: ... - def max(self, _method=..., min_count: int = ..., *args, **kwargs) -> FrameOrSeriesUnion: ... - def first(self, _method=..., min_count: int = ..., *args, **kwargs) -> FrameOrSeriesUnion: ... - def last(self, _method=..., min_count: int = ..., *args, **kwargs) -> FrameOrSeriesUnion: ... - def mean(self, _method=..., *args, **kwargs) -> FrameOrSeriesUnion: ... - def sem(self, _method=..., *args, **kwargs) -> FrameOrSeriesUnion: ... - def median(self, _method=..., *args, **kwargs) -> FrameOrSeriesUnion: ... - def ohlc(self, _method=..., *args, **kwargs) -> FrameOrSeriesUnion: ... - -class _GroupByMixin(GroupByMixin): - groupby = ... - def __init__(self, obj, *args, **kwargs) -> None: ... - -def resample(obj, kind=..., **kwds): ... -def get_resampler_for_grouping(groupby, rule, how=..., fill_method=..., limit=..., kind=..., **kwargs): ... -def asfreq(obj, freq, method=..., how=..., normalize: bool = ..., fill_value=...): ... diff --git a/partial/pandas/core/reshape/__init__.pyi b/partial/pandas/core/reshape/__init__.pyi deleted file mode 100644 index e69de29..0000000 diff --git a/partial/pandas/core/reshape/api.pyi b/partial/pandas/core/reshape/api.pyi deleted file mode 100644 index 3ddc732..0000000 --- a/partial/pandas/core/reshape/api.pyi +++ /dev/null @@ -1,6 +0,0 @@ -from pandas.core.reshape.concat import concat as concat -from pandas.core.reshape.melt import lreshape as lreshape, melt as melt, wide_to_long as wide_to_long -from pandas.core.reshape.merge import merge as merge, merge_asof as merge_asof, merge_ordered as merge_ordered -from pandas.core.reshape.pivot import crosstab as crosstab, pivot as pivot, pivot_table as pivot_table -from pandas.core.reshape.reshape import get_dummies as get_dummies -from pandas.core.reshape.tile import cut as cut, qcut as qcut diff --git a/partial/pandas/core/reshape/concat.pyi b/partial/pandas/core/reshape/concat.pyi deleted file mode 100644 index 63280ad..0000000 --- a/partial/pandas/core/reshape/concat.pyi +++ /dev/null @@ -1,44 +0,0 @@ -from pandas import DataFrame as DataFrame, Series as Series -from typing import Hashable, Iterable, Mapping, Optional, Union, overload, Literal, TypeVar - -HashableT = TypeVar("HashableT", bound=Hashable) - -@overload -def concat( - objs: Union[Iterable[Optional[Series]], Mapping[HashableT, Optional[Series]]], - join: str = ..., - ignore_index: bool = ..., - keys=..., - levels=..., - names=..., - verify_integrity: bool = ..., - sort: bool = ..., - copy: bool = ..., - axis: Literal[0, "index"] = ..., -) -> Series: ... -@overload -def concat( - objs: Union[Iterable[Optional[Series]], Mapping[HashableT, Optional[Series]]], - axis: Literal[1, "columns"], - join: str = ..., - ignore_index: bool = ..., - keys=..., - levels=..., - names=..., - verify_integrity: bool = ..., - sort: bool = ..., - copy: bool = ..., -) -> DataFrame: ... -@overload -def concat( - objs: Union[Iterable[Optional[Union[DataFrame, Series]]], Mapping[HashableT, Optional[Union[DataFrame, Series]]]], - axis: Literal[0, "index", 1, "columns"] = ..., - join: str = ..., - ignore_index: bool = ..., - keys=..., - levels=..., - names=..., - verify_integrity: bool = ..., - sort: bool = ..., - copy: bool = ..., -) -> DataFrame: ... diff --git a/partial/pandas/core/reshape/melt.pyi b/partial/pandas/core/reshape/melt.pyi deleted file mode 100644 index 4e2ccae..0000000 --- a/partial/pandas/core/reshape/melt.pyi +++ /dev/null @@ -1,15 +0,0 @@ -import numpy as np -from pandas.core.frame import DataFrame as DataFrame -from typing import List, Optional, Tuple, Union - -def melt( - frame: DataFrame, - id_vars: Optional[Union[Tuple, List, np.ndarray]] = ..., - value_vars: Optional[Union[Tuple, List, np.ndarray]] = ..., - var_name: Optional[str] = ..., - value_name: str = ..., - col_level: Optional[Union[int, str]] = ..., - ignore_index: bool = ... -) -> DataFrame: ... -def lreshape(data: DataFrame, groups, dropna: bool=..., label=...) -> DataFrame: ... -def wide_to_long(df: DataFrame, stubnames, i, j, sep: str=..., suffix: str=...) -> DataFrame: ... diff --git a/partial/pandas/core/reshape/merge.pyi b/partial/pandas/core/reshape/merge.pyi deleted file mode 100644 index 7f422a0..0000000 --- a/partial/pandas/core/reshape/merge.pyi +++ /dev/null @@ -1,130 +0,0 @@ -from pandas._libs.tslibs import Timedelta -from pandas import DataFrame as DataFrame, Series as Series -from pandas._typing import Label -from typing import Optional, Sequence, Union - -def merge( - left: Union[DataFrame, Series], - right: Union[DataFrame, Series], - how: str = ..., - on: Optional[Union[Label, Sequence]] = ..., - left_on: Optional[Union[Label, Sequence]] = ..., - right_on: Optional[Union[Label, Sequence]] = ..., - left_index: bool = ..., - right_index: bool = ..., - sort: bool = ..., - suffixes: Sequence[Union[str, None]] = ..., - copy: bool = ..., - indicator: Union[bool, str] = ..., - validate: str = ..., -) -> DataFrame: ... -def merge_ordered( - left: Union[DataFrame, Series], - right: Union[DataFrame, Series], - on: Optional[Union[Label, Sequence]] = ..., - left_on: Optional[Union[Label, Sequence]] = ..., - right_on: Optional[Union[Label, Sequence]] = ..., - left_by: Optional[Union[str, Sequence[str]]] = ..., - right_by: Optional[Union[str, Sequence[str]]] = ..., - fill_method: Optional[str] = ..., - suffixes: Sequence[Union[str, None]] = ..., - how: str = ..., -) -> DataFrame: ... -def merge_asof( - left: Union[DataFrame, Series], - right: Union[DataFrame, Series], - on: Optional[Label] = ..., - left_on: Optional[Label] = ..., - right_on: Optional[Label] = ..., - left_index: bool = ..., - right_index: bool = ..., - by: Optional[Union[str, Sequence[str]]] = ..., - left_by: Optional[str] = ..., - right_by: Optional[str] = ..., - suffixes: Sequence[Union[str, None]] = ..., - tolerance: Optional[Union[int, Timedelta]] = ..., - allow_exact_matches: bool = ..., - direction: str = ..., -) -> DataFrame: ... - -class _MergeOperation: - left = ... - right = ... - how = ... - axis = ... - on = ... - left_on = ... - right_on = ... - copy = ... - suffixes = ... - sort = ... - left_index = ... - right_index = ... - indicator = ... - indicator_name = ... - def __init__( - self, - left: Union[Series, DataFrame], - right: Union[Series, DataFrame], - how: str = ..., - on=..., - left_on=..., - right_on=..., - axis=..., - left_index: bool = ..., - right_index: bool = ..., - sort: bool = ..., - suffixes=..., - copy: bool = ..., - indicator: bool = ..., - validate=..., - ) -> None: ... - def get_result(self): ... - -class _OrderedMerge(_MergeOperation): - fill_method = ... - def __init__( - self, - left, - right, - on=..., - left_on=..., - right_on=..., - left_index: bool = ..., - right_index: bool = ..., - axis=..., - suffixes=..., - copy: bool = ..., - fill_method=..., - how: str = ..., - ) -> None: ... - def get_result(self): ... - -class _AsOfMerge(_OrderedMerge): - by = ... - left_by = ... - right_by = ... - tolerance = ... - allow_exact_matches = ... - direction = ... - def __init__( - self, - left, - right, - on=..., - left_on=..., - right_on=..., - left_index: bool = ..., - right_index: bool = ..., - by=..., - left_by=..., - right_by=..., - axis=..., - suffixes=..., - copy: bool = ..., - fill_method=..., - how: str = ..., - tolerance=..., - allow_exact_matches: bool = ..., - direction: str = ..., - ) -> None: ... diff --git a/partial/pandas/core/reshape/pivot.pyi b/partial/pandas/core/reshape/pivot.pyi deleted file mode 100644 index fd871f2..0000000 --- a/partial/pandas/core/reshape/pivot.pyi +++ /dev/null @@ -1,36 +0,0 @@ -from pandas.core.series import Series -from pandas.core.frame import DataFrame -from pandas.core.groupby.grouper import Grouper -from pandas._typing import Scalar -from typing import Callable, Optional, Sequence, Union - -def pivot_table( - data: DataFrame, - values: Optional[str] = ..., - index: Optional[Union[str, Sequence, Grouper]] = ..., - columns: Optional[Union[str, Sequence, Grouper]] = ..., - aggfunc = ..., - fill_value: Optional[Scalar] = ..., - margins: bool = ..., - dropna: bool = ..., - margins_name: str = ..., - observed: bool = ...) -> DataFrame: ... - -def pivot( - data: DataFrame, - index: Optional[str] = ..., - columns: Optional[str] = ..., - values: Optional[Union[str, Sequence[str]]] = ..., -) -> DataFrame: ... - -def crosstab( - index: Union[Sequence, Series], - columns: Union[Sequence, Series], - values: Optional[Sequence] = ..., - rownames: Optional[Sequence] = ..., - colnames: Optional[Sequence] = ..., - aggfunc: Optional[Callable] = ..., - margins: bool = ..., - margins_name: str = ..., - dropna: bool = ..., - normalize: bool = ...) -> DataFrame: ... diff --git a/partial/pandas/core/reshape/util.pyi b/partial/pandas/core/reshape/util.pyi deleted file mode 100644 index 4ce5844..0000000 --- a/partial/pandas/core/reshape/util.pyi +++ /dev/null @@ -1 +0,0 @@ -def cartesian_product(X): ... diff --git a/partial/pandas/core/series.pyi b/partial/pandas/core/series.pyi deleted file mode 100644 index efcf4df..0000000 --- a/partial/pandas/core/series.pyi +++ /dev/null @@ -1,1592 +0,0 @@ -import numpy as np -from datetime import time, date - -from matplotlib.axes import Axes as PlotAxes, SubplotBase as SubplotBase -import sys -from .base import IndexOpsMixin -from .generic import NDFrame -from .indexes.multi import MultiIndex -from .indexing import _iLocIndexer, _LocIndexer -from .frame import DataFrame -from pandas.core.arrays.base import ExtensionArray -from pandas.core.groupby.generic import SeriesGroupBy -from pandas.core.indexes.base import Index -from pandas.core.indexes.datetimes import DatetimeIndex -from pandas.core.resample import Resampler -from pandas.core.strings import StringMethods -from pandas.core.window.rolling import Rolling, Window -from pandas.core.window import ExponentialMovingWindow -from pandas._typing import ( - ArrayLike as ArrayLike, - Axis as Axis, - AxisType as AxisType, - Dtype as Dtype, - DtypeNp as DtypeNp, - FilePathOrBuffer as FilePathOrBuffer, - IgnoreRaise as IgnoreRaise, - Level as Level, - ListLike as ListLike, - MaskType as MaskType, - Renamer as Renamer, - S1 as S1, - Scalar as Scalar, - SeriesAxisType as SeriesAxisType, - Timestamp as Timestamp, - Timedelta as Timedelta, - num as num, - Label as Label, -) -from typing import ( - Any, - Callable, - Dict, - Generic, - Hashable, - Iterable, - List, - Literal, - Mapping, - Optional, - Sequence, - Tuple, - Type, - Union, - overload, -) - -_bool = bool -_str = str - -class _iLocIndexerSeries(_iLocIndexer, Generic[S1]): - # get item - @overload - def __getitem__(self, idx: int) -> S1: ... - @overload - def __getitem__(self, idx: Union[Index, slice]) -> Series[S1]: ... - # set item - @overload - def __setitem__(self, idx: int, value: S1) -> None: ... - @overload - def __setitem__(self, idx: Index, value: Union[S1, Series[S1]]) -> None: ... - -class _LocIndexerSeries(_LocIndexer, Generic[S1]): - @overload - def __getitem__( - self, - idx: Union[ - MaskType, - Index, - Sequence[Union[int, float]], - List[_str], - slice, - Tuple[Union[int, str, float, slice, Index], ...], - ], - ) -> Series[S1]: ... - @overload - def __getitem__( - self, - idx: Union[int, _str, float], - ) -> S1: ... - @overload - def __setitem__( - self, - idx: Union[Index, MaskType], - value: Union[S1, ArrayLike, Series[S1]], - ) -> None: ... - @overload - def __setitem__( - self, - idx: str, - value: S1, - ) -> None: ... - @overload - def __setitem__( - self, - idx: Union[List[int], List[str], List[Union[str, int]]], - value: Union[S1, ArrayLike, Series[S1]], - ) -> None: ... - -class Series(IndexOpsMixin, NDFrame, Generic[S1]): - - _ListLike = Union[ArrayLike, Dict[_str, np.ndarray], List, Tuple, Index] - @overload - def __new__( - cls, - data: DatetimeIndex, - index: Union[_str, int, Series, List, Index] = ..., - dtype=..., - name: Optional[Hashable] = ..., - copy: bool = ..., - fastpath: bool = ..., - ) -> TimestampSeries: ... - @overload - def __new__( - cls, - data: Optional[Union[object, _ListLike, Series[S1], Dict[int, S1], Dict[_str, S1]]], - dtype: Type[S1], - index: Union[_str, int, Series, List, Index] = ..., - name: Optional[Hashable] = ..., - copy: bool = ..., - fastpath: bool = ..., - ) -> Series[S1]: ... - @overload - def __new__( - cls, - data: Optional[Union[object, _ListLike, Series[S1], Dict[int, S1], Dict[_str, S1]]] = ..., - index: Union[_str, int, Series, List, Index] = ..., - dtype=..., - name: Optional[Hashable] = ..., - copy: bool = ..., - fastpath: bool = ..., - ) -> Series: ... - @property - def hasnans(self) -> bool: ... - def div( - self, - other: Union[num, _ListLike, Series[S1]], - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - axis: SeriesAxisType = ..., - ) -> Series[float]: ... - def rdiv( - self, - other: Union[Series[S1], Scalar], - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - axis: SeriesAxisType = ..., - ) -> Series[S1]: ... - @property - def dtype(self) -> Dtype: ... - @property - def dtypes(self) -> Dtype: ... - @property - def name(self) -> Optional[Hashable]: ... - @name.setter - def name(self, value: Optional[Hashable]) -> None: ... - @property - def values(self) -> ArrayLike: ... - @property - def array(self) -> ExtensionArray: ... - def ravel(self, order: _str = ...) -> np.ndarray: ... - def __len__(self) -> int: ... - def view(self, dtype=...) -> Series[S1]: ... - def __array_ufunc__(self, ufunc: Callable, method: _str, *inputs, **kwargs): ... - def __array__(self, dtype=...) -> np.ndarray: ... - @property - def axes(self) -> List: ... - def take(self, indices: Sequence, axis: SeriesAxisType = ..., is_copy: Optional[_bool] = ..., **kwargs) -> Series[S1]: ... - @overload - def __getitem__(self, idx: Union[List[_str], Index, Series[S1], slice, MaskType, Tuple[Union[S1, slice], ...]]) -> Series: ... - @overload - def __getitem__(self, idx: Union[int, _str]) -> S1: ... - def __setitem__(self, key, value) -> None: ... - def repeat(self, repeats: Union[int, List[int]], axis: Optional[SeriesAxisType] = ...) -> Series[S1]: ... - @property - def index(self) -> Union[Index, MultiIndex]: ... - @index.setter - def index(self, idx: Index) -> None: ... - @overload - def reset_index( - self, - level: Optional[Sequence[Level]], - drop: Literal[True], - *, - name: Optional[object] = ..., - inplace: _bool = ..., - ) -> Series[S1]: ... - @overload - def reset_index( - self, - level: Optional[Level], - drop: Literal[True], - *, - name: Optional[object] = ..., - inplace: _bool = ..., - ) -> Series[S1]: ... - @overload - def reset_index( - self, - /, - drop: Literal[True], - level: Optional[Sequence[Level]] = ..., - name: Optional[object] = ..., - inplace: _bool = ..., - ) -> Series[S1]: ... - @overload - def reset_index( - self, - /, - drop: Literal[True], - level: Optional[Level] = ..., - name: Optional[object] = ..., - inplace: _bool = ..., - ) -> Series[S1]: ... - @overload - def reset_index( - self, - level: Optional[Sequence[Level]] = ..., - drop: Literal[False] = ..., - name: Optional[object] = ..., - inplace: _bool = ..., - ) -> DataFrame: ... - @overload - def reset_index( - self, - level: Optional[Level] = ..., - drop: Literal[False] = ..., - name: Optional[object] = ..., - inplace: _bool = ..., - ) -> DataFrame: ... - @overload - def to_string( - self, - buf: Optional[FilePathOrBuffer], - na_rep: _str = ..., - formatters=..., - float_format=..., - sparsify: Optional[_bool] = ..., - index_names: _bool = ..., - justify: Optional[_str] = ..., - max_rows: Optional[int] = ..., - min_rows: Optional[int] = ..., - max_cols: Optional[int] = ..., - show_dimensions: _bool = ..., - decimal: _str = ..., - line_width: Optional[int] = ..., - max_colwidth: Optional[int] = ..., - encoding: Optional[_str] = ..., - ) -> None: ... - @overload - def to_string( - self, - na_rep: _str = ..., - formatters=..., - float_format=..., - sparsify: Optional[_bool] = ..., - index_names: _bool = ..., - justify: Optional[_str] = ..., - max_rows: Optional[int] = ..., - min_rows: Optional[int] = ..., - max_cols: Optional[int] = ..., - show_dimensions: _bool = ..., - decimal: _str = ..., - line_width: Optional[int] = ..., - max_colwidth: Optional[int] = ..., - encoding: Optional[_str] = ..., - ) -> _str: ... - @overload - def to_markdown( - self, - buf: Optional[FilePathOrBuffer], - mode: Optional[_str] = ..., - index: _bool = ..., - storage_options: Optional[dict] = ..., - **kwargs, - ) -> None: ... - @overload - def to_markdown(self, mode: Optional[_str] = ..., index: _bool = ..., storage_options: Optional[dict] = ...) -> _str: ... - def items(self) -> Iterable[Tuple[Hashable, S1]]: ... - def iteritems(self) -> Iterable[Tuple[Label, S1]]: ... - def keys(self) -> List: ... - def to_dict(self, into: Hashable = ...) -> Dict[Any, Any]: ... - def to_frame(self, name: Optional[object] = ...) -> DataFrame: ... - def groupby( - self, - by=..., - axis: SeriesAxisType = ..., - level: Optional[Level] = ..., - as_index: _bool = ..., - sort: _bool = ..., - group_keys: _bool = ..., - squeeze: _bool = ..., - observed: _bool = ..., - dropna: _bool = ..., - ) -> SeriesGroupBy: ... - @overload - def count(self, level: None = ...) -> int: ... - @overload - def count(self, level: Hashable) -> Series[S1]: ... - def mode(self, dropna) -> Series[S1]: ... - def unique(self) -> np.ndarray: ... - @overload - def drop_duplicates(self, keep: Literal["first", "last", False] = ..., inplace: Literal[False] = ...) -> Series[S1]: ... - @overload - def drop_duplicates(self, keep: Literal["first", "last", False], inplace: Literal[True]) -> None: ... - @overload - def drop_duplicates(self, *, inplace: Literal[True]) -> None: ... - @overload - def drop_duplicates(self, keep: Literal["first", "last", False] = ..., inplace: bool = ...) -> Optional[Series[S1]]: ... - def duplicated(self, keep: Literal["first", "last", False] = ...) -> Series[_bool]: ... - def idxmax(self, axis: SeriesAxisType = ..., skipna: _bool = ..., *args, **kwargs) -> Union[int, _str]: ... - def idxmin(self, axis: SeriesAxisType = ..., skipna: _bool = ..., *args, **kwargs) -> Union[int, _str]: ... - def round(self, decimals: int = ..., *args, **kwargs) -> Series[S1]: ... - @overload - def quantile( - self, - q: float = ..., - interpolation: Union[_str, Literal["linear", "lower", "higher", "midpoint", "nearest"]] = ..., - ) -> float: ... - @overload - def quantile( - self, - q: _ListLike, - interpolation: Union[_str, Literal["linear", "lower", "higher", "midpoint", "nearest"]] = ..., - ) -> Series[S1]: ... - def corr( - self, - other: Series[S1], - method: Literal["pearson", "kendall", "spearman"] = ..., - min_periods: int = ..., - ) -> float: ... - def cov(self, other: Series[S1], min_periods: Optional[int] = ..., ddof: int = ...) -> float: ... - def diff(self, periods: int = ...) -> Series[S1]: ... - def autocorr(self, lag: int = ...) -> float: ... - @overload - def dot(self, other: Series[S1]) -> Scalar: ... - @overload - def dot(self, other: DataFrame) -> Series[S1]: ... - @overload - def dot(self, other: _ListLike) -> np.ndarray: ... - def __matmul__(self, other): ... - def __rmatmul__(self, other): ... - @overload - def searchsorted( - self, - value: _ListLike, - side: Union[_str, Literal["left", "right"]] = ..., - sorter: Optional[_ListLike] = ..., - ) -> List[int]: ... - @overload - def searchsorted( - self, - value: Scalar, - side: Union[_str, Literal["left", "right"]] = ..., - sorter: Optional[_ListLike] = ..., - ) -> int: ... - def append( - self, - to_append: Union[Series, Sequence[Series]], - ignore_index: _bool = ..., - verify_integrity: _bool = ..., - ) -> Series[S1]: ... - @overload - def compare( - self, - other: Series, - align_axis: SeriesAxisType, - keep_shape: bool = ..., - keep_equal: bool = ..., - ) -> Series: ... - @overload - def compare( - self, - other: Series, - align_axis: Literal["columns", 1] = ..., - keep_shape: bool = ..., - keep_equal: bool = ..., - ) -> DataFrame: ... - def combine(self, other: Series[S1], func: Callable, fill_value: Optional[Scalar] = ...) -> Series[S1]: ... - def combine_first(self, other: Series[S1]) -> Series[S1]: ... - def update(self, other: Union[Series[S1], Sequence[S1], Mapping[int, S1]]) -> None: ... - @overload - def sort_values( - self, - axis: AxisType = ..., - ascending: Union[_bool, Sequence[_bool]] = ..., - kind: Union[_str, Literal["quicksort", "mergesort", "heapsort"]] = ..., - na_position: Union[_str, Literal["first", "last"]] = ..., - ignore_index: _bool = ..., - *, - inplace: Literal[True], - key: Optional[Callable] = ..., - ) -> None: ... - @overload - def sort_values( - self, - axis: AxisType = ..., - ascending: Union[_bool, Sequence[_bool]] = ..., - kind: Union[_str, Literal["quicksort", "mergesort", "heapsort"]] = ..., - na_position: Union[_str, Literal["first", "last"]] = ..., - ignore_index: _bool = ..., - *, - inplace: Literal[False], - key: Optional[Callable] = ..., - ) -> Series[S1]: ... - @overload - def sort_values( - self, - axis: AxisType = ..., - ascending: Union[_bool, Sequence[_bool]] = ..., - *, - kind: Union[_str, Literal["quicksort", "mergesort", "heapsort"]] = ..., - na_position: Union[_str, Literal["first", "last"]] = ..., - ignore_index: _bool = ..., - key: Optional[Callable] = ..., - ) -> Series[S1]: ... - @overload - def sort_values( - self, - axis: AxisType = ..., - ascending: Union[_bool, Sequence[_bool]] = ..., - inplace: Optional[_bool] = ..., - kind: Union[_str, Literal["quicksort", "mergesort", "heapsort"]] = ..., - na_position: Union[_str, Literal["first", "last"]] = ..., - ignore_index: _bool = ..., - key: Optional[Callable] = ..., - ) -> Union[None, Series[S1]]: ... - @overload - def sort_index( - self, - axis: AxisType = ..., - level: Optional[Level] = ..., - ascending: Union[_bool, Sequence[_bool]] = ..., - kind: Union[_str, Literal["quicksort", "mergesort", "heapsort"]] = ..., - na_position: Union[_str, Literal["first", "last"]] = ..., - sort_remaining: _bool = ..., - ignore_index: _bool = ..., - *, - inplace: Literal[True], - key: Optional[Callable] = ..., - ) -> None: ... - @overload - def sort_index( - self, - axis: AxisType = ..., - level: Optional[Union[Level, List[int], List[_str]]] = ..., - ascending: Union[_bool, Sequence[_bool]] = ..., - kind: Union[_str, Literal["quicksort", "mergesort", "heapsort"]] = ..., - na_position: Union[_str, Literal["first", "last"]] = ..., - sort_remaining: _bool = ..., - ignore_index: _bool = ..., - *, - inplace: Literal[False], - key: Optional[Callable] = ..., - ) -> Series: ... - @overload - def sort_index( - self, - axis: AxisType = ..., - level: Optional[Union[Level, List[int], List[_str]]] = ..., - ascending: Union[_bool, Sequence[_bool]] = ..., - *, - kind: Union[_str, Literal["quicksort", "mergesort", "heapsort"]] = ..., - na_position: Union[_str, Literal["first", "last"]] = ..., - sort_remaining: _bool = ..., - ignore_index: _bool = ..., - key: Optional[Callable] = ..., - ) -> Series: ... - @overload - def sort_index( - self, - axis: AxisType = ..., - level: Optional[Union[Level, List[int], List[_str]]] = ..., - ascending: Union[_bool, Sequence[_bool]] = ..., - inplace: Optional[_bool] = ..., - kind: Union[_str, Literal["quicksort", "mergesort", "heapsort"]] = ..., - na_position: Union[_str, Literal["first", "last"]] = ..., - sort_remaining: _bool = ..., - ignore_index: _bool = ..., - key: Optional[Callable] = ..., - ) -> Union[None, Series]: ... - def argsort( - self, - axis: SeriesAxisType = ..., - kind: Union[_str, Literal["mergesort", "quicksort", "heapsort"]] = ..., - order: None = ..., - ) -> Series[int]: ... - def nlargest(self, n: int = ..., keep: Union[_str, Literal["first", "last", "all"]] = ...) -> Series[S1]: ... - def nsmallest(self, n: int = ..., keep: Union[_str, Literal["first", "last", "all"]] = ...) -> Series[S1]: ... - def swaplevel(self, i: Level = ..., j: Level = ..., copy: _bool = ...) -> Series[S1]: ... - def reorder_levels(self, order: List) -> Series[S1]: ... - def explode(self) -> Series[S1]: ... - def unstack( - self, - level: Level = ..., - fill_value: Optional[Union[int, _str, Dict]] = ..., - ) -> DataFrame: ... - def map(self, arg, na_action: Optional[Union[_str, Literal["ignore"]]] = ...) -> Series[S1]: ... - def aggregate( - self, - func: Union[ - Callable, - _str, - List[Union[Callable, _str]], - Dict[SeriesAxisType, Union[Callable, _str]], - ], - axis: SeriesAxisType = ..., - *args, - **kwargs, - ) -> None: ... - def agg( - self, - func: Union[ - Callable, - _str, - List[Union[Callable, _str]], - Dict[SeriesAxisType, Union[Callable, _str]], - ] = ..., - axis: SeriesAxisType = ..., - *args, - **kwargs, - ) -> None: ... - def transform( - self, func: Union[List[Callable], Dict[_str, Callable]], axis: SeriesAxisType = ..., *args, **kwargs - ) -> Series[S1]: ... - def apply(self, func: Callable, convertDType: _bool = ..., args: Tuple = ..., **kwds) -> Union[Series, DataFrame]: ... - def align( - self, - other: Union[DataFrame, Series], - join: Union[_str, Literal["inner", "outer", "left", "right"]] = ..., - axis: Optional[AxisType] = ..., - level: Optional[Level] = ..., - copy: _bool = ..., - fill_value=..., - method: Optional[Union[_str, Literal["backfill", "bfill", "pad", "ffill"]]] = ..., - limit: Optional[int] = ..., - fill_axis: SeriesAxisType = ..., - broadcast_axis: Optional[SeriesAxisType] = ..., - ) -> Tuple[Series, Series]: ... - @overload - def rename( - self, - index: Optional[Union[Renamer, Hashable]] = ..., - *, - axis: Optional[Axis] = ..., - copy: bool = ..., - inplace: Literal[True], - level: Optional[Level] = ..., - errors: IgnoreRaise = ..., - ) -> None: ... - @overload - def rename( - self, - index: Optional[Renamer] = ..., - *, - axis: Optional[Axis] = ..., - copy: bool = ..., - inplace: Literal[False] = ..., - level: Optional[Level] = ..., - errors: IgnoreRaise = ..., - ) -> Series: ... - @overload - def rename( - self, - index: Optional[Hashable] = ..., - *, - axis: Optional[Axis] = ..., - copy: bool = ..., - inplace: Literal[False] = ..., - level: Optional[Level] = ..., - errors: IgnoreRaise = ..., - ) -> Series: ... - @overload - def rename( - self, - index: Optional[Union[Renamer, Hashable]] = ..., - *, - axis: Optional[Axis] = ..., - copy: bool = ..., - inplace: bool = ..., - level: Optional[Level] = ..., - errors: IgnoreRaise = ..., - ) -> Optional[Series]: ... - def reindex_like( - self, - other: Series[S1], - method: Optional[Union[_str, Literal["backfill", "bfill", "pad", "ffill", "nearest"]]] = ..., - copy: _bool = ..., - limit: Optional[int] = ..., - tolerance: Optional[float] = ..., - ) -> Series: ... - @overload - def drop( - self, - labels: Union[Hashable, List[Hashable]] = ..., - *, - axis: Axis = ..., - index: Union[Hashable, List[Hashable]] = ..., - columns: Union[Hashable, List[Hashable]] = ..., - level: Optional[Level] = ..., - inplace: Literal[True], - errors: IgnoreRaise = ..., - ) -> None: ... - @overload - def drop( - self, - labels: Union[Hashable, List[Hashable]] = ..., - *, - axis: Axis = ..., - index: Union[Hashable, List[Hashable]] = ..., - columns: Union[Hashable, List[Hashable]] = ..., - level: Optional[Level] = ..., - inplace: Literal[False] = ..., - errors: IgnoreRaise = ..., - ) -> Series: ... - @overload - def drop( - self, - labels: Union[Hashable, List[Hashable]] = ..., - *, - axis: Axis = ..., - index: Union[Hashable, List[Hashable]] = ..., - columns: Union[Hashable, List[Hashable]] = ..., - level: Optional[Level] = ..., - inplace: bool = ..., - errors: IgnoreRaise = ..., - ) -> Optional[Series]: ... - @overload - def fillna( - self, - value: Optional[Union[Scalar, Dict, Series[S1], DataFrame]] = ..., - method: Optional[Union[_str, Literal["backfill", "bfill", "pad", "ffill"]]] = ..., - axis: SeriesAxisType = ..., - limit: Optional[int] = ..., - downcast: Optional[Dict] = ..., - *, - inplace: Literal[True], - ) -> None: ... - @overload - def fillna( - self, - value: Optional[Union[Scalar, Dict, Series[S1], DataFrame]] = ..., - method: Optional[Union[_str, Literal["backfill", "bfill", "pad", "ffill"]]] = ..., - axis: SeriesAxisType = ..., - *, - limit: Optional[int] = ..., - downcast: Optional[Dict] = ..., - ) -> Series[S1]: ... - @overload - def fillna( - self, - value: Optional[Union[Scalar, Dict, Series[S1], DataFrame]] = ..., - method: Optional[Union[_str, Literal["backfill", "bfill", "pad", "ffill"]]] = ..., - axis: SeriesAxisType = ..., - inplace: _bool = ..., - limit: Optional[int] = ..., - downcast: Optional[Dict] = ..., - ) -> Union[Series[S1], None]: ... - def replace( - self, - to_replace: Optional[Union[_str, List, Dict, Series[S1], int, float]] = ..., - value: Optional[Union[Scalar, Dict, List, _str]] = ..., - inplace: _bool = ..., - limit: Optional[int] = ..., - regex=..., - method: Optional[Union[_str, Literal["pad", "ffill", "bfill"]]] = ..., - ) -> Series[S1]: ... - def shift( - self, - periods: int = ..., - freq=..., - axis: SeriesAxisType = ..., - fill_value: Optional[object] = ..., - ) -> Series[S1]: ... - def memory_usage(self, index: _bool = ..., deep: _bool = ...) -> int: ... - def isin(self, values: Union[Iterable, Series[S1], Dict]) -> Series[_bool]: ... - def between( - self, - left: Union[Scalar, Sequence], - right: Union[Scalar, Sequence], - inclusive: Literal["both", "neither", "left", "right"] = "both", - ) -> Series[_bool]: ... - def isna(self) -> Series[_bool]: ... - def isnull(self) -> Series[_bool]: ... - def notna(self) -> Series[_bool]: ... - def notnull(self) -> Series[_bool]: ... - @overload - def dropna(self, axis: SeriesAxisType = ..., how: Optional[_str] = ..., *, inplace: Literal[True]) -> None: ... - @overload - def dropna( - self, - axis: SeriesAxisType = ..., - inplace: _bool = ..., - how: Optional[_str] = ..., - ) -> Series[S1]: ... - def to_timestamp( - self, - freq=..., - how: Union[_str, Literal["start", "end", "s", "e"]] = ..., - copy: _bool = ..., - ) -> Series[S1]: ... - def to_period(self, freq: Optional[_str] = ..., copy: _bool = ...) -> DataFrame: ... - @property - def str(self) -> StringMethods[Series]: ... - @property - def dt(self) -> Series: ... - cat = ... - def plot(self, **kwargs) -> Union[PlotAxes, np.ndarray]: ... - sparse = ... - def hist( - self, - by: Optional[object] = ..., - ax: Optional[PlotAxes] = ..., - grid: _bool = ..., - xlabelsize: Optional[int] = ..., - xrot: Optional[float] = ..., - ylabelsize: Optional[int] = ..., - yrot: Optional[float] = ..., - figsize: Optional[Tuple[float, float]] = ..., - bins: Union[int, Sequence] = ..., - backend: Optional[_str] = ..., - **kwargs, - ) -> SubplotBase: ... - def swapaxes(self, axis1: SeriesAxisType, axis2: SeriesAxisType, copy: _bool = ...) -> Series[S1]: ... - def droplevel(self, level: Union[Level, List[Level]], axis: SeriesAxisType = ...) -> DataFrame: ... - def pop(self, item: _str) -> Series[S1]: ... - def squeeze(self, axis: Optional[SeriesAxisType] = ...) -> Scalar: ... - def __abs__(self) -> Series[S1]: ... - def add_prefix(self, prefix: _str) -> Series[S1]: ... - def add_suffix(self, suffix: _str) -> Series[S1]: ... - def reindex(self, index: Optional[_ListLike] = ..., **kwargs) -> Series[S1]: ... - def filter( - self, - items: Optional[_ListLike] = ..., - like: Optional[_str] = ..., - regex: Optional[_str] = ..., - axis: Optional[SeriesAxisType] = ..., - ) -> Series[S1]: ... - def head(self, n: int = ...) -> Series[S1]: ... - def tail(self, n: int = ...) -> Series[S1]: ... - def sample( - self, - n: Optional[int] = ..., - frac: Optional[float] = ..., - replace: _bool = ..., - weights: Optional[Union[_str, _ListLike, np.ndarray]] = ..., - random_state: Optional[int] = ..., - axis: Optional[SeriesAxisType] = ..., - ignore_index: _bool = ..., - ) -> Series[S1]: ... - def astype( - self, - dtype: Union[S1, _str, Type[Scalar]], - copy: _bool = ..., - errors: Union[_str, Literal["raise", "ignore"]] = ..., - ) -> Series: ... - def copy(self, deep: _bool = ...) -> Series[S1]: ... - def infer_objects(self) -> Series[S1]: ... - def convert_dtypes( - self, - infer_objects: _bool = ..., - convert_string: _bool = ..., - convert_integer: _bool = ..., - convert_boolean: _bool = ..., - ) -> Series[S1]: ... - @overload - def ffill( - self, - axis: Optional[SeriesAxisType] = ..., - *, - inplace: Literal[True], - limit: Optional[int] = ..., - downcast: Optional[Dict] = ..., - ) -> None: ... - @overload - def ffill( - self, - axis: Optional[SeriesAxisType] = ..., - *, - inplace: Literal[False], - limit: Optional[int] = ..., - downcast: Optional[Dict] = ..., - ) -> Series[S1]: ... - @overload - def bfill( - self, - axis: Optional[SeriesAxisType] = ..., - *, - inplace: Literal[True], - limit: Optional[int] = ..., - downcast: Optional[Dict] = ..., - ) -> None: ... - @overload - def bfill( - self, - axis: Optional[SeriesAxisType] = ..., - *, - inplace: Literal[False], - limit: Optional[int] = ..., - downcast: Optional[Dict] = ..., - ) -> Series[S1]: ... - @overload - def bfill( - self, - value: Union[S1, Dict, Series[S1], DataFrame], - axis: SeriesAxisType = ..., - inplace: _bool = ..., - limit: Optional[int] = ..., - downcast: Optional[Dict] = ..., - ) -> Union[Series[S1], None]: ... - def interpolate( - self, - method: Union[ - _str, - Literal[ - "linear", - "time", - "index", - "values", - "pad", - "nearest", - "slinear", - "quadratic", - "cubic", - "spline", - "barycentric", - "polynomial", - "krogh", - "pecewise_polynomial", - "spline", - "pchip", - "akima", - "from_derivatives", - ], - ] = ..., - axis: Optional[SeriesAxisType] = ..., - limit: Optional[int] = ..., - inplace: _bool = ..., - limit_direction: Optional[Union[_str, Literal["forward", "backward", "both"]]] = ..., - limit_area: Optional[Union[_str, Literal["inside", "outside"]]] = ..., - downcast: Optional[Union[_str, Literal["infer"]]] = ..., - **kwargs, - ) -> Series[S1]: ... - def asof( - self, - where: Union[Scalar, Sequence[Scalar]], - subset: Optional[Union[_str, Sequence[_str]]] = ..., - ) -> Union[Scalar, Series[S1]]: ... - def clip( - self, - lower: Optional[float] = ..., - upper: Optional[float] = ..., - axis: Optional[SeriesAxisType] = ..., - inplace: _bool = ..., - *args, - **kwargs, - ) -> Series[S1]: ... - def asfreq( - self, - freq, - method: Optional[Union[_str, Literal["backfill", "bfill", "pad", "ffill"]]] = ..., - how: Optional[Union[_str, Literal["start", "end"]]] = ..., - normalize: _bool = ..., - fill_value: Optional[Scalar] = ..., - ) -> Series[S1]: ... - def at_time( - self, - time: Union[_str, time], - asof: _bool = ..., - axis: Optional[SeriesAxisType] = ..., - ) -> Series[S1]: ... - def between_time( - self, - start_time: Union[_str, time], - end_time: Union[_str, time], - include_start: _bool = ..., - include_end: _bool = ..., - axis: Optional[SeriesAxisType] = ..., - ) -> Series[S1]: ... - def resample( - self, - rule, - axis: SeriesAxisType = ..., - closed: Optional[_str] = ..., - label: Optional[_str] = ..., - convention: Union[_str, Literal["start", "end", "s", "e"]] = ..., - kind: Optional[Union[_str, Literal["timestamp", "period"]]] = ..., - loffset=..., - base: int = ..., - on: Optional[_str] = ..., - level: Optional[Level] = ..., - origin: Union[Timestamp, Literal["epoch", "start", "start_day", "end", "end_day"]] = ..., - offset: Optional[Union[Timedelta, _str]] = None, - ) -> Resampler: ... - def first(self, offset) -> Series[S1]: ... - def last(self, offset) -> Series[S1]: ... - def rank( - self, - axis: SeriesAxisType = ..., - method: Union[_str, Literal["average", "min", "max", "first", "dense"]] = ..., - numeric_only: Optional[_bool] = ..., - na_option: Union[_str, Literal["keep", "top", "bottom"]] = ..., - ascending: _bool = ..., - pct: _bool = ..., - ) -> Series: ... - def where( - self, - cond: Union[Series[S1], Series[_bool], np.ndarray], - other=..., - inplace: _bool = ..., - axis: Optional[SeriesAxisType] = ..., - level: Optional[Level] = ..., - errors: _str = ..., - try_cast: _bool = ..., - ) -> Series[S1]: ... - def mask( - self, - cond: MaskType, - other: Union[Scalar, Series[S1], DataFrame, Callable] = ..., - inplace: _bool = ..., - axis: Optional[SeriesAxisType] = ..., - level: Optional[Level] = ..., - errors: Union[_str, Literal["raise", "ignore"]] = ..., - try_cast: _bool = ..., - ) -> Series[S1]: ... - def slice_shift(self, periods: int = ..., axis: SeriesAxisType = ...) -> Series[S1]: ... - def tshift(self, periods: int = ..., freq=..., axis: SeriesAxisType = ...) -> Series[S1]: ... - def truncate( - self, - before: Optional[Union[date, _str, int]] = ..., - after: Optional[Union[date, _str, int]] = ..., - axis: Optional[SeriesAxisType] = ..., - copy: _bool = ..., - ) -> Series[S1]: ... - def tz_convert( - self, - tz, - axis: SeriesAxisType = ..., - level: Optional[Level] = ..., - copy: _bool = ..., - ) -> Series[S1]: ... - def tz_localize( - self, - tz, - axis: SeriesAxisType = ..., - level: Optional[Level] = ..., - copy: _bool = ..., - ambiguous=..., - nonexistent: _str = ..., - ) -> Series[S1]: ... - def abs(self) -> Series[S1]: ... - def describe( - self, - percentiles: Optional[List[float]] = ..., - include: Optional[Union[_str, Literal["all"], List[S1]]] = ..., - exclude: Optional[Union[S1, List[S1]]] = ..., - datetime_is_numeric: Optional[_bool] = ..., - ) -> Series[S1]: ... - def pct_change( - self, periods: int = ..., fill_method: _str = ..., limit: Optional[int] = ..., freq=..., **kwargs - ) -> Series[S1]: ... - def first_valid_index(self) -> Scalar: ... - def last_valid_index(self) -> Scalar: ... - def value_counts( - self, - normalize: _bool = ..., - sort: _bool = ..., - ascending: _bool = ..., - bins: Optional[int] = ..., - dropna: _bool = ..., - ) -> Series[S1]: ... - def transpose(self, *args, **kwargs) -> Series[S1]: ... - @property - def T(self) -> Series[S1]: ... - # The rest of these were left over from the old - # stubs we shipped in preview. They may belong in - # the base classes in some cases; I expect stubgen - # just failed to generate these so I couldn't match - # them up. - @overload - def __add__(self, other: TimestampSeries) -> TimestampSeries: ... - @overload - def __add__(self, other: DatetimeIndex) -> TimestampSeries: ... - @overload - def __add__(self, other: Timestamp) -> TimestampSeries: ... - @overload - def __add__(self, other: Union[num, _str, Timedelta, _ListLike, Series[S1]]) -> Series: ... - def __and__(self, other: Union[_ListLike, Series[S1]]) -> Series[_bool]: ... - # def __array__(self, dtype: Optional[_bool] = ...) -> _np_ndarray - def __div__(self, other: Union[num, _ListLike, Series[S1]]) -> Series[S1]: ... - def __eq__(self, other: object) -> Series[_bool]: ... # type: ignore - def __floordiv__(self, other: Union[num, _ListLike, Series[S1]]) -> Series[int]: ... - def __ge__(self, other: Union[num, _ListLike, Series[S1]]) -> Series[_bool]: ... - def __gt__(self, other: Union[num, _ListLike, Series[S1]]) -> Series[_bool]: ... - # def __iadd__(self, other: S1) -> Series[S1]: ... - # def __iand__(self, other: S1) -> Series[_bool]: ... - # def __idiv__(self, other: S1) -> Series[S1]: ... - # def __ifloordiv__(self, other: S1) -> Series[S1]: ... - # def __imod__(self, other: S1) -> Series[S1]: ... - # def __imul__(self, other: S1) -> Series[S1]: ... - # def __ior__(self, other: S1) -> Series[_bool]: ... - # def __ipow__(self, other: S1) -> Series[S1]: ... - # def __isub__(self, other: S1) -> Series[S1]: ... - # def __itruediv__(self, other: S1) -> Series[S1]: ... - # def __itruediv__(self, other) -> None: ... - # def __ixor__(self, other: S1) -> Series[_bool]: ... - def __le__(self, other: Union[num, _ListLike, Series[S1]]) -> Series[_bool]: ... - def __lt__(self, other: Union[num, _ListLike, Series[S1]]) -> Series[_bool]: ... - @overload - def __mul__(self, other: Union[Timedelta, TimedeltaSeries]) -> TimedeltaSeries: ... - @overload - def __mul__(self, other: Union[num, _ListLike, Series]) -> Series: ... - def __mod__(self, other: Union[num, _ListLike, Series[S1]]) -> Series[S1]: ... - def __ne__(self, other: object) -> Series[_bool]: ... # type: ignore - def __pow__(self, other: Union[num, _ListLike, Series[S1]]) -> Series[S1]: ... - def __or__(self, other: Union[_ListLike, Series[S1]]) -> Series[_bool]: ... - def __radd__(self, other: Union[num, _str, _ListLike, Series[S1]]) -> Series[S1]: ... - def __rand__(self, other: Union[num, _ListLike, Series[S1]]) -> Series[_bool]: ... - def __rdiv__(self, other: Union[num, _ListLike, Series[S1]]) -> Series[S1]: ... - def __rdivmod__(self, other: Union[num, _ListLike, Series[S1]]) -> Series[S1]: ... - def __rfloordiv__(self, other: Union[num, _ListLike, Series[S1]]) -> Series[S1]: ... - def __rmod__(self, other: Union[num, _ListLike, Series[S1]]) -> Series[S1]: ... - def __rmul__(self, other: Union[num, _ListLike, Series]) -> Series: ... - def __rnatmul__(self, other: Union[num, _ListLike, Series[S1]]) -> Series[S1]: ... - def __rpow__(self, other: Union[num, _ListLike, Series[S1]]) -> Series[S1]: ... - def __ror__(self, other: Union[num, _ListLike, Series[S1]]) -> Series[_bool]: ... - def __rsub__(self, other: Union[num, _ListLike, Series[S1]]) -> Series: ... - @overload - def __rtruediv__(self, other: Union[Timedelta, TimedeltaSeries]) -> Series[float]: ... - @overload - def __rtruediv__(self, other: Union[num, _ListLike, Series[S1]]) -> Series: ... - def __rxor__(self, other: Union[num, _ListLike, Series[S1]]) -> Series[_bool]: ... - @overload - def __sub__(self, other: Union[Timestamp, TimestampSeries]) -> TimedeltaSeries: ... - @overload - def __sub__(self, other: Union[Timedelta, TimedeltaSeries]) -> TimestampSeries: ... - @overload - def __sub__(self, other: Union[num, _ListLike, Series]) -> Series: ... - @overload - def __truediv__(self, other: Union[num, _ListLike, Series[S1]]) -> Series: ... - @overload - def __truediv__(self, other: Union[Timedelta, TimedeltaSeries]) -> Series[float]: ... - def __xor__(self, other: Union[_ListLike, Series[S1]]) -> Series: ... - def __invert__(self) -> Series[bool]: ... - # properties - # @property - # def array(self) -> _npndarray - @property - def at(self) -> _LocIndexerSeries[S1]: ... - # @property - # def cat(self) -> ? - @property - def iat(self) -> _iLocIndexerSeries[S1]: ... - @property - def iloc(self) -> _iLocIndexerSeries[S1]: ... - @property - def loc(self) -> _LocIndexerSeries[S1]: ... - # Methods - def add( - self, - other: Union[Series[S1], Scalar], - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - axis: int = ..., - ) -> Series[S1]: ... - def all( - self, - axis: SeriesAxisType = ..., - bool_only: Optional[_bool] = ..., - skipna: _bool = ..., - level: Optional[Level] = ..., - **kwargs, - ) -> _bool: ... - def any( - self, - axis: SeriesAxisType = ..., - bool_only: Optional[_bool] = ..., - skipna: _bool = ..., - level: Optional[Level] = ..., - **kwargs, - ) -> _bool: ... - def cummax(self, axis: Optional[SeriesAxisType] = ..., skipna: _bool = ..., *args, **kwargs) -> Series[S1]: ... - def cummin(self, axis: Optional[SeriesAxisType] = ..., skipna: _bool = ..., *args, **kwargs) -> Series[S1]: ... - def cumprod(self, axis: Optional[SeriesAxisType] = ..., skipna: _bool = ..., *args, **kwargs) -> Series[S1]: ... - def cumsum(self, axis: Optional[SeriesAxisType] = ..., skipna: _bool = ..., *args, **kwargs) -> Series[S1]: ... - def divide( - self, - other: Union[num, _ListLike, Series[S1]], - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - axis: SeriesAxisType = ..., - ) -> Series[float]: ... - def divmod( - self, - other: Union[num, _ListLike, Series[S1]], - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - axis: SeriesAxisType = ..., - ) -> Series[S1]: ... - def eq( - self, - other: Union[Scalar, Series[S1]], - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - axis: SeriesAxisType = ..., - ) -> Series[_bool]: ... - def ewm( - self, - com: Optional[float] = ..., - span: Optional[float] = ..., - halflife: Optional[float] = ..., - alpha: Optional[float] = ..., - min_periods: int = ..., - adjust: _bool = ..., - ignore_na: _bool = ..., - axis: SeriesAxisType = ..., - ) -> ExponentialMovingWindow: ... - def expanding(self, min_periods: int = ..., center: _bool = ..., axis: SeriesAxisType = ...) -> DataFrame: ... - def floordiv( - self, - other: Union[num, _ListLike, Series[S1]], - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - axis: Optional[SeriesAxisType] = ..., - ) -> Series[int]: ... - def ge( - self, - other: Union[Scalar, Series[S1]], - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - axis: SeriesAxisType = ..., - ) -> Series[_bool]: ... - def gt( - self, - other: Union[Scalar, Series[S1]], - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - axis: SeriesAxisType = ..., - ) -> Series[_bool]: ... - def item(self) -> S1: ... - @overload - def kurt( - self, - axis: Optional[SeriesAxisType] = ..., - skipna: _bool = ..., - numeric_only: Optional[_bool] = ..., - *, - level: Level, - **kwargs, - ) -> Series[S1]: ... - @overload - def kurt( - self, - axis: Optional[SeriesAxisType] = ..., - skipna: _bool = ..., - level: None = ..., - numeric_only: Optional[_bool] = ..., - **kwargs, - ) -> Scalar: ... - @overload - def kurtosis( - self, - axis: Optional[SeriesAxisType] = ..., - skipna: _bool = ..., - numeric_only: Optional[_bool] = ..., - *, - level: Optional[Level], - **kwargs, - ) -> Series[S1]: ... - @overload - def kurtosis( - self, - axis: Optional[SeriesAxisType] = ..., - skipna: _bool = ..., - level: None = ..., - numeric_only: Optional[_bool] = ..., - **kwargs, - ) -> Scalar: ... - def le( - self, - other: Union[Scalar, Series[S1]], - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - axis: SeriesAxisType = ..., - ) -> Series[_bool]: ... - def lt( - self, - other: Union[Scalar, Series[S1]], - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - axis: SeriesAxisType = ..., - ) -> Series[_bool]: ... - @overload - def mad(self, axis: Optional[SeriesAxisType] = ..., skipna: _bool = ..., *, level: Level, **kwargs) -> Series[S1]: ... - @overload - def mad(self, axis: Optional[SeriesAxisType] = ..., skipna: _bool = ..., level: None = ..., **kwargs) -> Scalar: ... - @overload - def max( - self, - axis: Optional[SeriesAxisType] = ..., - skipna: _bool = ..., - *, - level: Level, - numeric_only: Optional[_bool] = ..., - **kwargs, - ) -> Series[S1]: ... - @overload - def max( - self, - axis: Optional[SeriesAxisType] = ..., - skipna: _bool = ..., - *, - level: None = ..., - numeric_only: Optional[_bool] = ..., - **kwargs, - ) -> S1: ... - @overload - def mean( - self, - axis: Optional[SeriesAxisType] = ..., - skipna: _bool = ..., - numeric_only: Optional[_bool] = ..., - *, - level: Level, - **kwargs, - ) -> Series[S1]: ... - @overload - def mean( - self, - axis: Optional[SeriesAxisType] = ..., - skipna: _bool = ..., - level: None = ..., - numeric_only: Optional[_bool] = ..., - **kwargs, - ) -> float: ... - @overload - def median( - self, - axis: Optional[SeriesAxisType] = ..., - skipna: _bool = ..., - numeric_only: Optional[_bool] = ..., - *, - level: Level, - **kwargs, - ) -> Series[S1]: ... - @overload - def median( - self, - axis: Optional[SeriesAxisType] = ..., - skipna: _bool = ..., - level: None = ..., - numeric_only: Optional[_bool] = ..., - **kwargs, - ) -> float: ... - @overload - def min( - self, - axis: Optional[SeriesAxisType] = ..., - skipna: _bool = ..., - numeric_only: Optional[_bool] = ..., - *, - level: Level, - **kwargs, - ) -> Series[S1]: ... - @overload - def min( - self, - axis: Optional[SeriesAxisType] = ..., - skipna: _bool = ..., - level: None = ..., - numeric_only: Optional[_bool] = ..., - **kwargs, - ) -> S1: ... - def mod( - self, - other: Union[num, _ListLike, Series[S1]], - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - axis: Optional[SeriesAxisType] = ..., - ) -> Series[S1]: ... - def mul( - self, - other: Union[num, _ListLike, Series[S1]], - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - axis: Optional[SeriesAxisType] = ..., - ) -> Series[S1]: ... - def multiply( - self, - other: Union[num, _ListLike, Series[S1]], - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - axis: Optional[SeriesAxisType] = ..., - ) -> Series[S1]: ... - def ne( - self, - other: Union[Scalar, Series[S1]], - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - axis: SeriesAxisType = ..., - ) -> Series[_bool]: ... - def nunique(self, dropna: _bool = ...) -> int: ... - def pow( - self, - other: Union[num, _ListLike, Series[S1]], - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - axis: Optional[SeriesAxisType] = ..., - ) -> Series[S1]: ... - @overload - def prod( - self, - axis: Optional[SeriesAxisType] = ..., - skipna: Optional[_bool] = ..., - numeric_only: Optional[_bool] = ..., - min_count: int = ..., - *, - level: Level, - **kwargs, - ) -> Series[S1]: ... - @overload - def prod( - self, - axis: Optional[SeriesAxisType] = ..., - skipna: Optional[_bool] = ..., - level: None = ..., - numeric_only: Optional[_bool] = ..., - min_count: int = ..., - **kwargs, - ) -> Scalar: ... - @overload - def product( - self, - axis: Optional[SeriesAxisType] = ..., - skipna: Optional[_bool] = ..., - numeric_only: Optional[_bool] = ..., - min_count: int = ..., - *, - level: Level, - **kwargs, - ) -> Series[S1]: ... - @overload - def product( - self, - axis: Optional[SeriesAxisType] = ..., - skipna: Optional[_bool] = ..., - level: None = ..., - numeric_only: Optional[_bool] = ..., - min_count: int = ..., - **kwargs, - ) -> Scalar: ... - def radd( - self, - other: Union[Series[S1], Scalar], - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - axis: SeriesAxisType = ..., - ) -> Series[S1]: ... - def rdivmod( - self, - other: Union[Series[S1], Scalar], - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - axis: SeriesAxisType = ..., - ) -> Series[S1]: ... - def rfloordiv( - self, - other, - level: Optional[Level] = ..., - fill_value: Optional[Union[float, None]] = ..., - axis: SeriesAxisType = ..., - ) -> Series[S1]: ... - def rmod( - self, - other: Union[Series[S1], Scalar], - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - axis: SeriesAxisType = ..., - ) -> Series[S1]: ... - def rmul( - self, - other: Union[Series[S1], Scalar], - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - axis: SeriesAxisType = ..., - ) -> Series[S1]: ... - @overload - def rolling( - self, - window, - min_periods: Optional[int] = ..., - center: _bool = ..., - *, - win_type: _str, - on: Optional[_str] = ..., - axis: SeriesAxisType = ..., - closed: Optional[_str] = ..., - ) -> Window: ... - @overload - def rolling( - self, - window, - min_periods: Optional[int] = ..., - center: _bool = ..., - *, - on: Optional[_str] = ..., - axis: SeriesAxisType = ..., - closed: Optional[_str] = ..., - ) -> Rolling: ... - def rpow( - self, - other: Union[Series[S1], Scalar], - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - axis: SeriesAxisType = ..., - ) -> Series[S1]: ... - def rsub( - self, - other: Union[Series[S1], Scalar], - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - axis: SeriesAxisType = ..., - ) -> Series[S1]: ... - def rtruediv( - self, - other, - level: Optional[Level] = ..., - fill_value: Optional[Union[float, None]] = ..., - axis: SeriesAxisType = ..., - ) -> Series[S1]: ... - @overload - def sem( - self, - axis: Optional[SeriesAxisType] = ..., - skipna: Optional[_bool] = ..., - ddof: int = ..., - numeric_only: Optional[_bool] = ..., - *, - level: Level, - **kwargs, - ) -> Series[S1]: ... - @overload - def sem( - self, - axis: Optional[SeriesAxisType] = ..., - skipna: Optional[_bool] = ..., - level: None = ..., - ddof: int = ..., - numeric_only: Optional[_bool] = ..., - **kwargs, - ) -> Scalar: ... - @overload - def skew( - self, - axis: Optional[SeriesAxisType] = ..., - skipna: Optional[_bool] = ..., - numeric_only: Optional[_bool] = ..., - *, - level: Level, - **kwargs, - ) -> Series[S1]: ... - @overload - def skew( - self, - axis: Optional[SeriesAxisType] = ..., - skipna: Optional[_bool] = ..., - level: None = ..., - numeric_only: Optional[_bool] = ..., - **kwargs, - ) -> Scalar: ... - @overload - def std( - self, - axis: Optional[SeriesAxisType] = ..., - skipna: Optional[_bool] = ..., - ddof: int = ..., - numeric_only: Optional[_bool] = ..., - *, - level: Level, - **kwargs, - ) -> Series[float]: ... - @overload - def std( - self, - axis: Optional[SeriesAxisType] = ..., - skipna: Optional[_bool] = ..., - level: None = ..., - ddof: int = ..., - numeric_only: Optional[_bool] = ..., - **kwargs, - ) -> float: ... - def sub( - self, - other: Union[num, _ListLike, Series[S1]], - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - axis: Optional[SeriesAxisType] = ..., - ) -> Series[S1]: ... - def subtract( - self, - other: Union[num, _ListLike, Series[S1]], - level: Optional[Level] = ..., - fill_value: Optional[float] = ..., - axis: Optional[SeriesAxisType] = ..., - ) -> Series[S1]: ... - def sum( - self: Series[S1], - axis: Optional[SeriesAxisType] = ..., - skipna: Optional[_bool] = ..., - level: Optional[Level] = ..., - numeric_only: Optional[_bool] = ..., - min_count: int = ..., - **kwargs, - ) -> S1: ... - def to_list(self) -> List: ... - def to_numpy(self, dtype: Optional[Type[DtypeNp]] = ..., copy: _bool = ..., na_value=..., **kwargs) -> np.ndarray: ... - def to_records( - self, - index: _bool = ..., - columnDTypes: Optional[Union[_str, Dict]] = ..., - indexDTypes: Optional[Union[_str, Dict]] = ..., - ): ... - def tolist(self) -> List: ... - def truediv( - self, - other, - level: Optional[Level] = ..., - fill_value: Optional[Union[float, None]] = ..., - axis: SeriesAxisType = ..., - ) -> Series[float]: ... - @overload - def var( - self, - axis: Optional[SeriesAxisType] = ..., - skipna: Optional[_bool] = ..., - ddof: int = ..., - numeric_only: Optional[_bool] = ..., - *, - level: Level, - **kwargs, - ) -> Series[S1]: ... - @overload - def var( - self, - axis: Optional[SeriesAxisType] = ..., - skipna: Optional[_bool] = ..., - level: None = ..., - ddof: int = ..., - numeric_only: Optional[_bool] = ..., - **kwargs, - ) -> Scalar: ... - @overload - def rename_axis( - self, - mapper: Union[Scalar, ListLike] = ..., - index: Optional[Union[Scalar, ListLike, Callable, Dict]] = ..., - columns: Optional[Union[Scalar, ListLike, Callable, Dict]] = ..., - axis: Optional[SeriesAxisType] = ..., - copy: _bool = ..., - *, - inplace: Literal[True], - ) -> None: ... - @overload - def rename_axis( - self, - mapper: Union[Scalar, ListLike] = ..., - index: Optional[Union[Scalar, ListLike, Callable, Dict]] = ..., - columns: Optional[Union[Scalar, ListLike, Callable, Dict]] = ..., - axis: Optional[SeriesAxisType] = ..., - copy: _bool = ..., - inplace: Literal[False] = ..., - ) -> Series: ... - @overload - def set_axis(self, labels, axis: Axis = ..., inplace: Literal[False] = ...) -> Series[S1]: ... - @overload - def set_axis(self, labels, axis: Axis, inplace: Literal[True]) -> None: ... - @overload - def set_axis(self, labels, *, inplace: Literal[True]) -> None: ... - @overload - def set_axis(self, labels, axis: Axis = ..., inplace: bool = ...) -> Optional[Series[S1]]: ... - -class TimestampSeries(Series): ... -class TimedeltaSeries(Series): ... diff --git a/partial/pandas/core/sorting.pyi b/partial/pandas/core/sorting.pyi deleted file mode 100644 index 1c8baf3..0000000 --- a/partial/pandas/core/sorting.pyi +++ /dev/null @@ -1,24 +0,0 @@ -from typing import Any - -def get_group_index(labels: Any, shape: Any, sort: bool, xnull: bool) -> Any: ... -def get_compressed_ids(labels: Any, sizes: Any): ... -def is_int64_overflow_possible(shape: Any) -> bool: ... -def decons_group_index(comp_labels: Any, shape: Any): ... -def decons_obs_group_ids(comp_ids: Any, obs_ids: Any, shape: Any, labels: Any, xnull: bool) -> Any: ... -def indexer_from_factorized(labels: Any, shape: Any, compress: bool = ...) -> Any: ... -def lexsort_indexer(keys: Any, orders: Any = ..., na_position: str = ...) -> Any: ... -def nargsort(items: Any, kind: str = ..., ascending: bool = ..., na_position: str = ...) -> Any: ... - -class _KeyMapper: - levels: Any = ... - labels: Any = ... - comp_ids: Any = ... - k: Any = ... - tables: Any = ... - def __init__(self, comp_ids: Any, ngroups: int, levels: Any, labels: Any) -> None: ... - def get_key(self, comp_id: Any): ... - -def get_flattened_iterator(comp_ids: Any, ngroups: Any, levels: Any, labels: Any): ... -def get_indexer_dict(label_list: Any, keys: Any): ... -def get_group_index_sorter(group_index: Any, ngroups: int) -> Any: ... -def compress_group_index(group_index: Any, sort: bool = ...) -> Any: ... diff --git a/partial/pandas/core/strings.pyi b/partial/pandas/core/strings.pyi deleted file mode 100644 index 35c6683..0000000 --- a/partial/pandas/core/strings.pyi +++ /dev/null @@ -1,94 +0,0 @@ -from pandas.core.base import NoNewAttributesMixin as NoNewAttributesMixin -from pandas.core.series import Series -from typing import List, Generic, TypeVar - -def cat_core(list_of_columns: List, sep: str) : ... -def cat_safe(list_of_columns: List, sep: str) : ... -def str_count(arr, pat, flags: int = ...): ... -def str_contains(arr, pat, case: bool = ..., flags: int = ..., na = ..., regex: bool = ...): ... -def str_startswith(arr, pat, na = ...): ... -def str_endswith(arr, pat, na = ...): ... -def str_replace(arr, pat, repl, n: int = ..., case = ..., flags: int = ..., regex: bool = ...): ... -def str_repeat(arr, repeats): ... -def str_match(arr, pat, case: bool = ..., flags: int = ..., na = ...): ... -def str_extract(arr, pat, flags: int = ..., expand: bool = ...): ... -def str_extractall(arr, pat, flags: int = ...): ... -def str_get_dummies(arr, sep: str = ...): ... -def str_join(arr, sep): ... -def str_findall(arr, pat, flags: int = ...): ... -def str_find(arr, sub, start: int = ..., end = ..., side: str = ...): ... -def str_index(arr, sub, start: int = ..., end = ..., side: str = ...): ... -def str_pad(arr, width, side: str = ..., fillchar: str = ...): ... -def str_split(arr, pat = ..., n = ...): ... -def str_rsplit(arr, pat = ..., n = ...): ... -def str_slice(arr, start = ..., stop = ..., step = ...): ... -def str_slice_replace(arr, start = ..., stop = ..., repl = ...): ... -def str_strip(arr, to_strip = ..., side: str = ...): ... -def str_wrap(arr, width, **kwargs): ... -def str_translate(arr, table): ... -def str_get(arr, i): ... -def str_decode(arr, encoding, errors: str = ...): ... -def str_encode(arr, encoding, errors: str = ...): ... -def forbid_nonstring_types(forbidden, name = ...): ... -def copy(source): ... - -RT = TypeVar("RT") - -class StringMethods(NoNewAttributesMixin, Generic[RT]): - def __init__(self, data) -> None: ... - def __getitem__(self, key) -> RT: ... - def __iter__(self) : ... - def cat(self, others = ..., sep = ..., na_rep = ..., join: str = ...) -> RT: ... - def split(self, pat = ..., n: int = ..., expand: bool = ...) -> RT: ... - def rsplit(self, pat = ..., n: int = ..., expand: bool = ...) -> RT: ... - def partition(self, sep: str = ..., expand: bool = ...) -> RT: ... - def rpartition(self, sep: str = ..., expand: bool = ...) -> RT: ... - def get(self, i) -> RT: ... - def join(self, sep) -> RT: ... - def contains(self, pat, case: bool = ..., flags: int = ..., na = ..., regex: bool = ...) -> Series[bool]: ... - def match(self, pat, case: bool = ..., flags: int = ..., na = ...) -> RT: ... - def replace(self, pat, repl, n: int = ..., case = ..., flags: int = ..., regex: bool = ...) -> RT: ... - def repeat(self, repeats) -> RT: ... - def pad(self, width, side: str = ..., fillchar: str = ...) -> RT: ... - def center(self, width, fillchar: str = ...) -> RT: ... - def ljust(self, width, fillchar: str = ...) -> RT: ... - def rjust(self, width, fillchar: str = ...) -> RT: ... - def zfill(self, width) -> RT: ... - def slice(self, start = ..., stop = ..., step = ...) -> RT: ... - def slice_replace(self, start = ..., stop = ..., repl = ...) -> RT: ... - def decode(self, encoding, errors: str = ...) -> RT: ... - def encode(self, encoding, errors: str = ...) -> RT: ... - def strip(self, to_strip = ...) -> RT: ... - def lstrip(self, to_strip = ...) -> RT: ... - def rstrip(self, to_strip = ...) -> RT: ... - def wrap(self, width, **kwargs) -> RT: ... - def get_dummies(self, sep: str = ...) -> RT: ... - def translate(self, table) -> RT: ... - count = ... - startswith = ... - endswith = ... - findall = ... - def extract(self, pat, flags: int = ..., expand: bool = ...) -> RT: ... - def extractall(self, pat, flags: int = ...) -> RT: ... - def find(self, sub, start: int = ..., end = ...) -> RT: ... - def rfind(self, sub, start: int = ..., end = ...) -> RT: ... - def normalize(self, form) -> RT: ... - def index(self, sub, start: int = ..., end = ...) -> RT: ... - def rindex(self, sub, start: int = ..., end = ...) -> RT: ... - len = ... - lower = ... - upper = ... - title = ... - capitalize = ... - swapcase = ... - casefold = ... - isalnum = ... - isalpha = ... - isdigit = ... - isspace = ... - islower = ... - isupper = ... - istitle = ... - isnumeric = ... - isdecimal = ... - diff --git a/partial/pandas/core/tools/__init__.pyi b/partial/pandas/core/tools/__init__.pyi deleted file mode 100644 index 68f6a6d..0000000 --- a/partial/pandas/core/tools/__init__.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from .datetimes import to_datetime as to_datetime -from .timedeltas import to_timedelta as to_timedelta - diff --git a/partial/pandas/core/tools/datetimes.pyi b/partial/pandas/core/tools/datetimes.pyi deleted file mode 100644 index 1985d43..0000000 --- a/partial/pandas/core/tools/datetimes.pyi +++ /dev/null @@ -1,89 +0,0 @@ -from datetime import datetime as datetime -from numpy import datetime64 as datetime64 -import numpy as np - -from pandas._typing import ( - ArrayLike as ArrayLike, - Index as Index, - AnyArrayLike as AnyArrayLike, - DateTimeErrorChoices as DateTimeErrorChoices, - ExtensionArray as ExtensionArray, - Timestamp as Timestamp, -) -from pandas.core.dtypes.generic import ABCSeries as ABCSeries -from pandas.core.generic import NDFrame as NDFrame -from pandas.core.indexes.datetimes import DatetimeIndex as DatetimeIndex -from pandas.core.frame import DataFrame as DataFrame -from pandas.core.series import Series as Series, TimestampSeries -from typing import List, Optional, Tuple, TypedDict, Union, overload - -ArrayConvertible = Union[List, Tuple, AnyArrayLike] -Scalar = Union[int, float, str] -DatetimeScalar = Union[Scalar, datetime] - -DatetimeScalarOrArrayConvertible = Union[DatetimeScalar, ArrayConvertible] - -DatetimeDictArg = Union[List[Scalar], Tuple[Scalar, ...], AnyArrayLike] - -class YearMonthDayDict(TypedDict, total=True): - year: DatetimeDictArg - month: DatetimeDictArg - day: DatetimeDictArg - -class FulldatetimeDict(YearMonthDayDict, total=False): - hour: DatetimeDictArg - hours: DatetimeDictArg - minute: DatetimeDictArg - minutes: DatetimeDictArg - second: DatetimeDictArg - seconds: DatetimeDictArg - ms: DatetimeDictArg - us: DatetimeDictArg - ns: DatetimeDictArg - -DictConvertible = Union[FulldatetimeDict, "DataFrame"] - -def should_cache(arg: ArrayConvertible, unique_share: float = ..., check_count: Optional[int] = ...) -> bool: ... -@overload -def to_datetime( - arg: DatetimeScalar, - errors: DateTimeErrorChoices = ..., - dayfirst: bool = ..., - yearfirst: bool = ..., - utc: bool | None = ..., - format: str | None = ..., - exact: bool = ..., - unit: str | None = ..., - infer_datetime_format: bool = ..., - origin=..., - cache: bool = ..., -) -> Timestamp: ... -@overload -def to_datetime( - arg: Series | DictConvertible, - errors: DateTimeErrorChoices = ..., - dayfirst: bool = ..., - yearfirst: bool = ..., - utc: bool | None = ..., - format: str | None = ..., - exact: bool = ..., - unit: str | None = ..., - infer_datetime_format: bool = ..., - origin=..., - cache: bool = ..., -) -> TimestampSeries: ... -@overload -def to_datetime( - arg: list | tuple | np.ndarray | Index | ExtensionArray, - errors: DateTimeErrorChoices = ..., - dayfirst: bool = ..., - yearfirst: bool = ..., - utc: bool | None = ..., - format: str | None = ..., - exact: bool = ..., - unit: str | None = ..., - infer_datetime_format: bool = ..., - origin=..., - cache: bool = ..., -) -> DatetimeIndex: ... -def to_time(arg, format=..., infer_time_format: bool = ..., errors: str = ...): ... diff --git a/partial/pandas/core/tools/numeric.pyi b/partial/pandas/core/tools/numeric.pyi deleted file mode 100644 index 426071d..0000000 --- a/partial/pandas/core/tools/numeric.pyi +++ /dev/null @@ -1 +0,0 @@ -def to_numeric(arg, errors: str = ..., downcast = ...): ... diff --git a/partial/pandas/core/tools/timedeltas.pyi b/partial/pandas/core/tools/timedeltas.pyi deleted file mode 100644 index 78a3d3f..0000000 --- a/partial/pandas/core/tools/timedeltas.pyi +++ /dev/null @@ -1,29 +0,0 @@ -# def to_timedelta(arg, unit: str = ..., errors: str = ...): ... -from datetime import timedelta -from typing import Literal, Optional, Union, overload -from pandas._libs.tslibs import Timedelta -from pandas._libs.tslibs.timedeltas import UnitChoices -from pandas._typing import DateTimeErrorChoices, ArrayLike, Index as Index -from pandas.core.series import Series as Series, TimedeltaSeries -from pandas.core.indexes.timedeltas import TimedeltaIndex - -# Copied from pandas/_libs/tslibs/timedeltas.pyx - -@overload -def to_timedelta( - arg: Union[str, int, float, timedelta], - unit: Optional[UnitChoices] = ..., - errors: DateTimeErrorChoices = ..., -) -> Timedelta: ... -@overload -def to_timedelta( - arg: Series, - unit: Optional[UnitChoices] = ..., - errors: DateTimeErrorChoices = ..., -) -> TimedeltaSeries: ... -@overload -def to_timedelta( - arg: Union[list, tuple, range, ArrayLike, Index], - unit: Optional[UnitChoices] = ..., - errors: DateTimeErrorChoices = ..., -) -> TimedeltaIndex: ... diff --git a/partial/pandas/core/window/__init__.pyi b/partial/pandas/core/window/__init__.pyi deleted file mode 100644 index 7b4e23e..0000000 --- a/partial/pandas/core/window/__init__.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from .ewm import ExponentialMovingWindow as ExponentialMovingWindow -from .expanding import Expanding as Expanding, ExpandingGroupby as ExpandingGroupby -from .rolling import Rolling as Rolling, RollingGroupby as RollingGroupby, Window as Window diff --git a/partial/pandas/core/window/ewm.pyi b/partial/pandas/core/window/ewm.pyi deleted file mode 100644 index 5f0c449..0000000 --- a/partial/pandas/core/window/ewm.pyi +++ /dev/null @@ -1,33 +0,0 @@ -from typing import Union, Optional, Callable -from pandas.core.window.rolling import _Rolling - -from pandas._typing import Scalar, Series, DataFrame - -class ExponentialMovingWindow(_Rolling): - obj = ... - com = ... - min_periods: int = ... - adjust = ... - ignore_na = ... - axis = ... - on = ... - def __init__( - self, - obj, - com=..., - span=..., - halflife=..., - alpha=..., - min_periods: int = ..., - adjust: bool = ..., - ignore_na: bool = ..., - axis: int = ..., - ) -> None: ... - def aggregate(self, func: Optional[Callable] = ..., *args, **kwargs) -> Union[Scalar, Series, DataFrame]: ... - agg = aggregate - def mean(self, *args, **kwargs): ... - def std(self, bias: bool = ..., *args, **kwargs): ... - vol = ... - def var(self, bias: bool = ..., *args, **kwargs): ... - def cov(self, other=..., pairwise=..., bias: bool = ..., **kwargs): ... - def corr(self, other=..., pairwise=..., **kwargs): ... diff --git a/partial/pandas/core/window/expanding.pyi b/partial/pandas/core/window/expanding.pyi deleted file mode 100644 index 41af06c..0000000 --- a/partial/pandas/core/window/expanding.pyi +++ /dev/null @@ -1,19 +0,0 @@ -from typing import Callable, Any, Dict, Tuple, Optional -from pandas._typing import FrameOrSeriesUnion as FrameOrSeries -from pandas.core.window.common import WindowGroupByMixin as WindowGroupByMixin -from pandas.core.window.rolling import _Rolling_and_Expanding - -class Expanding(_Rolling_and_Expanding): - def __init__(self, obj, min_periods: int = ..., center: bool = ..., axis: int = ..., **kwargs) -> None: ... - def count(self, **kwargs) -> FrameOrSeries: ... - def apply( - self, - func: Callable[..., Any], - raw: bool = ..., - engine: Optional[str] = ..., - engine_kwargs: Optional[Dict[str, bool]] = ..., - args: Optional[Tuple[Any, ...]] = ..., - kwargs: Optional[Dict[str, Any]] = ..., - ): ... - -class ExpandingGroupby(WindowGroupByMixin, Expanding): ... diff --git a/partial/pandas/core/window/numba_.pyi b/partial/pandas/core/window/numba_.pyi deleted file mode 100644 index c1eea17..0000000 --- a/partial/pandas/core/window/numba_.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from pandas._typing import Scalar as Scalar -from typing import Any, Callable, Dict, Optional, Tuple - -def make_rolling_apply(func: Callable[..., Scalar], args: Tuple, nogil: bool, parallel: bool, nopython: bool): ... -def generate_numba_apply_func( - args: Tuple, kwargs: Dict[str, Any], func: Callable[..., Scalar], engine_kwargs: Optional[Dict[str, bool]] -): ... diff --git a/partial/pandas/core/window/rolling.pyi b/partial/pandas/core/window/rolling.pyi deleted file mode 100644 index 84c1663..0000000 --- a/partial/pandas/core/window/rolling.pyi +++ /dev/null @@ -1,88 +0,0 @@ -import numpy as np -from pandas._typing import Axis as Axis, FrameOrSeriesUnion as FrameOrSeries, Scalar as Scalar -from pandas.core.base import PandasObject as PandasObject, SelectionMixin as SelectionMixin, ShallowMixin as ShallowMixin -from pandas.core.indexes.api import Index as Index -from pandas.core.window.common import WindowGroupByMixin as WindowGroupByMixin -from typing import Callable, Dict, Mapping, Optional, Sequence, Set, Tuple, Union - -class _Window(PandasObject, ShallowMixin, SelectionMixin): - exclusions: Set[str] = ... - obj = ... - on = ... - closed = ... - window = ... - min_periods: int = ... - center = ... - win_type: str = ... - win_freq = ... - axis = ... - def __init__( - self, - obj, - window=..., - min_periods: Optional[int] = ..., - center: Optional[bool] = ..., - win_type: Optional[str] = ..., - axis: Axis = ..., - on: Optional[Union[str, Index]] = ..., - closed: Optional[str] = ..., - **kwargs, - ) -> None: ... - @property - def is_datetimelike(self) -> Optional[bool]: ... - @property - def is_freq_type(self) -> bool: ... - def validate(self) -> None: ... - def __getattr__(self, attr: str): ... - def __iter__(self): ... - def aggregate(self, func: Optional[Callable] = ..., *args, **kwargs) -> Union[Scalar, FrameOrSeries]: ... - agg = aggregate - -class Window(_Window): - def validate(self) -> None: ... - def sum(self, *args, **kwargs): ... - def mean(self, *args, **kwargs): ... - def var(self, ddof: int = ..., *args, **kwargs): ... - def std(self, ddof: int = ..., *args, **kwargs): ... - -class _Rolling(_Window): ... - -class _Rolling_and_Expanding(_Rolling): - def count(self) -> FrameOrSeries: ... - def apply( - self, - func, - raw: bool = ..., - engine: str = ..., - engine_kwargs: Optional[Dict] = ..., - args: Optional[Tuple] = ..., - kwargs: Optional[Dict] = ..., - ): ... - def sum(self, *args, **kwargs) -> FrameOrSeries: ... - def max(self, *args, **kwargs) -> FrameOrSeries: ... - def min(self, *args, **kwargs) -> FrameOrSeries: ... - def mean(self, *args, **kwargs) -> FrameOrSeries: ... - def median(self, **kwargs) -> FrameOrSeries: ... - def std(self, ddof: int = ..., *args, **kwargs) -> FrameOrSeries: ... - def var(self, ddof: int = ..., *args, **kwargs) -> FrameOrSeries: ... - def skew(self, **kwargs) -> FrameOrSeries: ... - def kurt(self, **kwargs) -> FrameOrSeries: ... - def quantile(self, quantile: float, interpolation: str = ..., **kwargs) -> FrameOrSeries: ... - def cov( - self, other: Optional[Union[FrameOrSeries, np.ndarray]] = ..., pairwise: Optional[bool] = ..., ddof: int = ..., **kwargs - ) -> FrameOrSeries: ... - def corr( - self, other: Optional[Union[FrameOrSeries, np.ndarray]] = ..., pairwise: Optional[bool] = ..., **kwargs - ) -> FrameOrSeries: ... - -class Rolling(_Rolling_and_Expanding): - def is_datetimelike(self) -> bool: ... - win_freq = ... - window = ... - win_type: str = ... - min_periods: int = ... - def validate(self) -> None: ... - def count(self) -> FrameOrSeries: ... - def apply(self, func, raw: bool = ..., engine: str = ..., engine_kwargs=..., args=..., kwargs=...): ... - -class RollingGroupby(WindowGroupByMixin, Rolling): ... diff --git a/partial/pandas/io/__init__.pyi b/partial/pandas/io/__init__.pyi deleted file mode 100644 index e69de29..0000000 diff --git a/partial/pandas/io/api.pyi b/partial/pandas/io/api.pyi deleted file mode 100644 index 78a69a3..0000000 --- a/partial/pandas/io/api.pyi +++ /dev/null @@ -1,15 +0,0 @@ -from pandas.io.clipboards import read_clipboard as read_clipboard -from pandas.io.excel import ExcelFile as ExcelFile, ExcelWriter as ExcelWriter, read_excel as read_excel -from pandas.io.feather_format import read_feather as read_feather -from pandas.io.gbq import read_gbq as read_gbq -from pandas.io.html import read_html as read_html -from pandas.io.json import read_json as read_json -from pandas.io.orc import read_orc as read_orc -from pandas.io.parquet import read_parquet as read_parquet -from pandas.io.parsers import read_csv as read_csv, read_fwf as read_fwf, read_table as read_table -from pandas.io.pickle import read_pickle as read_pickle, to_pickle as to_pickle -from pandas.io.pytables import HDFStore as HDFStore, read_hdf as read_hdf -from pandas.io.sas import read_sas as read_sas -from pandas.io.spss import read_spss as read_spss -from pandas.io.sql import read_sql as read_sql, read_sql_query as read_sql_query, read_sql_table as read_sql_table -from pandas.io.stata import read_stata as read_stata diff --git a/partial/pandas/io/excel/_base.pyi b/partial/pandas/io/excel/_base.pyi deleted file mode 100644 index b5663cb..0000000 --- a/partial/pandas/io/excel/_base.pyi +++ /dev/null @@ -1,173 +0,0 @@ -import abc -from pandas._typing import Dtype, Scalar -from pandas.core.frame import DataFrame as DataFrame -from typing import Any, Callable, Dict, List, Literal, Optional, Sequence, Union, overload - -@overload -def read_excel( - filepath: str, - sheet_name: Optional[List[str]], - header: Optional[Union[int, Sequence[int]]] = ..., - names: Optional[Sequence[str]] = ..., - index_col: Optional[Union[int, Sequence[int]]] = ..., - usecols: Optional[Union[int, str, Sequence[Union[int, str, Callable]]]] = ..., - squeeze: bool = ..., - dtype: Union[str, Dict[str, Any], Dtype] = ..., - engine: Optional[str] = ..., - converters: Optional[Dict[Union[int, str], Callable]] = ..., - true_values: Optional[Sequence[Scalar]] = ..., - false_values: Optional[Sequence[Scalar]] = ..., - skiprows: Optional[Union[Sequence[int], int, Callable]] = ..., - nrows: Optional[int] = ..., - na_values = ..., - keep_default_na: bool = ..., - verbose: bool = ..., - parse_dates: Union[bool, Sequence, Dict[str, Sequence]] = ..., - date_parser: Optional[Callable] = ..., - thousands: Optional[str] = ..., - comment: Optional[str] = ..., - skipfooter: int = ..., - convert_float: bool = ..., - mangle_dupe_cols: bool = ..., -) -> Dict[str, DataFrame]: ... - -@overload -def read_excel( - filepath: str, - sheet_name: List[int], - header: Optional[Union[int, Sequence[int]]] = ..., - names: Optional[Sequence[str]] = ..., - index_col: Optional[Union[int, Sequence[int]]] = ..., - usecols: Optional[Union[int, str, Sequence[Union[int, str, Callable]]]] = ..., - squeeze: bool = ..., - dtype: Union[str, Dict[str, Any], Dtype] = ..., - engine: Optional[str] = ..., - converters: Optional[Dict[Union[int, str], Callable]] = ..., - true_values: Optional[Sequence[Scalar]] = ..., - false_values: Optional[Sequence[Scalar]] = ..., - skiprows: Optional[Union[Sequence[int], int, Callable]] = ..., - nrows: Optional[int] = ..., - na_values = ..., - keep_default_na: bool = ..., - verbose: bool = ..., - parse_dates: Union[bool, Sequence, Dict[str, Sequence]] = ..., - date_parser: Optional[Callable] = ..., - thousands: Optional[str] = ..., - comment: Optional[str] = ..., - skipfooter: int = ..., - convert_float: bool = ..., - mangle_dupe_cols: bool = ..., -) -> Dict[int, DataFrame]: ... - -@overload -def read_excel( - filepath: str, - sheet_name: List[Union[int, str]], - header: Optional[Union[int, Sequence[int]]] = ..., - names: Optional[Sequence[str]] = ..., - index_col: Optional[Union[int, Sequence[int]]] = ..., - usecols: Optional[Union[int, str, Sequence[Union[int, str, Callable]]]] = ..., - squeeze: bool = ..., - dtype: Union[str, Dict[str, Any], Dtype] = ..., - engine: Optional[str] = ..., - converters: Optional[Dict[Union[int, str], Callable]] = ..., - true_values: Optional[Sequence[Scalar]] = ..., - false_values: Optional[Sequence[Scalar]] = ..., - skiprows: Optional[Union[Sequence[int], int, Callable]] = ..., - nrows: Optional[int] = ..., - na_values = ..., - keep_default_na: bool = ..., - verbose: bool = ..., - parse_dates: Union[bool, Sequence, Dict[str, Sequence]] = ..., - date_parser: Optional[Callable] = ..., - thousands: Optional[str] = ..., - comment: Optional[str] = ..., - skipfooter: int = ..., - convert_float: bool = ..., - mangle_dupe_cols: bool = ..., -) -> Dict[Union[int, str], DataFrame]: ... - -@overload -def read_excel( - filepath: str, - sheet_name: Union[int, str] = ..., - header: Optional[Union[int, Sequence[int]]] = ..., - names: Optional[Sequence[str]] = ..., - index_col: Optional[Union[int, Sequence[int]]] = ..., - usecols: Optional[Union[int, str, Sequence[Union[int, str, Callable]]]] = ..., - squeeze: bool = ..., - dtype: Union[str, Dict[str, Any], Dtype] = ..., - engine: Optional[str] = ..., - converters: Optional[Dict[Union[int, str], Callable]] = ..., - true_values: Optional[Sequence[Scalar]] = ..., - false_values: Optional[Sequence[Scalar]] = ..., - skiprows: Optional[Union[Sequence[int], int, Callable]] = ..., - nrows: Optional[int] = ..., - na_values = ..., - keep_default_na: bool = ..., - verbose: bool = ..., - parse_dates: Union[bool, Sequence, Dict[str, Sequence]] = ..., - date_parser: Optional[Callable] = ..., - thousands: Optional[str] = ..., - comment: Optional[str] = ..., - skipfooter: int = ..., - convert_float: bool = ..., - mangle_dupe_cols: bool = ..., - **kwargs -) -> DataFrame: ... - -class BaseExcelReader(metaclass=abc.ABCMeta): - book = ... - def __init__(self, filepath_or_buffer) -> None: ... - @abc.abstractmethod - def load_workbook(self, filepath_or_buffer): ... - def close(self) -> None: ... - @property - @abc.abstractmethod - def sheet_names(self): ... - @abc.abstractmethod - def get_sheet_by_name(self, name): ... - @abc.abstractmethod - def get_sheet_by_index(self, index): ... - @abc.abstractmethod - def get_sheet_data(self, sheet, convert_float): ... - def parse(self, sheet_name: int = ..., header: int = ..., names = ..., index_col = ..., usecols = ..., squeeze: bool = ..., dtype = ..., true_values = ..., false_values = ..., skiprows = ..., nrows = ..., na_values = ..., verbose: bool = ..., parse_dates: bool = ..., date_parser = ..., thousands = ..., comment = ..., skipfooter: int = ..., convert_float: bool = ..., mangle_dupe_cols: bool = ..., **kwds): ... - -class ExcelWriter(metaclass=abc.ABCMeta): - def __new__(cls, path, engine = ..., **kwargs): ... - book = ... - curr_sheet = ... - path = ... - @property - def supported_extensions(self): ... - @property - def engine(self): ... - def write_cells(self, cells, sheet_name = ..., startrow: int = ..., startcol: int = ..., freeze_panes = ...): ... - def save(self): ... - sheets = ... - cur_sheet = ... - date_format: str = ... - datetime_format: str = ... - mode = ... - def __init__(self, path, engine = ..., date_format = ..., datetime_format = ..., mode: str = ..., **engine_kwargs) -> None: ... - def __fspath__(self): ... - @classmethod - def check_extension(cls, ext): ... - def __enter__(self): ... - def __exit__(self, exc_type, exc_value, traceback) -> None: ... - def close(self): ... - -class ExcelFile: - engine = ... - io = ... - def __init__(self, io, engine = ...) -> None: ... - def __fspath__(self): ... - def parse(self, sheet_name: int = ..., header: int = ..., names = ..., index_col = ..., usecols = ..., squeeze: bool = ..., converters = ..., true_values = ..., false_values = ..., skiprows = ..., nrows = ..., na_values = ..., parse_dates: bool = ..., date_parser = ..., thousands = ..., comment = ..., skipfooter: int = ..., convert_float: bool = ..., mangle_dupe_cols: bool = ..., **kwds): ... - @property - def book(self): ... - @property - def sheet_names(self): ... - def close(self) -> None: ... - def __enter__(self): ... - def __exit__(self, exc_type, exc_value, traceback) -> None: ... - def __del__(self) -> None: ... diff --git a/partial/pandas/io/gcs.pyi b/partial/pandas/io/gcs.pyi deleted file mode 100644 index 3edd1e4..0000000 --- a/partial/pandas/io/gcs.pyi +++ /dev/null @@ -1,5 +0,0 @@ -from pandas._typing import FilePathOrBuffer as FilePathOrBuffer - -gcsfs = ... - -def get_filepath_or_buffer(filepath_or_buffer: FilePathOrBuffer, encoding=..., compression=..., mode=...): ... diff --git a/partial/pandas/io/json/__init__.pyi b/partial/pandas/io/json/__init__.pyi deleted file mode 100644 index be00195..0000000 --- a/partial/pandas/io/json/__init__.pyi +++ /dev/null @@ -1,4 +0,0 @@ -from ._json import dumps as dumps, loads as loads, read_json as read_json, to_json as to_json -from ._normalize import json_normalize as json_normalize -from ._table_schema import build_table_schema as build_table_schema - diff --git a/partial/pandas/io/json/_json.pyi b/partial/pandas/io/json/_json.pyi deleted file mode 100644 index 896b64f..0000000 --- a/partial/pandas/io/json/_json.pyi +++ /dev/null @@ -1,200 +0,0 @@ -from collections import abc -import sys -from pandas.core.series import Series as Series -from pandas.core.frame import DataFrame -from pandas._typing import JSONSerializable as JSONSerializable, FilePathOrBuffer -from typing import Any, Callable, Optional, Union, overload - -if sys.version_info >= (3, 8): - from typing import Literal -else: - from typing_extensions import Literal - -loads = ... -dumps = ... -TABLE_SCHEMA_VERSION: str = ... - -def to_json( - path_or_buf, - obj, - orient: Optional[str] = ..., - date_format: str = ..., - double_precision: int = ..., - force_ascii: bool = ..., - date_unit: str = ..., - default_handler: Optional[Callable[[Any], JSONSerializable]] = ..., - lines: bool = ..., - compression: Optional[str] = ..., - index: bool = ..., - indent: int = ..., -): ... - -class Writer: - obj = ... - orient = ... - date_format = ... - double_precision = ... - ensure_ascii = ... - date_unit = ... - default_handler = ... - index = ... - indent = ... - is_copy = ... - def __init__( - self, - obj, - orient: Optional[str], - date_format: str, - double_precision: int, - ensure_ascii: bool, - date_unit: str, - index: bool, - default_handler: Optional[Callable[[Any], JSONSerializable]] = ..., - indent: int = ..., - ) -> None: ... - def write(self): ... - -class SeriesWriter(Writer): ... -class FrameWriter(Writer): ... - -class JSONTableWriter(FrameWriter): - schema = ... - obj = ... - date_format = ... - orient = ... - index = ... - def __init__( - self, - obj, - orient: Optional[str], - date_format: str, - double_precision: int, - ensure_ascii: bool, - date_unit: str, - index: bool, - default_handler: Optional[Callable[[Any], JSONSerializable]] = ..., - indent: int = ..., - ): ... - -@overload -def read_json( - path: FilePathOrBuffer, - orient: Optional[str] = ..., - dtype=..., - convert_axes=..., - convert_dates: bool = ..., - keep_default_dates: bool = ..., - numpy: bool = ..., - precise_float: bool = ..., - date_unit: Optional[str] = ..., - encoding: Optional[str] = ..., - lines: bool = ..., - chunksize: Optional[int] = ..., - compression: Optional[Union[str, Literal["infer", "gzip", "bz2", "zip", "xz"]]] = ..., - *, - typ: Literal["series"], -) -> Series: ... -@overload -def read_json( - path: FilePathOrBuffer, - orient: Optional[str] = ..., - dtype=..., - convert_axes=..., - convert_dates: bool = ..., - keep_default_dates: bool = ..., - numpy: bool = ..., - precise_float: bool = ..., - date_unit: Optional[str] = ..., - encoding: Optional[str] = ..., - lines: bool = ..., - chunksize: Optional[int] = ..., - compression: Optional[Union[str, Literal["infer", "gzip", "bz2", "zip", "xz"]]] = ..., - *, - typ: Literal["frame"], -) -> DataFrame: ... -@overload -def read_json( - path: FilePathOrBuffer, - orient: Optional[str] = ..., - typ: Optional[str] = ..., - dtype=..., - convert_axes=..., - convert_dates: bool = ..., - keep_default_dates: bool = ..., - numpy: bool = ..., - precise_float: bool = ..., - date_unit: Optional[str] = ..., - encoding: Optional[str] = ..., - lines: bool = ..., - chunksize: Optional[int] = ..., - compression: Optional[Union[str, Literal["infer", "gzip", "bz2", "zip", "xz"]]] = ..., -) -> Union[Series, DataFrame]: ... - -class JsonReader(abc.Iterator): - path_or_buf = ... - orient = ... - typ = ... - dtype = ... - convert_axes = ... - convert_dates = ... - keep_default_dates = ... - numpy = ... - precise_float = ... - date_unit = ... - encoding = ... - compression = ... - lines = ... - chunksize = ... - nrows_seen: int = ... - should_close: bool = ... - data = ... - def __init__( - self, - filepath_or_buffer, - orient, - typ, - dtype, - convert_axes, - convert_dates, - keep_default_dates, - numpy, - precise_float, - date_unit, - encoding, - lines, - chunksize, - compression, - ) -> None: ... - def read(self): ... - def close(self) -> None: ... - def __next__(self): ... - -class Parser: - json = ... - orient = ... - dtype = ... - min_stamp = ... - numpy = ... - precise_float = ... - convert_axes = ... - convert_dates = ... - date_unit = ... - keep_default_dates = ... - obj = ... - def __init__( - self, - json, - orient, - dtype=..., - convert_axes: bool = ..., - convert_dates: bool = ..., - keep_default_dates: bool = ..., - numpy: bool = ..., - precise_float: bool = ..., - date_unit=..., - ) -> None: ... - def check_keys_split(self, decoded) -> None: ... - def parse(self): ... - -class SeriesParser(Parser): ... -class FrameParser(Parser): ... diff --git a/partial/pandas/io/json/_normalize.pyi b/partial/pandas/io/json/_normalize.pyi deleted file mode 100644 index 0ee573f..0000000 --- a/partial/pandas/io/json/_normalize.pyi +++ /dev/null @@ -1,17 +0,0 @@ -from pandas.core.frame import DataFrame as DataFrame -from pandas._typing import Scalar as Scalar -from typing import Any, Dict, List, Optional, Union - -def convert_to_line_delimits(s: Any): ... -def nested_to_record(ds: Any, prefix: str=..., sep: str=..., level: int=..., max_level: Optional[int]=...) -> Any: ... - -def json_normalize( - data: Union[Dict, List[Dict]], - record_path: Optional[Union[str, List]] = None, - meta: Optional[Union[str, List[Union[str, List[str]]]]] = None, - meta_prefix: Optional[str] = None, - record_prefix: Optional[str] = None, - errors: str = "raise", - sep: str = ".", - max_level: Optional[int] = None, -) -> DataFrame: ... diff --git a/partial/pandas/io/json/_table_schema.pyi b/partial/pandas/io/json/_table_schema.pyi deleted file mode 100644 index 257c6e8..0000000 --- a/partial/pandas/io/json/_table_schema.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from typing import Any, Optional - -loads: Any - -def as_json_table_type(x: Any): ... -def set_default_names(data: Any): ... -def convert_pandas_type_to_json_field(arr: Any, dtype: Optional[Any] = ...): ... -def convert_json_field_to_pandas_type(field: Any): ... -def build_table_schema(data: Any, index: bool = ..., primary_key: Optional[Any] = ..., version: bool = ...): ... -def parse_table_schema(json: Any, precise_float: Any): ... diff --git a/partial/pandas/io/parsers.pyi b/partial/pandas/io/parsers.pyi deleted file mode 100644 index afc6fcf..0000000 --- a/partial/pandas/io/parsers.pyi +++ /dev/null @@ -1,597 +0,0 @@ -from __future__ import annotations -from collections import abc -import sys -from pandas._typing import ( - FilePath as FilePath, - FilePathOrBuffer as FilePathOrBuffer, - Scalar as Scalar, - ReadBuffer as ReadBuffer, - AnyStr_cov as AnyStr_cov, - DtypeArg as DtypeArg, - CompressionOptions as CompressionOptions, - StorageOptions as StorageOptions, -) -from pandas.core.frame import DataFrame as DataFrame -from typing import Any, Callable, Dict, List, Mapping, Optional, Sequence, Union, overload, Protocol - -if sys.version_info >= (3, 8): - from typing import Literal -else: - from typing_extensions import Literal - -class ReadCsvBuffer(ReadBuffer[AnyStr_cov], Protocol): ... - -# read_csv engines -CSVEngine = Literal["c", "python", "pyarrow", "python-fwf"] - -# iterator=True -> TextFileReader -@overload -def read_csv( - filepath_or_buffer: Union[FilePath, ReadCsvBuffer[bytes], ReadCsvBuffer[str]], - *, - sep: Optional[str] = ..., - delimiter: Optional[str] = ..., - header: Optional[Union[int, Sequence[int], Literal["infer"]]] = ..., - names=..., - index_col=..., - usecols=..., - squeeze: Optional[bool] = ..., - prefix: Optional[str] = ..., - mangle_dupe_cols: bool = ..., - dtype: Optional[DtypeArg] = ..., - engine: Optional[CSVEngine] = ..., - converters=..., - true_values=..., - false_values=..., - skipinitialspace: bool = ..., - skiprows=..., - skipfooter: int = ..., - nrows: Optional[int] = ..., - na_values=..., - keep_default_na: bool = ..., - na_filter: bool = ..., - verbose: bool = ..., - skip_blank_lines: bool = ..., - parse_dates=..., - infer_datetime_format: bool = ..., - keep_date_col: bool = ..., - date_parser=..., - dayfirst: bool = ..., - cache_dates: bool = ..., - iterator: Literal[True], - chunksize: Optional[int] = ..., - compression: CompressionOptions = ..., - thousands: Optional[str] = ..., - decimal: str = ..., - lineterminator: Optional[str] = ..., - quotechar: str = ..., - quoting: int = ..., - doublequote: bool = ..., - escapechar: Optional[str] = ..., - comment: Optional[str] = ..., - encoding: Optional[str] = ..., - encoding_errors: Optional[str] = ..., - dialect=..., - error_bad_lines: Optional[bool] = ..., - warn_bad_lines: Optional[bool] = ..., - on_bad_lines=..., - delim_whitespace: bool = ..., - low_memory=..., - memory_map: bool = ..., - float_precision: Optional[Literal["high", "legacy"]] = ..., - storage_options: Optional[StorageOptions] = ..., -) -> TextFileReader: ... - -# chunksize=int -> TextFileReader -@overload -def read_csv( - filepath_or_buffer: Union[FilePath, ReadCsvBuffer[bytes], ReadCsvBuffer[str]], - *, - sep: Optional[str] = ..., - delimiter: Optional[str] = ..., - header: Optional[Union[int, Sequence[int], Literal["infer"]]] = ..., - names=..., - index_col=..., - usecols=..., - squeeze: Optional[bool] = ..., - prefix: Optional[str] = ..., - mangle_dupe_cols: bool = ..., - dtype: Optional[DtypeArg] = ..., - engine: Optional[CSVEngine] = ..., - converters=..., - true_values=..., - false_values=..., - skipinitialspace: bool = ..., - skiprows=..., - skipfooter: int = ..., - nrows: Optional[int] = ..., - na_values=..., - keep_default_na: bool = ..., - na_filter: bool = ..., - verbose: bool = ..., - skip_blank_lines: bool = ..., - parse_dates=..., - infer_datetime_format: bool = ..., - keep_date_col: bool = ..., - date_parser=..., - dayfirst: bool = ..., - cache_dates: bool = ..., - iterator: bool = ..., - chunksize: int, - compression: CompressionOptions = ..., - thousands: Optional[str] = ..., - decimal: str = ..., - lineterminator: Optional[str] = ..., - quotechar: str = ..., - quoting: int = ..., - doublequote: bool = ..., - escapechar: Optional[str] = ..., - comment: Optional[str] = ..., - encoding: Optional[str] = ..., - encoding_errors: Optional[str] = ..., - dialect=..., - error_bad_lines: Optional[bool] = ..., - warn_bad_lines: Optional[bool] = ..., - on_bad_lines=..., - delim_whitespace: bool = ..., - low_memory=..., - memory_map: bool = ..., - float_precision: Optional[Literal["high", "legacy"]] = ..., - storage_options: Optional[StorageOptions] = ..., -) -> TextFileReader: ... - -# default case -> DataFrame -@overload -def read_csv( - filepath_or_buffer: Union[FilePath, ReadCsvBuffer[bytes], ReadCsvBuffer[str]], - *, - sep: Optional[str] = ..., - delimiter: Optional[str] = ..., - header: Optional[Union[int, Sequence[int], Literal["infer"]]] = ..., - names=..., - index_col=..., - usecols=..., - squeeze: Optional[bool] = ..., - prefix: Optional[str] = ..., - mangle_dupe_cols: bool = ..., - dtype: Optional[DtypeArg] = ..., - engine: Optional[CSVEngine] = ..., - converters=..., - true_values=..., - false_values=..., - skipinitialspace: bool = ..., - skiprows=..., - skipfooter: int = ..., - nrows: Optional[int] = ..., - na_values=..., - keep_default_na: bool = ..., - na_filter: bool = ..., - verbose: bool = ..., - skip_blank_lines: bool = ..., - parse_dates=..., - infer_datetime_format: bool = ..., - keep_date_col: bool = ..., - date_parser=..., - dayfirst: bool = ..., - cache_dates: bool = ..., - iterator: Literal[False] = ..., - chunksize: None = ..., - compression: CompressionOptions = ..., - thousands: Optional[str] = ..., - decimal: str = ..., - lineterminator: Optional[str] = ..., - quotechar: str = ..., - quoting: int = ..., - doublequote: bool = ..., - escapechar: Optional[str] = ..., - comment: Optional[str] = ..., - encoding: Optional[str] = ..., - encoding_errors: Optional[str] = ..., - dialect=..., - error_bad_lines: Optional[bool] = ..., - warn_bad_lines: Optional[bool] = ..., - on_bad_lines=..., - delim_whitespace: bool = ..., - low_memory=..., - memory_map: bool = ..., - float_precision: Optional[Literal["high", "legacy"]] = ..., - storage_options: Optional[StorageOptions] = ..., -) -> DataFrame: ... - -# Unions -> DataFrame | TextFileReader -@overload -def read_csv( - filepath_or_buffer: Union[FilePath, ReadCsvBuffer[bytes], ReadCsvBuffer[str]], - *, - sep: Optional[str] = ..., - delimiter: Optional[str] = ..., - header: Optional[Union[int, Sequence[int], Literal["infer"]]] = ..., - names=..., - index_col=..., - usecols=..., - squeeze: Optional[bool] = ..., - prefix: Optional[str] = ..., - mangle_dupe_cols: bool = ..., - dtype: Optional[DtypeArg] = ..., - engine: Optional[CSVEngine] = ..., - converters=..., - true_values=..., - false_values=..., - skipinitialspace: bool = ..., - skiprows=..., - skipfooter: int = ..., - nrows: Optional[int] = ..., - na_values=..., - keep_default_na: bool = ..., - na_filter: bool = ..., - verbose: bool = ..., - skip_blank_lines: bool = ..., - parse_dates=..., - infer_datetime_format: bool = ..., - keep_date_col: bool = ..., - date_parser=..., - dayfirst: bool = ..., - cache_dates: bool = ..., - iterator: bool = ..., - chunksize: Optional[int] = ..., - compression: CompressionOptions = ..., - thousands: Optional[str] = ..., - decimal: str = ..., - lineterminator: Optional[str] = ..., - quotechar: str = ..., - quoting: int = ..., - doublequote: bool = ..., - escapechar: Optional[str] = ..., - comment: Optional[str] = ..., - encoding: Optional[str] = ..., - encoding_errors: Optional[str] = ..., - dialect=..., - error_bad_lines: Optional[bool] = ..., - warn_bad_lines: Optional[bool] = ..., - on_bad_lines=..., - delim_whitespace: bool = ..., - low_memory=..., - memory_map: bool = ..., - float_precision: Optional[Literal["high", "legacy"]] = ..., - storage_options: Optional[StorageOptions] = ..., -) -> DataFrame | TextFileReader: ... - -# iterator=True -> TextFileReader -@overload -def read_table( - filepath_or_buffer: Union[FilePath, ReadCsvBuffer[bytes], ReadCsvBuffer[str]], - *, - sep: Optional[str] = ..., - delimiter: Optional[str] = ..., - header: Optional[Union[int, Sequence[int], Literal["infer"]]] = ..., - names=..., - index_col=..., - usecols=..., - squeeze: Optional[bool] = ..., - prefix: Optional[str] = ..., - mangle_dupe_cols: bool = ..., - dtype: Optional[DtypeArg] = ..., - engine: Optional[CSVEngine] = ..., - converters=..., - true_values=..., - false_values=..., - skipinitialspace: bool = ..., - skiprows=..., - skipfooter: int = ..., - nrows: Optional[int] = ..., - na_values=..., - keep_default_na: bool = ..., - na_filter: bool = ..., - verbose: bool = ..., - skip_blank_lines: bool = ..., - parse_dates=..., - infer_datetime_format: bool = ..., - keep_date_col: bool = ..., - date_parser=..., - dayfirst: bool = ..., - cache_dates: bool = ..., - iterator: Literal[True], - chunksize: Optional[int] = ..., - compression: CompressionOptions = ..., - thousands: Optional[str] = ..., - decimal: str = ..., - lineterminator: Optional[str] = ..., - quotechar: str = ..., - quoting: int = ..., - doublequote: bool = ..., - escapechar: Optional[str] = ..., - comment: Optional[str] = ..., - encoding: Optional[str] = ..., - encoding_errors: Optional[str] = ..., - dialect=..., - error_bad_lines: Optional[bool] = ..., - warn_bad_lines: Optional[bool] = ..., - on_bad_lines=..., - delim_whitespace: bool = ..., - low_memory=..., - memory_map: bool = ..., - float_precision: Optional[Literal["high", "legacy"]] = ..., - storage_options: Optional[StorageOptions] = ..., -) -> TextFileReader: ... - -# chunksize=int -> TextFileReader -@overload -def read_table( - filepath_or_buffer: Union[FilePath, ReadCsvBuffer[bytes], ReadCsvBuffer[str]], - *, - sep: Optional[str] = ..., - delimiter: Optional[str] = ..., - header: Optional[Union[int, Sequence[int], Literal["infer"]]] = ..., - names=..., - index_col=..., - usecols=..., - squeeze: Optional[bool] = ..., - prefix: Optional[str] = ..., - mangle_dupe_cols: bool = ..., - dtype: Optional[DtypeArg] = ..., - engine: Optional[CSVEngine] = ..., - converters=..., - true_values=..., - false_values=..., - skipinitialspace: bool = ..., - skiprows=..., - skipfooter: int = ..., - nrows: Optional[int] = ..., - na_values=..., - keep_default_na: bool = ..., - na_filter: bool = ..., - verbose: bool = ..., - skip_blank_lines: bool = ..., - parse_dates=..., - infer_datetime_format: bool = ..., - keep_date_col: bool = ..., - date_parser=..., - dayfirst: bool = ..., - cache_dates: bool = ..., - iterator: bool = ..., - chunksize: int, - compression: CompressionOptions = ..., - thousands: Optional[str] = ..., - decimal: str = ..., - lineterminator: Optional[str] = ..., - quotechar: str = ..., - quoting: int = ..., - doublequote: bool = ..., - escapechar: Optional[str] = ..., - comment: Optional[str] = ..., - encoding: Optional[str] = ..., - encoding_errors: Optional[str] = ..., - dialect=..., - error_bad_lines: Optional[bool] = ..., - warn_bad_lines: Optional[bool] = ..., - on_bad_lines=..., - delim_whitespace: bool = ..., - low_memory=..., - memory_map: bool = ..., - float_precision: Optional[Literal["high", "legacy"]] = ..., - storage_options: Optional[StorageOptions] = ..., -) -> TextFileReader: ... - -# default case -> DataFrame -@overload -def read_table( - filepath_or_buffer: Union[FilePath, ReadCsvBuffer[bytes], ReadCsvBuffer[str]], - *, - sep: Optional[str] = ..., - delimiter: Optional[str] = ..., - header: Optional[Union[int, Sequence[int], Literal["infer"]]] = ..., - names=..., - index_col=..., - usecols=..., - squeeze: Optional[bool] = ..., - prefix: Optional[str] = ..., - mangle_dupe_cols: bool = ..., - dtype: Optional[DtypeArg] = ..., - engine: Optional[CSVEngine] = ..., - converters=..., - true_values=..., - false_values=..., - skipinitialspace: bool = ..., - skiprows=..., - skipfooter: int = ..., - nrows: Optional[int] = ..., - na_values=..., - keep_default_na: bool = ..., - na_filter: bool = ..., - verbose: bool = ..., - skip_blank_lines: bool = ..., - parse_dates=..., - infer_datetime_format: bool = ..., - keep_date_col: bool = ..., - date_parser=..., - dayfirst: bool = ..., - cache_dates: bool = ..., - iterator: Literal[False] = ..., - chunksize: None = ..., - compression: CompressionOptions = ..., - thousands: Optional[str] = ..., - decimal: str = ..., - lineterminator: Optional[str] = ..., - quotechar: str = ..., - quoting: int = ..., - doublequote: bool = ..., - escapechar: Optional[str] = ..., - comment: Optional[str] = ..., - encoding: Optional[str] = ..., - encoding_errors: Optional[str] = ..., - dialect=..., - error_bad_lines: Optional[bool] = ..., - warn_bad_lines: Optional[bool] = ..., - on_bad_lines=..., - delim_whitespace: bool = ..., - low_memory=..., - memory_map: bool = ..., - float_precision: Optional[Literal["high", "legacy"]] = ..., - storage_options: Optional[StorageOptions] = ..., -) -> DataFrame: ... - -# Unions -> DataFrame | TextFileReader -@overload -def read_table( - filepath_or_buffer: Union[FilePath, ReadCsvBuffer[bytes], ReadCsvBuffer[str]], - *, - sep: Optional[str] = ..., - delimiter: Optional[str] = ..., - header: Optional[Union[int, Sequence[int], Literal["infer"]]] = ..., - names=..., - index_col=..., - usecols=..., - squeeze: Optional[bool] = ..., - prefix: Optional[str] = ..., - mangle_dupe_cols: bool = ..., - dtype: Optional[DtypeArg] = ..., - engine: Optional[CSVEngine] = ..., - converters=..., - true_values=..., - false_values=..., - skipinitialspace: bool = ..., - skiprows=..., - skipfooter: int = ..., - nrows: Optional[int] = ..., - na_values=..., - keep_default_na: bool = ..., - na_filter: bool = ..., - verbose: bool = ..., - skip_blank_lines: bool = ..., - parse_dates=..., - infer_datetime_format: bool = ..., - keep_date_col: bool = ..., - date_parser=..., - dayfirst: bool = ..., - cache_dates: bool = ..., - iterator: bool = ..., - chunksize: Optional[int] = ..., - compression: CompressionOptions = ..., - thousands: Optional[str] = ..., - decimal: str = ..., - lineterminator: Optional[str] = ..., - quotechar: str = ..., - quoting: int = ..., - doublequote: bool = ..., - escapechar: Optional[str] = ..., - comment: Optional[str] = ..., - encoding: Optional[str] = ..., - encoding_errors: Optional[str] = ..., - dialect=..., - error_bad_lines: Optional[bool] = ..., - warn_bad_lines: Optional[bool] = ..., - on_bad_lines=..., - delim_whitespace: bool = ..., - low_memory=..., - memory_map: bool = ..., - float_precision: Optional[Literal["high", "legacy"]] = ..., - storage_options: Optional[StorageOptions] = ..., -) -> DataFrame | TextFileReader: ... -def read_fwf(filepath_or_buffer: FilePathOrBuffer, colspecs=..., widths=..., infer_nrows=..., **kwds): ... - -class TextFileReader(abc.Iterator): - f = ... - orig_options = ... - engine = ... - chunksize = ... - nrows = ... - squeeze = ... - def __init__(self, f, engine=..., **kwds) -> None: ... - def close(self) -> None: ... - def __next__(self): ... - def read(self, nrows=...): ... - def get_chunk(self, size=...): ... - -class ParserBase: - names = ... - orig_names = ... - prefix = ... - index_col = ... - unnamed_cols = ... - index_names = ... - col_names = ... - parse_dates = ... - date_parser = ... - dayfirst = ... - keep_date_col = ... - na_values = ... - na_fvalues = ... - na_filter = ... - keep_default_na = ... - true_values = ... - false_values = ... - mangle_dupe_cols = ... - infer_datetime_format = ... - cache_dates = ... - header = ... - handles = ... - def __init__(self, kwds) -> None: ... - def close(self) -> None: ... - -class CParserWrapper(ParserBase): - kwds = ... - unnamed_cols = ... - names = ... - orig_names = ... - index_names = ... - def __init__(self, src, **kwds) -> None: ... - def close(self) -> None: ... - def set_error_bad_lines(self, status) -> None: ... - def read(self, nrows=...): ... - -def TextParser(*args, **kwds): ... -def count_empty_vals(vals): ... - -class PythonParser(ParserBase): - data = ... - buf = ... - pos: int = ... - line_pos: int = ... - encoding = ... - compression = ... - memory_map = ... - skiprows = ... - skipfunc = ... - skipfooter = ... - delimiter = ... - quotechar = ... - escapechar = ... - doublequote = ... - skipinitialspace = ... - lineterminator = ... - quoting = ... - skip_blank_lines = ... - warn_bad_lines = ... - error_bad_lines = ... - names_passed = ... - has_index_names: bool = ... - verbose = ... - converters = ... - dtype = ... - thousands = ... - decimal = ... - comment = ... - num_original_columns = ... - columns = ... - orig_names = ... - index_names = ... - nonnum = ... - def __init__(self, f, **kwds): ... - def read(self, rows=...): ... - def get_chunk(self, size=...): ... - -class FixedWidthReader(abc.Iterator): - f = ... - buffer = ... - delimiter = ... - comment = ... - colspecs = ... - def __init__(self, f, colspecs, delimiter, comment, skiprows=..., infer_nrows: int = ...) -> None: ... - def get_rows(self, infer_nrows, skiprows=...): ... - def detect_colspecs(self, infer_nrows: int = ..., skiprows=...): ... - def __next__(self): ... - -class FixedWidthFieldParser(PythonParser): - colspecs = ... - infer_nrows = ... - def __init__(self, f, **kwds) -> None: ... diff --git a/partial/pandas/io/s3.pyi b/partial/pandas/io/s3.pyi deleted file mode 100644 index 42795ea..0000000 --- a/partial/pandas/io/s3.pyi +++ /dev/null @@ -1,12 +0,0 @@ -from pandas._typing import FilePathOrBuffer as FilePathOrBuffer -from typing import Any, IO, Optional, Tuple - -s3fs = ... - -def get_file_and_filesystem(filepath_or_buffer: FilePathOrBuffer, mode: Optional[str] = ...) -> Tuple[IO, Any]: ... -def get_filepath_or_buffer( - filepath_or_buffer: FilePathOrBuffer, - encoding: Optional[str] = ..., - compression: Optional[str] = ..., - mode: Optional[str] = ..., -) -> Tuple[IO, Optional[str], Optional[str], bool]: ... diff --git a/partial/pandas/io/sas/sas_constants.pyi b/partial/pandas/io/sas/sas_constants.pyi deleted file mode 100644 index c7e4e8f..0000000 --- a/partial/pandas/io/sas/sas_constants.pyi +++ /dev/null @@ -1,108 +0,0 @@ -magic = ... -align_1_checker_value: bytes = ... -align_1_offset: int = ... -align_1_length: int = ... -align_1_value: int = ... -u64_byte_checker_value: bytes = ... -align_2_offset: int = ... -align_2_length: int = ... -align_2_value: int = ... -endianness_offset: int = ... -endianness_length: int = ... -platform_offset: int = ... -platform_length: int = ... -encoding_offset: int = ... -encoding_length: int = ... -dataset_offset: int = ... -dataset_length: int = ... -file_type_offset: int = ... -file_type_length: int = ... -date_created_offset: int = ... -date_created_length: int = ... -date_modified_offset: int = ... -date_modified_length: int = ... -header_size_offset: int = ... -header_size_length: int = ... -page_size_offset: int = ... -page_size_length: int = ... -page_count_offset: int = ... -page_count_length: int = ... -sas_release_offset: int = ... -sas_release_length: int = ... -sas_server_type_offset: int = ... -sas_server_type_length: int = ... -os_version_number_offset: int = ... -os_version_number_length: int = ... -os_maker_offset: int = ... -os_maker_length: int = ... -os_name_offset: int = ... -os_name_length: int = ... -page_bit_offset_x86: int = ... -page_bit_offset_x64: int = ... -subheader_pointer_length_x86: int = ... -subheader_pointer_length_x64: int = ... -page_type_offset: int = ... -page_type_length: int = ... -block_count_offset: int = ... -block_count_length: int = ... -subheader_count_offset: int = ... -subheader_count_length: int = ... -page_meta_type: int = ... -page_data_type: int = ... -page_amd_type: int = ... -page_metc_type: int = ... -page_comp_type: int = ... -page_mix_types = ... -subheader_pointers_offset: int = ... -truncated_subheader_id: int = ... -compressed_subheader_id: int = ... -compressed_subheader_type: int = ... -text_block_size_length: int = ... -row_length_offset_multiplier: int = ... -row_count_offset_multiplier: int = ... -col_count_p1_multiplier: int = ... -col_count_p2_multiplier: int = ... -row_count_on_mix_page_offset_multiplier: int = ... -column_name_pointer_length: int = ... -column_name_text_subheader_offset: int = ... -column_name_text_subheader_length: int = ... -column_name_offset_offset: int = ... -column_name_offset_length: int = ... -column_name_length_offset: int = ... -column_name_length_length: int = ... -column_data_offset_offset: int = ... -column_data_length_offset: int = ... -column_data_length_length: int = ... -column_type_offset: int = ... -column_type_length: int = ... -column_format_text_subheader_index_offset: int = ... -column_format_text_subheader_index_length: int = ... -column_format_offset_offset: int = ... -column_format_offset_length: int = ... -column_format_length_offset: int = ... -column_format_length_length: int = ... -column_label_text_subheader_index_offset: int = ... -column_label_text_subheader_index_length: int = ... -column_label_offset_offset: int = ... -column_label_offset_length: int = ... -column_label_length_offset: int = ... -column_label_length_length: int = ... -rle_compression: bytes = ... -rdc_compression: bytes = ... -compression_literals = ... -encoding_names = ... - -class SASIndex: - row_size_index: int = ... - column_size_index: int = ... - subheader_counts_index: int = ... - column_text_index: int = ... - column_name_index: int = ... - column_attributes_index: int = ... - format_and_label_index: int = ... - column_list_index: int = ... - data_subheader_index: int = ... - -subheader_signature_to_index = ... -sas_date_formats = ... -sas_datetime_formats = ... diff --git a/partial/pandas/io/stata.pyi b/partial/pandas/io/stata.pyi deleted file mode 100644 index face1c8..0000000 --- a/partial/pandas/io/stata.pyi +++ /dev/null @@ -1,159 +0,0 @@ -import datetime -from collections import abc -from pandas._typing import FilePathOrBuffer as FilePathOrBuffer -from pandas.core.frame import DataFrame as DataFrame -from typing import Dict, Hashable, Optional, Sequence - -def read_stata( - path: FilePathOrBuffer, - convert_dates: bool = ..., - convert_categoricals: bool = ..., - index_col: Optional[str] = ..., - convert_missing: bool = ..., - preserve_dtypes: bool = ..., - columns: Optional[Sequence[str]] = ..., - order_categoricals: bool = ..., - chunksize: Optional[int] = ..., - iterator: bool = ..., -) -> DataFrame: ... - -stata_epoch = ... -excessive_string_length_error: str - -class PossiblePrecisionLoss(Warning): ... - -precision_loss_doc: str - -class ValueLabelTypeMismatch(Warning): ... - -value_label_mismatch_doc: str - -class InvalidColumnName(Warning): ... - -invalid_name_doc: str - -class StataValueLabel: - labname = ... - value_labels = ... - text_len = ... - off = ... - val = ... - txt = ... - n: int = ... - len = ... - def __init__(self, catarray, encoding: str = ...): ... - def generate_value_label(self, byteorder): ... - -class StataMissingValue: - MISSING_VALUES = ... - bases = ... - float32_base: bytes = ... - increment = ... - value = ... - int_value = ... - float64_base: bytes = ... - BASE_MISSING_VALUES = ... - def __init__(self, value) -> None: ... - string = ... - def __eq__(self, other) -> bool: ... - @classmethod - def get_base_missing_value(cls, dtype): ... - -class StataParser: - DTYPE_MAP = ... - DTYPE_MAP_XML = ... - TYPE_MAP = ... - TYPE_MAP_XML = ... - VALID_RANGE = ... - OLD_TYPE_MAPPING = ... - MISSING_VALUES = ... - NUMPY_TYPE_MAP = ... - RESERVED_WORDS = ... - def __init__(self) -> None: ... - -class StataReader(StataParser, abc.Iterator): - col_sizes = ... - path_or_buf = ... - def __init__( - self, - path_or_buf, - convert_dates: bool = ..., - convert_categoricals: bool = ..., - index_col=..., - convert_missing: bool = ..., - preserve_dtypes: bool = ..., - columns=..., - order_categoricals: bool = ..., - chunksize=..., - ) -> None: ... - def __enter__(self): ... - def __exit__(self, exc_type, exc_value, traceback) -> None: ... - def close(self) -> None: ... - def __next__(self): ... - def get_chunk(self, size=...): ... - def read( - self, - nrows=..., - convert_dates=..., - convert_categoricals=..., - index_col=..., - convert_missing=..., - preserve_dtypes=..., - columns=..., - order_categoricals=..., - ): ... - @property - def data_label(self): ... - def variable_labels(self): ... - def value_labels(self): ... - -class StataWriter(StataParser): - type_converters = ... - def __init__( - self, - fname, - data, - convert_dates=..., - write_index: bool = ..., - byteorder=..., - time_stamp=..., - data_label=..., - variable_labels=..., - ) -> None: ... - def write_file(self) -> None: ... - -class StataStrLWriter: - df = ... - columns = ... - def __init__(self, df, columns, version: int = ..., byteorder=...) -> None: ... - def generate_table(self): ... - def generate_blob(self, gso_table): ... - -class StataWriter117(StataWriter): - def __init__( - self, - fname, - data, - convert_dates=..., - write_index: bool = ..., - byteorder=..., - time_stamp=..., - data_label=..., - variable_labels=..., - convert_strl=..., - ) -> None: ... - -class StataWriterUTF8(StataWriter117): - def __init__( - self, - fname: FilePathOrBuffer, - data: DataFrame, - convert_dates: Optional[Dict[Hashable, str]] = ..., - write_index: bool = ..., - byteorder: Optional[str] = ..., - time_stamp: Optional[datetime.datetime] = ..., - data_label: Optional[str] = ..., - variable_labels: Optional[Dict[Hashable, str]] = ..., - convert_strl: Optional[Sequence[Hashable]] = ..., - version: Optional[int] = ..., - ) -> None: ... diff --git a/partial/pandas/plotting/__init__.pyi b/partial/pandas/plotting/__init__.pyi deleted file mode 100644 index 54956bb..0000000 --- a/partial/pandas/plotting/__init__.pyi +++ /dev/null @@ -1,2 +0,0 @@ -from ._core import PlotAccessor as PlotAccessor, boxplot as boxplot, boxplot_frame as boxplot_frame, boxplot_frame_groupby as boxplot_frame_groupby, hist_frame as hist_frame, hist_series as hist_series -from ._misc import andrews_curves as andrews_curves, autocorrelation_plot as autocorrelation_plot, bootstrap_plot as bootstrap_plot, deregister as deregister_matplotlib_converters, lag_plot as lag_plot, parallel_coordinates as parallel_coordinates, plot_params as plot_params, radviz as radviz, register as register_matplotlib_converters, scatter_matrix as scatter_matrix, table as table diff --git a/partial/pandas/plotting/_core.pyi b/partial/pandas/plotting/_core.pyi deleted file mode 100644 index d436a84..0000000 --- a/partial/pandas/plotting/_core.pyi +++ /dev/null @@ -1,36 +0,0 @@ -from matplotlib.axes import Axes as PlotAxes -from pandas.core.base import PandasObject as PandasObject -from pandas.core.frame import DataFrame -from typing import Optional, Sequence, Tuple, Union - -def hist_series(self, by = ..., ax = ..., grid: bool = ..., xlabelsize = ..., xrot = ..., ylabelsize = ..., yrot = ..., figsize = ..., bins: int = ..., backend = ..., **kwargs): ... -def hist_frame(data, column = ..., by = ..., grid: bool = ..., xlabelsize = ..., xrot = ..., ylabelsize = ..., yrot = ..., ax = ..., sharex: bool = ..., sharey: bool = ..., figsize = ..., layout = ..., bins: int = ..., backend = ..., **kwargs): ... -def boxplot( - data: DataFrame, - column: Optional[Union[str, Sequence[str]]] = ..., - by: Optional[Union[str, Sequence[str]]] = ..., - ax: Optional[PlotAxes] = ..., - fontsize: Optional[Union[float, str]] = ..., - rot: float = ..., - grid: bool = ..., - figsize: Optional[Tuple[float, float]] = ..., - layout: Optional[Tuple[int, int]] = ..., - return_type: Optional[str] = ..., -) : ... -def boxplot_frame(self, column = ..., by = ..., ax = ..., fontsize = ..., rot: int = ..., grid: bool = ..., figsize = ..., layout = ..., return_type = ..., backend = ..., **kwargs): ... -def boxplot_frame_groupby(grouped, subplots: bool = ..., column = ..., fontsize = ..., rot: int = ..., grid: bool = ..., ax = ..., figsize = ..., layout = ..., sharex: bool = ..., sharey: bool = ..., backend = ..., **kwargs): ... - -class PlotAccessor(PandasObject): - def __init__(self, data) -> None: ... - def __call__(self, *args, **kwargs): ... - def line(self, x = ..., y = ..., **kwargs) -> PlotAccessor: ... - def bar(self, x = ..., y = ..., **kwargs) -> PlotAccessor: ... - def barh(self, x = ..., y = ..., **kwargs) -> PlotAccessor: ... - def box(self, by = ..., **kwargs) -> PlotAccessor: ... - def hist(self, by = ..., bins: int = ..., **kwargs) -> PlotAccessor: ... - def kde(self, bw_method = ..., ind = ..., **kwargs) -> PlotAccessor: ... - density = ... - def area(self, x = ..., y = ..., **kwargs) -> PlotAccessor: ... - def pie(self, **kwargs) -> PlotAccessor: ... - def scatter(self, x, y, s = ..., c = ..., **kwargs) -> PlotAccessor: ... - def hexbin(self, x, y, C = ..., reduce_C_function = ..., gridsize = ..., **kwargs) -> PlotAccessor: ... diff --git a/partial/pandas/plotting/_matplotlib/__init__.pyi b/partial/pandas/plotting/_matplotlib/__init__.pyi deleted file mode 100644 index 1714ee2..0000000 --- a/partial/pandas/plotting/_matplotlib/__init__.pyi +++ /dev/null @@ -1,15 +0,0 @@ -from .boxplot import boxplot as boxplot, boxplot_frame as boxplot_frame, boxplot_frame_groupby as boxplot_frame_groupby -from .converter import deregister as deregister, register as register -from .hist import hist_frame as hist_frame, hist_series as hist_series -from .misc import ( - andrews_curves as andrews_curves, - autocorrelation_plot as autocorrelation_plot, - bootstrap_plot as bootstrap_plot, - lag_plot as lag_plot, - parallel_coordinates as parallel_coordinates, - radviz as radviz, - scatter_matrix as scatter_matrix, -) -from .tools import table as table - -def plot(data, kind, **kwargs): ... diff --git a/partial/pandas/plotting/_matplotlib/boxplot.pyi b/partial/pandas/plotting/_matplotlib/boxplot.pyi deleted file mode 100644 index 10a296d..0000000 --- a/partial/pandas/plotting/_matplotlib/boxplot.pyi +++ /dev/null @@ -1,58 +0,0 @@ -from matplotlib.axes import Axes as PlotAxes -from pandas.plotting._matplotlib.core import LinePlot as LinePlot -from typing import NamedTuple - -class BoxPlot(LinePlot): - class BoxPlot(NamedTuple): - ax: PlotAxes = ... - lines: dict = ... - BP = BoxPlot - - return_type = ... - def __init__(self, data, return_type: str = ..., **kwargs) -> None: ... - def maybe_color_bp(self, bp) -> None: ... - @property - def orientation(self): ... - @property - def result(self): ... - -def boxplot( - data, - column=..., - by=..., - ax=..., - fontsize=..., - rot: int = ..., - grid: bool = ..., - figsize=..., - layout=..., - return_type=..., - **kwds, -): ... -def boxplot_frame( - self, - column=..., - by=..., - ax=..., - fontsize=..., - rot: int = ..., - grid: bool = ..., - figsize=..., - layout=..., - return_type=..., - **kwds, -): ... -def boxplot_frame_groupby( - grouped, - subplots: bool = ..., - column=..., - fontsize=..., - rot: int = ..., - grid: bool = ..., - ax=..., - figsize=..., - layout=..., - sharex: bool = ..., - sharey: bool = ..., - **kwds, -): ... diff --git a/partial/pandas/plotting/_matplotlib/compat.pyi b/partial/pandas/plotting/_matplotlib/compat.pyi deleted file mode 100644 index e69de29..0000000 diff --git a/partial/pandas/plotting/_matplotlib/converter.pyi b/partial/pandas/plotting/_matplotlib/converter.pyi deleted file mode 100644 index 9d8683f..0000000 --- a/partial/pandas/plotting/_matplotlib/converter.pyi +++ /dev/null @@ -1,101 +0,0 @@ -import matplotlib.dates as dates -import matplotlib.units as units -from matplotlib.ticker import Formatter, Locator - -HOURS_PER_DAY: float = ... -MIN_PER_HOUR: float = ... -SEC_PER_MIN: float = ... -SEC_PER_HOUR: float = ... -SEC_PER_DAY: float = ... -MUSEC_PER_DAY: float = ... - -def get_pairs(): ... -def register_pandas_matplotlib_converters(func): ... -def pandas_converters() -> None: ... -def register() -> None: ... -def deregister() -> None: ... -def time2num(d): ... - -class TimeConverter(units.ConversionInterface): - @staticmethod - def convert(value, unit, axis): ... - @staticmethod - def axisinfo(unit, axis): ... - @staticmethod - def default_units(x, axis): ... - -class TimeFormatter(Formatter): - locs = ... - def __init__(self, locs) -> None: ... - def __call__(self, x, pos: int = ...): ... - -class PeriodConverter(dates.DateConverter): - @staticmethod - def convert(values, units, axis): ... - -def get_datevalue(date, freq): ... - -class DatetimeConverter(dates.DateConverter): - @staticmethod - def convert(values, unit, axis): ... - @staticmethod - def axisinfo(unit, axis): ... - -class PandasAutoDateFormatter(dates.AutoDateFormatter): - def __init__(self, locator, tz=..., defaultfmt: str = ...) -> None: ... - -class PandasAutoDateLocator(dates.AutoDateLocator): - def get_locator(self, dmin, dmax): ... - -class MilliSecondLocator(dates.DateLocator): - UNIT = ... - def __init__(self, tz) -> None: ... - @staticmethod - def get_unit_generic(freq): ... - def __call__(self): ... - def autoscale(self): ... - -def period_break(dates, period): ... -def has_level_label(label_flags, vmin): ... -def get_finder(freq): ... - -class TimeSeries_DateLocator(Locator): - freq = ... - base = ... - isminor = ... - isdynamic = ... - offset: int = ... - plot_obj = ... - finder = ... - def __init__( - self, - freq, - minor_locator: bool = ..., - dynamic_mode: bool = ..., - base: int = ..., - quarter: int = ..., - month: int = ..., - day: int = ..., - plot_obj=..., - ) -> None: ... - def __call__(self): ... - def autoscale(self): ... - -class TimeSeries_DateFormatter(Formatter): - format = ... - freq = ... - locs = ... - formatdict = ... - isminor = ... - isdynamic = ... - offset: int = ... - plot_obj = ... - finder = ... - def __init__(self, freq, minor_locator: bool = ..., dynamic_mode: bool = ..., plot_obj=...) -> None: ... - def set_locs(self, locs) -> None: ... - def __call__(self, x, pos: int = ...): ... - -class TimeSeries_TimedeltaFormatter(Formatter): - @staticmethod - def format_timedelta_ticks(x, pos, n_decimals): ... - def __call__(self, x, pos: int = ...): ... diff --git a/partial/pandas/plotting/_matplotlib/core.pyi b/partial/pandas/plotting/_matplotlib/core.pyi deleted file mode 100644 index da620fe..0000000 --- a/partial/pandas/plotting/_matplotlib/core.pyi +++ /dev/null @@ -1,117 +0,0 @@ -from typing import Optional - -class MPLPlot: - orientation: Optional[str] = ... - data = ... - by = ... - kind = ... - sort_columns = ... - subplots = ... - sharex: bool = ... - sharey = ... - figsize = ... - layout = ... - xticks = ... - yticks = ... - xlim = ... - ylim = ... - title = ... - use_index = ... - fontsize = ... - rot = ... - grid = ... - legend = ... - legend_handles = ... - legend_labels = ... - ax = ... - fig = ... - axes = ... - errors = ... - secondary_y = ... - colormap = ... - table = ... - include_bool = ... - kwds = ... - def __init__( - self, - data, - kind=..., - by=..., - subplots: bool = ..., - sharex=..., - sharey: bool = ..., - use_index: bool = ..., - figsize=..., - grid=..., - legend: bool = ..., - rot=..., - ax=..., - fig=..., - title=..., - xlim=..., - ylim=..., - xticks=..., - yticks=..., - sort_columns: bool = ..., - fontsize=..., - secondary_y: bool = ..., - colormap=..., - table: bool = ..., - layout=..., - include_bool: bool = ..., - **kwds, - ) -> None: ... - @property - def nseries(self): ... - def draw(self) -> None: ... - def generate(self) -> None: ... - @property - def result(self): ... - @property - def legend_title(self): ... - def plt(self): ... - @classmethod - def get_default_ax(cls, ax) -> None: ... - def on_right(self, i): ... - -class PlanePlot(MPLPlot): - x = ... - y = ... - def __init__(self, data, x, y, **kwargs) -> None: ... - @property - def nseries(self): ... - -class ScatterPlot(PlanePlot): - c = ... - def __init__(self, data, x, y, s=..., c=..., **kwargs) -> None: ... - -class HexBinPlot(PlanePlot): - C = ... - def __init__(self, data, x, y, C=..., **kwargs) -> None: ... - -class LinePlot(MPLPlot): - orientation: str = ... - data = ... - x_compat = ... - def __init__(self, data, **kwargs) -> None: ... - -class AreaPlot(LinePlot): - def __init__(self, data, **kwargs) -> None: ... - -class BarPlot(MPLPlot): - orientation: str = ... - bar_width = ... - tick_pos = ... - bottom = ... - left = ... - log = ... - tickoffset = ... - lim_offset = ... - ax_pos = ... - def __init__(self, data, **kwargs) -> None: ... - -class BarhPlot(BarPlot): - orientation: str = ... - -class PiePlot(MPLPlot): - def __init__(self, data, kind=..., **kwargs) -> None: ... diff --git a/partial/pandas/plotting/_matplotlib/hist.pyi b/partial/pandas/plotting/_matplotlib/hist.pyi deleted file mode 100644 index 560b604..0000000 --- a/partial/pandas/plotting/_matplotlib/hist.pyi +++ /dev/null @@ -1,45 +0,0 @@ -from pandas.plotting._matplotlib.core import LinePlot as LinePlot - -class HistPlot(LinePlot): - bins = ... - bottom = ... - def __init__(self, data, bins: int = ..., bottom: int = ..., **kwargs) -> None: ... - @property - def orientation(self): ... - -class KdePlot(HistPlot): - orientation: str = ... - bw_method = ... - ind = ... - def __init__(self, data, bw_method=..., ind=..., **kwargs) -> None: ... - -def hist_series( - self, - by=..., - ax=..., - grid: bool = ..., - xlabelsize=..., - xrot=..., - ylabelsize=..., - yrot=..., - figsize=..., - bins: int = ..., - **kwds, -): ... -def hist_frame( - data, - column=..., - by=..., - grid: bool = ..., - xlabelsize=..., - xrot=..., - ylabelsize=..., - yrot=..., - ax=..., - sharex: bool = ..., - sharey: bool = ..., - figsize=..., - layout=..., - bins: int = ..., - **kwds, -): ... diff --git a/partial/pandas/plotting/_matplotlib/misc.pyi b/partial/pandas/plotting/_matplotlib/misc.pyi deleted file mode 100644 index c313106..0000000 --- a/partial/pandas/plotting/_matplotlib/misc.pyi +++ /dev/null @@ -1,32 +0,0 @@ -def scatter_matrix( - frame, - alpha: float = ..., - figsize=..., - ax=..., - grid: bool = ..., - diagonal: str = ..., - marker: str = ..., - density_kwds=..., - hist_kwds=..., - range_padding: float = ..., - **kwds, -): ... -def radviz(frame, class_column, ax=..., color=..., colormap=..., **kwds): ... -def andrews_curves(frame, class_column, ax=..., samples: int = ..., color=..., colormap=..., **kwds): ... -def bootstrap_plot(series, fig=..., size: int = ..., samples: int = ..., **kwds): ... -def parallel_coordinates( - frame, - class_column, - cols=..., - ax=..., - color=..., - use_columns: bool = ..., - xticks=..., - colormap=..., - axvlines: bool = ..., - axvlines_kwds=..., - sort_labels: bool = ..., - **kwds, -): ... -def lag_plot(series, lag: int = ..., ax=..., **kwds): ... -def autocorrelation_plot(series, ax=..., **kwds): ... diff --git a/partial/pandas/plotting/_matplotlib/style.pyi b/partial/pandas/plotting/_matplotlib/style.pyi deleted file mode 100644 index e69de29..0000000 diff --git a/partial/pandas/plotting/_matplotlib/timeseries.pyi b/partial/pandas/plotting/_matplotlib/timeseries.pyi deleted file mode 100644 index b82fd0c..0000000 --- a/partial/pandas/plotting/_matplotlib/timeseries.pyi +++ /dev/null @@ -1 +0,0 @@ -def format_dateaxis(subplot, freq, index) -> None: ... diff --git a/partial/pandas/plotting/_matplotlib/tools.pyi b/partial/pandas/plotting/_matplotlib/tools.pyi deleted file mode 100644 index 06fa696..0000000 --- a/partial/pandas/plotting/_matplotlib/tools.pyi +++ /dev/null @@ -1,2 +0,0 @@ -def format_date_labels(ax, rot) -> None: ... -def table(ax, data, rowLabels=..., colLabels=..., **kwargs): ... diff --git a/partial/pandas/plotting/_misc.pyi b/partial/pandas/plotting/_misc.pyi deleted file mode 100644 index a45bf39..0000000 --- a/partial/pandas/plotting/_misc.pyi +++ /dev/null @@ -1,81 +0,0 @@ -from matplotlib.axes import Axes as PlotAxes -from matplotlib.figure import Figure -import numpy as np -from pandas.core.series import Series -from pandas.core.frame import DataFrame -from typing import Any, Dict, Optional, Sequence, Tuple, Union - -def table( - ax, - data, - rowLabels=None, - colLabels=None, -): ... -def register() -> None: ... -def deregister() -> None: ... -def scatter_matrix( - frame: DataFrame, - alpha: float = ..., - figsize: Optional[Tuple[float, float]] = ..., - ax: Optional[PlotAxes] = ..., - grid: bool = ..., - diagonal: str = ..., - marker: str = ..., - density_kwds=..., - hist_kwds=..., - range_padding: float = ..., -) -> np.ndarray: ... -def radviz( - frame: DataFrame, - class_column: str, - ax: Optional[PlotAxes] = ..., - color: Optional[Union[Sequence[str], Tuple[str]]] = ..., - colormap=..., -) -> PlotAxes: ... -def andrews_curves( - frame: DataFrame, - class_column: str, - ax: Optional[PlotAxes] = ..., - samples: int = ..., - color: Optional[Union[Sequence[str], Tuple[str]]] = ..., - colormap=..., -) -> PlotAxes: ... -def bootstrap_plot( - series: Series, - fig: Optional[Figure] = ..., - size: int = ..., - samples: int = ..., -) -> Figure: ... -def parallel_coordinates( - frame: DataFrame, - class_column: str, - cols: Optional[Sequence[str]] = ..., - ax: Optional[PlotAxes] = ..., - color: Optional[Union[Sequence[str], Tuple[str]]] = ..., - use_columns: bool = ..., - xticks: Optional[Union[Sequence, Tuple]] = ..., - colormap=..., - axvlines: bool = ..., - axvlines_kwds=..., - sort_labels: bool = ..., -) -> PlotAxes: ... -def lag_plot( - series: Series, - lag: int = ..., - ax: Optional[PlotAxes] = ..., -) -> PlotAxes: ... -def autocorrelation_plot( - series: Series, - ax: Optional[PlotAxes] = ..., -) -> PlotAxes: ... - -class _Options(dict): - def __init__(self, deprecated: bool = ...) -> None: ... - def __getitem__(self, key): ... - def __setitem__(self, key, value): ... - def __delitem__(self, key): ... - def __contains__(self, key) -> bool: ... - def reset(self) -> None: ... - def use(self, key, value) -> None: ... - -plot_params: Dict[str, Any] diff --git a/partial/pandas/py.typed b/partial/pandas/py.typed deleted file mode 100644 index b648ac9..0000000 --- a/partial/pandas/py.typed +++ /dev/null @@ -1 +0,0 @@ -partial diff --git a/partial/pandas/tseries/__init__.pyi b/partial/pandas/tseries/__init__.pyi deleted file mode 100644 index e69de29..0000000 diff --git a/partial/pandas/tseries/api.pyi b/partial/pandas/tseries/api.pyi deleted file mode 100644 index 21aee7b..0000000 --- a/partial/pandas/tseries/api.pyi +++ /dev/null @@ -1 +0,0 @@ -from pandas.tseries.frequencies import infer_freq as infer_freq diff --git a/partial/pandas/tseries/frequencies.pyi b/partial/pandas/tseries/frequencies.pyi deleted file mode 100644 index b4458a6..0000000 --- a/partial/pandas/tseries/frequencies.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from pandas.tseries.offsets import DateOffset as DateOffset -from typing import Optional - -def get_period_alias(offset_str: str) -> Optional[str]: ... -def to_offset(freq) -> Optional[DateOffset]: ... -def get_offset(name: str) -> DateOffset: ... -def infer_freq(index, warn: bool=...) -> Optional[str]: ... - - diff --git a/partial/pandas/tseries/offsets.pyi b/partial/pandas/tseries/offsets.pyi deleted file mode 100644 index f65a652..0000000 --- a/partial/pandas/tseries/offsets.pyi +++ /dev/null @@ -1,44 +0,0 @@ -from pandas._libs.tslibs.offsets import ( - FY5253 as FY5253, - BaseOffset as BaseOffset, - BDay as BDay, - BMonthBegin as BMonthBegin, - BMonthEnd as BMonthEnd, - BQuarterBegin as BQuarterBegin, - BQuarterEnd as BQuarterEnd, - BusinessDay as BusinessDay, - BusinessHour as BusinessHour, - BusinessMonthBegin as BusinessMonthBegin, - BusinessMonthEnd as BusinessMonthEnd, - BYearBegin as BYearBegin, - BYearEnd as BYearEnd, - CBMonthBegin as CBMonthBegin, - CBMonthEnd as CBMonthEnd, - CDay as CDay, - CustomBusinessDay as CustomBusinessDay, - CustomBusinessHour as CustomBusinessHour, - CustomBusinessMonthBegin as CustomBusinessMonthBegin, - CustomBusinessMonthEnd as CustomBusinessMonthEnd, - DateOffset as DateOffset, - Day as Day, - Easter as Easter, - FY5253Quarter as FY5253Quarter, - Hour as Hour, - LastWeekOfMonth as LastWeekOfMonth, - Micro as Micro, - Milli as Milli, - Minute as Minute, - MonthBegin as MonthBegin, - MonthEnd as MonthEnd, - Nano as Nano, - QuarterBegin as QuarterBegin, - QuarterEnd as QuarterEnd, - Second as Second, - SemiMonthBegin as SemiMonthBegin, - SemiMonthEnd as SemiMonthEnd, - Tick as Tick, - Week as Week, - WeekOfMonth as WeekOfMonth, - YearBegin as YearBegin, - YearEnd as YearEnd, -) diff --git a/tests/pandas/README.md b/tests/pandas/README.md deleted file mode 100644 index 2eb269e..0000000 --- a/tests/pandas/README.md +++ /dev/null @@ -1,3 +0,0 @@ -These tests originally came from https://github.com/VirtusLab/pandas-stubs. - - diff --git a/tests/pandas/__init__.py b/tests/pandas/__init__.py deleted file mode 100644 index 644c54b..0000000 --- a/tests/pandas/__init__.py +++ /dev/null @@ -1,114 +0,0 @@ -from typing import Union, Optional, Type, TYPE_CHECKING -import numpy as np -import numpy.typing as npt - -import pandas as pd - -from pandas._typing import Dtype - - -# The purpose of these checkers is twofold: -# 1) The type checker will see that the right result was returned -# 2) When using pytest, we can check that the result in the pyi file -# corresponds to what pandas returns - - -def check_dataframe_result(result: pd.DataFrame): - assert isinstance(result, pd.DataFrame) - - -def check_series_result(result: pd.Series, dtype: Optional[Dtype] = None): - """ - Check that the result is a Series, and that the dtype is the specified dtype - - Since pandas doesn't support typing of a Series, we can check the type - in pytest instead. - - Parameters - ---------- - result : pd.Series - result to check - dtype : Optional[Dtype], optional - expected dtype, by default None, which means don't check the dtype - """ - assert isinstance(result, pd.Series) - if dtype is not None: - assert result.dtype == dtype - - -def check_index_result(result: pd.Index, dtype: Optional[Dtype] = None): - """ - Check that the result is a Index, and that the dtype is the specified dtype - - Since pandas doesn't support typing of a Index, we can check the type - in pytest instead. - - Parameters - ---------- - result : pd.Index - result to check - dtype : Optional[Dtype], optional - expected dtype, by default None, which means don't check the dtype - """ - assert isinstance(result, pd.Index) - if dtype is not None: - assert result.dtype == dtype - - -def check_multiindex_result(result: pd.MultiIndex): - """ - Check that the result is a MultiIndex - - Parameters - ---------- - result : pd.MultiIndex - A multiindex - """ - - assert isinstance(result, pd.MultiIndex) - - -def check_datetimeindex_result(result: pd.DatetimeIndex): - """ - Check that the result is a DatetimeIndex - - Parameters - ---------- - result : pd.DatetimeIndex - result to check - """ - assert isinstance(result, pd.DatetimeIndex) - - -def check_numpy_result(result: np.ndarray, dtype: Optional[Union[Type[np.int64], Type[np.bool_], Type[np.str_]]] = None): - assert isinstance(result, np.ndarray) - if dtype is not None: - assert result.dtype == dtype - - -def check_timedelta_result(result: pd.Timedelta): - assert isinstance(result, pd.Timedelta) - - -def check_timestamp_result(result: pd.Timestamp): - assert isinstance(result, pd.Timestamp) - - -def check_interval_result( - result: pd.Interval, dtype: Optional[Union[Type[pd.Timestamp], Type[pd.Timedelta], Type[int], Type[float]]] -): - assert isinstance(result, pd.Interval) - if dtype is not None: - assert isinstance(result.left, dtype) - - -def check_int_result(result: int): - assert isinstance(result, int) - - -def check_float_result(result: float): - assert isinstance(result, float) - - -def check_bool_result(result: bool): - assert isinstance(result, bool) diff --git a/tests/pandas/test_frame.py b/tests/pandas/test_frame.py deleted file mode 100644 index 819ee4d..0000000 --- a/tests/pandas/test_frame.py +++ /dev/null @@ -1,922 +0,0 @@ -# flake8: noqa: F841 -from datetime import date, datetime -import io -import tempfile -from pathlib import Path -from typing import List, Tuple, Iterable, Any, Dict, Hashable - -import pandas as pd -from pandas.io.parsers import TextFileReader -import numpy as np - -from . import check_dataframe_result, check_series_result - -import pytest - - -def test_types_init() -> None: - pd.DataFrame(data={"col1": [1, 2], "col2": [3, 4]}) - pd.DataFrame(data={"col1": [1, 2], "col2": [3, 4]}, index=[2, 1]) - pd.DataFrame(data=[1, 2, 3, 4], dtype=np.int8) - pd.DataFrame(np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]), columns=["a", "b", "c"], dtype=np.int8, copy=True) - - -def test_types_append() -> None: - df = pd.DataFrame(data={"col1": [1, 2], "col2": [3, 4]}) - df2 = pd.DataFrame({"col1": [10, 20], "col2": [30, 40]}) - - res1: pd.DataFrame = df.append(df2) - res2: pd.DataFrame = df.append([1, 2, 3]) - res3: pd.DataFrame = df.append([[1, 2, 3]]) - res4: pd.DataFrame = df.append({("a", 1): [1, 2, 3], "b": df2}, ignore_index=True) - res5: pd.DataFrame = df.append({1: [1, 2, 3]}, ignore_index=True) - res6: pd.DataFrame = df.append({1: [1, 2, 3], "col2": [1, 2, 3]}, ignore_index=True) - res7: pd.DataFrame = df.append(pd.Series([5, 6]), ignore_index=True) - res8: pd.DataFrame = df.append(pd.Series([5, 6], index=["col1", "col2"]), ignore_index=True) - - -def test_types_to_csv() -> None: - df = pd.DataFrame(data={"col1": [1, 2], "col2": [3, 4]}) - csv_df: str = df.to_csv() - - with tempfile.NamedTemporaryFile(delete=False) as file: - df.to_csv(file.name) - file.close() - df2: pd.DataFrame = pd.read_csv(file.name) - - with tempfile.NamedTemporaryFile(delete=False) as file: - df.to_csv(Path(file.name)) - file.close() - df3: pd.DataFrame = pd.read_csv(Path(file.name)) - - # This keyword was added in 1.1.0 https://pandas.pydata.org/docs/whatsnew/v1.1.0.html - with tempfile.NamedTemporaryFile(delete=False) as file: - df.to_csv(file.name, errors="replace") - file.close() - df4: pd.DataFrame = pd.read_csv(file.name) - - # Testing support for binary file handles, added in 1.2.0 https://pandas.pydata.org/docs/whatsnew/v1.2.0.html - df.to_csv(io.BytesIO(), encoding="utf-8", compression="gzip") - - -def test_types_to_csv_when_path_passed() -> None: - df = pd.DataFrame(data={"col1": [1, 2], "col2": [3, 4]}) - path: Path = Path("./dummy_path.txt") - try: - assert not path.exists() - df.to_csv(path) - df5: pd.DataFrame = pd.read_csv(path) - finally: - path.unlink() - - -def test_types_copy() -> None: - df = pd.DataFrame([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) - df2: pd.DataFrame = df.copy() - - -def test_types_getitem() -> None: - df = pd.DataFrame(data={"col1": [1, 2], "col2": [3, 4], 5: [6, 7]}) - i = pd.Index(["col1", "col2"]) - s = pd.Series(["col1", "col2"]) - select_df = pd.DataFrame({"col1": [True, True], "col2": [False, True]}) - a = np.array(["col1", "col2"]) - df["col1"] - df[5] - df[["col1", "col2"]] - df[1:] - df[s] - df[a] - df[select_df] - df[i] - - -def test_slice_setitem() -> None: - # Due to the bug in pandas 1.2.3(https://github.com/pandas-dev/pandas/issues/40440), this is in separate test case - df = pd.DataFrame(data={"col1": [1, 2], "col2": [3, 4], 5: [6, 7]}) - df[1:] = ["a", "b", "c"] - - -def test_types_setitem() -> None: - df = pd.DataFrame(data={"col1": [1, 2], "col2": [3, 4], 5: [6, 7]}) - i = pd.Index(["col1", "col2"]) - s = pd.Series(["col1", "col2"]) - a = np.array(["col1", "col2"]) - df["col1"] = [1, 2] - df[5] = [5, 6] - df[["col1", "col2"]] = [[1, 2], [3, 4]] - df[s] = [5, 6] - df[a] = [[1, 2], [3, 4]] - df[i] = [8, 9] - - -def test_types_setitem_mask() -> None: - df = pd.DataFrame(data={"col1": [1, 2], "col2": [3, 4], 5: [6, 7]}) - select_df = pd.DataFrame({"col1": [True, True], "col2": [False, True]}) - df[select_df] = [1, 2, 3] - - -def test_types_iloc_iat() -> None: - df = pd.DataFrame(data={"col1": [1, 2], "col2": [3, 4]}) - df.iloc[1, 1] - df.iloc[[1], [1]] - df.iat[0, 0] - - -def test_types_loc_at() -> None: - df = pd.DataFrame(data={"col1": [1, 2], "col2": [3, 4]}) - df.loc[[0], "col1"] - df.at[0, "col1"] - - -def test_types_boolean_indexing() -> None: - df = pd.DataFrame(data={"col1": [1, 2], "col2": [3, 4]}) - df[df > 1] - df[~(df > 1.0)] - - -def test_types_df_to_df_comparison() -> None: - df = pd.DataFrame(data={"col1": [1, 2]}) - df2 = pd.DataFrame(data={"col1": [3, 2]}) - res_gt: pd.DataFrame = df > df2 - res_ge: pd.DataFrame = df >= df2 - res_lt: pd.DataFrame = df < df2 - res_le: pd.DataFrame = df <= df2 - res_e: pd.DataFrame = df == df2 - - -def test_types_head_tail() -> None: - df = pd.DataFrame(data={"col1": [1, 2], "col2": [3, 4]}) - df.head(1) - df.tail(1) - - -def test_types_assign() -> None: - df = pd.DataFrame(data={"col1": [1, 2], "col2": [3, 4]}) - df.assign(col3=lambda frame: frame.sum(axis=1)) - df["col3"] = df.sum(axis=1) - - -def test_types_sample() -> None: - df = pd.DataFrame(data={"col1": [1, 2], "col2": [3, 4]}) - df.sample(frac=0.5) - df.sample(n=1) - - -def test_types_nlargest_nsmallest() -> None: - df = pd.DataFrame(data={"col1": [1, 2], "col2": [3, 4]}) - df.nlargest(1, "col1") - df.nsmallest(1, "col2") - - -def test_types_filter() -> None: - df = pd.DataFrame(data={"col1": [1, 2], "col2": [3, 4]}) - df.filter(items=["col1"]) - df.filter(regex="co.*") - df.filter(like="1") - - -def test_types_setting() -> None: - df = pd.DataFrame(data={"col1": [1, 2], "col2": [3, 4]}) - df["col1"] = 1 - df[df == 1] = 7 - - -def test_types_drop() -> None: - df = pd.DataFrame(data={"col1": [1, 2], "col2": [3, 4]}) - res: pd.DataFrame = df.drop("col1", axis=1) - res2: pd.DataFrame = df.drop(columns=["col1"]) - res3: pd.DataFrame = df.drop([0]) - res4: pd.DataFrame = df.drop(index=[0]) - res5: pd.DataFrame = df.drop(columns=["col1"]) - res6: pd.DataFrame = df.drop(index=1) - res7: pd.DataFrame = df.drop(labels=0) - res8: None = df.drop([0, 0], inplace=True) - - -def test_types_dropna() -> None: - df = pd.DataFrame(data={"col1": [np.nan, np.nan], "col2": [3, np.nan]}) - res: pd.DataFrame = df.dropna() - res2: pd.DataFrame = df.dropna(axis=1, thresh=1) - res3: None = df.dropna(axis=0, how="all", subset=["col1"], inplace=True) - - -def test_types_fillna() -> None: - df = pd.DataFrame(data={"col1": [np.nan, np.nan], "col2": [3, np.nan]}) - res: pd.DataFrame = df.fillna(0) - res2: None = df.fillna(method="pad", axis=1, inplace=True) - - -def test_types_sort_index() -> None: - df = pd.DataFrame(data={"col1": [1, 2, 3, 4]}, index=[5, 1, 3, 2]) - df2 = pd.DataFrame(data={"col1": [1, 2, 3, 4]}, index=["a", "b", "c", "d"]) - res: pd.DataFrame = df.sort_index() - level1 = (1, 2) - res2: pd.DataFrame = df.sort_index(ascending=False, level=level1) - level2: List[str] = ["a", "b", "c"] - res3: pd.DataFrame = df2.sort_index(level=level2) - res4: pd.DataFrame = df.sort_index(ascending=False, level=3) - res5: None = df.sort_index(kind="mergesort", inplace=True) - - -# This was added in 1.1.0 https://pandas.pydata.org/docs/whatsnew/v1.1.0.html -def test_types_sort_index_with_key() -> None: - df = pd.DataFrame(data={"col1": [1, 2, 3, 4]}, index=["a", "b", "C", "d"]) - res: pd.DataFrame = df.sort_index(key=lambda k: k.str.lower()) - - -def test_types_set_index() -> None: - df = pd.DataFrame(data={"col1": [1, 2, 3, 4], "col2": ["a", "b", "c", "d"]}, index=[5, 1, 3, 2]) - res: pd.DataFrame = df.set_index("col1") - res2: pd.DataFrame = df.set_index("col1", drop=False) - res3: pd.DataFrame = df.set_index("col1", append=True) - res4: pd.DataFrame = df.set_index("col1", verify_integrity=True) - res5: pd.DataFrame = df.set_index(["col1", "col2"]) - res6: None = df.set_index("col1", inplace=True) - - -def test_types_query() -> None: - df = pd.DataFrame(data={"col1": [1, 2, 3, 4], "col2": [3, 0, 1, 7]}) - res: pd.DataFrame = df.query("col1 > col2") - res2: None = df.query("col1 % col2 == 0", inplace=True) - - -def test_types_eval() -> None: - df = pd.DataFrame(data={"col1": [1, 2, 3, 4], "col2": [3, 0, 1, 7]}) - df.eval("col1 > col2") - res: None = df.eval("C = col1 % col2 == 0", inplace=True) - - -def test_types_sort_values() -> None: - df = pd.DataFrame(data={"col1": [2, 1], "col2": [3, 4]}) - res: pd.DataFrame = df.sort_values("col1") - res2: None = df.sort_values("col1", ascending=False, inplace=True) - res3: pd.DataFrame = df.sort_values(by=["col1", "col2"], ascending=[True, False]) - - -# This was added in 1.1.0 https://pandas.pydata.org/docs/whatsnew/v1.1.0.html -def test_types_sort_values_with_key() -> None: - df = pd.DataFrame(data={"col1": [2, 1], "col2": [3, 4]}) - res: pd.DataFrame = df.sort_values(by="col1", key=lambda k: -k) - - -def test_types_shift() -> None: - df = pd.DataFrame(data={"col1": [1, 1], "col2": [3, 4]}) - df.shift() - df.shift(1) - df.shift(-1) - - -def test_types_rank() -> None: - df = pd.DataFrame(data={"col1": [2, 1], "col2": [3, 4]}) - df.rank(axis=0, na_option="bottom") - df.rank(method="min", pct=True) - df.rank(method="dense", ascending=True) - df.rank(method="first", numeric_only=True) - - -def test_types_mean() -> None: - df = pd.DataFrame(data={"col1": [2, 1], "col2": [3, 4]}) - s1: pd.Series = df.mean() - s2: pd.Series = df.mean(axis=0) - df2: pd.DataFrame = df.mean(level=0) - df3: pd.DataFrame = df.mean(axis=1, level=0) - df4: pd.DataFrame = df.mean(1, True, level=0) - s3: pd.Series = df.mean(axis=1, skipna=True, numeric_only=False) - - -def test_types_median() -> None: - df = pd.DataFrame(data={"col1": [2, 1], "col2": [3, 4]}) - s1: pd.Series = df.median() - s2: pd.Series = df.median(axis=0) - df2: pd.DataFrame = df.median(level=0) - df3: pd.DataFrame = df.median(axis=1, level=0) - df4: pd.DataFrame = df.median(1, True, level=0) - s3: pd.Series = df.median(axis=1, skipna=True, numeric_only=False) - - -def test_types_itertuples() -> None: - df = pd.DataFrame(data={"col1": [2, 1], "col2": [3, 4]}) - res1: Iterable[Tuple[Any, ...]] = df.itertuples() - res2: Iterable[Tuple[Any, ...]] = df.itertuples(index=False, name="Foobar") - res3: Iterable[Tuple[Any, ...]] = df.itertuples(index=False, name=None) - - -def test_types_sum() -> None: - df = pd.DataFrame(data={"col1": [2, 1], "col2": [3, 4]}) - df.sum() - df.sum(axis=1) - - -def test_types_cumsum() -> None: - df = pd.DataFrame(data={"col1": [2, 1], "col2": [3, 4]}) - df.cumsum() - df.sum(axis=0) - - -def test_types_min() -> None: - df = pd.DataFrame(data={"col1": [2, 1], "col2": [3, 4]}) - df.min() - df.min(axis=0) - - -def test_types_max() -> None: - df = pd.DataFrame(data={"col1": [2, 1], "col2": [3, 4]}) - df.max() - df.max(axis=0) - - -def test_types_quantile() -> None: - df = pd.DataFrame(data={"col1": [2, 1], "col2": [3, 4]}) - df.quantile([0.25, 0.5]) - df.quantile(0.75) - df.quantile() - - -def test_types_clip() -> None: - df = pd.DataFrame(data={"col1": [20, 12], "col2": [3, 14]}) - df.clip(lower=5, upper=15) - - -def test_types_abs() -> None: - df = pd.DataFrame(data={"col1": [-5, 1], "col2": [3, -14]}) - df.abs() - - -def test_types_var() -> None: - df = pd.DataFrame(data={"col1": [2, 1], "col2": [1, 4]}) - df.var() - df.var(axis=1, ddof=1) - df.var(skipna=True, numeric_only=False) - - -def test_types_std() -> None: - df = pd.DataFrame(data={"col1": [2, 1], "col2": [1, 4]}) - df.std() - df.std(axis=1, ddof=1) - df.std(skipna=True, numeric_only=False) - - -def test_types_idxmin() -> None: - df = pd.DataFrame(data={"col1": [2, 1], "col2": [3, 4]}) - df.idxmin() - df.idxmin(axis=0) - - -def test_types_idxmax() -> None: - df = pd.DataFrame(data={"col1": [2, 1], "col2": [3, 4]}) - df.idxmax() - df.idxmax(axis=0) - - -# This was added in 1.1.0 https://pandas.pydata.org/docs/whatsnew/v1.1.0.html -def test_types_value_counts() -> None: - df = pd.DataFrame(data={"col1": [1, 2], "col2": [1, 4]}) - df.value_counts() - - -def test_types_unique() -> None: - # This is really more for of a Series test - df = pd.DataFrame(data={"col1": [1, 2], "col2": [1, 4]}) - df["col1"].unique() - - -def test_types_apply() -> None: - df = pd.DataFrame(data={"col1": [2, 1], "col2": [3, 4]}) - df.apply(lambda x: x ** 2) - df.apply(np.exp) - df.apply(str) - - -def test_types_applymap() -> None: - df = pd.DataFrame(data={"col1": [2, 1], "col2": [3, 4]}) - df.applymap(lambda x: x ** 2) - df.applymap(np.exp) - df.applymap(str) - # na_action parameter was added in 1.2.0 https://pandas.pydata.org/docs/whatsnew/v1.2.0.html - df.applymap(np.exp, na_action="ignore") - df.applymap(str, na_action=None) - - -def test_types_element_wise_arithmetic() -> None: - df = pd.DataFrame(data={"col1": [2, 1], "col2": [3, 4]}) - df2 = pd.DataFrame(data={"col1": [10, 20], "col3": [3, 4]}) - - res_add1: pd.DataFrame = df + df2 - res_add2: pd.DataFrame = df.add(df2, fill_value=0) - - res_sub: pd.DataFrame = df - df2 - res_sub2: pd.DataFrame = df.sub(df2, fill_value=0) - - res_mul: pd.DataFrame = df * df2 - res_mul2: pd.DataFrame = df.mul(df2, fill_value=0) - - res_div: pd.DataFrame = df / df2 - res_div2: pd.DataFrame = df.div(df2, fill_value=0) - - res_floordiv: pd.DataFrame = df // df2 - res_floordiv2: pd.DataFrame = df.floordiv(df2, fill_value=0) - - res_mod: pd.DataFrame = df % df2 - res_mod2: pd.DataFrame = df.mod(df2, fill_value=0) - - res_pow: pd.DataFrame = df2 ** df - res_pow2: pd.DataFrame = df2.pow(df, fill_value=0) - - # divmod operation was added in 1.2.0 https://pandas.pydata.org/docs/whatsnew/v1.2.0.html - # noinspection PyTypeChecker - res_divmod: Tuple[pd.DataFrame, pd.DataFrame] = divmod(df, df2) - res_divmod2: Tuple[pd.DataFrame, pd.DataFrame] = df.__divmod__(df2) - res_rdivmod: Tuple[pd.DataFrame, pd.DataFrame] = df.__rdivmod__(df2) - - -def test_types_scalar_arithmetic() -> None: - df = pd.DataFrame(data={"col1": [2, 1], "col2": [3, 4]}) - - res_add1: pd.DataFrame = df + 1 - res_add2: pd.DataFrame = df.add(1, fill_value=0) - - res_sub: pd.DataFrame = df - 1 - res_sub2: pd.DataFrame = df.sub(1, fill_value=0) - - res_mul: pd.DataFrame = df * 2 - res_mul2: pd.DataFrame = df.mul(2, fill_value=0) - - res_div: pd.DataFrame = df / 2 - res_div2: pd.DataFrame = df.div(2, fill_value=0) - - res_floordiv: pd.DataFrame = df // 2 - res_floordiv2: pd.DataFrame = df.floordiv(2, fill_value=0) - - res_mod: pd.DataFrame = df % 2 - res_mod2: pd.DataFrame = df.mod(2, fill_value=0) - - res_pow: pd.DataFrame = df ** 2 - res_pow1: pd.DataFrame = df ** 0 - res_pow2: pd.DataFrame = df ** 0.213 - res_pow3: pd.DataFrame = df.pow(0.5) - - -def test_types_melt() -> None: - df = pd.DataFrame(data={"col1": [1, 2], "col2": [3, 4]}) - df.melt() - df.melt(id_vars=["col1"], value_vars=["col2"]) - df.melt(id_vars=["col1"], value_vars=["col2"], var_name="someVariable", value_name="someValue") - - pd.melt(df) - pd.melt(df, id_vars=["col1"], value_vars=["col2"]) - pd.melt(df, id_vars=["col1"], value_vars=["col2"], var_name="someVariable", value_name="someValue") - - -def test_types_pivot() -> None: - df = pd.DataFrame( - data={ - "col1": ["first", "second", "third", "fourth"], - "col2": [50, 70, 56, 111], - "col3": ["A", "B", "B", "A"], - "col4": [100, 102, 500, 600], - } - ) - df.pivot(index="col1", columns="col3", values="col2") - df.pivot(index="col1", columns="col3") - df.pivot(index="col1", columns="col3", values=["col2", "col4"]) - - -def test_types_groupby() -> None: - df = pd.DataFrame(data={"col1": [1, 1, 2], "col2": [3, 4, 5], "col3": [0, 1, 0]}) - df.index.name = "ind" - df.groupby(by="col1") - df.groupby(level="ind") - df.groupby(by="col1", sort=False, as_index=True) - df.groupby(by=["col1", "col2"]) - - df1: pd.DataFrame = df.groupby(by="col1").agg("sum") - df2: pd.DataFrame = df.groupby(level="ind").aggregate("sum") - df3: pd.DataFrame = df.groupby(by="col1", sort=False, as_index=True).transform(lambda x: x.max()) - df4: pd.DataFrame = df.groupby(by=["col1", "col2"]).count() - df5: pd.DataFrame = df.groupby(by=["col1", "col2"]).filter(lambda x: x["col1"] > 0) - df6: pd.DataFrame = df.groupby(by=["col1", "col2"]).nunique() - df7: pd.DataFrame = df.groupby(by="col1").apply(sum) - df8: pd.DataFrame = df.groupby("col1").transform("sum") - s1: pd.Series = df.set_index("col1")["col2"] - s2: pd.Series = s1.groupby("col1").transform("sum") - s3: pd.Series = df.groupby("col1")["col3"].agg(min) - df9: pd.DataFrame = df.groupby("col1")["col3"].agg([min, max]) - - -# This was added in 1.1.0 https://pandas.pydata.org/docs/whatsnew/v1.1.0.html -def test_types_group_by_with_dropna_keyword() -> None: - df = pd.DataFrame(data={"col1": [1, 1, 2, 1], "col2": [2, None, 1, 2], "col3": [3, 4, 3, 2]}) - df.groupby(by="col2", dropna=True).sum() - df.groupby(by="col2", dropna=False).sum() - df.groupby(by="col2").sum() - - -def test_types_groupby_any() -> None: - df = pd.DataFrame(data={"col1": [1, 1, 2], "col2": [True, False, False], "col3": [False, False, False]}) - check_dataframe_result(df.groupby("col1").any()) - check_dataframe_result(df.groupby("col1").all()) - check_series_result(df.groupby("col1")["col2"].any()) - check_series_result(df.groupby("col1")["col2"].any()) - - -def test_types_merge() -> None: - df = pd.DataFrame(data={"col1": [1, 1, 2], "col2": [3, 4, 5]}) - df2 = pd.DataFrame(data={"col1": [1, 1, 2], "col2": [0, 1, 0]}) - df.merge(df2) - df.merge(df2, on="col1") - df.merge(df2, on="col1", how="left") - df.merge(df2, on=["col1", "col2"], how="left") - df.merge(df2, on=("col1", "col2"), how="left") - df.merge(df2, on=("col1", "col2"), how="left", suffixes=(None, "s")) - df.merge(df2, on=("col1", "col2"), how="left", suffixes=("t", "s")) - df.merge(df2, on=("col1", "col2"), how="left", suffixes=("a", None)) - l = ["col1", "col2"] - df.merge(df2, on=l) - - -def test_types_plot() -> None: - pytest.skip() - df = pd.DataFrame(data={"col1": [1, 1, 2], "col2": [3, 4, 5]}) - df.plot.hist() - df.plot.scatter(x="col2", y="col1") - - -def test_types_window() -> None: - df = pd.DataFrame(data={"col1": [1, 1, 2], "col2": [3, 4, 5]}) - df.expanding() - df.expanding(axis=1, center=True) - - df.rolling(2) - df.rolling(2, axis=1, center=True) - - -def test_types_cov() -> None: - df = pd.DataFrame(data={"col1": [1, 1, 2], "col2": [3, 4, 5]}) - df.cov() - df.cov(min_periods=1) - # ddof param was added in 1.1.0 https://pandas.pydata.org/docs/whatsnew/v1.1.0.html - df.cov(ddof=2) - - -def test_types_to_numpy() -> None: - df = pd.DataFrame(data={"col1": [1, 1, 2], "col2": [3, 4, 5]}) - df.to_numpy() - df.to_numpy(dtype="str", copy=True) - # na_value param was added in 1.1.0 https://pandas.pydata.org/docs/whatsnew/v1.1.0.html - df.to_numpy(na_value=0) - - -def test_to_markdown() -> None: - pytest.importorskip("tabulate") - df = pd.DataFrame(data={"col1": [1, 1, 2], "col2": [3, 4, 5]}) - df.to_markdown() - df.to_markdown(buf=None, mode="wt") - # index param was added in 1.1.0 https://pandas.pydata.org/docs/whatsnew/v1.1.0.html - df.to_markdown(index=False) - - -def test_types_to_feather() -> None: - pytest.importorskip("pyarrow") - df = pd.DataFrame(data={"col1": [1, 1, 2], "col2": [3, 4, 5]}) - df.to_feather("dummy_path") - # kwargs for pyarrow.feather.write_feather added in 1.1.0 https://pandas.pydata.org/docs/whatsnew/v1.1.0.html - df.to_feather("dummy_path", compression="zstd", compression_level=3, chunksize=2) - - # to_feather has been able to accept a buffer since pandas 1.0.0 - # See https://pandas.pydata.org/docs/whatsnew/v1.0.0.html - # Docstring and type were updated in 1.2.0. - # https://github.com/pandas-dev/pandas/pull/35408 - with tempfile.NamedTemporaryFile(delete=False) as f: - df.to_feather(f.name) - f.close() - - -# compare() method added in 1.1.0 https://pandas.pydata.org/docs/whatsnew/v1.1.0.html -def test_types_compare() -> None: - df1 = pd.DataFrame(data={"col1": [1, 1, 2, 1], "col2": [2, None, 1, 2], "col3": [3, 4, 3, 2]}) - df2 = pd.DataFrame(data={"col1": [1, 2, 5, 6], "col2": [3, 4, 1, 1], "col3": [3, 4, 3, 2]}) - df1.compare(df2) - df2.compare(df1, align_axis=0, keep_shape=True, keep_equal=True) - - -def test_types_agg() -> None: - df = pd.DataFrame([[1, 2, 3], [4, 5, 6], [7, 8, 9]], columns=["A", "B", "C"]) - df.agg("min") - df.agg(x=("A", max), y=("B", "min"), z=("C", np.mean)) - df.agg("mean", axis=1) - - -def test_types_describe() -> None: - df = pd.DataFrame( - data={"col1": [1, 2, -4], "col2": [np.datetime64("2000-01-01"), np.datetime64("2010-01-01"), np.datetime64("2010-01-01")]} - ) - df.describe() - df.describe(percentiles=[0.5], include="all") - df.describe(exclude=[np.number]) - # datetime_is_numeric param added in 1.1.0 https://pandas.pydata.org/docs/whatsnew/v1.1.0.html - df.describe(datetime_is_numeric=True) - - -def test_types_to_string() -> None: - df = pd.DataFrame( - data={ - "col1": [1, None, -4], - "col2": [np.datetime64("2000-01-01"), np.datetime64("2010-01-01"), np.datetime64("2010-01-01")], - } - ) - df.to_string( - index=True, - col_space=2, - header=["a", "b"], - na_rep="0", - justify="left", - max_rows=2, - min_rows=0, - max_cols=2, - show_dimensions=True, - line_width=3, - ) - # col_space accepting list or dict added in 1.1.0 https://pandas.pydata.org/docs/whatsnew/v1.1.0.html - df.to_string(col_space=[1, 2]) - df.to_string(col_space={"col1": 1, "col2": 3}) - - -def test_types_to_html() -> None: - df = pd.DataFrame( - data={ - "col1": [1, None, -4], - "col2": [np.datetime64("2000-01-01"), np.datetime64("2010-01-01"), np.datetime64("2010-01-01")], - } - ) - df.to_html(index=True, col_space=2, header=True, na_rep="0", justify="left", max_rows=2, max_cols=2, show_dimensions=True) - # col_space accepting list or dict added in 1.1.0 https://pandas.pydata.org/docs/whatsnew/v1.1.0.html - df.to_html(col_space=[1, 2]) - df.to_html(col_space={"col1": 1, "col2": 3}) - - -def test_types_resample() -> None: - df = pd.DataFrame({"values": [2, 11, 3, 13, 14, 18, 17, 19]}) - df["date"] = pd.date_range("01/01/2018", periods=8, freq="W") - df.resample("M", on="date") - # origin and offset params added in 1.1.0 https://pandas.pydata.org/docs/whatsnew/v1.1.0.html - df.resample("20min", origin="epoch", offset=pd.Timedelta(2, "minutes"), on="date") - - -def test_types_from_dict() -> None: - pd.DataFrame.from_dict({"col_1": [3, 2, 1, 0], "col_2": ["a", "b", "c", "d"]}) - pd.DataFrame.from_dict({1: [3, 2, 1, 0], 2: ["a", "b", "c", "d"]}) - pd.DataFrame.from_dict({"a": {1: 2}, "b": {3: 4, 1: 4}}, orient="index") - pd.DataFrame.from_dict({"a": {"row1": 2}, "b": {"row2": 4, "row1": 4}}) - pd.DataFrame.from_dict({"a": (1, 2, 3), "b": (2, 4, 5)}) - pd.DataFrame.from_dict(data={"col_1": {"a": 1}, "col_2": {"a": 1, "b": 2}}, orient="columns") - - -def test_pipe() -> None: - pytest.skip("jinja2") - - def foo(df: pd.DataFrame) -> pd.DataFrame: - return df - - df1: pd.DataFrame = pd.DataFrame({"a": [1]}).pipe(foo) - - df2: pd.DataFrame = ( - pd.DataFrame({"price": [10, 11, 9, 13, 14, 18, 17, 19], "volume": [50, 60, 40, 100, 50, 100, 40, 50]}) - .assign(week_starting=pd.date_range("01/01/2018", periods=8, freq="W")) - .resample("M", on="week_starting") - .pipe(foo) - ) - - df3: pd.DataFrame = pd.DataFrame({"a": [1], "b": [1]}).groupby("a").pipe(foo) - - df4: pd.DataFrame = pd.DataFrame({"a": [1], "b": [1]}).style.pipe(foo) - - -# set_flags() method added in 1.2.0 https://pandas.pydata.org/docs/whatsnew/v1.2.0.html -def test_types_set_flags() -> None: - pd.DataFrame([[1, 2], [8, 9]], columns=["A", "B"]).set_flags(allows_duplicate_labels=False) - pd.DataFrame([[1, 2], [8, 9]], columns=["A", "A"]).set_flags(allows_duplicate_labels=True) - pd.DataFrame([[1, 2], [8, 9]], columns=["A", "A"]) - - -def test_types_to_parquet() -> None: - pytest.importorskip("pyarrow") - pytest.importorskip("fastparquet") - df = pd.DataFrame([[1, 2], [8, 9]], columns=["A", "B"]).set_flags(allows_duplicate_labels=False) - with tempfile.NamedTemporaryFile(delete=False) as file: - df.to_parquet(Path(file.name)) - file.close() - # to_parquet() returns bytes when no path given since 1.2.0 https://pandas.pydata.org/docs/whatsnew/v1.2.0.html - b: bytes = df.to_parquet() - - -def test_types_to_latex() -> None: - df = pd.DataFrame([[1, 2], [8, 9]], columns=["A", "B"]) - df.to_latex(columns=["A"], label="some_label", caption="some_caption", multirow=True) - df.to_latex(escape=False, decimal=",", column_format="r") - # position param was added in 1.2.0 https://pandas.pydata.org/docs/whatsnew/v1.2.0.html - df.to_latex(position="some") - # caption param was extended to accept tuple in 1.2.0 https://pandas.pydata.org/docs/whatsnew/v1.2.0.html - df.to_latex(caption=("cap1", "cap2")) - - -def test_types_explode() -> None: - df = pd.DataFrame([[1, 2], [8, 9]], columns=["A", "B"]) - res1: pd.DataFrame = df.explode("A") - res2: pd.DataFrame = df.explode("A", ignore_index=False) - res3: pd.DataFrame = df.explode("A", ignore_index=True) - - -def test_types_rename() -> None: - df = pd.DataFrame(columns=["a"]) - col_map = {"a": "b"} - df.rename(columns=col_map) - df.rename(columns={"a": "b"}) - df.rename(columns={1: "b"}) - # Apparently all of these calls are accepted by pandas - df.rename(columns={None: "b"}) - df.rename(columns={type("AnyObject")(): "b"}) - df.rename(columns={(2, 1): "b"}) - df.rename(columns=lambda s: s.upper()) - f = lambda s: s.upper() - df.rename(columns=f) - - -def test_types_eq() -> None: - df1 = pd.DataFrame([[1, 2], [8, 9]], columns=["A", "B"]) - res1: pd.DataFrame = df1 == 1 - df2 = pd.DataFrame([[1, 2], [8, 9]], columns=["A", "B"]) - res2: pd.DataFrame = df1 == df2 - - -def test_types_as_type() -> None: - df1 = pd.DataFrame([[1, 2], [8, 9]], columns=["A", "B"]) - df2: pd.DataFrame = df1.astype({"A": "int32"}) - - -def test_types_dot() -> None: - df1 = pd.DataFrame([[0, 1, -2, -1], [1, 1, 1, 1]]) - df2 = pd.DataFrame([[0, 1], [1, 2], [-1, -1], [2, 0]]) - s1 = pd.Series([1, 1, 2, 1]) - np_array = np.array([[0, 1], [1, 2], [-1, -1], [2, 0]]) - df3: pd.DataFrame = df1 @ df2 - df4: pd.DataFrame = df1.dot(df2) - df5: pd.DataFrame = df1 @ np_array - df6: pd.DataFrame = df1.dot(np_array) - df7: pd.Series = df1 @ s1 - df8: pd.Series = df1.dot(s1) - - -def test_types_regressions() -> None: - # https://github.com/microsoft/python-type-stubs/issues/32 - df = pd.DataFrame({"x": [1.0, 2.0, 3.0], "y": [4.0, 5, 6]}) - df2: pd.DataFrame = df.astype(int) - - # https://github.com/microsoft/python-type-stubs/issues/38 - df0: pd.DataFrame = pd.DataFrame({"x": [12, 34], "y": [78, 9]}) - ds: pd.DataFrame = df.sort_values(["x", "y"], ascending=[True, False]) - - # https://github.com/microsoft/python-type-stubs/issues/55 - df3 = pd.DataFrame([["a", 1], ["b", 2]], columns=["let", "num"]).set_index("let") - df4: pd.DataFrame = df3.reset_index() - df5: pd.DataFrame = df4[["num"]] - - # https://github.com/microsoft/python-type-stubs/issues/58 - df1 = pd.DataFrame(columns=["a", "b", "c"]) - df2 = pd.DataFrame(columns=["a", "c"]) - df6: pd.DataFrame = df1.drop(columns=df2.columns) - - # https://github.com/microsoft/python-type-stubs/issues/60 - df1 = pd.DataFrame([["a", 1], ["b", 2]], columns=["let", "num"]).set_index("let") - s2 = df1["num"] - res: pd.DataFrame = pd.merge(s2, df1, left_index=True, right_index=True) - - # https://github.com/microsoft/python-type-stubs/issues/62 - df7: pd.DataFrame = pd.DataFrame({"x": [1, 2, 3]}, index=pd.Index(["a", "b", "c"])) - index: pd.Index = pd.Index(["b"]) - df8: pd.DataFrame = df7.loc[index] - - # https://github.com/microsoft/python-type-stubs/issues/31 - df = pd.DataFrame({"A": [1, 2, 3], "B": [5, 6, 7]}) - column1: pd.DataFrame = df.iloc[:, [0]] - column2: pd.Series = df.iloc[:, 0] - - df = pd.DataFrame({"a_col": list(range(10)), "a_nother": list(range(10)), "b_col": list(range(10))}) - df.loc[:, lambda df: df.columns.str.startswith("a_")] - - df = df[::-1] - - # https://github.com/microsoft/python-type-stubs/issues/69 - s1 = pd.Series([1, 2, 3]) - s2 = pd.Series([4, 5, 6]) - df = pd.concat([s1, s2], axis=1) - ss1: pd.Series = pd.concat([s1, s2], axis=0) - ss2: pd.Series = pd.concat([s1, s2]) - - # https://github.com/microsoft/python-type-stubs/issues/110 - d: date = pd.Timestamp("2021-01-01") - tslist: List[pd.Timestamp] = list(pd.to_datetime(["2022-01-01", "2022-01-02"])) - sseries: pd.Series = pd.Series(tslist) - sseries_plus1: pd.Series = sseries + pd.Timedelta(1, "d") - - # https://github.com/microsoft/pylance-release/issues/2133 - dr = pd.date_range(start="2021-12-01", periods=24, freq="H") - time = dr.strftime("%H:%M:%S") - - # https://github.com/microsoft/python-type-stubs/issues/115 - df = pd.DataFrame({"A": [1, 2, 3], "B": [5, 6, 7]}) - pd.DatetimeIndex(data=df["A"], tz=None, normalize=False, closed=None, ambiguous="NaT", copy=True) - - -def test_read_csv() -> None: - pytest.skip() - # https://github.com/microsoft/python-type-stubs/issues/87 - df11: pd.DataFrame = pd.read_csv("foo") - df12: pd.DataFrame = pd.read_csv("foo", iterator=False) - df13: pd.DataFrame = pd.read_csv("foo", iterator=False, chunksize=None) - df14: TextFileReader = pd.read_csv("foo", chunksize=0) - df15: TextFileReader = pd.read_csv("foo", iterator=False, chunksize=0) - df16: TextFileReader = pd.read_csv("foo", iterator=True) - df17: TextFileReader = pd.read_csv("foo", iterator=True, chunksize=None) - df18: TextFileReader = pd.read_csv("foo", iterator=True, chunksize=0) - df19: TextFileReader = pd.read_csv("foo", chunksize=0) - - # https://github.com/microsoft/python-type-stubs/issues/118 - pd.read_csv("foo", storage_options=None) - - -def test_groupby_series_methods() -> None: - df = pd.DataFrame({"x": [1, 2, 2, 3, 3], "y": [10, 20, 30, 40, 50]}) - gb = df.groupby("x")["y"] - check_dataframe_result(gb.describe()) - gb.count().loc[2] - gb.pct_change().loc[2] - gb.bfill().loc[2] - gb.cummax().loc[2] - gb.cummin().loc[2] - gb.cumprod().loc[2] - gb.cumsum().loc[2] - gb.ffill().loc[2] - gb.first().loc[2] - gb.head().loc[2] - gb.last().loc[2] - gb.max().loc[2] - gb.mean().loc[2] - gb.median().loc[2] - gb.min().loc[2] - gb.nlargest().loc[2] - gb.nsmallest().loc[2] - gb.nth(0).loc[2] - - -def test_indexslice_setitem(): - df = pd.DataFrame({"x": [1, 2, 2, 3], "y": [1, 2, 3, 4], "z": [10, 20, 30, 40]}).set_index(["x", "y"]) - s = pd.Series([-1, -2]) - df.loc[pd.IndexSlice[2, :]] = s.values - df.loc[pd.IndexSlice[2, :], "z"] = [200, 300] - - -def test_compute_values(): - df = pd.DataFrame({"x": [1, 2, 3, 4]}) - s: pd.Series = pd.Series([10, 20, 30, 40]) - result: pd.Series = df["x"] + s.values - - -# https://github.com/microsoft/python-type-stubs/issues/164 -def test_sum_get_add() -> None: - df = pd.DataFrame({"x": [1, 2, 3, 4, 5], "y": [10, 20, 30, 40, 50]}) - s = df["x"] - check_series_result(s) - summer: pd.Series = df.sum(axis=1) - check_series_result(summer) - - s2: pd.Series = s + summer - s3: pd.Series = s + df["y"] - s4: pd.Series = summer + summer - - -def test_getset_untyped() -> None: - result: int = 10 - df = pd.DataFrame({"x": [1, 2, 3, 4, 5], "y": [10, 20, 30, 40, 50]}) - # Tests that Dataframe.__getitem__ needs to return untyped series. - result = df["x"].max() - - -def test_getmultiindex_columns() -> None: - mi = pd.MultiIndex.from_product([[1, 2], ["a", "b"]]) - df = pd.DataFrame([[1, 2, 3, 4], [10, 20, 30, 40]], columns=mi) - li: List[Tuple[int, str]] = [(1, "a"), (2, "b")] - res1: pd.DataFrame = df[[(1, "a"), (2, "b")]] - res2: pd.DataFrame = df[li] - res3: pd.DataFrame = df[[(i, s) for i in [1] for s in df.columns.get_level_values(1)]] - ndf: pd.DataFrame = df[[df.columns[0]]] - - -def test_frame_getitem_isin() -> None: - df = pd.DataFrame({"x": [1, 2, 3, 4, 5]}, index=[1, 2, 3, 4, 5]) - check_dataframe_result(df[df.index.isin([1, 3, 5])]) - - -def test_iloc_list() -> None: - df = pd.DataFrame({"x": [i for i in range(10)], "y": [i * 10 for i in range(10)]}, index=[100 + i for i in range(10)]) - cdf: pd.DataFrame = pd.concat([df.iloc[[i * 2 for i in range(5)]]]) diff --git a/tests/pandas/test_indexes.py b/tests/pandas/test_indexes.py deleted file mode 100644 index 739bd4e..0000000 --- a/tests/pandas/test_indexes.py +++ /dev/null @@ -1,41 +0,0 @@ -import numpy as np -import pandas as pd - - -from . import check_index_result, check_multiindex_result, check_numpy_result - - -def test_index_unique(): - - df = pd.DataFrame({"x": [1, 2, 3, 4]}, index=pd.Index([1, 2, 3, 2])) - ind = df.index - i2 = ind.unique() - check_index_result(i2) - - -def test_index_isin(): - ind = pd.Index([1, 2, 3, 4, 5]) - isin = ind.isin([2, 4]) - check_numpy_result(isin, np.bool_) - - -def test_index_astype(): - indi = pd.Index([1, 2, 3]) - inds = pd.Index(["a", "b", "c"]) - indc = indi.astype(inds.dtype) - check_index_result(indc) - mi = pd.MultiIndex.from_product([["a", "b"], ["c", "d"]], names=["ab", "cd"]) - mia = mi.astype(object) # object is only valid parameter for MultiIndex.astype() - check_multiindex_result(mia) - - -def test_multiindex_get_level_values(): - mi = pd.MultiIndex.from_product([["a", "b"], ["c", "d"]], names=["ab", "cd"]) - i1 = mi.get_level_values("ab") - check_index_result(i1) - -def test_index_tolist() -> None: - i1 = pd.Index([1,2,3]) - l1 = i1.tolist() - i2 = i1.to_list() - \ No newline at end of file diff --git a/tests/pandas/test_interval.py b/tests/pandas/test_interval.py deleted file mode 100644 index 3208954..0000000 --- a/tests/pandas/test_interval.py +++ /dev/null @@ -1,85 +0,0 @@ -# flake8: noqa: F841 -from typing import TYPE_CHECKING -import pandas as pd - -from . import ( - check_bool_result, - check_timedelta_result, - check_timestamp_result, - check_interval_result, - check_int_result, - check_float_result, -) - - -def test_interval_init() -> None: - i1: pd.Interval = pd.Interval(1, 2, closed="both") - i2: pd.Interval = pd.Interval(1, right=2, closed="right") - i3: pd.Interval = pd.Interval(left=1, right=2, closed="left") - - -def test_interval_arithmetic() -> None: - i1: pd.Interval = pd.Interval(1, 2, closed="both") - i2: pd.Interval = pd.Interval(1, right=2, closed="right") - - i3: pd.Interval = i1 + 1 - i4: pd.Interval = i1 - 1 - i5: pd.Interval = i1 * 2 - i6: pd.Interval = i1 / 2 - i7: pd.Interval = i1 // 2 - - -def test_max_intervals() -> None: - i1 = pd.Interval(pd.Timestamp("2000-01-01"), pd.Timestamp("2000-01-02"), closed="both") - i2 = pd.Interval(pd.Timestamp("2000-01-01T12:00:00"), pd.Timestamp("2000-01-02"), closed="both") - print(max(i1.left, i2.left)) - - -def test_interval_length() -> None: - i1 = pd.Interval(pd.Timestamp("2000-01-01"), pd.Timestamp("2000-01-03"), closed="both") - check_timedelta_result(i1.length) - check_timestamp_result(i1.left) - check_timestamp_result(i1.right) - check_timestamp_result(i1.mid) - i1.length.total_seconds() - inres = pd.Timestamp("2001-01-02") in i1 - check_bool_result(inres) - idres = i1 + pd.Timedelta(seconds=20) - - check_interval_result(idres, pd.Timestamp) - if TYPE_CHECKING: - 20 in i1 # type: ignore - i1 + pd.Timestamp("2000-03-03") # type: ignore - i1 * 3 # type: ignore - i1 * pd.Timedelta(seconds=20) # type: ignore - - i2 = pd.Interval(10, 20) - check_int_result(i2.length) - check_int_result(i2.left) - check_int_result(i2.right) - check_float_result(i2.mid) - - i2inres = 15 in i2 - check_bool_result(i2inres) - check_interval_result(i2 + 3, int) - check_interval_result(i2 + 3.2, float) - check_interval_result(i2 * 4, int) - check_interval_result(i2 * 4.2, float) - - if TYPE_CHECKING: - pd.Timestamp("2001-01-02") in i2 # type: ignore - i2 + pd.Timedelta(seconds=20) # type: ignore - - i3 = pd.Interval(13.2, 19.5) - check_float_result(i3.length) - check_float_result(i3.left) - check_float_result(i3.right) - check_float_result(i3.mid) - - i3inres = 15.4 in i3 - check_bool_result(i3inres) - check_interval_result(i3 + 3, float) - check_interval_result(i3 * 3, float) - if TYPE_CHECKING: - pd.Timestamp("2001-01-02") in i3 # type: ignore - i3 + pd.Timedelta(seconds=20) # type: ignore diff --git a/tests/pandas/test_merge.py b/tests/pandas/test_merge.py deleted file mode 100644 index 1a9d606..0000000 --- a/tests/pandas/test_merge.py +++ /dev/null @@ -1,8 +0,0 @@ -import pandas as pd - - -def test_types_merge() -> None: - df = pd.DataFrame(data={"col1": [1, 1, 2], "col2": [3, 4, 5]}) - df2 = pd.DataFrame(data={"col1": [1, 1, 2], "col2": [0, 1, 0]}) - l = ["col1", "col2"] - df.merge(df2, on=l) diff --git a/tests/pandas/test_pandas.py b/tests/pandas/test_pandas.py deleted file mode 100644 index db0d54b..0000000 --- a/tests/pandas/test_pandas.py +++ /dev/null @@ -1,104 +0,0 @@ -# flake8: noqa: F841 -import tempfile -from typing import Any, Dict, List, Union - -from pandas.io.parsers import TextFileReader - -import numpy as np -import pandas as pd - -from . import check_series_result, check_dataframe_result - - -def test_types_to_datetime() -> None: - df = pd.DataFrame({"year": [2015, 2016], "month": [2, 3], "day": [4, 5]}) - r1: pd.Series = pd.to_datetime(df) - r2: pd.Series = pd.to_datetime(df, unit="s", origin="unix", infer_datetime_format=True) - r3: pd.Series = pd.to_datetime(df, unit="ns", dayfirst=True, utc=None, format="%M:%D", exact=False) - r4: pd.DatetimeIndex = pd.to_datetime([1, 2], unit="D", origin=pd.Timestamp("01/01/2000")) - r5: pd.DatetimeIndex = pd.to_datetime([1, 2], unit="D", origin=3) - r6: pd.DatetimeIndex = pd.to_datetime(["2022-01-03", "2022-02-22"]) - r7: pd.DatetimeIndex = pd.to_datetime(pd.Index(["2022-01-03", "2022-02-22"])) - r8: pd.Series = pd.to_datetime({"year": [2015, 2016], "month": [2, 3], "day": [4, 5]}) - - -def test_types_concat() -> None: - s = pd.Series([0, 1, -10]) - s2 = pd.Series([7, -5, 10]) - - check_series_result(pd.concat([s, s2])) - check_dataframe_result(pd.concat([s, s2], axis=1)) - check_series_result(pd.concat([s, s2], keys=["first", "second"], sort=True)) - check_series_result(pd.concat([s, s2], keys=["first", "second"], names=["source", "row"])) - - # Depends on the axis - rs1: Union[pd.Series, pd.DataFrame] = pd.concat({"a": s, "b": s2}) - rs1a: Union[pd.Series, pd.DataFrame] = pd.concat({"a": s, "b": s2}, axis=1) - rs2: Union[pd.Series, pd.DataFrame] = pd.concat({1: s, 2: s2}) - rs2a: Union[pd.Series, pd.DataFrame] = pd.concat({1: s, 2: s2}, axis=1) - rs3: Union[pd.Series, pd.DataFrame] = pd.concat({1: s, None: s2}) - rs3a: Union[pd.Series, pd.DataFrame] = pd.concat({1: s, None: s2}, axis=1) - - df = pd.DataFrame(data={"col1": [1, 2], "col2": [3, 4]}) - df2 = pd.DataFrame(data={"col1": [10, 20], "col2": [30, 40]}) - - check_dataframe_result(pd.concat([df, df2])) - check_dataframe_result(pd.concat([df, df2], axis=1)) - check_dataframe_result(pd.concat([df, df2], keys=["first", "second"], sort=True)) - check_dataframe_result(pd.concat([df, df2], keys=["first", "second"], names=["source", "row"])) - - result: pd.DataFrame = pd.concat({"a": pd.DataFrame([1, 2, 3]), "b": pd.DataFrame([4, 5, 6])}, axis=1) - result2: Union[pd.DataFrame, pd.Series] = pd.concat({"a": pd.Series([1, 2, 3]), "b": pd.Series([4, 5, 6])}, axis=1) - - rdf1: pd.DataFrame = pd.concat({"a": df, "b": df2}) - rdf2: pd.DataFrame = pd.concat({1: df, 2: df2}) - rdf3: pd.DataFrame = pd.concat({1: df, None: df2}) - - rdf4: pd.DataFrame = pd.concat(list(map(lambda x: s2, ["some_value", 3])), axis=1) - adict = {"a": df, 2: df2} - rdict: pd.DataFrame = pd.concat(adict) - - -def test_types_json_normalize() -> None: - data1: List[Dict[str, Any]] = [ - {"id": 1, "name": {"first": "Coleen", "last": "Volk"}}, - {"name": {"given": "Mose", "family": "Regner"}}, - {"id": 2, "name": "Faye Raker"}, - ] - df1: pd.DataFrame = pd.json_normalize(data=data1) - df2: pd.DataFrame = pd.json_normalize(data=data1, max_level=0, sep=";") - df3: pd.DataFrame = pd.json_normalize(data=data1, meta_prefix="id", record_prefix="name", errors="raise") - df4: pd.DataFrame = pd.json_normalize(data=data1, record_path=None, meta="id") - data2: Dict[str, Any] = {"name": {"given": "Mose", "family": "Regner"}} - df5: pd.DataFrame = pd.json_normalize(data=data2) - - -def test_types_read_csv() -> None: - df = pd.DataFrame(data={"col1": [1, 2], "col2": [3, 4]}) - csv_df: str = df.to_csv() - - with tempfile.NamedTemporaryFile(delete=False) as file: - df.to_csv(file.name) - file.close() - df2: pd.DataFrame = pd.read_csv(file.name) - df3: pd.DataFrame = pd.read_csv(file.name, sep="a", squeeze=False) - df4: pd.DataFrame = pd.read_csv(file.name, header=None, prefix="b", mangle_dupe_cols=True, keep_default_na=False) - df5: pd.DataFrame = pd.read_csv(file.name, engine="python", true_values=[0, 1, 3], na_filter=False) - df6: pd.DataFrame = pd.read_csv(file.name, skiprows=lambda x: x in [0, 2], skip_blank_lines=True, dayfirst=False) - df7: pd.DataFrame = pd.read_csv(file.name, nrows=2) - df8: pd.DataFrame = pd.read_csv(file.name, dtype={"a": float, "b": int}) - - tfr1: TextFileReader = pd.read_csv(file.name, nrows=2, iterator=True, chunksize=3) - tfr2: TextFileReader = pd.read_csv(file.name, nrows=2, chunksize=1) - tfr3: TextFileReader = pd.read_csv(file.name, nrows=2, iterator=False, chunksize=1) - tfr4: TextFileReader = pd.read_csv(file.name, nrows=2, iterator=True) - - -def test_isna() -> None: - s = pd.Series([1, np.nan, 3.2]) - check_series_result(pd.isna(s), bool) - b: bool = pd.isna(np.nan) - ar: np.ndarray = pd.isna(list(s)) - check_series_result(pd.notna(s), bool) - b2: bool = pd.notna(np.nan) - ar2: np.ndarray = pd.notna(list(s)) diff --git a/tests/pandas/test_series.py b/tests/pandas/test_series.py deleted file mode 100644 index 1f1c4c4..0000000 --- a/tests/pandas/test_series.py +++ /dev/null @@ -1,661 +0,0 @@ -# flake8: noqa: F841 - -import tempfile -from pathlib import Path -from typing import List, Union, TYPE_CHECKING -from typing_extensions import assert_type - -from pandas._typing import Scalar -from pandas.api.extensions import ExtensionArray - -import pandas as pd -import numpy as np - -from pandas.core.window import ExponentialMovingWindow -from . import check_dataframe_result, check_series_result - -import pytest - - -def test_types_init() -> None: - pd.Series(1) - pd.Series((1, 2, 3)) - pd.Series(np.array([1, 2, 3])) - pd.Series(data=[1, 2, 3, 4], name="series") - pd.Series(data=[1, 2, 3, 4], dtype=np.int8) - pd.Series(data={"row1": [1, 2], "row2": [3, 4]}) - pd.Series(data=[1, 2, 3, 4], index=[4, 3, 2, 1], copy=True) - - -def test_types_any() -> None: - res1: bool = pd.Series([False, False]).any() - res2: bool = pd.Series([False, False]).any(bool_only=False) - res3: bool = pd.Series([np.nan]).any(skipna=False) - - -def test_types_all() -> None: - res1: bool = pd.Series([False, False]).all() - res2: bool = pd.Series([False, False]).all(bool_only=False) - res3: bool = pd.Series([np.nan]).all(skipna=False) - - -def test_types_csv() -> None: - s = pd.Series(data=[1, 2, 3]) - csv_df: str = s.to_csv() - - with tempfile.NamedTemporaryFile(delete=False) as file: - s.to_csv(file.name) - file.close() - s2: pd.DataFrame = pd.read_csv(file.name) - - with tempfile.NamedTemporaryFile(delete=False) as file: - s.to_csv(Path(file.name)) - file.close() - s3: pd.DataFrame = pd.read_csv(Path(file.name)) - - # This keyword was added in 1.1.0 https://pandas.pydata.org/docs/whatsnew/v1.1.0.html - with tempfile.NamedTemporaryFile(delete=False) as file: - s.to_csv(file.name, errors="replace") - file.close() - s4: pd.DataFrame = pd.read_csv(file.name) - - -def test_types_copy() -> None: - s = pd.Series(data=[1, 2, 3, 4]) - s2: pd.Series = s.copy() - - -def test_types_select() -> None: - s = pd.Series(data={"row1": 1, "row2": 2}) - s[0] - s[1:] - - -def test_types_iloc_iat() -> None: - s = pd.Series(data={"row1": 1, "row2": 2}) - s2 = pd.Series(data=[1, 2]) - s.loc["row1"] - s.iat[0] - s2.loc[0] - s2.iat[0] - - -def test_types_loc_at() -> None: - s = pd.Series(data={"row1": 1, "row2": 2}) - s2 = pd.Series(data=[1, 2]) - s.loc["row1"] - s.at["row1"] - s2.loc[1] - s2.at[1] - - -def test_multiindex_loc() -> None: - s = pd.Series([1, 2, 3, 4], index=pd.MultiIndex.from_product([[1, 2], ["a", "b"]])) - check_series_result(s.loc[1, :]) - check_series_result(s.loc[pd.Index([1]), :]) - - -def test_types_boolean_indexing() -> None: - s = pd.Series([0, 1, 2]) - s[s > 1] - s[s] - - -def test_types_df_to_df_comparison() -> None: - s = pd.Series(data={"col1": [1, 2]}) - s2 = pd.Series(data={"col1": [3, 2]}) - res_gt: pd.Series = s > s2 - res_ge: pd.Series = s >= s2 - res_lt: pd.Series = s < s2 - res_le: pd.Series = s <= s2 - res_e: pd.Series = s == s2 - - -def test_types_head_tail() -> None: - s = pd.Series([0, 1, 2]) - s.head(1) - s.tail(1) - - -def test_types_sample() -> None: - s = pd.Series([0, 1, 2]) - s.sample(frac=0.5) - s.sample(n=1) - - -def test_types_nlargest_nsmallest() -> None: - s = pd.Series([0, 1, 2]) - s.nlargest(1) - s.nlargest(1, "first") - s.nsmallest(1, "last") - s.nsmallest(1, "all") - - -def test_types_filter() -> None: - s = pd.Series(data=[1, 2, 3, 4], index=["cow", "coal", "coalesce", ""]) - s.filter(items=["cow"]) - s.filter(regex="co.*") - s.filter(like="al") - - -def test_types_setting() -> None: - s = pd.Series([0, 1, 2]) - s[3] = 4 - s[s == 1] = 5 - s[:] = 3 - - -def test_types_drop() -> None: - s = pd.Series([0, 1, 2]) - res: pd.Series = s.drop(0) - res2: pd.Series = s.drop([0, 1]) - res3: pd.Series = s.drop(0, axis=0) - res4: None = s.drop([0, 1], inplace=True, errors="raise") - res5: None = s.drop([0, 1], inplace=True, errors="ignore") - - -def test_types_drop_multilevel() -> None: - index = pd.MultiIndex( - levels=[["top", "bottom"], ["first", "second", "third"]], codes=[[0, 0, 0, 1, 1, 1], [0, 1, 2, 0, 1, 2]] - ) - s = pd.Series(data=[1, 2, 3, 4, 5, 6], index=index) - res: pd.Series = s.drop(labels="first", level=1) - - -def test_types_dropna() -> None: - s = pd.Series([1, np.nan, np.nan]) - res: pd.Series = s.dropna() - res2: None = s.dropna(axis=0, inplace=True) - - -def test_types_fillna() -> None: - s = pd.Series([1, np.nan, np.nan, 3]) - res: pd.Series = s.fillna(0) - res2: pd.Series = s.fillna(0, axis="index") - res3: pd.Series = s.fillna(method="backfill", axis=0) - res4: None = s.fillna(method="bfill", inplace=True) - res5: pd.Series = s.fillna(method="pad") - res6: pd.Series = s.fillna(method="ffill", limit=1) - - -def test_types_sort_index() -> None: - s = pd.Series([1, 2, 3], index=[2, 3, 1]) - res: pd.Series = s.sort_index() - res2: None = s.sort_index(ascending=False, inplace=True) - res3: pd.Series = s.sort_index(kind="mergesort") - - -# This was added in 1.1.0 https://pandas.pydata.org/docs/whatsnew/v1.1.0.html -def test_types_sort_index_with_key() -> None: - s = pd.Series([1, 2, 3], index=["a", "B", "c"]) - res: pd.Series = s.sort_index(key=lambda k: k.str.lower()) - - -def test_types_sort_values() -> None: - s = pd.Series([4, 2, 1, 3]) - res: pd.Series = s.sort_values(0) - res2: pd.Series = s.sort_values(ascending=False) - res3: None = s.sort_values(inplace=True, kind="quicksort") - res4: pd.Series = s.sort_values(na_position="last") - res5: pd.Series = s.sort_values(ignore_index=True) - - -# This was added in 1.1.0 https://pandas.pydata.org/docs/whatsnew/v1.1.0.html -def test_types_sort_values_with_key() -> None: - s = pd.Series([1, 2, 3], index=[2, 3, 1]) - res: pd.Series = s.sort_values(key=lambda k: -k) - - -def test_types_shift() -> None: - s = pd.Series([1, 2, 3]) - s.shift() - s.shift(axis=0, periods=1) - s.shift(-1, fill_value=0) - - -def test_types_rank() -> None: - s = pd.Series([1, 1, 2, 5, 6, np.nan, "milion"]) - s.rank() - s.rank(axis=0, na_option="bottom") - s.rank(method="min", pct=True) - s.rank(method="dense", ascending=True) - s.rank(method="first", numeric_only=True) - - -def test_types_mean() -> None: - s = pd.Series([1, 2, 3, np.nan]) - f1: float = s.mean() - s1: pd.Series = s.mean(axis=0, level=0) - f2: float = s.mean(skipna=False) - f3: float = s.mean(numeric_only=False) - - -def test_types_median() -> None: - s = pd.Series([1, 2, 3, np.nan]) - f1: float = s.median() - s1: pd.Series = s.median(axis=0, level=0) - f2: float = s.median(skipna=False) - f3: float = s.median(numeric_only=False) - - -def test_types_sum() -> None: - s = pd.Series([1, 2, 3, np.nan]) - s.sum() - s.sum(axis=0, level=0) - s.sum(skipna=False) - s.sum(numeric_only=False) - s.sum(min_count=4) - - -def test_types_cumsum() -> None: - s = pd.Series([1, 2, 3, np.nan]) - s.cumsum() - s.cumsum(axis=0) - s.cumsum(skipna=False) - - -def test_types_min() -> None: - s = pd.Series([1, 2, 3, np.nan]) - s.min() - s.min(axis=0) - s.min(level=0) - s.min(skipna=False) - - -def test_types_max() -> None: - s = pd.Series([1, 2, 3, np.nan]) - s.max() - s.max(axis=0) - s.max(level=0) - s.max(skipna=False) - - -def test_types_quantile() -> None: - s = pd.Series([1, 2, 3, 10]) - s.quantile([0.25, 0.5]) - s.quantile(0.75) - s.quantile() - s.quantile(interpolation="nearest") - - -def test_types_clip() -> None: - s = pd.Series([-10, 2, 3, 10]) - s.clip(lower=0, upper=5) - s.clip(lower=0, upper=5, inplace=True) - - -def test_types_abs() -> None: - s = pd.Series([-10, 2, 3, 10]) - s.abs() - - -def test_types_var() -> None: - s = pd.Series([-10, 2, 3, 10]) - s.var() - s.var(axis=0, ddof=1) - s.var(skipna=True, numeric_only=False) - - -def test_types_std() -> None: - s = pd.Series([-10, 2, 3, 10]) - s.std() - s.std(axis=0, ddof=1) - s.std(skipna=True, numeric_only=False) - - -def test_types_idxmin() -> None: - s = pd.Series([-10, 2, 3, 10]) - s.idxmin() - s.idxmin(axis=0) - - -def test_types_idxmax() -> None: - s = pd.Series([-10, 2, 3, 10]) - s.idxmax() - s.idxmax(axis=0) - - -def test_types_value_counts() -> None: - s = pd.Series([1, 2]) - s.value_counts() - - -def test_types_unique() -> None: - s = pd.Series([-10, 2, 2, 3, 10, 10]) - s.unique() - - -def test_types_apply() -> None: - s = pd.Series([-10, 2, 2, 3, 10, 10]) - s.apply(lambda x: x ** 2) - s.apply(np.exp) - s.apply(str) - - -def test_types_element_wise_arithmetic() -> None: - s = pd.Series([0, 1, -10]) - s2 = pd.Series([7, -5, 10]) - - res_add1: pd.Series = s + s2 - res_add2: pd.Series = s.add(s2, fill_value=0) - - res_sub: pd.Series = s - s2 - res_sub2: pd.Series = s.sub(s2, fill_value=0) - - res_mul: pd.Series = s * s2 - res_mul2: pd.Series = s.mul(s2, fill_value=0) - - res_div: pd.Series = s / s2 - res_div2: pd.Series = s.div(s2, fill_value=0) - - res_floordiv: pd.Series = s // s2 - res_floordiv2: pd.Series = s.floordiv(s2, fill_value=0) - - res_mod: pd.Series = s % s2 - res_mod2: pd.Series = s.mod(s2, fill_value=0) - - res_pow: pd.Series = s ** abs(s2) - res_pow2: pd.Series = s.pow(abs(s2), fill_value=0) - - -def test_types_scalar_arithmetic() -> None: - s = pd.Series([0, 1, -10]) - - res_add1: pd.Series = s + 1 - res_add2: pd.Series = s.add(1, fill_value=0) - - res_sub: pd.Series = s - 1 - res_sub2: pd.Series = s.sub(1, fill_value=0) - - res_mul: pd.Series = s * 2 - res_mul2: pd.Series = s.mul(2, fill_value=0) - - res_div: pd.Series = s / 2 - res_div2: pd.Series = s.div(2, fill_value=0) - - res_floordiv: pd.Series = s // 2 - res_floordiv2: pd.Series = s.floordiv(2, fill_value=0) - - res_mod: pd.Series = s % 2 - res_mod2: pd.Series = s.mod(2, fill_value=0) - - res_pow: pd.Series = s ** 2 - res_pow1: pd.Series = s ** 0 - res_pow2: pd.Series = s ** 0.213 - res_pow3: pd.Series = s.pow(0.5) - - -def test_types_groupby() -> None: - s = pd.Series([4, 2, 1, 8], index=["a", "b", "a", "b"]) - s.groupby(["a", "b", "a", "b"]) - s.groupby(level=0) - s.groupby(s > 2) - - -# This added in 1.1.0 https://pandas.pydata.org/docs/whatsnew/v1.1.0.html -def test_types_group_by_with_dropna_keyword() -> None: - s = pd.Series([1, 2, 3, 3], index=["col1", "col2", "col3", np.nan]) - s.groupby(level=0, dropna=True).sum() - s.groupby(level=0, dropna=False).sum() - s.groupby(level=0).sum() - - -def test_types_plot() -> None: - pytest.skip() - s = pd.Series([0, 1, 1, 0, -10]) - s.plot.hist() - - -def test_types_window() -> None: - s = pd.Series([0, 1, 1, 0, 5, 1, -10]) - s.expanding() - s.expanding(axis=0, center=True) - - s.rolling(2) - s.rolling(2, axis=0, center=True) - - -def test_types_cov() -> None: - s1 = pd.Series([0, 1, 1, 0, 5, 1, -10]) - s2 = pd.Series([0, 2, 12, -4, 7, 9, 2]) - s1.cov(s2) - s1.cov(s2, min_periods=1) - # ddof param was added in 1.1.0 https://pandas.pydata.org/docs/whatsnew/v1.1.0.html - s1.cov(s2, ddof=2) - - -def test_update() -> None: - s1 = pd.Series([0, 1, 1, 0, 5, 1, -10]) - s1.update(pd.Series([0, 2, 12])) - # Series.update() accepting objects that can be coerced to a Series was added in 1.1.0 https://pandas.pydata.org/docs/whatsnew/v1.1.0.html - s1.update([1, 2, -4, 3]) - s1.update([1, "b", "c", "d"]) - s1.update({1: 9, 3: 4}) - - -def test_to_markdown() -> None: - pytest.importorskip("tabulate") - s = pd.Series([0, 1, 1, 0, 5, 1, -10]) - s.to_markdown() - s.to_markdown(buf=None, mode="wt") - # index param was added in 1.1.0 https://pandas.pydata.org/docs/whatsnew/v1.1.0.html - s.to_markdown(index=False) - - -# compare() method added in 1.1.0 https://pandas.pydata.org/docs/whatsnew/v1.1.0.html -def test_types_compare() -> None: - s1 = pd.Series([0, 1, 1, 0, 5, 1, -10]) - s2 = pd.Series([0, 2, 12, -4, 7, 9, 2]) - s1.compare(s2) - s2.compare(s1, align_axis="columns", keep_shape=True, keep_equal=True) - - -def test_types_agg() -> None: - s = pd.Series([1, 2, 3], index=["col1", "col2", "col3"]) - s.agg("min") - s.agg(x=max, y="min", z=np.mean) - s.agg("mean", axis=0) - - -def test_types_describe() -> None: - s = pd.Series([1, 2, 3, np.datetime64("2000-01-01")]) - s.describe() - s.describe(percentiles=[0.5], include="all") - s.describe(exclude=np.number) - # datetime_is_numeric param added in 1.1.0 https://pandas.pydata.org/docs/whatsnew/v1.1.0.html - s.describe(datetime_is_numeric=True) - - -def test_types_resample() -> None: - s = pd.Series(range(9), index=pd.date_range("1/1/2000", periods=9, freq="T")) - s.resample("3T").sum() - # origin and offset params added in 1.1.0 https://pandas.pydata.org/docs/whatsnew/v1.1.0.html - s.resample("20min", origin="epoch", offset=pd.Timedelta(value=2, unit="minutes")) - - -# set_flags() method added in 1.2.0 https://pandas.pydata.org/docs/whatsnew/v1.2.0.html -def test_types_set_flags() -> None: - pd.Series([1, 2], index=["a", "b"]).set_flags(allows_duplicate_labels=False) - pd.Series([3, 4], index=["a", "a"]).set_flags(allows_duplicate_labels=True) - pd.Series([5, 2], index=["a", "a"]) - - -def test_types_getitem() -> None: - s = pd.Series({"key": [0, 1, 2, 3]}) - key: List[int] = s["key"] - s2 = pd.Series([0, 1, 2, 3]) - value: int = s2[0] - s3: pd.Series = s[:2] - - -def test_types_eq() -> None: - s1 = pd.Series([1, 2, 3]) - res1: pd.Series = s1 == 1 - s2 = pd.Series([1, 2, 4]) - res2: pd.Series = s1 == s2 - - -def test_types_rename_axis() -> None: - s: pd.Series = pd.Series([1, 2, 3]).rename_axis("A") - - -def test_types_values() -> None: - n1: Union[np.ndarray, ExtensionArray] = pd.Series([1, 2, 3]).values - n2: Union[np.ndarray, ExtensionArray] = pd.Series(list("aabc")).values - n3: Union[np.ndarray, ExtensionArray] = pd.Series(list("aabc")).astype("category").values - n4: Union[np.ndarray, ExtensionArray] = pd.Series(pd.date_range("20130101", periods=3, tz="US/Eastern")).values - - -def test_types_rename() -> None: - # Scalar - s1 = pd.Series([1, 2, 3]).rename("A") - check_series_result(s1) - # Hashable Sequence - s2 = pd.Series([1, 2, 3]).rename(("A", "B")) - check_series_result(s2) - - # Optional - s3 = pd.Series([1, 2, 3]).rename(None) - check_series_result(s3) - - # Functions - def add1(x: int) -> int: - return x + 1 - - s4 = pd.Series([1, 2, 3]).rename(add1) - check_series_result(s4) - - # Dictionary - s5 = pd.Series([1, 2, 3]).rename({1: 10}) - check_series_result(s5) - # inplace - s6: None = pd.Series([1, 2, 3]).rename("A", inplace=True) - - if TYPE_CHECKING: - s7 = pd.Series([1, 2, 3]).rename({1: [3, 4, 5]}) # type: ignore[dict-item] - - -def test_types_ne() -> None: - s1 = pd.Series([1, 2, 3]) - s2 = pd.Series([1, 2, 4]) - s3: pd.Series = s1 != s2 - - -def test_types_bfill() -> None: - s1 = pd.Series([1, 2, 3]) - s2: pd.Series = s1.bfill(inplace=False) - s3: None = s1.bfill(inplace=True) - - -def test_types_ewm() -> None: - s1 = pd.Series([1, 2, 3]) - w1: ExponentialMovingWindow = s1.ewm(com=0.3, min_periods=0, adjust=False, ignore_na=True, axis=0) - w2: ExponentialMovingWindow = s1.ewm(alpha=0.4) - w3: ExponentialMovingWindow = s1.ewm(span=1.6) - w4: ExponentialMovingWindow = s1.ewm(halflife=0.7) - - -def test_types_ffill() -> None: - s1 = pd.Series([1, 2, 3]) - s2: pd.Series = s1.ffill(inplace=False) - s3: None = s1.ffill(inplace=True) - - -def test_types_as_type() -> None: - s1 = pd.Series([1, 2, 8, 9]) - s2: pd.Series = s1.astype("int32") - - -def test_types_dot() -> None: - s1 = pd.Series([0, 1, 2, 3]) - s2 = pd.Series([-1, 2, -3, 4]) - df1 = pd.DataFrame([[0, 1], [-2, 3], [4, -5], [6, 7]]) - n1 = np.array([[0, 1], [1, 2], [-1, -1], [2, 0]]) - sc1: Scalar = s1.dot(s2) - sc2: Scalar = s1 @ s2 - s3: pd.Series = s1.dot(df1) - s4: pd.Series = s1 @ df1 - n2: np.ndarray = s1.dot(n1) - n3: np.ndarray = s1 @ n1 - - -def test_series_loc_setitem() -> None: - s = pd.Series([1, 2, 3, 4, 5]) - v = s.loc[[0, 2, 4]].values - s.loc[[0, 2, 4]] = v - - -def test_series_min_max_sub_axis() -> None: - df = pd.DataFrame({"x": [1, 2, 3, 4, 5], "y": [5, 4, 3, 2, 1]}) - s1 = df.min(axis=1) - s2 = df.max(axis=1) - sa = s1 + s2 - ss = s1 - s2 - sm = s1 * s2 - sd = s1 / s2 - assert_type(sa, "pd.Series") - assert_type(ss, "pd.Series") - assert_type(sm, "pd.Series") - assert_type(sd, "pd.Series") - - -def test_series_index_isin() -> None: - s = pd.Series([1, 2, 3, 4, 5], index=[1, 2, 2, 3, 3]) - t1 = s.loc[s.index.isin([1, 3])] - t2 = s.loc[~s.index.isin([1, 3])] - t3 = s[s.index.isin([1, 3])] - t4 = s[~s.index.isin([1, 3])] - check_series_result(t1) - check_series_result(t2) - check_series_result(t3) - check_series_result(t4) - - -def test_series_invert() -> None: - s1 = pd.Series([True, False, True]) - s2 = ~s1 - assert_type(s2, "pd.Series[bool]") - s3 = pd.Series([1, 2, 3]) - check_series_result(s3[s2]) - check_series_result(s3.loc[s2]) - - -def test_series_multiindex_getitem() -> None: - s = pd.Series([1, 2, 3, 4], index=pd.MultiIndex.from_product([["a", "b"], ["x", "y"]])) - s1: pd.Series = s["a", :] - - -def test_series_mul() -> None: - s = pd.Series([1, 2, 3]) - sm = s * 4 - check_series_result(sm) - ss = s - 4 - check_series_result(ss) - sm2 = s * s - check_series_result(sm2) - sp = s + 4 - check_series_result(sp) - - -def test_reset_index() -> None: - s = pd.Series([1, 2, 3, 4], index=pd.MultiIndex.from_product([["a", "b"], ["c", "d"]], names=["ab", "cd"])) - r1 = s.reset_index() - check_dataframe_result(r1) - r2 = s.reset_index(["ab"]) - check_dataframe_result(r2) - r3 = s.reset_index("ab") - check_dataframe_result(r3) - r4 = s.reset_index(drop=True) - check_series_result(r4) - r5 = s.reset_index(["ab"], drop=True) - check_series_result(r5) - -def test_series_add_str() -> None: - s = pd.Series(["abc", "def"]) - check_series_result(s + "x") - check_series_result("x" + s) - -def test_series_dtype() -> None: - s = pd.Series(["abc", "def"], dtype=str) - check_series_result(s, object) - \ No newline at end of file diff --git a/tests/pandas/test_testing.py b/tests/pandas/test_testing.py deleted file mode 100644 index 4b6bebd..0000000 --- a/tests/pandas/test_testing.py +++ /dev/null @@ -1,13 +0,0 @@ -from pandas.testing import assert_series_equal - -import pandas as pd - - -def test_types_assert_series_equal() -> None: - s1 = pd.Series([0, 1, 1, 0]) - s2 = pd.Series([0, 1, 1, 0]) - assert_series_equal(left=s1, right=s2) - assert_series_equal(s1, s2, check_freq=False, check_categorical=True, check_flags=True, - check_datetimelike_compat=True) - assert_series_equal(s1, s2, check_dtype=True, check_less_precise=True, check_names=True) - diff --git a/tests/pandas/test_timefuncs.py b/tests/pandas/test_timefuncs.py deleted file mode 100644 index 40c31da..0000000 --- a/tests/pandas/test_timefuncs.py +++ /dev/null @@ -1,150 +0,0 @@ -# flake8: noqa: F841 - -from typing import TYPE_CHECKING -import pandas as pd -import datetime as dt -from typing_extensions import assert_type - -from pandas.testing import assert_series_equal - -from . import check_datetimeindex_result, check_series_result - -if TYPE_CHECKING: - from pandas.core.series import TimedeltaSeries, TimestampSeries - - -def test_types_init() -> None: - ts: pd.Timestamp = pd.Timestamp("2021-03-01T12") - ts1: pd.Timestamp = pd.Timestamp(dt.date(2021, 3, 15)) - ts2: pd.Timestamp = pd.Timestamp(dt.datetime(2021, 3, 10, 12)) - ts3: pd.Timestamp = pd.Timestamp(pd.Timestamp("2021-03-01T12")) - ts4: pd.Timestamp = pd.Timestamp(1515590000.1, unit="s") - ts5: pd.Timestamp = pd.Timestamp(1515590000.1, unit="s", tz="US/Pacific") - ts6: pd.Timestamp = pd.Timestamp(1515590000100000000) # plain integer (nanosecond) - ts7: pd.Timestamp = pd.Timestamp(2021, 3, 10, 12) - ts8: pd.Timestamp = pd.Timestamp(year=2021, month=3, day=10, hour=12) - ts9: pd.Timestamp = pd.Timestamp(year=2021, month=3, day=10, hour=12, tz="US/Pacific") - - -def test_types_arithmetic() -> None: - ts: pd.Timestamp = pd.to_datetime("2021-03-01") - ts2: pd.Timestamp = pd.to_datetime("2021-01-01") - delta: pd.Timedelta = pd.to_timedelta("1 day") - - tsr: pd.Timedelta = ts - ts2 - tsr2: pd.Timestamp = ts + delta - tsr3: pd.Timestamp = ts - delta - tsr4: pd.Timedelta = ts - dt.datetime(2021, 1, 3) - - -def test_types_comparison() -> None: - ts: pd.Timestamp = pd.to_datetime("2021-03-01") - ts2: pd.Timestamp = pd.to_datetime("2021-01-01") - - tsr: bool = ts < ts2 - tsr2: bool = ts > ts2 - - -def test_types_pydatetime() -> None: - ts: pd.Timestamp = pd.Timestamp("2021-03-01T12") - - datet: dt.datetime = ts.to_pydatetime() - datet2: dt.datetime = ts.to_pydatetime(False) - datet3: dt.datetime = ts.to_pydatetime(warn=True) - - -def test_to_timedelta() -> None: - td: pd.Timedelta = pd.to_timedelta(3, "days") - tds: pd.TimedeltaIndex = pd.to_timedelta([2, 3], "minutes") - - -def test_timedelta_arithmetic() -> None: - td1: pd.Timedelta = pd.to_timedelta(3, "days") - td2: pd.Timedelta = pd.to_timedelta(4, "hours") - td3: pd.Timedelta = td1 + td2 - td4: pd.Timedelta = td1 - td2 - td5: pd.Timedelta = td1 * 4.3 - td6: pd.Timedelta = td3 / 10.2 - - -def test_timedelta_series_arithmetic() -> None: - tds1: pd.TimedeltaIndex = pd.to_timedelta([2, 3], "minutes") - td1: pd.Timedelta = pd.Timedelta("2 days") - r1: pd.TimedeltaIndex = tds1 + td1 - r2: pd.TimedeltaIndex = tds1 - td1 - r3: pd.TimedeltaIndex = tds1 * 4.3 - r4: pd.TimedeltaIndex = tds1 / 10.2 - - -def test_timestamp_timedelta_series_arithmetic() -> None: - ts = pd.Timestamp("2022-03-05") - s1 = pd.Series(["2022-03-05", "2022-03-06"]) - ts1 = pd.to_datetime(pd.Series(["2022-03-05", "2022-03-06"])) - assert isinstance(ts1.iloc[0], pd.Timestamp) - td1 = pd.to_timedelta([2, 3], "seconds") - ts2 = pd.to_datetime(pd.Series(["2022-03-08", "2022-03-10"])) - r1 = ts1 - ts2 - assert_type(r1, "TimedeltaSeries") - check_series_result(r1, td1.dtype) # type: ignore - r2 = r1 / td1 - check_series_result(r2, float) - r3 = r1 - td1 - check_series_result(r3, td1.dtype) # type: ignore - r4 = pd.Timedelta(5, "days") / r1 - check_series_result(r4, float) - sb = pd.Series([1, 2]) == pd.Series([1, 3]) - check_series_result(sb, bool) - r5 = sb * r1 - check_series_result(r5, r1.dtype) - r6 = r1 * 4 - check_series_result(r6, r1.dtype) - - -def test_timestamp_dateoffset_arithmetic() -> None: - ts = pd.Timestamp("2022-03-18") - do = pd.DateOffset(days=366) - r1: pd.Timestamp = ts + do - - -def test_datetimeindex_plus_timedelta() -> None: - tscheck = pd.Series([pd.Timestamp("2022-03-05"), pd.Timestamp("2022-03-06")]) - dti = pd.to_datetime(["2022-03-08", "2022-03-15"]) - td_s = pd.to_timedelta(pd.Series([10, 20]), "minutes") - dti_td_s = dti + td_s - # ignore type on next, because `tscheck` has Unknown dtype - check_series_result(dti_td_s, tscheck.dtype) # type: ignore - td_dti_s = td_s + dti - check_series_result(td_dti_s, tscheck.dtype) # type: ignore - tdi = pd.to_timedelta([10, 20], "minutes") - dti_tdi_dti = dti + tdi - check_datetimeindex_result(dti_tdi_dti) - tdi_dti_dti = tdi + dti - check_datetimeindex_result(tdi_dti_dti) - dti_td_dti = dti + pd.Timedelta(10, "minutes") - check_datetimeindex_result(dti_td_dti) - - -def test_timestamp_plus_timedelta_series() -> None: - tscheck = pd.Series([pd.Timestamp("2022-03-05"), pd.Timestamp("2022-03-06")]) - ts = pd.Timestamp("2022-03-05") - td = pd.to_timedelta(pd.Series([10, 20]), "minutes") - r3 = td + ts - assert_type(r3, "TimestampSeries") - # ignore type on next, because `tscheck` has Unknown dtype - check_series_result(r3, tscheck.dtype) # type: ignore - - -def test_timedelta_series_mult() -> None: - df = pd.DataFrame({"x": [1, 3, 5], "y": [2, 2, 6]}) - std = (df["x"] < df["y"]) * pd.Timedelta(10, "minutes") - assert_type(std, "TimedeltaSeries") - -def test_timedelta_series_sum() -> None: - s = pd.Series(pd.to_datetime(["04/05/2022 11:00", "04/03/2022 10:00"])) - pd.Series(pd.to_datetime(["04/05/2022 08:00", "04/03/2022 09:00"])) - ssum = s.sum() - ires: int = ssum.days - - sf = pd.Series([1.0, 2.2, 3.3]) - sfsum: float = sf.sum() - - \ No newline at end of file diff --git a/tests/requirements.txt b/tests/requirements.txt index 595326e..4528b07 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,4 +1,3 @@ -pandas==1.4.2 pyright pytest mypy==0.950 diff --git a/utils/build_bundle/build.sh b/utils/build_bundle/build.sh index 0948b3c..7d940bb 100755 --- a/utils/build_bundle/build.sh +++ b/utils/build_bundle/build.sh @@ -6,24 +6,10 @@ python -m pip install --upgrade docopt mkdir -p stubs -# Generate pandas stubs with pyright and copy them over - -#pyright --createstub pandas -#cp -R ../../typings/pandas stubs - -# Copy over the stubs from here, including partial stubs for pandas +# Copy over the stubs from here for d in cv2-stubs django gym-stubs jmespath matplotlib openpyxl pythonwin-stubs scipy-stubs sklearn-stubs sqlalchemy sympy-stubs transformers-stubs win32-stubs win32comext-stubs do cp -R ../../$d stubs done -cp -R ../../partial/pandas stubs - -# Install docify and patch the pandas stubs with docstrings - -(cd ../docify; rm -rf .eggs; PBR_VERSION=1.0.0 pip install .) -(cd stubs/pandas; docify ../../docify-pandas.cfg) - - - diff --git a/utils/build_bundle/docify-pandas.cfg b/utils/build_bundle/docify-pandas.cfg deleted file mode 100644 index bf1c5c4..0000000 --- a/utils/build_bundle/docify-pandas.cfg +++ /dev/null @@ -1,51 +0,0 @@ -pandas,core/algorithms.pyi,,factorize -pandas,core/frame.pyi,DataFrame,align -pandas,core/frame.pyi,DataFrame,fillna -pandas,core/frame.pyi,DataFrame,groupby -pandas,core/frame.pyi,DataFrame,isna -pandas,core/frame.pyi,DataFrame,isnull -pandas,core/frame.pyi,DataFrame,items -pandas,core/frame.pyi,DataFrame,iteritems -pandas,core/frame.pyi,DataFrame,notna -pandas,core/frame.pyi,DataFrame,notnull -pandas,core/frame.pyi,DataFrame,pivot -pandas,core/frame.pyi,DataFrame,reindex -pandas,core/frame.pyi,DataFrame,replace -pandas,core/frame.pyi,DataFrame,shift -pandas,core/frame.pyi,DataFrame,sort_index -pandas,core/frame.pyi,DataFrame,sort_values -pandas,core/frame.pyi,DataFrame,to_markdown -pandas,core/series.pyi,Series,aggregate -pandas,core/series.pyi,Series,align -pandas,core/series.pyi,Series,fillna -pandas,core/series.pyi,Series,groupby -pandas,core/series.pyi,Series,isna -pandas,core/series.pyi,Series,isnull -pandas,core/series.pyi,Series,iteritems -pandas,core/series.pyi,Series,notna -pandas,core/series.pyi,Series,notnull -pandas,core/series.pyi,Series,reindex -pandas,core/series.pyi,Series,replace -pandas,core/series.pyi,Series,searchsorted -pandas,core/series.pyi,Series,shift -pandas,core/series.pyi,Series,take -pandas,core/series.pyi,Series,to_markdown -pandas,core/series.pyi,Series,transform -pandas,core/groupby/generic.pyi,DataFrameGroupBy,aggregate -pandas,core/groupby/generic.pyi,DataFrameGroupBy,boxplot -pandas,core/groupby/generic.pyi,DataFrameGroupBy,fillna -pandas,core/groupby/generic.pyi,DataFrameGroupBy,hist -pandas,core/groupby/generic.pyi,DataFrameGroupBy,idxmax -pandas,core/groupby/generic.pyi,DataFrameGroupBy,idxmin -pandas,core/groupby/generic.pyi,DataFrameGroupBy,mad -pandas,core/groupby/generic.pyi,DataFrameGroupBy,skew -pandas,core/groupby/generic.pyi,DataFrameGroupBy,take -pandas,core/indexes/base.pyi,Index,astype -pandas,core/indexes/base.pyi,Index,is_monotonic_increasing -pandas,core/reshape/melt.pyi,,melt -pandas,core/reshape/merge.pyi,,merge -pandas,core/reshape/pivot.pyi,,pivot -pandas,io/excel/_base.pyi,,read_excel -pandas,io/parsers.pyi,,read_csv -pandas,io/parsers.pyi,,read_table -pandas,io/stata.pyi,,read_stata diff --git a/utils/docify/README.md b/utils/docify/README.md deleted file mode 100644 index 91822f7..0000000 --- a/utils/docify/README.md +++ /dev/null @@ -1,31 +0,0 @@ -Docify is a utility that can insert docstrings into Python type stub files. -We use this because we sometimes want to put docstrings for functions into -the stubs, because it is hard to extract them from source. This is primarily -used for some pandas APIs for now. - -To install: - - PBR_VERSION=1.0.0 pip install . - - -Usage: - docify [--verbose] - docify -h | --help - docify --version - - -The config file is a CSV file that has lines of the form: - - package,stub_file_path,classname,methodname - -If classname is empty, methodname is a top-level function name. - -The stub file specified by stub_file_path will be patched with -the docstring of classname.methodname, which will be extracted -by introspection from the specified package. - -For example: - - pandas,./core/series.pyi,Series,groupby - - diff --git a/utils/docify/docify/__init__.py b/utils/docify/docify/__init__.py deleted file mode 100644 index 89dda43..0000000 --- a/utils/docify/docify/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from .docify import docify - diff --git a/utils/docify/docify/cli.py b/utils/docify/docify/cli.py deleted file mode 100644 index 3ecbeee..0000000 --- a/utils/docify/docify/cli.py +++ /dev/null @@ -1,95 +0,0 @@ -""" -Docify. - -Usage: - docify [--verbose] [] - docify -h | --help - docify --version - -Options: - --verbose Print out details of what docify is doing. - -h --help Show this screen. - --version Show version. - -If stubpath is not specified the current working directory -will be assumed. - -The config file is a CSV file that has lines of the form: - - package,stub_file_path,classname,methodname - -If classname is empty, methodname is a top-level function name. -The stub_file_path paths should be relative to stubpath. - -The stub file specified by stub_file_path will be patched with -the docstring of classname.methodname, which will be extracted -by introspection from the specified package. - -For example: - - pandas,core/series.pyi,Series,groupby - -""" -import csv -import importlib -import inspect -import os -import sys -from docopt import docopt -import docify - - -def main(): - arguments = docopt(__doc__, version='docify 0.1') - configfile = arguments[''] - stubpath = arguments[''] - if stubpath is None: - stubpath = '.' - verbose = arguments['--verbose'] - with open(configfile) as f: - patches = csv.reader(f) - - for patch in patches: - if not patch: - break - pkg, stub, class_, method = patch - try: - if pkg in sys.modules: - package = sys.modules[pkg] - else: - package = importlib.import_module(pkg) - - obj = package - - for path in stub[:-4].split('/'): - obj = obj.__dict__[path] - - if class_: - obj = obj.__dict__[class_] - obj = obj.__dict__[method] - doc = inspect.getdoc(obj) - - except Exception as e: - if class_ is None: - print(f'Could not get docstring for {pkg}.{method}: {e}') - else: - print(f'Could not get docstring for {pkg}.{class_}.{method}: {e}') - sys.exit(-1) - - if not doc: - if class_ is None: - print(f'{pkg}.{method} has no docstring') - else: - print(f'{pkg}.{class_}.{method} has no docstring') - sys.exit(-1) - - try: - docify.docify(os.path.join(stubpath, stub), class_, method, doc, verbose) - except Exception as e: - print(e) - sys.exit(-1) - - -if __name__ == '__main__': - main() - sys.exit(0) diff --git a/utils/docify/docify/docify.py b/utils/docify/docify/docify.py deleted file mode 100644 index eef79e3..0000000 --- a/utils/docify/docify/docify.py +++ /dev/null @@ -1,88 +0,0 @@ -import os -import sys - - -def docify(stubfile, class_, method, doc, verbose): - if not os.path.exists(stubfile): - raise Exception(f'Missing stub file {stubfile}') - with open(stubfile) as f: - stublines = f.readlines() - - lookfor = f'class {class_}' if class_ else f'def {method}(' - i = 0 - in_doc = False - while i < len(stublines): - line = stublines[i] - - # Look for docstring start/end, as we want to skip docstrings - # as they can mess with the parser. We use a simple check - # that relies on """ being on a line on its own, which is - # true of the docstrings we add at least. - - if line.strip() == '"""': - in_doc = not in_doc - - elif not in_doc and line.startswith(lookfor): - # If we are looking for a method, we have found the - # class but need to keep going... - if class_: - i += 1 - lookfor = f'def {method}(' - while i < len(stublines): - line = stublines[i].strip() - if line == '"""': - in_doc = not in_doc - elif not in_doc: - if line.startswith('class '): - raise Exception(f'{stubfile}:{i} Method {method} not found in class {class_}') - if line.startswith(lookfor): - break - i += 1 - else: # We're all out of lines and didn't find the method - raise Exception(f'{stubfile}:{i} Method {method} not found in class {class_}') - - # We have found the first line of the method. The signature can - # span multiple lines, so we need to look for ': ...' to find the end - j = i - end = i - while j < len(stublines): - line = stublines[j].rstrip() - if line.endswith(': ...'): - end = j - break - j += 1 - else: - raise Exception(f'Could not find end of method {method}') - break - - i += 1 - else: - raise Exception(f'{stubfile}: Could not find target {class_} {method}') - - # We now have the start and end of the method. Discard the " ..." - # and add the docstring and a 'pass'. - if class_: - stublines[end] = f'{line[:-4]}\n """\n{doc}\n """\n pass\n' - else: - stublines[end] = f'{line[:-4]}\n """\n{doc}\n """\n pass\n' - - # Do a sanity check; the first non-comment non-docstring line after what we patched - # should be a function, class, or method definition, or if not, it should not be - # a partial argument list (i.e. no commas or right parentheses). - i = end + 1 - while i < len(stublines): - line = stublines[i].strip() - if len(line) and line[0] != '#' and line[0] != '@': - if line.startswith('class ') or line.startswith('def '): - break - if line.find(',') >= 0 or line.find(')') >= 0 or line.find('"""') >= 0: - raise Exception(f'Docstring inserted at {stubfile}:{end} is malformed; next line was {line}') - else: - break - i += 1 - - with open(stubfile, 'w') as f: - f.writelines(stublines) - - print(f'Patched {class_} {method} in {stubfile}') - diff --git a/utils/docify/setup.cfg b/utils/docify/setup.cfg deleted file mode 100644 index e9c74c1..0000000 --- a/utils/docify/setup.cfg +++ /dev/null @@ -1,6 +0,0 @@ -[metadata] -name = docify -author = Microsoft -license = MIT -long_description = file: README.md -requires-python = >= 3.8 diff --git a/utils/docify/setup.py b/utils/docify/setup.py deleted file mode 100644 index f6097e1..0000000 --- a/utils/docify/setup.py +++ /dev/null @@ -1,15 +0,0 @@ -import setuptools - - -setuptools.setup( - entry_points = { - 'console_scripts': ['docify=docify.cli:main'], - }, - setup_requires=['pbr'], - tests_require=['pytest', 'PyHamcrest'], - install_requires=[ - 'docopt', - ], - pbr=True -) - diff --git a/utils/requirements.txt b/utils/requirements.txt deleted file mode 100644 index ee4f1b9..0000000 --- a/utils/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -pandas==1.4.0 -docopt diff --git a/utils/stubsplit/ChangeLog b/utils/stubsplit/ChangeLog deleted file mode 100644 index 2e35f5f..0000000 --- a/utils/stubsplit/ChangeLog +++ /dev/null @@ -1,170 +0,0 @@ -CHANGES -======= - -* pandas: handle setitem with Timedelta (#120) -* fix NamedAgg aggfunc should be AggScalar (#128) -* pandas: fix Series.between() (#121) -* read\_csv on\_bad\_lines and storage\_options arguments (#119) -* allow \`args\` and \`kwargs\` for pandas DataFrame.apply (#104) -* pandas: add dropna argument to DataFrameGroupBy (#126) -* pandas: fix Timedeltas constructor (#123) -* pandas: add kwargs to to\_feather (#124) -* pandas: fix series and using getitem (#122) -* fix for missing types on NamedAgg (#111) -* fix overloads for read\_csv and read\_table (#109) -* add typing for pandas.isnull(), pandas.isna() (#106) -* fix arguments to pandas.Series.where() (#108) -* for pandas.loc\_\_setitem\_\_, use Sequence and allow boolean series (#107) -* fix return types for pandas str accessors (#105) -* pandas allow tuples to mix types in index in .loc and be of any length (#103) -* fix pandas .loc with slice arguments (#98) -* Allow Series as argument to pandas.to\_datetime (#102) -* pandas Series.to\_dict() can return any key in Dict (#99) -* Resync pandas stubs from pylance (#101) -* allow Series.index to be set (#97) -* pandas: allow tuples to get scalar values in .loc (#96) -* Rename \_BaseExcelReader to BaseExcelReader -* pandas: allow list of strings to index DataFrame (#94) -* pandas: allow loc set with scalar arguments (#93) -* allow boolean series as columns chooser in getitem (#92) -* fix Series.mask argument (#89) -* pandas: fix .loc setitem with a scalar (#90) -* matplotlib Patch.\_\_init\_\_ accepts any arguments (#91) -* Fix annotation for the \`parse\_dates\` argument of the \`pandas.read\_html\` function (#85) -* initial opencv scraped stub (#72) -* adding partial stubs for huggingface transformers due to poor perform… (#86) -* allow Index in setitem on DataFrame (#84) -* pandas: allow scalars as args to series.fillna (#83) -* pandas: fix various arguments for Series.iloc and DataFrame.loc (#82) -* fix return type of Series groupby aggregate (#81) -* pandas: allow str as second item in setitem for loc on DF, allow Index in setitem for loc on Series (#79) -* Update typing for ascending param for DataFrame.sort\_values and DataF… (#80) -* Add type for pandas.\_\_version\_\_ (#78) -* Remove upstreamed stubs (#77) -* Allow a scalar argument for data in Series (#76) -* fix axis arguments for concat (#68) -* loc on DataFrame should accept str (#74) -* Fix a syntax error in the matplotlib stubs (#75) -* Added initial partial sympy-stubs -* loc on just index returns DataFrame (#71) -* setter for index.names (#70) -* add gym-stubs used in pylance to stub repo -* pandas: fix series name argument (#66) -* fix series.astype dtype argument for pandas (#64) -* fix loc to accept Index as arg (#63) -* fix arguments for merge (#61) -* fix drop columns argument (#59) -* fix getitem issue (#56) -* added pywin32 compiled module's stubs for longer name import usage cases (#57) -* Pandas fixes. (#54) -* Update PIL stubs (#53) -* Add matplotlib and PIL stubs from Pylance (#51) -* Pandas (#49) -* push stubs in pylance to python-type-stubs repo -* Fix mapper-based calling convention of DataFrame rename (#41) -* Fix issues with rename\_axis overloads and arguments (microsoft/pylance-release#634), concat return type (microsoft/pylance-release#624), path-like arguments (microsoft/pylance-release#602) and DataFrame.astype (microsoft/python-type-stubs#32) -* Fix pygame AbstractGroup attribute typehints (#34) -* Incorporated changes from Pylance -* Create README.md -* Create README.md -* Changed from copying original package licenses to READMEs that reference original package locations -* Added Microsoft headers as we can't put the (c) line in the license file for PyGame -* Add license and 3rd party notice file -* Add stubsplit utility. Update pandas stubs -* Update README.md -* Create CONTRIBUTING.md -* Update README.md -* Reorg -* Partial -* Partial -* Update README.md -* Updated README -* Partial -* Partial -* Partial -* Fixups after code review by Pygame folks -* Ran black and isort on pygame and fixed a few other errors caught by pyright -* Removed stub files that have been submitted to typeshed and replaced with README.md files -* Take 2 -* PR Feedback changes -* removed an Any -* Remove compat.pyi amd small fixes -* PR feedback changes -* added two more stubs -* First commit of modified stubs. More celanup needed for typshed -* black formatting messes up every alternate save -* Clearn up commas, initializers -* Fixed \_\_init\_\_.py and dangling commas -* Completed Rect.pyi -* Initial pass creating overloads & ensuring types -* initial commit of pygame stubs -* fixed \_\_init\_\_.py to export the classes -* Fixed a couple of issues in deprecated stubs -* Partial -* Fixed a couple of bugs caught by stubtest -* Small clean-up in retry stubs -* Small clean-up within packaging stubs -* Small clean-ups in markdown stubs -* A few more small tweaks to deprecated -* Small clean-up in deprecated stubs -* Fix a few issues with the docs to merge and named them with the proper suffix -* Added a few more typings, and crated a doc directory where we can keep the docstrings to be merged -* More cleanup and fixes -* Create README.md -* Small clean-up pass on cachetools -* Enabled black formatter -* Removed uneeded imports. Removed use of Any where redundant and not explicitly intended. Fixed some more minor issues -* fixed errors found with mypy tests removed sigs that were already typed in the base class -* Added utility scripts. Renamed DType to Dtype. Made the iLocIndexerrFrame synthetic class a subclass of the concrete non-specialized iLocIndexer, and similar for loc indexers and for both of these as specialized for Series -* Many fixes, added lots of missing Cython types, commented out unneeded imports (leaving them around for now though; we can strip all comments later) -* Did a clean-up pass on freezegun (small changes for consistency with other type stubs) -* Small clean-up pass on filelock stub -* Minor tweaks -* Add missing annotations -* Minor corrections -* Address more comments -* Address comments -* Formatting -* Add stubs for freezegun -* Formatting -* Fixes -* Stubs for filelock -* fixed a \_Timer reference -* Deleted multidict stubs. The latest version of multidict ships with inlined stubs -* Did clean-up pass on slugify stubs -* Did clean-up pass on packaging stubs -* Started to clean up mutlidict stubs. More work is needed -* Checked in .vscode/settings.json so everyone uses the same settings when working on stubs -* Did a clean-up pass on markdown stubs -* Did a clean-up pass on deprecated stubs -* Did a clean-up pass on cachetools stubs -* Did a clean-up pass on aiofiles stubs -* Added Tuples Made \_timer to a Callable fixed popitem -* Fixes -* Whoops -* Stubs for retry -* Fixes -* Fixes -* Removed the remaining Anys,; Removed danglings commas Removed generics \_\_iter\_\_() returns \_KT -* Add slugify stubs -* New pandas staubs based off stubgen skeletons, with the old ones I did before merged in -* Drop non-core API -* PR feedback -* added generics and removed almost all Anys -* Add stubs for Extensions public API -* Fix formatting -* Remove overload with kwargs -* Add stubs for core public API -* Add overloads + keyword args -* Add overloads -* Add callable -* Create pyproject.toml -* Stubs for deprecated -* stubs for cachetools -* Added initial stubs for aiofiles package -* Added some packages that had type hints in comments/docstrings -* Initial SECURITY.md commit -* Initial README.md commit -* Initial CODE\_OF\_CONDUCT.md commit -* Initial LICENSE commit -* Initial commit diff --git a/utils/stubsplit/README.md b/utils/stubsplit/README.md deleted file mode 100644 index 167ca47..0000000 --- a/utils/stubsplit/README.md +++ /dev/null @@ -1,22 +0,0 @@ -stubsplit is a utility that can remove docstrings from Python type stub files, or -merge docstrings back in. We use this because we sometimes want to put docstrings for -functions into the stubs, because it is hard to extract them from source. This is -primarily used for some pandas APIs for now. - -To install: - - PBR_VERSION=1.0.0 pip install . - - -Usage: - stubsplit (split|merge) [--verbose] - stubsplit -h | --help - stubsplit --version - - -TODO: -- handle folded lines -- handle nested classes -- implement merge -- test against pandas stubs for hermeticity - diff --git a/utils/stubsplit/setup.cfg b/utils/stubsplit/setup.cfg deleted file mode 100644 index 6b15a61..0000000 --- a/utils/stubsplit/setup.cfg +++ /dev/null @@ -1,6 +0,0 @@ -[metadata] -name = stubsplit -author = Microsoft -license = MIT -long_description = file: README.md -requires-python = >= 3.6 diff --git a/utils/stubsplit/setup.py b/utils/stubsplit/setup.py deleted file mode 100644 index 6ba0997..0000000 --- a/utils/stubsplit/setup.py +++ /dev/null @@ -1,15 +0,0 @@ -import setuptools - - -setuptools.setup( - entry_points = { - 'console_scripts': ['stubsplit=stubsplit.cli:main'], - }, - setup_requires=['pbr'], - tests_require=['pytest', 'PyHamcrest'], - install_requires=[ - 'docopt', - ], - pbr=True -) - diff --git a/utils/stubsplit/stubsplit/__init__.py b/utils/stubsplit/stubsplit/__init__.py deleted file mode 100644 index 3571e4d..0000000 --- a/utils/stubsplit/stubsplit/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from .stubsplit import split, combine - diff --git a/utils/stubsplit/stubsplit/cli.py b/utils/stubsplit/stubsplit/cli.py deleted file mode 100644 index dde0601..0000000 --- a/utils/stubsplit/stubsplit/cli.py +++ /dev/null @@ -1,42 +0,0 @@ -""" -StubSplit. - -Usage: - stubsplit (split|merge) [--verbose] - stubsplit -h | --help - stubsplit --version - -Options: - -h --help Show this screen. - --version Show version. -""" -import os -from docopt import docopt -import stubsplit - - -def main(): - arguments = docopt(__doc__, version='Stubsplit 0.1') - docpath = arguments[''] - stubpath = arguments[''] - verbose = arguments['--verbose'] - if arguments['split']: - # Walk the stub tree and call split for each .pyi file - for root, _, files in os.walk(stubpath): - for name in files: - if not name.endswith('.pyi'): - continue - relpath = root[len(stubpath)+1:] - stubsplit.split(root, os.path.join(docpath, relpath), name, verbose) - else: - # Walk the doc tree and call combine for each .ds file - for root, _, files in os.walk(docpath): - for name in files: - if not name.endswith('.ds'): - continue - relpath = root[len(docpath)+1:] - stubsplit.combine(os.path.join(stubpath, relpath), root, name[:-3], verbose) - - -if __name__ == '__main__': - main() diff --git a/utils/stubsplit/stubsplit/stubsplit.py b/utils/stubsplit/stubsplit/stubsplit.py deleted file mode 100644 index d29011c..0000000 --- a/utils/stubsplit/stubsplit/stubsplit.py +++ /dev/null @@ -1,238 +0,0 @@ -import os - - -# TODO: -# - rewrite these as FSMs; will probably be cleaner and more -# maintainable long-term. Right now split() uses a for-in -# loop which requires buffering some past content. For merge -# I used indexing instead which avoided that, but it does -# mix metaphors; using FSMs for both could be more consistent -# and possible reuse the same 'driver' for both. -# - handle nested classes. This isn't urgent as we likely won't -# have any docstrings in these, but we should at least not -# break. - - -def split(stubroot, docroot, fname, verbose): - """ - Given the path to a .pyi file in `fname` as a path relative to `stubroot`, - split it into a docstring part and a stub part. The stub part should get - written to the original file, and the docstring part should be written to - a file with a .ds extension at the same relative path but under `docroot`. - - So for example, if called with `split('orig', 'target', 'module/__init__.py')`, - you will end up with a stripped version of the stub in `orig/module/__init__.py`, - and the docstrings in `target/module/__init__.py.ds`. - - The docstring file will preserve `class` lines, and the signature of the - specific function/method. - - The inverse function is `combine`. - """ - stubfile = os.path.join(stubroot, fname) - docfile = os.path.join(docroot, fname) + '.ds' - docpath, _ = os.path.split(docfile) - if not os.path.exists(docpath): - os.makedirs(docpath) - if not os.path.exists(stubfile): - raise Exception(f'Missing stub file {fname}') - with open(stubfile) as f: - stublines = f.readlines() - newstublines = [] - newdoclines = [] - defbuff = None - classbuff = None - indoc = False - target = newstublines - gotclose = False - - # TODO: handle split lines. This is more urgent as the stubs will likely be - # reformatted. - for line in stublines: - ls = line.strip() - if defbuff and defbuff.find(')') > 0: - if ls[:3] == "'''" or ls[:3] == '"""': # start of docstring - if classbuff and defbuff[0] == ' ': - newdoclines.append('\n') - newdoclines.append(classbuff) - newstublines.append(defbuff[:-1] + ' ...\n') - newdoclines.append(defbuff) - indoc = True - classbuff = None - else: - newstublines.append(defbuff) - if defbuff[0] == 'd': # top level def? - classbuff = None - defbuff = None - - if indoc: # Keep adding to docstring until we hit a 'pass' line - newdoclines.append(line) - if gotclose and ls == 'pass': - indoc = False - else: - gotclose = ls.find( "'''") >= 0 or ls.find('"""') >= 0 - elif ls[:4] == 'def ': - defbuff = line - elif defbuff and defbuff.find(')') < 0: # Handle split lines; is this enough? - defbuff += line - else: - # For now we handle top-level classes only - if line[:6] == 'class ': - classbuff = line - newstublines.append(line) - - if defbuff: - newstublines.append(defbuff) - - with open(stubfile, 'w') as f: - f.writelines(newstublines) - - if len(newdoclines): - with open(docfile, 'w') as f: - f.writelines(newdoclines) - - -def combine(stubroot, docroot, fname, verbose): - """ - Given the path to a .pyi file in `fname` as a path relative to `origroot`, - and given that a similar file exists under `docroot` with the same relative - path but an additional `.ds` suffix, combine these and replace the original - stubfile with one that has the docstrings merged in. - - The inverse function is `split`. - """ - stubfile = os.path.join(stubroot, fname) - docfile = os.path.join(docroot, fname) + '.ds' - if not os.path.exists(stubfile): - raise Exception(f'Missing stub file {fname}') - if not os.path.exists(docfile): - raise Exception(f'Missing doc file {fname}.ds') - with open(stubfile) as f: - stublines = f.readlines() - with open(docfile) as f: - doclines = f.readlines() - if len(doclines) == 0: - print(f'No docs found in {docfile}') - return - - # Gather together all the top-level functions and all the classes - # in dicts. That way we can be resilient to reorderings, if not - # file moves yet. - if verbose: - print(f'Gathering docs from {docfile}') - - def gather_def(lines, i): - ln = lines[i].strip() - name = ln[4:ln.find('(')] - start = i - i += 1 - while i < len(lines): - ln = lines[i].strip() - i += 1 - if ln == 'pass': - break - return name, lines[start:i], i - - top_level = {} - classes = {} - i = 0 - while i < len(doclines): - ln = doclines[i] - if ln[:6] == 'class ': - name = ln[6:min(ln.find('('), ln.find(':'))] - i += 1 - methods = {} - classes[name] = methods - if verbose: - print(f'{i+1}: class {name}') - while i < len(doclines) and doclines[i][0] == ' ': - name, deflines, i = gather_def(doclines, i) - methods[name] = deflines - if verbose: - print(f'{i+1}: def {name}') - elif ln[:4] == 'def ': - name, deflines, i = gather_def(doclines, i) - top_level[name] = deflines - if verbose: - print(f'{i+1}: def {name}') - elif len(ln.strip()) > 0: - raise Exception(f'Unhandled line {i}: "{ln}"') - else: - i += 1 - - # Now output the new stub lines. If we find a top-level method - # or class that is in our gathered data, substitute the original - # line for the gathered version. - - print(f'Merging docs from {docfile} into {stubfile}') - newstublines = [] - - i = 0 - while i < len(stublines): - ln = stublines[i] - i += 1 - if ln[:6] == 'class ': - name = ln[6:min(ln.find('('), ln.find(':'))] - methods = classes[name] if name in classes else {} - if methods.keys(): - print(f"Annotating class {name}") - elif verbose: - print(f'No methods found for class {name}') - newstublines.append(ln) - while i < len(stublines): - # Either we have a indented line or a top-level - # construct again - ln = stublines[i] - if ln[0].isalpha() or ln[0] == '@': - break - i += 1 - ls = ln.strip() - if ls[:4] == 'def ': - name = ls[4:ls.find('(')] - if name in methods: - # in case this is an overload, document same occurrence. To do that we need to - # do a full signature comparison which may span several lines. - # Note that this is not robust in the face of running formatters with - # different line lengths. We should really reconstruct the signature line - # ourselves with normalized formatting. Ain't nobody got time for that. - # Given Python functions are not polymorphic and so the names should be - # unique (ignoring @overloads), a better approach would be to change - # the split process so that it drops signatures and just stores function name - # or classname.methodname keys along with the docstrings, and then we can - # just reinsert those ourselves on the first instance we find, instead of - # matching the exact instance. - lines = methods[name] - j = -1 - while stublines[i + j].find(')') < 0: # Check all lines of signature for match - if stublines[i + j] != lines[j + 1]: - break - j += 1 - # For last line of signature, stop matching at closing ')' - if stublines[i + j][:stublines[i + j].find(')')] == lines[j + 1][:lines[j + 1].find(')')]: - print(f" Annotating method {name}") - newstublines.extend(lines) - del methods[name] # Only doc first occurrence - # If split line skip rest of signature - i += j + 1 - else: - newstublines.append(ln) - else: - newstublines.append(ln) - else: - newstublines.append(ln) - elif ln[:4] == 'def ': - name = ln[4:ln.find('(')] - if name in top_level: - print(f"Annotating function {name}") - newstublines.extend(top_level[name]) - while ln.find(')') < 0: # If wrapped we need to skip the rest of the signature - ln = stublines[i] - i += 1 - del top_level[name] - else: - newstublines.append(ln) - else: - newstublines.append(ln) - - with open(stubfile, 'w') as f: - f.writelines(newstublines) diff --git a/utils/stubsplit/test/__init__.py b/utils/stubsplit/test/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/utils/stubsplit/test/test_merge.py b/utils/stubsplit/test/test_merge.py deleted file mode 100644 index cc78fea..0000000 --- a/utils/stubsplit/test/test_merge.py +++ /dev/null @@ -1,51 +0,0 @@ -import os -import pytest -from stubsplit import stubsplit -import tempfile -from hamcrest import * - - -@pytest.fixture -def simplestub(): - stubdir = tempfile.TemporaryDirectory() - docdir = tempfile.TemporaryDirectory() - stubpath = stubdir.name - docpath = docdir.name - stubname = 'test.pyi' - docname = stubname + '.ds' - orig = """ -def one(): ... -def two(): - ''' - This is the doc - ''' - pass - -class A: - def one(): ... - -class B: - def two(): - ''' - This is the doc - ''' - pass -""" - with open(os.path.join(stubpath, stubname), 'w') as f: - f.write(orig) - yield stubpath, docpath, stubname, orig - stubdir.cleanup() - docdir.cleanup() - - -def test_merge_stub(simplestub): - (stubroot, docroot, fname, orig) = simplestub - - stubsplit.split(stubroot, docroot, fname) - - stubsplit.combine(stubroot, docroot, fname) - - with open(os.path.join(stubroot, fname)) as f: - assert_that(f.read(), equal_to(orig)) - - diff --git a/utils/stubsplit/test/test_split.py b/utils/stubsplit/test/test_split.py deleted file mode 100644 index 565cbef..0000000 --- a/utils/stubsplit/test/test_split.py +++ /dev/null @@ -1,130 +0,0 @@ -import os -import pytest -from stubsplit import stubsplit -import tempfile -from hamcrest import * - - -@pytest.fixture -def simplestub(): - stubdir = tempfile.TemporaryDirectory() - docdir = tempfile.TemporaryDirectory() - stubpath = stubdir.name - docpath = docdir.name - stubname = 'test.pyi' - docname = stubname + '.ds' - - with open(os.path.join(stubpath, stubname), 'w') as f: - f.write( - """ -def one(): ... -def two(): - ''' - This is the doc - ''' - pass - -class A: - def one(): ... - -class B: - def two(): - ''' - This is the doc - ''' - pass - -def three(a, b, - c): - \"\"\" - This is - the doc - \"\"\" - pass - -def four(a, b, - c) -> Any: ... - -class C: - - def four(a, b, - c) -> Any: ... - def three(a, b, - c): - \"\"\" - This is - the doc - \"\"\" - pass -""" - ) - yield stubpath, docpath, stubname - stubdir.cleanup() - docdir.cleanup() - - -def test_split_stub(simplestub): - (stubroot, docroot, fname) = simplestub - - stubsplit.split(stubroot, docroot, fname) - - with open(os.path.join(stubroot, fname)) as f: - assert_that(f.read(), equal_to(""" -def one(): ... -def two(): ... - -class A: - def one(): ... - -class B: - def two(): ... - -def three(a, b, - c): ... - -def four(a, b, - c) -> Any: ... - -class C: - - def four(a, b, - c) -> Any: ... - def three(a, b, - c): ... -""")) - -def test_split_doc(simplestub): - (stubroot, docroot, fname) = simplestub - - stubsplit.split(stubroot, docroot, fname) - - with open(os.path.join(docroot, fname + '.ds')) as f: - assert_that(f.read(), equal_to("""def two(): - ''' - This is the doc - ''' - pass - -class B: - def two(): - ''' - This is the doc - ''' - pass -def three(a, b, - c): - \"\"\" - This is - the doc - \"\"\" - pass - -class C: - def three(a, b, - c): - \"\"\" - This is - the doc - \"\"\" - pass -"""))