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