Skip to content

BUG: Fix numpy boolean subtraction error in Series.diff #27755

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
wants to merge 193 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
193 commits
Select commit Hold shift + click to select a range
8be97f8
Fix numpy boolean subtraction error in Series.diff
Unprocessable Aug 5, 2019
7c982d2
Added is_bool outside if function
Unprocessable Aug 5, 2019
97509e9
Slightly rephrase SPSS doc (#27754)
cbrnr Aug 5, 2019
b3c2453
DOC: update compiling instructions and link. (#27717)
Aug 5, 2019
45f9c60
Added test_diff function
Unprocessable Aug 5, 2019
83907a2
Update test_diff.py
Unprocessable Aug 5, 2019
6c3875e
Changing style to match PEP
Unprocessable Aug 5, 2019
ecf1c04
Update test_diff.py
Unprocessable Aug 5, 2019
0e7ed3d
missed from #27720 (#27759)
jbrockmendel Aug 5, 2019
dd8ff98
Using tm to assert series differences
Unprocessable Aug 5, 2019
f9f95c0
ENH: Validation to only allow positive integers for options (#27382)
Adam-Klaum Aug 5, 2019
2f775b0
REF: separate out invalid ops (#27735)
jbrockmendel Aug 5, 2019
ac69333
CLN: collected cleanups from other branches (#27723)
jbrockmendel Aug 5, 2019
61819ab
BUG: fix to_datetime(dti, utc=True) (#27733)
jbrockmendel Aug 5, 2019
e123486
Added diff bug description to changelog
Unprocessable Aug 6, 2019
269d148
Added issue number
Unprocessable Aug 6, 2019
3993206
Adding timeseries tests as well
Unprocessable Aug 6, 2019
b610dd9
Removed test_diff, it is added to test_diff.py
Unprocessable Aug 6, 2019
92075fb
Removed too much code, importing nan again
Unprocessable Aug 6, 2019
1b90657
STYLE: formatting...
Unprocessable Aug 6, 2019
182cbc2
Splitting into two functions
Unprocessable Aug 6, 2019
3ba0958
Split into 3 functions
Unprocessable Aug 6, 2019
47feb30
Update test_diff.py
Unprocessable Aug 6, 2019
d425cdf
Adding nan test
Unprocessable Aug 6, 2019
050b8cb
STYLE: Black formatting
Unprocessable Aug 6, 2019
e028aef
Import order changed
Unprocessable Aug 6, 2019
f669f94
BUG: Fix windowing over read-only arrays (#27767)
kernc Aug 6, 2019
341043d
CLN/REF: Remove _try_cast_result, _try_coerce_and_cast_result (#27764)
jbrockmendel Aug 6, 2019
640d9e1
BUG: pd.crosstab not working when margin and normalize are set togeth…
charlesdong1991 Aug 6, 2019
54e5803
DOC: Validate docstring directives (#27630)
albertvillanova Aug 6, 2019
a45760f
DEPR: Removed the previously deprecated ExtensionArray._formatting_va…
simonjayhawkins Aug 7, 2019
820e09e
CI: Fix setting PATH in azure pipelines (#27787)
bhavaniravi Aug 7, 2019
9d947db
Update test_diff.py
Unprocessable Aug 7, 2019
b115c9e
Update test_diff.py
Unprocessable Aug 7, 2019
6cde0b3
DEPR: Remove previously deprecated IntervalIndex.from_intervals (#27793)
jschendel Aug 7, 2019
38d2372
BUG: fix construction of NonConsolidatableBlock with inconsistent ndi…
jorisvandenbossche Aug 7, 2019
9724ace
[BLD] Add script that fails build if git tags do not exist (#27770)
qwhelan Aug 7, 2019
3bf35c6
REF: pandas/core/window.py into multiple files (#27736)
mroeschke Aug 7, 2019
3bdac3e
TST: Add tests for groupby categorical values with axis=1 (#27788)
charlesdong1991 Aug 7, 2019
3581073
CLN: remove nested error handling (#27792)
jbrockmendel Aug 7, 2019
c0ff67a
BUG: Add mapping for pyqt for successful package installation (#27645)
charlesdong1991 Aug 7, 2019
3ae18d5
CI: remove pytest pins (#27809)
TomAugspurger Aug 8, 2019
fae84ec
DOC: add print statement in to_latex example (#27798)
sameshl Aug 8, 2019
c729b73
REF: separate method-pinning functions (#27811)
jbrockmendel Aug 8, 2019
f00905e
REF: Simplify _comp_method_SERIES (#27803)
jbrockmendel Aug 8, 2019
d320ef7
CLN: Assorted Cleanups (#27791)
jbrockmendel Aug 8, 2019
78c6843
DOC: Add expanded index descriptors for specifying for RangeIndex-as-…
wesm Aug 8, 2019
8b6942f
PERF: break reference cycle in Index._engine (#27607)
crepererum Aug 8, 2019
d7dcdf3
COMPAT: restore shape for 'invalid' Index with nd array (#27818)
jorisvandenbossche Aug 9, 2019
0227e69
EA: implement+test EA.view (#27633)
jbrockmendel Aug 9, 2019
62429ae
Update sample() documentation (#27833)
lizsaret Aug 9, 2019
67de633
Add example for Series.str.slice() (#27832)
Aug 9, 2019
7bfa9b8
Add security policy (#27822)
TomAugspurger Aug 9, 2019
be6c369
Add tidelift sponsor to FUNDING (#27823)
TomAugspurger Aug 9, 2019
865e913
Moving test_diff.py to test_analytics.py
Unprocessable Aug 10, 2019
6f8986b
Removed test_diff.py, added to test_analytics
Unprocessable Aug 10, 2019
081c2c8
Removing tailing whitespaces
Unprocessable Aug 10, 2019
96bb1b4
STYLE: Black formatting
Unprocessable Aug 10, 2019
91ebae5
Update test_analytics.py
Unprocessable Aug 10, 2019
74a474f
Update test_analytics.py
Unprocessable Aug 10, 2019
40df511
Removing self.ts from code
Unprocessable Aug 10, 2019
18a2e35
Update test_analytics.py
Unprocessable Aug 10, 2019
716a70e
Adding tm.makeTimeSeries, as in the original
Unprocessable Aug 10, 2019
e879dd7
STYLE: Black
Unprocessable Aug 10, 2019
e26fa2b
CI: pytest, xdist versions (#27845)
TomAugspurger Aug 12, 2019
2ebab98
CI: Pin Python to 3.7.3 (#27868)
TomAugspurger Aug 12, 2019
9fd432b
BUG: Fix groupby quantile segfault (#27826)
TomAugspurger Aug 12, 2019
2b6c977
op--> opname (#27849)
jbrockmendel Aug 12, 2019
01f90c1
CLN: short-circuit case in Block.replace (#27768)
jbrockmendel Aug 12, 2019
6afa2ad
BUG: Allow plotting boolean values (#27665)
charlesdong1991 Aug 12, 2019
35821a5
Avoid calling S3File.s3 (#27777)
CJStadler Aug 12, 2019
aef0804
BUG: add back check for MultiIndex case and take_split_path (#27855)
jorisvandenbossche Aug 13, 2019
794be8c
Added missing space to error description (#27866)
jimmycallin Aug 13, 2019
666928b
DOC: Updated Series.items 'See also' section for clarity (#27888)
Aug 13, 2019
2349783
DOC: clarify see also for DataFrame.iterrows() (#27893)
Ankit-Dhankhar Aug 13, 2019
f872bcd
DOC: Add append example in to_excel documentation (#27852)
sameshl Aug 13, 2019
6572497
DOC: Standardize use of "Iterate" and "Iterator" (#27871)
sameshl Aug 13, 2019
3e4b196
REF: Make CategoricalIndex comparison defer to Categorical comparison…
jbrockmendel Aug 13, 2019
d187d90
skip test if running non-installed (#27810)
jbrockmendel Aug 13, 2019
6a927b0
CLN: match standardized dispatch logic (#27830)
jbrockmendel Aug 13, 2019
eddeee5
requested edit to comparison method (#27873)
jbrockmendel Aug 13, 2019
69b25ee
CLN: use invalid_comparison for incorrect case in Index comparison (#…
jbrockmendel Aug 13, 2019
e47362a
CLN: Index.__new__ (#27883)
jbrockmendel Aug 13, 2019
de53f6e
remove unnecessary validate_for_numeric_binop (#27886)
jbrockmendel Aug 13, 2019
d32d464
CLN: remove unnecessary dtype checks (#27889)
jbrockmendel Aug 13, 2019
b623a9d
BUG: boxplot does not work when data has datetime column (#27846)
charlesdong1991 Aug 13, 2019
80a7a45
DOC: Add CoC to the README (#27851)
sparalic Aug 13, 2019
5de4e55
BUG: fix Sparse reduction (#27890)
jbrockmendel Aug 13, 2019
584b154
DOC:Use of "Yields" for documentation of DataFrame.iteritems() (#27876)
sameshl Aug 14, 2019
11b28ea
Revert 37 pins (#27907)
TomAugspurger Aug 14, 2019
fae56d0
PERF: Break reference cycle for all Index types (#27840)
topper-123 Aug 14, 2019
46ff5ee
CLN: remove never-True checks (#27908)
jbrockmendel Aug 14, 2019
5c81d8a
REF: implement should_extension_dispatch (#27815)
jbrockmendel Aug 14, 2019
603dbdc
CLN: remove unnecessary validate_for_numeric_unary (#27891)
jbrockmendel Aug 14, 2019
6813d77
DOC: Fix section reference placement in whatsnew (#27919)
jschendel Aug 14, 2019
a656d24
TST: parametrize arithmetic tests (#27847)
jbrockmendel Aug 15, 2019
c1f7b39
BUG: fix+test op(NaT, ndarray), also simplify (#27807)
jbrockmendel Aug 15, 2019
48dd753
CLN: remove _maybe_update_attributes (#27896)
jbrockmendel Aug 15, 2019
9d7a282
CLN: simplify comparison method, docstring cleanups (#27923)
jbrockmendel Aug 15, 2019
a818281
TST: Raise ValueError and suggestion to use header=None if header=-1 …
MarcoGorelli Aug 15, 2019
ca5198a
BUG: Ensure that fill_na in Categorical only replaces null values (#2…
MarcoGorelli Aug 16, 2019
0e24468
DOC: Fix typos in HDFStore docs (#27940)
adamjstewart Aug 16, 2019
5d3b492
VIS: Fix DataFrame.plot() produces incorrect legend markers (#27808)
charlesdong1991 Aug 16, 2019
7a0bcc3
BUG: Merge with readonly arrays (#27946)
TomAugspurger Aug 16, 2019
e66ad6c
cleanups, remove StringMixin (#27939)
jbrockmendel Aug 16, 2019
d03beab
implement array_ops (#27936)
jbrockmendel Aug 16, 2019
802f670
TST: Asserts all types are caterogical in function fillna with correc…
LiuSeeker Aug 16, 2019
f4b4ec2
DOC/CLN: docstring cleanups (#27942)
jbrockmendel Aug 16, 2019
9f93d57
TST: xfail on 37, win (#27956)
TomAugspurger Aug 16, 2019
5b0a2a6
DOC: remove savefig references from the docs v0.7.3 (#27990)
bhavaniravi Aug 18, 2019
35c44ce
DOC: Updated table with read_fwf() (#27920)
isantolin Aug 19, 2019
ba94f9b
BUG: lzma is a required part of python, make it optional (#27882)
guilherme-salome Aug 19, 2019
6e0ab71
BUG: Help python csv engine read binary buffers (#27925)
fiendish Aug 19, 2019
489d1ff
CLN: missing boilerplate in Sparse op (#27910)
jbrockmendel Aug 19, 2019
fb62fcf
BUG: _can_use_numexpr fails when passed large Series (#27773)
ccharlesgb Aug 19, 2019
a4b0132
TST: fix flaky xfail (#28016)
jbrockmendel Aug 19, 2019
325dd68
Fix regression in .ix fallback with IntervalIndex (#27926)
jorisvandenbossche Aug 19, 2019
be08902
BUG: TimedeltaArray - Index result.name (#27962)
jbrockmendel Aug 19, 2019
9a244b5
REF: use should_extension_dispatch for comparison method (#27912)
jbrockmendel Aug 19, 2019
9f71625
CLN: Remove incorrect check, comment, rename (#27922)
jbrockmendel Aug 20, 2019
0a7bb2a
BUG: fix to_timestamp out_of_bounds (#27916)
jbrockmendel Aug 20, 2019
e118b1d
BUG: added a check for if obj is instance of type in _isna-new (#27664)
joy-rosie Aug 20, 2019
69c58da
PLT: plot('line') or plot('area') produces wrong xlim in xaxis in 0.2…
charlesdong1991 Aug 20, 2019
e55b698
BUG: Correctly reinstate Matplotlib converters (#27481)
dstansby Aug 20, 2019
62ab439
BUG: rfloordiv with fill_value, closes#27464 (#28024)
jbrockmendel Aug 20, 2019
8110b47
DOC: Corrected file description in read_fwf() (#28009)
isantolin Aug 20, 2019
d2031d7
Fix GroupBy nth Handling with Observed=False (#26419)
WillAyd Aug 20, 2019
ec3d786
DataFrame html repr: also follow min_rows setting (#27991)
jorisvandenbossche Aug 20, 2019
b7aacb1
DOC: Add punctuation to IntervalArray docstrings (#28043)
sparalic Aug 21, 2019
a429aaf
DOC: Change document code prun in a row (#28029)
EunSeop Aug 21, 2019
e4c4b78
CI: Add pip dependence explicitly (#28008)
makbigc Aug 21, 2019
32b4710
BUG: Correct the previous bug fixing on xlim for plotting (#28059)
charlesdong1991 Aug 21, 2019
8b3246f
CI: Set SHA for codecov upload (#28067)
TomAugspurger Aug 21, 2019
cf6b09d
CI: disable codecov (#28065)
jbrockmendel Aug 21, 2019
7f6ba6b
DOC: Update whatsnew (#28073)
TomAugspurger Aug 21, 2019
becb774
TST: non-strict xfail for period test (#28072)
TomAugspurger Aug 21, 2019
bdcab11
BUG: iter with readonly values, closes #28055 (#28074)
jbrockmendel Aug 21, 2019
8f6118c
BUG: Fixed groupby quantile for listlike q (#27827)
TomAugspurger Aug 22, 2019
a76df79
Preserve index when setting new column on empty dataframe. (#26471)
sumanau7 Aug 22, 2019
b1c871c
BUG: Series.rename raises error on values accepted by Series construc…
lgmsantos Aug 22, 2019
def01cf
BUG: timedelta merge asof with tolerance (#27650)
ianzur Aug 22, 2019
888d1fa
DOC: update GroupBy.head()/tail() documentation (#27844)
mtrbean Aug 23, 2019
d5ba4c1
DOC: Remove alias for numpy.random.randn from the docs (#28082)
WuraolaOyewusi Aug 23, 2019
c7ceff9
DOC: Fix docstrings lack of punctuation (#28031)
martinagvilas Aug 23, 2019
9dc4d71
DOC: Start 0.25.2 (#28111)
TomAugspurger Aug 23, 2019
347ad85
TST: fix compression tests when run without virtualenv/condaenv (#28051)
jbrockmendel Aug 23, 2019
e2483c0
TYPING: more type hints for io.formats.printing (#27765)
simonjayhawkins Aug 23, 2019
d75ee70
Remove Encoding of values in char** For Labels (#27618)
WillAyd Aug 23, 2019
5c0da7d
DOC: Fix GL01 and GL02 errors in the docstrings (#27988)
steveayers124 Aug 24, 2019
518d8ae
Change trys to checks (#28121)
jbrockmendel Aug 25, 2019
2165a6a
Remove outdated docstring that no longer applies (#28137)
bmoscon Aug 25, 2019
09ab18f
TYPING: _pytest.mark.structures.MarkDecorator -> Callable (#28134)
simonjayhawkins Aug 25, 2019
97f9bbf
Contributing Guide for Type Hints (#27050)
WillAyd Aug 25, 2019
5d9fd7e
DOC: Fixes to docstrings formatting (#28096)
realjohnward Aug 25, 2019
2c9c422
DOC: Fix RangeIndex and other docstrings for missing period in summar…
bhuvanakundumani Aug 26, 2019
ea60c19
DOC: Added periods to end of docstrings in explode function (#27973)
jalbritt Aug 26, 2019
765eb8d
COMPAT: 3.8 compat for tests and DataFrame.query (#28101)
TomAugspurger Aug 26, 2019
cebc343
TYPING: --check-untyped-defs for Index.__new__ (#28141)
simonjayhawkins Aug 26, 2019
0d0daa8
ENH: Allow compression in NDFrame.to_csv to be a dict with optional …
drew-heenan Aug 26, 2019
a1bdacf
DOC: Harmonize column selection to bracket notation (#27562)
katrinleinweber Aug 26, 2019
7528d08
TYPING: add stubs for _packer and _unpacker (#28135)
simonjayhawkins Aug 26, 2019
bca39a7
Run clang-format on objToJSON (#28144)
WillAyd Aug 26, 2019
87d26ba
PERF: replace with list, closes #28084 (#28099)
jbrockmendel Aug 26, 2019
7deda21
DOC: whatsnew for 28099 (#28154)
TomAugspurger Aug 26, 2019
9f48098
DOC: Set 1.0.0 in index.rst (#28149)
TomAugspurger Aug 26, 2019
294a22c
BUG: Fix groupby quantile array (#28113)
TomAugspurger Aug 26, 2019
ddfc9a2
TYPING: --disallow-any-expr for HTMLFormatter.__init__ (#28140)
simonjayhawkins Aug 26, 2019
3577746
CLN: small ops optimizations (#28036)
jbrockmendel Aug 26, 2019
49d2019
CLN: internals.blocks cleanup, typing (#27941)
jbrockmendel Aug 26, 2019
041b6b1
Replace with nested dict raises for overlapping keys (#27696)
charlesdong1991 Aug 27, 2019
bd8dbf9
TYPING: --check-untyped-defs util._decorators (#28128)
simonjayhawkins Aug 27, 2019
080d57e
CLN: Use ABC classes for isinstance checks, remove unnecessary import…
addisonlynch Aug 27, 2019
d91ffa6
TYPING: change to FrameOrSeries Alias in pandas._typing (#28173)
simonjayhawkins Aug 27, 2019
612d3b2
Solving GL01,GL02 in pandas.Interval and a few mentioned in the comme…
killerontherun1 Aug 28, 2019
bc65fe6
Fix slicer assignment bug (#28131)
RoeiRaz Aug 28, 2019
2518040
STY: whitespace before class docstringsd (#28209)
jbrockmendel Aug 29, 2019
5f34933
DOC: Example for adding a calculated column in SQL and Pandas (#28182)
DavidRosen Aug 29, 2019
03b3c8f
CLN: minor typos MutliIndex -> MultiIndex (#28223)
simonjayhawkins Aug 29, 2019
d9b3993
reduction-> libreduction for grepability (#28184)
jbrockmendel Aug 30, 2019
82a7455
REGR: Fix to_csv with IntervalIndex (#28229)
jschendel Aug 30, 2019
7b25463
BUG: Multiple lambdas in named aggregation (#27921)
charlesdong1991 Aug 30, 2019
51db82d
PERF: lazify pytz seqToRE call, trims 35ms from import (#28228)
jbrockmendel Aug 30, 2019
75c9783
STYLE: run pre-commit filters on the repo (#27915)
basnijholt Aug 30, 2019
fadb271
REGR: <th> tags for notebook display closes #28204 (#28216)
simonjayhawkins Aug 30, 2019
cad3918
Fix read of py27 pytables tz attribute, gh#26443 (#28221)
quintusdias Aug 30, 2019
621ad9d
DOC: Document existing functionality of pandas.DataFrame.to_sql() #11…
oguzhanogreden Aug 30, 2019
bfdbebe
CLN: catch less inside try/except (#28203)
jbrockmendel Aug 30, 2019
f8a924b
DOC: fix DatetimeIndex.tz_localize doc string example (#28237)
wholmgren Aug 30, 2019
850e315
Adding updates
Sep 2, 2019
8d2547a
BUG: Fix numpy boolean subtraction error in Series.diff (#27755)
Sep 2, 2019
e6f1890
Merge branch 'patch-2' of https://github.com/Unprocessable/pandas int…
Sep 2, 2019
3231d8f
Resolved merge conflict added changes to older whatsnew.
Sep 2, 2019
5530d5c
Update v0.25.1.rst
Unprocessable Sep 2, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pandas/core/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -1933,6 +1933,7 @@ def diff(arr, n, axis=0):

elif is_bool_dtype(dtype):
dtype = np.object_
is_bool = True

elif is_integer_dtype(dtype):
dtype = np.float64
Expand Down Expand Up @@ -1972,6 +1973,8 @@ def diff(arr, n, axis=0):
result = res - lag
result[mask] = na
out_arr[res_indexer] = result
elif is_bool:
out_arr[res_indexer] = arr[res_indexer] ^ arr[lag_indexer]
else:
out_arr[res_indexer] = arr[res_indexer] - arr[lag_indexer]

Expand Down