Skip to content

BUG Series rolling count ignores min periods #31319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
165 commits
Select commit Hold shift + click to select a range
b7fcb54
CLN: remove unnecessary overriding in subclasses (#30875)
jbrockmendel Jan 10, 2020
6f2c509
DEPR: fix missing stacklevel in pandas.core.index deprecation (#30878)
jorisvandenbossche Jan 10, 2020
d1b9598
DOC: Encourage use of pre-commit in the docs (#30864)
gfyoung Jan 10, 2020
447a3b0
WEB: Removing Discourse links (#30890)
datapythonista Jan 10, 2020
03cdcb6
WEB: Remove from roadmap moving the docstring script (#30893)
datapythonista Jan 10, 2020
0b4bac7
TYP: typing annotations (#30901)
ShaharNaveh Jan 10, 2020
f887eb0
TYP: offsets (#30897)
jbrockmendel Jan 10, 2020
6e9651e
BUG: pickle files left behind by tm.round_trip_pickle (#30906)
jbrockmendel Jan 11, 2020
398bf7d
BUG: Series rolling count ignores min_periods (GH26996)
fujiaxiang Jan 11, 2020
7f2948c
replace syntax with f-string (#30919)
HH-MWB Jan 11, 2020
939e7dd
CLN: F-strings (#30916)
dinasv Jan 11, 2020
b47a454
DOC: Fixture docs in pandas/conftest.py (#30917)
gfyoung Jan 11, 2020
75ecfa4
CLN: remove unnecesary _date_check_type (#30932)
jbrockmendel Jan 11, 2020
044559a
DOC: Fix SS03 docstring error (#30939)
galuhsahid Jan 12, 2020
28e909c
TYP: type up parts of series.py (#30761)
topper-123 Jan 12, 2020
4e2546d
STY: wrong placed space in strings (#30940)
ShaharNaveh Jan 12, 2020
45580a2
DOC: Fix whatsnew contributors section (#30926)
jschendel Jan 13, 2020
439d629
CI: numpydev changed double to single quote (#30952)
jbrockmendel Jan 13, 2020
46c2864
CLN: leftover ix checks (#30951)
jbrockmendel Jan 13, 2020
bbccf2d
DOC: Move import conventions from wiki to docs #30808 (#30888)
souvik3333 Jan 13, 2020
2c76d06
DOC: Move couple of deprecations whatsnew to correct section (#30961)
ryankarlos Jan 13, 2020
62d16ab
STY: concat strings that should not be seperated (#30942)
ShaharNaveh Jan 13, 2020
dd6e31a
REGR: Fixed hash_key=None for object values (#30900)
TomAugspurger Jan 13, 2020
bd63ece
CLN: remove no-op from indexing (#30934)
jbrockmendel Jan 13, 2020
7ba53f0
BUG: -1 to the power of pd.NA was returning -1 (#30960)
MarcoGorelli Jan 13, 2020
67fcdef
TYP: NDFrame.resample (#30947)
topper-123 Jan 13, 2020
993fdbe
DOC: whatsnew for 1.1 (#30972)
WillAyd Jan 13, 2020
6928327
CLN: misc cleanups (#30877)
jbrockmendel Jan 13, 2020
2bf0c9f
Compat for util.testing import (#30973)
TomAugspurger Jan 13, 2020
307137c
STY: concat strings (#30979)
ShaharNaveh Jan 13, 2020
2075539
Added small corrections to the test for interpolate limit_area (#30987)
cchwala Jan 13, 2020
8ff2ebd
STY: concat strings (#30991)
ShaharNaveh Jan 14, 2020
13b22fd
CLN: de-duplicate _getitem_scalar (#30992)
jbrockmendel Jan 14, 2020
0f048cb
CLN: remove geopandas compat code (#30909)
jbrockmendel Jan 14, 2020
b18024d
STY: Whitespaces placed at the beginning instead at the end of a line…
ShaharNaveh Jan 14, 2020
3471270
API: Disallow NaN in StringArray constructor (#30980)
TomAugspurger Jan 14, 2020
81d9636
BUG: ensure_datetime64ns with bigendian array (#30976)
jbrockmendel Jan 14, 2020
d78c061
ENH: Add Stata 119 writer (#30959)
bashtage Jan 14, 2020
1835064
TST: bare pytest raises (#31001)
ShaharNaveh Jan 14, 2020
ee83988
DOC: Changed links to sphinx documentation in contributing.rst file (…
Jan 14, 2020
8d093fe
TST: Insert 'match' to bare pytest raises (#30997)
ShaharNaveh Jan 14, 2020
3787133
DOC: Fixed documented value of `pd.NA ** 0` (#31005) (#31015)
TomAugspurger Jan 14, 2020
cb05c13
DOC: Clarified documentation for convert_dates and use_default_dates …
amilbourne Jan 14, 2020
6b87716
CI: Remove unrequired config (#31024)
alimcmaster1 Jan 15, 2020
6837794
BUG: Preserve string dtype in extract (#31018)
TomAugspurger Jan 15, 2020
51cb276
CLN: remove checks for inferred_dtype==unicode (#31020)
jbrockmendel Jan 15, 2020
4ed9a39
CLN: remove unused NDFrame methods (#30935)
jbrockmendel Jan 15, 2020
bea5789
doc: update copyright year (#31022)
simon04 Jan 15, 2020
d243ca0
REF: PeriodIndex.get_loc (#31021)
jbrockmendel Jan 15, 2020
9b0ef5d
refactor DTI.get_loc (#31023)
jbrockmendel Jan 15, 2020
698920f
REF: do all casting _before_ call to DatetimeEngine.get_loc (#30948)
jbrockmendel Jan 15, 2020
586bcb1
BUG: pivot_table with multi-index columns only fails (#31013)
charlesdong1991 Jan 15, 2020
ef0cf1e
REF: implement _split_op_result (#31027)
jbrockmendel Jan 15, 2020
030a35c
PERF: RangeIndex.get_loc (#30930)
jbrockmendel Jan 15, 2020
8718877
ENH/TST: Allow more keywords to ensure_clean (#30915)
gfyoung Jan 15, 2020
dd94e0d
BLD: More lightweight mypy pre-commit hook (#30814)
xhochy Jan 15, 2020
2cabca8
CI: Fix clipboard problems (#29712)
datapythonista Jan 15, 2020
9a68635
BUG: SystemError in df.sum (#30905)
jbrockmendel Jan 15, 2020
bc9d329
BUG: Fix Timestamp constructor changes value on ambiguous DST (#30995)
AlexKirko Jan 15, 2020
c139f08
a -> an (#31033)
Jan 16, 2020
2170f4e
CI: Using docstring validator from numpydoc (#30746)
datapythonista Jan 16, 2020
2ba6be7
TST: Disallow bare pytest.raises (#31045)
gdex1 Jan 16, 2020
5d49730
CLN: assorted cleanups (#31056)
jbrockmendel Jan 16, 2020
c040f14
CLN: remove redundant return value (#31065)
jbrockmendel Jan 16, 2020
22fe19c
TYP/CLN: Replaced "Optional[Hashable]" with "Label" from pandas._typi…
ShaharNaveh Jan 16, 2020
7eafd73
CLN: Removed unused varibles from for loops (#31059)
ShaharNaveh Jan 16, 2020
7a1dad1
CLN/STY: Some stuff that got the attention of my eye (#31076)
ShaharNaveh Jan 16, 2020
7b7bb83
CLN: Removed the same code in 'if' and the 'else' (#31081)
ShaharNaveh Jan 16, 2020
721a2eb
CLN: remove unnecessary arg from _to_dt64 (#30895)
jbrockmendel Jan 16, 2020
a8eaebf
CLN: simplify Float64Index.__contains__ (#30899)
jbrockmendel Jan 16, 2020
208bb41
DOC: Add pandas_path to the accesor list in the documentation (#30898)
pjbull Jan 16, 2020
171a1ed
TYP: _config/config.py && core/{apply,construction}.py (#30734)
ShaharNaveh Jan 16, 2020
e4a96bb
ENH: Add engine keyword to expanding.apply to utilize Numba (#30937)
mroeschke Jan 16, 2020
321bae6
automatic 'end' year of copyright (#31085)
ShaharNaveh Jan 16, 2020
b2c90cc
CLN: Remove download_wheels.py, moved to pandas-release (#31083)
datapythonista Jan 16, 2020
14ab82e
CLN: remove unused legacy pickle compat code (#31078)
jbrockmendel Jan 16, 2020
f6747b9
REF: stricter types for RangeIndex._simple_new (#31084)
jbrockmendel Jan 16, 2020
b68a9bb
WEB: Improving the sponsors in the web, and adding CZI (#31046)
datapythonista Jan 17, 2020
0f04c6a
CI/TST: fix failing tests in py37_np_dev (#31091)
ShaharNaveh Jan 17, 2020
d21638b
CLN: Regular expression clean as @jbrockmendel suggested (#31098)
ShaharNaveh Jan 17, 2020
5d471c9
Merge remote-tracking branch 'upstream/master' into series_rolling_co…
fujiaxiang Jan 17, 2020
a72eef5
DOC: Add missing docstrings in pd.Index (#31047)
galuhsahid Jan 17, 2020
47f4e61
ENH: handles min_periods argument in rolling.count (GH26996)
fujiaxiang Jan 17, 2020
fb0f96e
WEB: Styling blog (#31094)
datapythonista Jan 17, 2020
a0c7a8a
CLN: Index._values docstring + Block.internal/external_values (#31103)
jorisvandenbossche Jan 17, 2020
641346c
TST: Fix some bare pytest raises (#31105)
ShaharNaveh Jan 17, 2020
a890239
BUG: pd.crosstab(s1, s2) handle column index incorrectly when both se…
charlesdong1991 Jan 17, 2020
f873fb9
TYP: annotations (#31115)
jbrockmendel Jan 18, 2020
9c33464
JSON Date Handling 1.0 Regressions (#30977)
WillAyd Jan 18, 2020
4e9ee4d
BUG: reductions for nullable dtypes should return pd.NA for skipna=Fa…
jorisvandenbossche Jan 18, 2020
f19035d
REF: fix calls to Index.get_value (#31112)
jbrockmendel Jan 18, 2020
1c9f23c
CLN: prune unreachable code (#31106)
jbrockmendel Jan 18, 2020
df2a3e9
DOC: moved whatsnew to V1.1.0
fujiaxiang Jan 18, 2020
554abfa
Merge remote-tracking branch 'upstream/master' into series_rolling_co…
fujiaxiang Jan 18, 2020
65b23c2
BUG: partial-timestamp slicing near the end of year/quarter/month (#3…
jbrockmendel Jan 18, 2020
8b754fc
CLN: update _simple_new usages (#31089)
jbrockmendel Jan 18, 2020
024925a
REF: handle searchsorted casting within DatetimeLikeArray (#30950)
jbrockmendel Jan 18, 2020
55cfabb
REF: be stricter about what we pass to _simple_new (#31055)
jbrockmendel Jan 18, 2020
f792d8c
BUG: correct wrong error message in df.pivot when columns=None (#30925)
charlesdong1991 Jan 18, 2020
6245c70
Updated years in LICENSE (#31100)
ShaharNaveh Jan 18, 2020
d16dc5a
Pull Request Tips (#31093)
WillAyd Jan 18, 2020
a3c7722
DOC: Moved PANDAS_TESTING_MODE tip to .travis.yml (#30694) (#31008)
saloni30agr Jan 18, 2020
c4878b0
Merge remote-tracking branch 'upstream/master' into series_rolling_co…
fujiaxiang Jan 18, 2020
cdf6774
DOC: Replace ggpy with plotnine in ecosystem (#31097)
hvardhan20 Jan 18, 2020
d170cc0
TST/BUG: fix incorrectly-passing Exception (#30553)
jbrockmendel Jan 18, 2020
52c22b2
REF/CLN: Index.get_value wrapping incorrectly (#31125)
jbrockmendel Jan 18, 2020
a446979
REF: simplify Float64Index.get_loc (#31123)
jbrockmendel Jan 18, 2020
7d28040
ENH: Create DockerFile and devcontainer.json files to work with Docke…
yehoshuadimarsky Jan 19, 2020
b0f5baa
Merge remote-tracking branch 'upstream/master' into series_rolling_co…
fujiaxiang Jan 19, 2020
31a7f57
REF: share code between Int64Index and UInt64Index (#31129)
jbrockmendel Jan 19, 2020
ebaed91
REF: share code between Int64Index and UInt64Index (#31129)
jbrockmendel Jan 19, 2020
4f1afc4
REF: share code between Int64Index and UInt64Index (#31129)
jbrockmendel Jan 19, 2020
9843f43
REF: share code between Int64Index and UInt64Index (#31129)
jbrockmendel Jan 19, 2020
7c94949
TYP: Index get_indexer_foo methods (#31137)
jbrockmendel Jan 19, 2020
54ba6db
DOC: Fix HDF5 complevel and complib formatting (#31053)
kylekeppler Jan 20, 2020
212b714
DOC: Restore ExtensionIndex.dropna.__doc__ (#31095)
jbrockmendel Jan 20, 2020
eb492a2
Use Python 3 shebangs (#31147)
rebecca-palmer Jan 20, 2020
71b6833
REF/BUG: Index.get_value called incorrectly, de-duplicate+simplify (#…
jbrockmendel Jan 20, 2020
6a2f95b
REF: require PeriodArray in PeriodIndex._simple_new (#31128)
jbrockmendel Jan 20, 2020
be6a3bc
BUG: groupby apply raises ValueError when groupby axis has duplicates…
fujiaxiang Jan 20, 2020
f4de727
TST: insert 'match' to bare pytest raises in pandas/tests/internals/…
ShaharNaveh Jan 20, 2020
f8e905e
REF: share searchsorted between DTI/TDI/PI, insert between DTI/TDI (#…
jbrockmendel Jan 20, 2020
264363e
TYP: Annotations in pandas/core/nanops.py (#30461)
ShaharNaveh Jan 20, 2020
06e416d
BUG: raise on non-hashable in __contains__ (#30902)
jbrockmendel Jan 20, 2020
998e742
BUG: EAs should not be hashable (#30908)
jbrockmendel Jan 20, 2020
cd7c784
CLN: fix wrong types getting passed to TDI._get_string_slice (#30874)
jbrockmendel Jan 20, 2020
059742b
TYP: Type annotations in pandas/io/formats/style.py (#30403)
ShaharNaveh Jan 20, 2020
3fbc332
CLN: Remove unused release scripts (#31049)
datapythonista Jan 20, 2020
7882aac
:pencil: set klass correctly for series and dataframe set_axis (#30885)
MarcoGorelli Jan 20, 2020
15bacea
raise more specific error if dict is appended to frame wit… (#30882)
MarcoGorelli Jan 20, 2020
e0bd394
ENH Avoid redundant CSS in Styler.render (#30876)
jnothman Jan 20, 2020
cd20c95
REF: use _get_string_slice in PeriodIndex.get_value (#31058)
jbrockmendel Jan 20, 2020
f1aaf62
BUG: df.pivot_table fails when margin is True and only columns is def…
charlesdong1991 Jan 20, 2020
29edd11
BUG: Break reference from grouping level to MI (#31133)
TomAugspurger Jan 20, 2020
469b4b7
CLN/STY: various code cleanups (#31162)
ShaharNaveh Jan 20, 2020
24d7c06
BUG: Fix MutliIndexed unstack failures at tuple names (#30943)
charlesdong1991 Jan 20, 2020
9a01577
REF: Move generic methods to aggregation.py (#30856)
charlesdong1991 Jan 20, 2020
f1bbb21
ENH: show percentiles in timestamp describe (#30164) (#30209)
david-cortes Jan 20, 2020
8a8e967
Split out JSON Date Converters (#31057)
WillAyd Jan 20, 2020
cdffa43
ENH: XLSB support (#29836)
Rik-de-Kort Jan 20, 2020
bbcda98
TST: Add regression tests for fixed issues (#31161)
mroeschke Jan 21, 2020
bfe10f0
TST: added more tests (GH26996)
fujiaxiang Jan 21, 2020
1a90629
Merge branch 'master' into series_rolling_count_ignores_min_periods
fujiaxiang Jan 21, 2020
964400d
Remove possibly illegal test data (#31146)
rebecca-palmer Jan 21, 2020
7ffcf9d
BUG: concat not copying index and columns when copy=True (#31119)
fujiaxiang Jan 21, 2020
be0926b
Merge remote-tracking branch 'upstream/master' into series_rolling_co…
fujiaxiang Jan 21, 2020
c0046b6
BUG: updated rolling and expanding count for consistency (GH26996)
fujiaxiang Jan 21, 2020
4050e4c
ENH: partial string indexing on non-monotonic PeriodIndex (#31096)
jbrockmendel Jan 21, 2020
d77b1d8
TST: Add more regression tests for fixed issues (#31171)
mroeschke Jan 21, 2020
e31c5ad
COMPAT: numpy test warnings (#30345)
nschloe Jan 21, 2020
c3f492f
REF: move misplaced tests (#31189)
jbrockmendel Jan 22, 2020
6dea557
CLN: remove unused fixtures (#31192)
jbrockmendel Jan 22, 2020
f4c99ff
REG: restore format_type attr (#31017)
jbrockmendel Jan 22, 2020
6752833
CI: numpydev ragged array dtype warning (#31203)
TomAugspurger Jan 22, 2020
8807ba1
CLN: further cleaned code (GH26996)
fujiaxiang Jan 22, 2020
118dc6c
DOC: fixup whatsnew (#31217)
TomAugspurger Jan 22, 2020
774498b
Follow-up: XLSB Support (#31215)
Rik-de-Kort Jan 22, 2020
6f395ad
Replaced set comprehension with a generator (#31229)
ShaharNaveh Jan 23, 2020
e83a6bd
BUG: Fixed upcast dtype for datetime64 in merge (#31211)
TomAugspurger Jan 23, 2020
7aa1582
Merge remote-tracking branch 'upstream/master' into series_rolling_co…
fujiaxiang Jan 23, 2020
bcce129
TST: cleaned up tests (GH26996)
fujiaxiang Jan 24, 2020
1a4352b
BUG: changed min_periods default to 0 for rolling and expanding (GH26…
fujiaxiang Jan 24, 2020
9fa4531
BUG: reverted non-relevant changes accidentally added (GH26996)
fujiaxiang Jan 24, 2020
987c033
BUG: small change in whatsnew (GH26996)
fujiaxiang Jan 25, 2020
a00532a
CLN: slight cleanup (GH26996)
fujiaxiang Jan 25, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
28 changes: 28 additions & 0 deletions .devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or the definition README at
// https://github.com/microsoft/vscode-dev-containers/tree/master/containers/python-3-miniconda
{
"name": "pandas",
"context": ".",
"dockerFile": "Dockerfile",

// Use 'settings' to set *default* container specific settings.json values on container create.
// You can edit these settings after create using File > Preferences > Settings > Remote.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"python.condaPath": "/opt/conda/bin/conda",
"python.pythonPath": "/opt/conda/bin/python",
"python.formatting.provider": "black",
"python.linting.enabled": true,
"python.linting.flake8Enabled": true,
"python.linting.pylintEnabled": false,
"python.linting.mypyEnabled": true,
"python.testing.pytestEnabled": true,
"python.testing.cwd": "pandas/tests"
},

// Add the IDs of extensions you want installed when the container is created in the array below.
"extensions": [
"ms-python.python",
"ms-vscode.cpptools"
]
}
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ repos:
rev: v0.730
hooks:
- id: mypy
# We run mypy over all files because of:
# * changes in type definitions may affect non-touched files.
# * Running it with `mypy pandas` and the filenames will lead to
# spurious duplicate module errors,
# see also https://github.com/pre-commit/mirrors-mypy/issues/5
pass_filenames: false
args:
- pandas
# As long as a some files are excluded from check-untyped-defs
# we have to exclude it from the pre-commit hook as the configuration
# is based on modules but the hook runs on files.
- --no-check-untyped-defs
- --follow-imports
- skip
files: pandas/
33 changes: 16 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ python: 3.7
# travis cache --delete inside the project directory from the travis command line client
# The cache directories will be deleted if anything in ci/ changes in a commit
cache:
ccache: true
directories:
- $HOME/.cache # cython cache
- $HOME/.ccache # compiler cache
ccache: true
directories:
- $HOME/.cache # cython cache
- $HOME/.ccache # compiler cache

env:
global:
Expand All @@ -20,30 +20,30 @@ env:
- secure: "EkWLZhbrp/mXJOx38CHjs7BnjXafsqHtwxPQrqWy457VDFWhIY1DMnIR/lOWG+a20Qv52sCsFtiZEmMfUjf0pLGXOqurdxbYBGJ7/ikFLk9yV2rDwiArUlVM9bWFnFxHvdz9zewBH55WurrY4ShZWyV+x2dWjjceWG5VpWeI6sA="

git:
# for cloning
depth: false
# for cloning
depth: false

matrix:
fast_finish: true
exclude:
# Exclude the default Python 3.5 build
- python: 3.5
fast_finish: true

include:
include:
- env:
- JOB="3.8" ENV_FILE="ci/deps/travis-38.yaml" PATTERN="(not slow and not network)"
- JOB="3.8" ENV_FILE="ci/deps/travis-38.yaml" PATTERN="(not slow and not network and not clipboard)"

- env:
- JOB="3.7" ENV_FILE="ci/deps/travis-37.yaml" PATTERN="(not slow and not network)"
- JOB="3.7" ENV_FILE="ci/deps/travis-37.yaml" PATTERN="(not slow and not network and not clipboard)"

- env:
- JOB="3.6, locale" ENV_FILE="ci/deps/travis-36-locale.yaml" PATTERN="((not slow and not network) or (single and db))" LOCALE_OVERRIDE="zh_CN.UTF-8" SQL="1"
- JOB="3.6, locale" ENV_FILE="ci/deps/travis-36-locale.yaml" PATTERN="((not slow and not network and not clipboard) or (single and db))" LOCALE_OVERRIDE="zh_CN.UTF-8" SQL="1"
services:
- mysql
- postgresql

- env:
- JOB="3.6, coverage" ENV_FILE="ci/deps/travis-36-cov.yaml" PATTERN="((not slow and not network) or (single and db))" PANDAS_TESTING_MODE="deprecate" COVERAGE=true SQL="1"
# Enabling Deprecations when running tests
# PANDAS_TESTING_MODE="deprecate" causes DeprecationWarning messages to be displayed in the logs
# See pandas/_testing.py for more details.
- JOB="3.6, coverage" ENV_FILE="ci/deps/travis-36-cov.yaml" PATTERN="((not slow and not network and not clipboard) or (single and db))" PANDAS_TESTING_MODE="deprecate" COVERAGE=true SQL="1"
services:
- mysql
- postgresql
Expand Down Expand Up @@ -73,7 +73,6 @@ before_install:
# This overrides travis and tells it to look nowhere.
- export BOTO_CONFIG=/dev/null


install:
- echo "install start"
- ci/prep_cython_cache.sh
Expand All @@ -90,5 +89,5 @@ script:
after_script:
- echo "after_script start"
- source activate pandas-dev && pushd /tmp && python -c "import pandas; pandas.show_versions();" && popd
- ci/print_skipped.py
- ci/print_skipped.py
- echo "after_script done"
47 changes: 47 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
FROM continuumio/miniconda3

# if you forked pandas, you can pass in your own GitHub username to use your fork
# i.e. gh_username=myname
ARG gh_username=pandas-dev
ARG pandas_home="/home/pandas"

# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive

# Configure apt and install packages
RUN apt-get update \
&& apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \
#
# Verify git, process tools, lsb-release (common in install instructions for CLIs) installed
&& apt-get -y install git iproute2 procps iproute2 lsb-release \
#
# Install C compilers (gcc not enough, so just went with build-essential which admittedly might be overkill),
# needed to build pandas C extensions
&& apt-get -y install build-essential \
#
# cleanup
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*

# Switch back to dialog for any ad-hoc use of apt-get
ENV DEBIAN_FRONTEND=dialog

# Clone pandas repo
RUN mkdir "$pandas_home" \
&& git clone "https://github.com/$gh_username/pandas.git" "$pandas_home" \
&& cd "$pandas_home" \
&& git remote add upstream "https://github.com/pandas-dev/pandas.git" \
&& git pull upstream master

# Because it is surprisingly difficult to activate a conda environment inside a DockerFile
# (from personal experience and per https://github.com/ContinuumIO/docker-images/issues/89),
# we just update the base/root one from the 'environment.yml' file instead of creating a new one.
#
# Set up environment
RUN conda env update -n base -f "$pandas_home/environment.yml"

# Build C extensions and pandas
RUN cd "$pandas_home" \
&& python setup.py build_ext --inplace -j 4 \
&& python -m pip install -e .
4 changes: 3 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
BSD 3-Clause License

Copyright (c) 2008-2012, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
Copyright (c) 2008-2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
All rights reserved.

Copyright (c) 2011-2020, Open source contributors.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

Expand Down
1 change: 1 addition & 0 deletions asv_bench/asv.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"matplotlib": [],
"sqlalchemy": [],
"scipy": [],
"numba": [],
"numexpr": [],
"pytables": [null, ""], // platform dependent, see excludes below
"tables": [null, ""],
Expand Down
3 changes: 3 additions & 0 deletions asv_bench/benchmarks/reshape.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ def time_pivot_table_categorical_observed(self):
observed=True,
)

def time_pivot_table_margins_only_column(self):
self.df.pivot_table(columns=["key2", "key3"], margins=True)


class Crosstab:
def setup(self):
Expand Down
21 changes: 21 additions & 0 deletions asv_bench/benchmarks/rolling.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,27 @@ def time_rolling(self, constructor, window, dtype, function, raw):
self.roll.apply(function, raw=raw)


class Engine:
params = (
["DataFrame", "Series"],
["int", "float"],
[np.sum, lambda x: np.sum(x) + 5],
["cython", "numba"],
)
param_names = ["constructor", "dtype", "function", "engine"]

def setup(self, constructor, dtype, function, engine):
N = 10 ** 3
arr = (100 * np.random.random(N)).astype(dtype)
self.data = getattr(pd, constructor)(arr)

def time_rolling_apply(self, constructor, dtype, function, engine):
self.data.rolling(10).apply(function, raw=True, engine=engine)

def time_expanding_apply(self, constructor, dtype, function, engine):
self.data.expanding().apply(function, raw=True, engine=engine)


class ExpandingMethods:

params = (
Expand Down
8 changes: 4 additions & 4 deletions ci/azure/posix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
py36_minimum_versions:
ENV_FILE: ci/deps/azure-36-minimum_versions.yaml
CONDA_PY: "36"
PATTERN: "not slow and not network"
PATTERN: "not slow and not network and not clipboard"

py36_locale_slow_old_np:
ENV_FILE: ci/deps/azure-36-locale_slow.yaml
Expand All @@ -36,12 +36,12 @@ jobs:
PATTERN: "not slow and not network"
LANG: "it_IT.utf8"
LC_ALL: "it_IT.utf8"
EXTRA_APT: "language-pack-it"
EXTRA_APT: "language-pack-it xsel"

py36_32bit:
ENV_FILE: ci/deps/azure-36-32bit.yaml
CONDA_PY: "36"
PATTERN: "not slow and not network"
PATTERN: "not slow and not network and not clipboard"
BITS32: "yes"

py37_locale:
Expand All @@ -50,7 +50,7 @@ jobs:
PATTERN: "not slow and not network"
LANG: "zh_CN.utf8"
LC_ALL: "zh_CN.utf8"
EXTRA_APT: "language-pack-zh-hans"
EXTRA_APT: "language-pack-zh-hans xsel"

py37_np_dev:
ENV_FILE: ci/deps/azure-37-numpydev.yaml
Expand Down
4 changes: 2 additions & 2 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,8 @@ fi
### DOCSTRINGS ###
if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then

MSG='Validate docstrings (GL03, GL04, GL05, GL06, GL07, GL09, GL10, SS04, SS05, PR03, PR04, PR05, PR10, EX04, RT01, RT04, RT05, SA01, SA02, SA03, SA05)' ; echo $MSG
$BASE_DIR/scripts/validate_docstrings.py --format=azure --errors=GL03,GL04,GL05,GL06,GL07,GL09,GL10,SS04,SS05,PR03,PR04,PR05,PR10,EX04,RT01,RT04,RT05,SA01,SA02,SA03,SA05
MSG='Validate docstrings (GL03, GL04, GL05, GL06, GL07, GL09, GL10, SS04, SS05, PR03, PR04, PR05, PR10, EX04, RT01, RT04, RT05, SA02, SA03, SA05)' ; echo $MSG
$BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=GL03,GL04,GL05,GL06,GL07,GL09,GL10,SS04,SS05,PR03,PR04,PR05,PR10,EX04,RT01,RT04,RT05,SA02,SA03,SA05
RET=$(($RET + $?)) ; echo $MSG "DONE"

fi
Expand Down
3 changes: 3 additions & 0 deletions ci/deps/azure-37-locale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ dependencies:
- xlsxwriter
- xlwt
- pyarrow>=0.15
- pip
- pip:
- pyxlsb
1 change: 1 addition & 0 deletions ci/deps/azure-macos-36.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ dependencies:
- pip
- pip:
- pyreadstat
- pyxlsb
3 changes: 3 additions & 0 deletions ci/deps/azure-windows-37.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ dependencies:
- xlsxwriter
- xlwt
- pyreadstat
- pip
- pip:
- pyxlsb
1 change: 1 addition & 0 deletions ci/deps/travis-36-cov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ dependencies:
- coverage
- pandas-datareader
- python-dateutil
- pyxlsb
2 changes: 1 addition & 1 deletion ci/print_skipped.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import os
import xml.etree.ElementTree as et

Expand Down
12 changes: 6 additions & 6 deletions ci/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ if [ "$COVERAGE" ]; then
COVERAGE="-s --cov=pandas --cov-report=xml:$COVERAGE_FNAME"
fi

PYTEST_CMD="pytest -m \"$PATTERN\" -n auto --dist=loadfile -s --strict --durations=10 --junitxml=test-data.xml $TEST_ARGS $COVERAGE pandas"

# Travis does not have have an X server
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
DISPLAY=DISPLAY=:99.0
PYTEST_CMD="xvfb-run -e /dev/stdout $PYTEST_CMD"
# If no X server is found, we use xvfb to emulate it
if [[ $(uname) == "Linux" && -z $DISPLAY ]]; then
export DISPLAY=":0"
XVFB="xvfb-run "
fi

PYTEST_CMD="${XVFB}pytest -m \"$PATTERN\" -n auto --dist=loadfile -s --strict --durations=10 --junitxml=test-data.xml $TEST_ARGS $COVERAGE pandas"

echo $PYTEST_CMD
sh -c "$PYTEST_CMD"

Expand Down
5 changes: 5 additions & 0 deletions ci/setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ echo "remove postgres if has been installed with conda"
echo "we use the one from the CI"
conda remove postgresql -y --force || true

echo
echo "remove qt"
echo "causes problems with the clipboard, we use xsel for that"
conda remove qt -y --force || true

echo
echo "conda list pandas"
conda list pandas
Expand Down
2 changes: 1 addition & 1 deletion doc/make.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
"""
Python script for building documentation.

Expand Down
3 changes: 2 additions & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

from datetime import datetime
import importlib
import inspect
import logging
Expand Down Expand Up @@ -137,7 +138,7 @@

# General information about the project.
project = "pandas"
copyright = "2008-2014, the pandas development team"
copyright = f"2008-{datetime.now().year}, the pandas development team"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down
26 changes: 26 additions & 0 deletions doc/source/development/code_style.rst
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,29 @@ For example:

value = str
f"Unknown recived type, got: '{type(value).__name__}'"


Imports (aim for absolute)
==========================

In Python 3, absolute imports are recommended. In absolute import doing something
like ``import string`` will import the string module rather than ``string.py``
in the same directory. As much as possible, you should try to write out
absolute imports that show the whole import chain from toplevel pandas.

Explicit relative imports are also supported in Python 3. But it is not
recommended to use it. Implicit relative imports should never be used
and is removed in Python 3.

For example:

::

# preferred
import pandas.core.common as com

# not preferred
from .common import test_base

# wrong
from common import test_base
Loading