Skip to content
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

BUG: fix Series(extension array) + extension array values addition #22479

Merged
merged 6 commits into from
Oct 3, 2018

Conversation

peterpanmj
Copy link
Contributor

@peterpanmj peterpanmj commented Aug 23, 2018

@peterpanmj
Copy link
Contributor Author

It is a simple fix, but not sure where to put additional tests.

@jorisvandenbossche jorisvandenbossche changed the title BUG: extension array add values of itself cause cause runtime excepti… BUG: fix Series(extension array) + extension array values addition Aug 23, 2018
@jorisvandenbossche
Copy link
Member

It is a simple fix, but not sure where to put additional tests.

I would look in pandas/tests/extension/base/ops.py, there is a test_arith_series_with_array that tests Series + Series, you could add in that test to do a Series + array (with a similar self.check_opname call). But make sure you also test that it actually fails without your fix.

@jorisvandenbossche jorisvandenbossche added Bug ExtensionArray Extending pandas with custom dtypes or arrays. labels Aug 23, 2018
@jorisvandenbossche jorisvandenbossche added this to the 0.24.0 milestone Aug 23, 2018
@codecov
Copy link

codecov bot commented Aug 23, 2018

Codecov Report

Merging #22479 into master will not change coverage.
The diff coverage is 0%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #22479   +/-   ##
=======================================
  Coverage   92.04%   92.04%           
=======================================
  Files         169      169           
  Lines       50740    50740           
=======================================
  Hits        46705    46705           
  Misses       4035     4035
Flag Coverage Δ
#multiple 90.45% <0%> (ø) ⬆️
#single 42.24% <0%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/core/ops.py 96.71% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2be2ba5...7e3b219. Read the comment docs.

@peterpanmj
Copy link
Contributor Author

pandas/tests/extension/base/ops.py Can not be discovered by pytest. How to test it ? @jorisvandenbossche

@jorisvandenbossche
Copy link
Member

@peterpanmj the actual tests are in one directory up (they inherit from those base classes), so if you do pytest pandas/tests/extension, they should all be run.

@jreback
Copy link
Contributor

jreback commented Sep 15, 2018

can you update

@pep8speaks
Copy link

Hello @peterpanmj! Thanks for updating the PR.

@peterpanmj peterpanmj force-pushed the ops_new_right branch 2 times, most recently from 327cd9e to 05be784 Compare September 17, 2018 06:50
@peterpanmj
Copy link
Contributor Author

I will compose a test shortly @jreback

@peterpanmj peterpanmj force-pushed the ops_new_right branch 2 times, most recently from b1b5304 to 2ee5b34 Compare September 18, 2018 11:12
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add this issue number onto the IntegerArray whatsnew section

@@ -587,6 +587,13 @@ def test_cross_type_arithmetic():
tm.assert_series_equal(result, expected)


def test_arith_extension_array_values():
s = pd.Series([1, 2, 3], dtype='Int64')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add the issue as a comment

@codecov
Copy link

codecov bot commented Sep 19, 2018

Codecov Report

Merging #22479 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #22479      +/-   ##
==========================================
+ Coverage   92.18%   92.19%   +<.01%     
==========================================
  Files         169      169              
  Lines       50833    50830       -3     
==========================================
- Hits        46862    46861       -1     
+ Misses       3971     3969       -2
Flag Coverage Δ
#multiple 90.6% <100%> (ø) ⬆️
#single 42.37% <0%> (+0.01%) ⬆️
Impacted Files Coverage Δ
pandas/core/ops.py 97.51% <100%> (+0.09%) ⬆️
pandas/core/indexes/period.py 93.48% <0%> (-0.18%) ⬇️
pandas/core/indexes/datetimes.py 95.66% <0%> (-0.12%) ⬇️
pandas/core/indexes/base.py 96.39% <0%> (-0.11%) ⬇️
pandas/core/indexes/datetimelike.py 98.1% <0%> (-0.02%) ⬇️
pandas/core/panel.py 97.89% <0%> (-0.02%) ⬇️
pandas/core/sparse/series.py 95.22% <0%> (-0.02%) ⬇️
pandas/core/series.py 93.74% <0%> (-0.01%) ⬇️
pandas/core/frame.py 97.2% <0%> (-0.01%) ⬇️
pandas/core/indexes/multi.py 95.45% <0%> (-0.01%) ⬇️
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b0f9a10...7efeed8. Read the comment docs.

@codecov
Copy link

codecov bot commented Sep 19, 2018

Codecov Report

Merging #22479 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #22479      +/-   ##
==========================================
+ Coverage   92.17%   92.17%   +<.01%     
==========================================
  Files         169      169              
  Lines       50721    50721              
==========================================
+ Hits        46750    46751       +1     
+ Misses       3971     3970       -1
Flag Coverage Δ
#multiple 90.58% <100%> (ø) ⬆️
#single 42.34% <0%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/core/ops.py 97.07% <100%> (+0.13%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 249f0ee...4eb9321. Read the comment docs.

@peterpanmj
Copy link
Contributor Author

@jreback Any thing I need to change ?

@@ -493,6 +493,7 @@ ExtensionType Changes
- :meth:`Series.combine()` with scalar argument now works for any function type (:issue:`21248`)
- :meth:`Series.astype` and :meth:`DataFrame.astype` now dispatch to :meth:`ExtensionArray.astype` (:issue:`21185:`).
- Added :meth:`pandas.api.types.register_extension_dtype` to register an extension type with pandas (:issue:`22664`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

W can remove this I think... integerArray is new in 0.24

Copy link
Contributor

@TomAugspurger TomAugspurger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jreback is there an issue for not listifying right? That seems unnecessary when new_left and right are both EAs of the same type.

@jreback
Copy link
Contributor

jreback commented Sep 30, 2018

u can add this issue number to the integer_array whatsnew

@TomAugspurger
Copy link
Contributor

TomAugspurger commented Sep 30, 2018 via email

@jreback
Copy link
Contributor

jreback commented Sep 30, 2018

that’s not the point
it provides a reference to all issues with this feature

just add the number (on the existing note)

@TomAugspurger
Copy link
Contributor

Sorry I don't see the need. If this bug hadn't been there when you wrote IntegerArray, would you have made a note saying that ops between Series[IntegerArray] and IntegeryArray works? I don't see why we should distract readers going through the release notes with the fact that this was implemented across two PRs.

@jreback
Copy link
Contributor

jreback commented Sep 30, 2018

i think u have missed my point

we list all issues that are relevent if possible . all u do is add it to the list of issues. no extra note is necessary.

the problem with ignoring it is if you only look at the listed issues you will miss things. it’s irrelevant whether it’s a bug or additional features. it’s all a part of the single what’s new note.

this has been practice for many years

this way you have a complete record of what has changed.

@peterpanmj
Copy link
Contributor Author

How about we leave the bug there in 0.24 . Fix it later in 0.24.1 and update the whatsnew then.

@@ -587,6 +587,14 @@ def test_cross_type_arithmetic():
tm.assert_series_equal(result, expected)


def test_arith_extension_array_values():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move the test to pandas/tests/extension/base/ops.py, as this is not a specific failure for IntegerArray, it is relevant for all extension types.

@jorisvandenbossche
Copy link
Member

How about we leave the bug there in 0.24 . Fix it later in 0.24.1 and update the whatsnew then.

No, we certainly want to get this fixed in master / in the first coming release.


I agree with Tom, this is something that only failed in master, for a new feature that doesn't exist in 0.23. So no whatsnew note is needed, and adding the issue number there only adds noise IMO. If it would have been another issue that already existed before that was also resolved by the same fix, yes, then it would be good to list the issue number in the whatsnew.

(but let's further discuss this on gitter / mail to not bother this PR?)


@jreback is there an issue for not listifying right? That seems unnecessary when new_left and right are both EAs of the same type.

I didn't find one. Opened #22922

@@ -143,6 +143,12 @@ def test_error(self, data, all_arithmetic_operators):
# other specific errors tested in the integer array specific tests
pass

@pytest.mark.xfail(reason="EA is listified. GH-22922", strict=True)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, here's what's happening for IntegerArray with missing values,

Because of #22922, the ExtensionArray is listified, so we do IntegerArray + List. Then, in IntegerArray.__add__ we do np.asarray(other). Since we have missing values, we naturally end up with a float ndarray.

Fixing #22922 will fix this specific issue, but doesn't handle the general problem of IntegerArray + List. i.e. is this a bug?

In [3]: arr = pd.Series([1, None, 3], dtype='Int8').values

In [4]: arr
Out[4]: IntegerArray([1, nan, 3], dtype='Int8')

In [5]: arr + list(arr)
Out[5]: array([ 2., nan,  6.])

Should Out[5] be an IntegerArray([2, nan, 6], dtype='Int8')? If so, I'll open a new issue.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes i think you are right

not sure this is hitting the right path

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TomAugspurger
Copy link
Contributor

Note that this is still tested via decimal.

Copy link
Contributor

@TomAugspurger TomAugspurger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No new CI failures (just s3 and numpydev, which I'm hoping to resolve tomorrow).

@jorisvandenbossche jorisvandenbossche merged commit 03181f0 into pandas-dev:master Oct 3, 2018
@jorisvandenbossche
Copy link
Member

Thanks @peterpanmj and @TomAugspurger !

@jreback
Copy link
Contributor

jreback commented Oct 3, 2018

this was not fully reviewed

need tests for the reverse op as well, eg

data + series

ideally we would test using the fixture for all ops as well

@TomAugspurger
Copy link
Contributor

@jreback can you open a new issue with specifics?

need tests for the reverse op as well, eg

That hits a different code path, so would be a different bug if it doesn't work (what's the expected result? Right now IntegerArray + Series[IntegerArray] returns an IntegerArray)

ideally we would test using the fixture for all ops as well

I meant to include a note with my push, but was distracted by the float array issue. In this case, I opted for a simpler test that didn't include all the indirection of _check_op_name. This test was about covering our dispatching, so just the add is sufficient.

@jorisvandenbossche
Copy link
Member

what's the expected result? Right now IntegerArray + Series[IntegerArray] returns an IntegerArray

That should be a Series instead IMO (that's what we do with Series/array as well, and Series is "higher in the hierarchy")

@TomAugspurger
Copy link
Contributor

TomAugspurger commented Oct 3, 2018 via email

TomAugspurger added a commit to TomAugspurger/pandas that referenced this pull request Oct 9, 2018
commit 11a0d93
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 14:26:34 2018 -0500

    typerror

commit a0cd5e7
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 14:25:38 2018 -0500

    TypeError for Series

commit 2247461
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:29:29 2018 -0500

    Test op(Series[EA], EA])

commit c9fe5d3
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:21:33 2018 -0500

    make strict

commit 7ef697c
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:14:52 2018 -0500

    Use super

commit 35d4213
Merge: 0671e7d ee80803
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:11:05 2018 -0500

    Merge remote-tracking branch 'upstream/master' into ea-divmod

commit ee80803
Author: Matthew Roeschke <[email protected]>
Date:   Wed Oct 3 08:25:44 2018 -0700

     BUG: Correctly weekly resample over DST (pandas-dev#22941)

    * test resample fix

    * move the localization until needed

    * BUG: Correctly weekly resample over DST

    * Move whatsnew to new section

commit fea27f0
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 08:49:44 2018 -0500

    CI: pin moto to 1.3.4 (pandas-dev#22959)

commit 15d32bb
Author: jbrockmendel <[email protected]>
Date:   Wed Oct 3 04:32:35 2018 -0700

    [CLN] Dispatch (some) Frame ops to Series, avoiding _data.eval (pandas-dev#22019)

    * avoid casting to object dtype in mixed-type frames

    * Dispatch to Series ops in _combine_match_columns

    * comment

    * docstring

    * flake8 fixup

    * dont bother with try_cast_result

    * revert non-central change

    * simplify

    * revert try_cast_results

    * revert non-central changes

    * Fixup typo syntaxerror

    * simplify assertion

    * use dispatch_to_series in combine_match_columns

    * Pass unwrapped op where appropriate

    * catch correct error

    * whatsnew note

    * comment

    * whatsnew section

    * remove unnecessary tester

    * doc fixup

commit 3e3256b
Author: alimcmaster1 <[email protected]>
Date:   Wed Oct 3 12:23:22 2018 +0100

    Allow passing a mask to NanOps (pandas-dev#22865)

commit e756e99
Author: jbrockmendel <[email protected]>
Date:   Wed Oct 3 02:19:27 2018 -0700

    CLN: Use is_period_dtype instead of ABCPeriodIndex checks (pandas-dev#22958)

commit 03181f0
Author: Wenhuan <[email protected]>
Date:   Wed Oct 3 15:28:07 2018 +0800

    BUG: fix Series(extension array) + extension array values addition (pandas-dev#22479)

commit 04ea51d
Author: Joris Van den Bossche <[email protected]>
Date:   Wed Oct 3 09:24:36 2018 +0200

    CLN: small clean-up of IntervalIndex (pandas-dev#22956)

commit b0f9a10
Author: Tony Tao <[email protected]>
Date:   Tue Oct 2 19:01:08 2018 -0500

    DOC GH22893 Fix docstring of groupby in pandas/core/generic.py (pandas-dev#22920)

commit 08ecba8
Author: jbrockmendel <[email protected]>
Date:   Tue Oct 2 14:22:53 2018 -0700

    BUG: fix DataFrame+DataFrame op with timedelta64 dtype (pandas-dev#22696)

commit c44bad2
Author: Pamela Wu <[email protected]>
Date:   Tue Oct 2 17:16:25 2018 -0400

    CLN GH22873 Replace base excepts in pandas/core (pandas-dev#22901)

commit 8e749a3
Author: Pamela Wu <[email protected]>
Date:   Tue Oct 2 17:14:48 2018 -0400

    CLN GH22874 replace bare excepts in pandas/io/pytables.py (pandas-dev#22919)

commit 1102a33
Author: Joris Van den Bossche <[email protected]>
Date:   Tue Oct 2 22:31:36 2018 +0200

    DOC/CLN: clean-up shared_docs in generic.py (pandas-dev#20074)

commit 9caf048
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 13:25:22 2018 -0500

    CI: change windows vm image (pandas-dev#22948)

commit 0671e7d
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:10:42 2018 -0500

    Fixup

commit 1b4261f
Merge: c92a4a8 1d9f76c
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 10:58:43 2018 -0500

    Merge remote-tracking branch 'upstream/master' into ea-divmod

commit 1d9f76c
Author: Joris Van den Bossche <[email protected]>
Date:   Tue Oct 2 17:11:11 2018 +0200

    CLN: remove Index._to_embed (pandas-dev#22879)

    * CLN: remove Index._to_embed

    * pep8

commit 6247da0
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 08:50:41 2018 -0500

    Provide default implementation for `data_repated` (pandas-dev#22935)

commit c92a4a8
Author: Tom Augspurger <[email protected]>
Date:   Mon Oct 1 16:56:15 2018 -0500

    Update old test

commit 52538fa
Author: Tom Augspurger <[email protected]>
Date:   Mon Oct 1 16:51:48 2018 -0500

    BUG: divmod return type

commit 5ce06b5
Author: Matthew Roeschke <[email protected]>
Date:   Mon Oct 1 14:22:20 2018 -0700

     BUG: to_datetime preserves name of Index argument in the result (pandas-dev#22918)

    * BUG: to_datetime preserves name of Index argument in the result

    * correct test
TomAugspurger added a commit to TomAugspurger/pandas that referenced this pull request Oct 9, 2018
commit 7714e79
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 10:13:06 2018 -0500

    Always return ndarray

commit 1921c6f
Merge: 01f7366 fea27f0
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 09:50:30 2018 -0500

    Merge remote-tracking branch 'upstream/master' into combine-exception

commit fea27f0
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 08:49:44 2018 -0500

    CI: pin moto to 1.3.4 (pandas-dev#22959)

commit 15d32bb
Author: jbrockmendel <[email protected]>
Date:   Wed Oct 3 04:32:35 2018 -0700

    [CLN] Dispatch (some) Frame ops to Series, avoiding _data.eval (pandas-dev#22019)

    * avoid casting to object dtype in mixed-type frames

    * Dispatch to Series ops in _combine_match_columns

    * comment

    * docstring

    * flake8 fixup

    * dont bother with try_cast_result

    * revert non-central change

    * simplify

    * revert try_cast_results

    * revert non-central changes

    * Fixup typo syntaxerror

    * simplify assertion

    * use dispatch_to_series in combine_match_columns

    * Pass unwrapped op where appropriate

    * catch correct error

    * whatsnew note

    * comment

    * whatsnew section

    * remove unnecessary tester

    * doc fixup

commit 3e3256b
Author: alimcmaster1 <[email protected]>
Date:   Wed Oct 3 12:23:22 2018 +0100

    Allow passing a mask to NanOps (pandas-dev#22865)

commit e756e99
Author: jbrockmendel <[email protected]>
Date:   Wed Oct 3 02:19:27 2018 -0700

    CLN: Use is_period_dtype instead of ABCPeriodIndex checks (pandas-dev#22958)

commit 03181f0
Author: Wenhuan <[email protected]>
Date:   Wed Oct 3 15:28:07 2018 +0800

    BUG: fix Series(extension array) + extension array values addition (pandas-dev#22479)

commit 04ea51d
Author: Joris Van den Bossche <[email protected]>
Date:   Wed Oct 3 09:24:36 2018 +0200

    CLN: small clean-up of IntervalIndex (pandas-dev#22956)

commit b0f9a10
Author: Tony Tao <[email protected]>
Date:   Tue Oct 2 19:01:08 2018 -0500

    DOC GH22893 Fix docstring of groupby in pandas/core/generic.py (pandas-dev#22920)

commit 08ecba8
Author: jbrockmendel <[email protected]>
Date:   Tue Oct 2 14:22:53 2018 -0700

    BUG: fix DataFrame+DataFrame op with timedelta64 dtype (pandas-dev#22696)

commit c44bad2
Author: Pamela Wu <[email protected]>
Date:   Tue Oct 2 17:16:25 2018 -0400

    CLN GH22873 Replace base excepts in pandas/core (pandas-dev#22901)

commit 8e749a3
Author: Pamela Wu <[email protected]>
Date:   Tue Oct 2 17:14:48 2018 -0400

    CLN GH22874 replace bare excepts in pandas/io/pytables.py (pandas-dev#22919)

commit 1102a33
Author: Joris Van den Bossche <[email protected]>
Date:   Tue Oct 2 22:31:36 2018 +0200

    DOC/CLN: clean-up shared_docs in generic.py (pandas-dev#20074)

commit 01f7366
Merge: 5372134 9caf048
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 13:50:28 2018 -0500

    Merge remote-tracking branch 'upstream/master' into combine-exception

commit 9caf048
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 13:25:22 2018 -0500

    CI: change windows vm image (pandas-dev#22948)

commit 5372134
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:35:07 2018 -0500

    fixed move

commit ce1a3c6
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:32:11 2018 -0500

    fixed move

commit b9c7e4b
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:28:57 2018 -0500

    remove old note

commit a4a2933
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:24:48 2018 -0500

    handle test

commit be63feb
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:19:17 2018 -0500

    move test

commit 0eef0cf
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:18:18 2018 -0500

    move back

commit 2183f7b
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:17:28 2018 -0500

    api

commit 85fc5d8
Merge: 9059c0d 1d9f76c
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:15:52 2018 -0500

    Merge remote-tracking branch 'upstream/master' into combine-exception

commit 1d9f76c
Author: Joris Van den Bossche <[email protected]>
Date:   Tue Oct 2 17:11:11 2018 +0200

    CLN: remove Index._to_embed (pandas-dev#22879)

    * CLN: remove Index._to_embed

    * pep8

commit 6247da0
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 08:50:41 2018 -0500

    Provide default implementation for `data_repated` (pandas-dev#22935)

commit 9059c0d
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 06:33:15 2018 -0500

    Note

commit 0c53f08
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 06:30:54 2018 -0500

    Imports

commit ce94bf9
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 06:28:16 2018 -0500

    Moves

commit fdd43c4
Author: Tom Augspurger <[email protected]>
Date:   Mon Oct 1 21:26:09 2018 -0500

    Closes pandas-dev#22850

commit 5ce06b5
Author: Matthew Roeschke <[email protected]>
Date:   Mon Oct 1 14:22:20 2018 -0700

     BUG: to_datetime preserves name of Index argument in the result (pandas-dev#22918)

    * BUG: to_datetime preserves name of Index argument in the result

    * correct test
jreback pushed a commit that referenced this pull request Oct 25, 2018
* WIP: PeriodArray

* WIP

* remove debug

* Just moves

* PeriodArray.shift definition

* _data type

* clean

* accessor wip

* some more wip

* tshift, shift

* Arithmetic

* repr changes

* wip

* freq setter

* Added disabled ops

* copy

* Support concat

* object ctor

* Updates

* lint

* lint

* wip

* more wip

* array-setitem

* wip

* wip

* Use ._tshift internally for datetimelike ops

In preperation for PeriodArray / DatetimeArray / TimedeltaArray.

Index.shift has a different meaning from ExtensionArray.shift.

- Index.shift pointwise shifts each element by some amount
- ExtensionArray.shift shits the *position* of each value in the array
  padding the end with NA

This is going to get confusing. This PR tries to avoid some of that by
internally using a new `_tshift` method (time-shift) when we want to do pointwise
shifting of each value. Places that know they want that behavior (like in the
datetimelike ops) should use that.

* deep

* Squashed commit of the following:

commit 23e5cfc
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 13:10:41 2018 -0500

    Use ._tshift internally for datetimelike ops

    In preperation for PeriodArray / DatetimeArray / TimedeltaArray.

    Index.shift has a different meaning from ExtensionArray.shift.

    - Index.shift pointwise shifts each element by some amount
    - ExtensionArray.shift shits the *position* of each value in the array
      padding the end with NA

    This is going to get confusing. This PR tries to avoid some of that by
    internally using a new `_tshift` method (time-shift) when we want to do pointwise
    shifting of each value. Places that know they want that behavior (like in the
    datetimelike ops) should use that.

commit 1d9f76c
Author: Joris Van den Bossche <[email protected]>
Date:   Tue Oct 2 17:11:11 2018 +0200

    CLN: remove Index._to_embed (#22879)

    * CLN: remove Index._to_embed

    * pep8

commit 6247da0
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 08:50:41 2018 -0500

    Provide default implementation for `data_repated` (#22935)

commit 5ce06b5
Author: Matthew Roeschke <[email protected]>
Date:   Mon Oct 1 14:22:20 2018 -0700

     BUG: to_datetime preserves name of Index argument in the result (#22918)

    * BUG: to_datetime preserves name of Index argument in the result

    * correct test

* Squashed commit of the following:

commit bccfc3f
Merge: d65980e 9caf048
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 13:47:48 2018 -0500

    Merge remote-tracking branch 'upstream/master' into period-dtype-type

commit 9caf048
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 13:25:22 2018 -0500

    CI: change windows vm image (#22948)

commit d65980e
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:46:38 2018 -0500

    typo

commit e5c61fc
Merge: d7a8e1b 1d9f76c
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 10:57:59 2018 -0500

    Merge remote-tracking branch 'upstream/master' into period-dtype-type

commit d7a8e1b
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 10:57:56 2018 -0500

    Fixed

commit 598cc62
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 10:32:22 2018 -0500

    doc note

commit 83db05c
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 10:28:52 2018 -0500

    updates

commit 1d9f76c
Author: Joris Van den Bossche <[email protected]>
Date:   Tue Oct 2 17:11:11 2018 +0200

    CLN: remove Index._to_embed (#22879)

    * CLN: remove Index._to_embed

    * pep8

commit 6247da0
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 08:50:41 2018 -0500

    Provide default implementation for `data_repated` (#22935)

commit f07ab80
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 06:22:27 2018 -0500

    str, bytes

commit 8a8bdb0
Author: Tom Augspurger <[email protected]>
Date:   Mon Oct 1 21:40:59 2018 -0500

    import at top

commit 99bafdd
Author: Tom Augspurger <[email protected]>
Date:   Mon Oct 1 21:38:12 2018 -0500

    Update type for PeriodDtype

    Removed unused IntervalDtypeType

commit 5ce06b5
Author: Matthew Roeschke <[email protected]>
Date:   Mon Oct 1 14:22:20 2018 -0700

     BUG: to_datetime preserves name of Index argument in the result (#22918)

    * BUG: to_datetime preserves name of Index argument in the result

    * correct test

* fixup

* The rest of the EA tests

* docs

* rename to time_shift

* Squashed commit of the following:

commit 11a0d93
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 14:26:34 2018 -0500

    typerror

commit a0cd5e7
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 14:25:38 2018 -0500

    TypeError for Series

commit 2247461
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:29:29 2018 -0500

    Test op(Series[EA], EA])

commit c9fe5d3
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:21:33 2018 -0500

    make strict

commit 7ef697c
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:14:52 2018 -0500

    Use super

commit 35d4213
Merge: 0671e7d ee80803
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:11:05 2018 -0500

    Merge remote-tracking branch 'upstream/master' into ea-divmod

commit ee80803
Author: Matthew Roeschke <[email protected]>
Date:   Wed Oct 3 08:25:44 2018 -0700

     BUG: Correctly weekly resample over DST (#22941)

    * test resample fix

    * move the localization until needed

    * BUG: Correctly weekly resample over DST

    * Move whatsnew to new section

commit fea27f0
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 08:49:44 2018 -0500

    CI: pin moto to 1.3.4 (#22959)

commit 15d32bb
Author: jbrockmendel <[email protected]>
Date:   Wed Oct 3 04:32:35 2018 -0700

    [CLN] Dispatch (some) Frame ops to Series, avoiding _data.eval (#22019)

    * avoid casting to object dtype in mixed-type frames

    * Dispatch to Series ops in _combine_match_columns

    * comment

    * docstring

    * flake8 fixup

    * dont bother with try_cast_result

    * revert non-central change

    * simplify

    * revert try_cast_results

    * revert non-central changes

    * Fixup typo syntaxerror

    * simplify assertion

    * use dispatch_to_series in combine_match_columns

    * Pass unwrapped op where appropriate

    * catch correct error

    * whatsnew note

    * comment

    * whatsnew section

    * remove unnecessary tester

    * doc fixup

commit 3e3256b
Author: alimcmaster1 <[email protected]>
Date:   Wed Oct 3 12:23:22 2018 +0100

    Allow passing a mask to NanOps (#22865)

commit e756e99
Author: jbrockmendel <[email protected]>
Date:   Wed Oct 3 02:19:27 2018 -0700

    CLN: Use is_period_dtype instead of ABCPeriodIndex checks (#22958)

commit 03181f0
Author: Wenhuan <[email protected]>
Date:   Wed Oct 3 15:28:07 2018 +0800

    BUG: fix Series(extension array) + extension array values addition (#22479)

commit 04ea51d
Author: Joris Van den Bossche <[email protected]>
Date:   Wed Oct 3 09:24:36 2018 +0200

    CLN: small clean-up of IntervalIndex (#22956)

commit b0f9a10
Author: Tony Tao <[email protected]>
Date:   Tue Oct 2 19:01:08 2018 -0500

    DOC GH22893 Fix docstring of groupby in pandas/core/generic.py (#22920)

commit 08ecba8
Author: jbrockmendel <[email protected]>
Date:   Tue Oct 2 14:22:53 2018 -0700

    BUG: fix DataFrame+DataFrame op with timedelta64 dtype (#22696)

commit c44bad2
Author: Pamela Wu <[email protected]>
Date:   Tue Oct 2 17:16:25 2018 -0400

    CLN GH22873 Replace base excepts in pandas/core (#22901)

commit 8e749a3
Author: Pamela Wu <[email protected]>
Date:   Tue Oct 2 17:14:48 2018 -0400

    CLN GH22874 replace bare excepts in pandas/io/pytables.py (#22919)

commit 1102a33
Author: Joris Van den Bossche <[email protected]>
Date:   Tue Oct 2 22:31:36 2018 +0200

    DOC/CLN: clean-up shared_docs in generic.py (#20074)

commit 9caf048
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 13:25:22 2018 -0500

    CI: change windows vm image (#22948)

commit 0671e7d
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:10:42 2018 -0500

    Fixup

commit 1b4261f
Merge: c92a4a8 1d9f76c
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 10:58:43 2018 -0500

    Merge remote-tracking branch 'upstream/master' into ea-divmod

commit 1d9f76c
Author: Joris Van den Bossche <[email protected]>
Date:   Tue Oct 2 17:11:11 2018 +0200

    CLN: remove Index._to_embed (#22879)

    * CLN: remove Index._to_embed

    * pep8

commit 6247da0
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 08:50:41 2018 -0500

    Provide default implementation for `data_repated` (#22935)

commit c92a4a8
Author: Tom Augspurger <[email protected]>
Date:   Mon Oct 1 16:56:15 2018 -0500

    Update old test

commit 52538fa
Author: Tom Augspurger <[email protected]>
Date:   Mon Oct 1 16:51:48 2018 -0500

    BUG: divmod return type

commit 5ce06b5
Author: Matthew Roeschke <[email protected]>
Date:   Mon Oct 1 14:22:20 2018 -0700

     BUG: to_datetime preserves name of Index argument in the result (#22918)

    * BUG: to_datetime preserves name of Index argument in the result

    * correct test

* Squashed commit of the following:

commit 7714e79
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 10:13:06 2018 -0500

    Always return ndarray

commit 1921c6f
Merge: 01f7366 fea27f0
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 09:50:30 2018 -0500

    Merge remote-tracking branch 'upstream/master' into combine-exception

commit fea27f0
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 08:49:44 2018 -0500

    CI: pin moto to 1.3.4 (#22959)

commit 15d32bb
Author: jbrockmendel <[email protected]>
Date:   Wed Oct 3 04:32:35 2018 -0700

    [CLN] Dispatch (some) Frame ops to Series, avoiding _data.eval (#22019)

    * avoid casting to object dtype in mixed-type frames

    * Dispatch to Series ops in _combine_match_columns

    * comment

    * docstring

    * flake8 fixup

    * dont bother with try_cast_result

    * revert non-central change

    * simplify

    * revert try_cast_results

    * revert non-central changes

    * Fixup typo syntaxerror

    * simplify assertion

    * use dispatch_to_series in combine_match_columns

    * Pass unwrapped op where appropriate

    * catch correct error

    * whatsnew note

    * comment

    * whatsnew section

    * remove unnecessary tester

    * doc fixup

commit 3e3256b
Author: alimcmaster1 <[email protected]>
Date:   Wed Oct 3 12:23:22 2018 +0100

    Allow passing a mask to NanOps (#22865)

commit e756e99
Author: jbrockmendel <[email protected]>
Date:   Wed Oct 3 02:19:27 2018 -0700

    CLN: Use is_period_dtype instead of ABCPeriodIndex checks (#22958)

commit 03181f0
Author: Wenhuan <[email protected]>
Date:   Wed Oct 3 15:28:07 2018 +0800

    BUG: fix Series(extension array) + extension array values addition (#22479)

commit 04ea51d
Author: Joris Van den Bossche <[email protected]>
Date:   Wed Oct 3 09:24:36 2018 +0200

    CLN: small clean-up of IntervalIndex (#22956)

commit b0f9a10
Author: Tony Tao <[email protected]>
Date:   Tue Oct 2 19:01:08 2018 -0500

    DOC GH22893 Fix docstring of groupby in pandas/core/generic.py (#22920)

commit 08ecba8
Author: jbrockmendel <[email protected]>
Date:   Tue Oct 2 14:22:53 2018 -0700

    BUG: fix DataFrame+DataFrame op with timedelta64 dtype (#22696)

commit c44bad2
Author: Pamela Wu <[email protected]>
Date:   Tue Oct 2 17:16:25 2018 -0400

    CLN GH22873 Replace base excepts in pandas/core (#22901)

commit 8e749a3
Author: Pamela Wu <[email protected]>
Date:   Tue Oct 2 17:14:48 2018 -0400

    CLN GH22874 replace bare excepts in pandas/io/pytables.py (#22919)

commit 1102a33
Author: Joris Van den Bossche <[email protected]>
Date:   Tue Oct 2 22:31:36 2018 +0200

    DOC/CLN: clean-up shared_docs in generic.py (#20074)

commit 01f7366
Merge: 5372134 9caf048
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 13:50:28 2018 -0500

    Merge remote-tracking branch 'upstream/master' into combine-exception

commit 9caf048
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 13:25:22 2018 -0500

    CI: change windows vm image (#22948)

commit 5372134
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:35:07 2018 -0500

    fixed move

commit ce1a3c6
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:32:11 2018 -0500

    fixed move

commit b9c7e4b
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:28:57 2018 -0500

    remove old note

commit a4a2933
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:24:48 2018 -0500

    handle test

commit be63feb
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:19:17 2018 -0500

    move test

commit 0eef0cf
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:18:18 2018 -0500

    move back

commit 2183f7b
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:17:28 2018 -0500

    api

commit 85fc5d8
Merge: 9059c0d 1d9f76c
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:15:52 2018 -0500

    Merge remote-tracking branch 'upstream/master' into combine-exception

commit 1d9f76c
Author: Joris Van den Bossche <[email protected]>
Date:   Tue Oct 2 17:11:11 2018 +0200

    CLN: remove Index._to_embed (#22879)

    * CLN: remove Index._to_embed

    * pep8

commit 6247da0
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 08:50:41 2018 -0500

    Provide default implementation for `data_repated` (#22935)

commit 9059c0d
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 06:33:15 2018 -0500

    Note

commit 0c53f08
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 06:30:54 2018 -0500

    Imports

commit ce94bf9
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 06:28:16 2018 -0500

    Moves

commit fdd43c4
Author: Tom Augspurger <[email protected]>
Date:   Mon Oct 1 21:26:09 2018 -0500

    Closes #22850

commit 5ce06b5
Author: Matthew Roeschke <[email protected]>
Date:   Mon Oct 1 14:22:20 2018 -0700

     BUG: to_datetime preserves name of Index argument in the result (#22918)

    * BUG: to_datetime preserves name of Index argument in the result

    * correct test

* Squashed commit of the following:

commit 11a0d93
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 14:26:34 2018 -0500

    typerror

commit a0cd5e7
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 14:25:38 2018 -0500

    TypeError for Series

commit 2247461
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:29:29 2018 -0500

    Test op(Series[EA], EA])

commit c9fe5d3
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:21:33 2018 -0500

    make strict

commit 7ef697c
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:14:52 2018 -0500

    Use super

commit 35d4213
Merge: 0671e7d ee80803
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:11:05 2018 -0500

    Merge remote-tracking branch 'upstream/master' into ea-divmod

commit 0671e7d
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:10:42 2018 -0500

    Fixup

commit 1b4261f
Merge: c92a4a8 1d9f76c
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 10:58:43 2018 -0500

    Merge remote-tracking branch 'upstream/master' into ea-divmod

commit c92a4a8
Author: Tom Augspurger <[email protected]>
Date:   Mon Oct 1 16:56:15 2018 -0500

    Update old test

commit 52538fa
Author: Tom Augspurger <[email protected]>
Date:   Mon Oct 1 16:51:48 2018 -0500

    BUG: divmod return type

* fixed merge conflict

* Handle divmod test

* extension tests passing

* Squashed commit of the following:

commit c9d6e89
Author: Tom Augspurger <[email protected]>
Date:   Thu Oct 4 08:34:22 2018 -0500

    xpass -> skip

commit 95d5cbf
Author: Tom Augspurger <[email protected]>
Date:   Thu Oct 4 08:22:17 2018 -0500

    typo, import

commit 4e9b7f0
Author: Tom Augspurger <[email protected]>
Date:   Thu Oct 4 08:18:40 2018 -0500

    doc update

commit cc2bfc8
Merge: 11a0d93 fe67b94
Author: Tom Augspurger <[email protected]>
Date:   Thu Oct 4 08:15:46 2018 -0500

    Merge remote-tracking branch 'upstream/master' into ea-divmod

commit fe67b94
Author: Tom Augspurger <[email protected]>
Date:   Thu Oct 4 06:55:09 2018 -0500

    Update type for PeriodDtype / DatetimeTZDtype / IntervalDtype (#22938)

commit b12e5ba
Author: Tom Augspurger <[email protected]>
Date:   Thu Oct 4 06:30:29 2018 -0500

    Safer is dtype (#22975)

commit c19c805
Author: Tom Augspurger <[email protected]>
Date:   Thu Oct 4 06:27:54 2018 -0500

    Catch Exception in combine (#22936)

commit d553ab3
Author: Anjali2019 <[email protected]>
Date:   Thu Oct 4 13:24:06 2018 +0200

    TST: Fixturize series/test_combine_concat.py (#22964)

commit 4c78b97
Author: Anjali2019 <[email protected]>
Date:   Thu Oct 4 13:23:39 2018 +0200

    TST: Fixturize series/test_constructors.py (#22965)

commit 45d3bb7
Author: Anjali2019 <[email protected]>
Date:   Thu Oct 4 13:23:20 2018 +0200

    TST: Fixturize series/test_datetime_values.py (#22966)

commit f1a22ff
Author: Anjali2019 <[email protected]>
Date:   Thu Oct 4 13:22:21 2018 +0200

    TST: Fixturize series/test_dtypes.py (#22967)

commit abf68fd
Author: Anjali2019 <[email protected]>
Date:   Thu Oct 4 13:21:45 2018 +0200

    TST: Fixturize series/test_io.py (#22972)

commit e6b0c29
Author: Anjali2019 <[email protected]>
Date:   Thu Oct 4 13:20:46 2018 +0200

    TST: Fixturize series/test_missing.py (#22973)

commit 9b405b8
Author: Joris Van den Bossche <[email protected]>
Date:   Thu Oct 4 13:16:28 2018 +0200

    CLN: values is required argument in _shallow_copy_with_infer (#22983)

commit c282e31
Author: h-vetinari <[email protected]>
Date:   Thu Oct 4 03:34:35 2018 +0200

    Fix ASV import error (#22978)

commit 11a0d93
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 14:26:34 2018 -0500

    typerror

commit a0cd5e7
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 14:25:38 2018 -0500

    TypeError for Series

commit 2247461
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:29:29 2018 -0500

    Test op(Series[EA], EA])

commit c9fe5d3
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:21:33 2018 -0500

    make strict

commit 7ef697c
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:14:52 2018 -0500

    Use super

commit 35d4213
Merge: 0671e7d ee80803
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:11:05 2018 -0500

    Merge remote-tracking branch 'upstream/master' into ea-divmod

commit 0671e7d
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:10:42 2018 -0500

    Fixup

commit 1b4261f
Merge: c92a4a8 1d9f76c
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 10:58:43 2018 -0500

    Merge remote-tracking branch 'upstream/master' into ea-divmod

commit c92a4a8
Author: Tom Augspurger <[email protected]>
Date:   Mon Oct 1 16:56:15 2018 -0500

    Update old test

commit 52538fa
Author: Tom Augspurger <[email protected]>
Date:   Mon Oct 1 16:51:48 2018 -0500

    BUG: divmod return type

* merge conflict

* wip

* indexes passing

* op names

* extension, arrays passing

* fixup

* lint

* Fixed to_timestamp

* Same error message for index, series

* Fix freq handling in to_timestamp

* dtype update

* accept kwargs

* fixups

* updates

* explicit

* add to assert

* wip period_array

* wip period_array

* order

* sort order

* test for hashing

* update

* lint

* boxing

* fix fixtures

* infer

* Remove seemingly unreachable code

* lint

* wip

* Updates for master

* simplify

* wip

* remove view

* simplify

* lint

* Removed add_comparison_methods

* xfail op

* remove some

* constructors

* Constructor cleanup

* misc fixups

* more xfails

* typo

* Added asi8

* Allow setting nan

* revert breaking docs

* Override _add_sub_int_array

* lint

* Update PeriodIndex._simple_new

* Clean up uses of .values, ._values, ._ndarray_values, ._data

* one more values

* remove xfails

* Fixed freq handling in _shallow_copy with a freq

* test updates

* API: Keep PeriodIndex.values an ndarray

* BUG: Raise for non-equal freq in take

* Punt on DataFrame.replace specializing

* lint

* fixed xfail message

* TST: _from_datetime64

* Fixups

- Perf in period_array
- pyarrow error
- py2 compat

* escape

* dtype

* revert and unxfail values

* error catching

* isort

* Avoid PeriodArray.values

* clarify _box_func usage

* TST: unxfail ops tests

* Avoid use of .values

* __setitem__ type

* Misc cleanups

* docstring on PeriodArray
* examples for period_array
* remove _box_values_as_index
* names
* object_dtype
* use __sub__

* lint

* API: remove ordinal from period_array

* catch exception

* misc cleanup

* Handle astype integer size

* Bump test coverage

* remove partial test

* close bracket

* change the test

* isort

* consistent _data

* lint

* ndarray_values -> asi8

* colocate ops

* refactor PeriodIndex.item

remove unused method

* return NotImplemented for Series / Index

* remove xpass

* release note

* types, use data

* remove ufunc xpass
tm9k1 pushed a commit to tm9k1/pandas that referenced this pull request Nov 19, 2018
* WIP: PeriodArray

* WIP

* remove debug

* Just moves

* PeriodArray.shift definition

* _data type

* clean

* accessor wip

* some more wip

* tshift, shift

* Arithmetic

* repr changes

* wip

* freq setter

* Added disabled ops

* copy

* Support concat

* object ctor

* Updates

* lint

* lint

* wip

* more wip

* array-setitem

* wip

* wip

* Use ._tshift internally for datetimelike ops

In preperation for PeriodArray / DatetimeArray / TimedeltaArray.

Index.shift has a different meaning from ExtensionArray.shift.

- Index.shift pointwise shifts each element by some amount
- ExtensionArray.shift shits the *position* of each value in the array
  padding the end with NA

This is going to get confusing. This PR tries to avoid some of that by
internally using a new `_tshift` method (time-shift) when we want to do pointwise
shifting of each value. Places that know they want that behavior (like in the
datetimelike ops) should use that.

* deep

* Squashed commit of the following:

commit 23e5cfc
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 13:10:41 2018 -0500

    Use ._tshift internally for datetimelike ops

    In preperation for PeriodArray / DatetimeArray / TimedeltaArray.

    Index.shift has a different meaning from ExtensionArray.shift.

    - Index.shift pointwise shifts each element by some amount
    - ExtensionArray.shift shits the *position* of each value in the array
      padding the end with NA

    This is going to get confusing. This PR tries to avoid some of that by
    internally using a new `_tshift` method (time-shift) when we want to do pointwise
    shifting of each value. Places that know they want that behavior (like in the
    datetimelike ops) should use that.

commit 1d9f76c
Author: Joris Van den Bossche <[email protected]>
Date:   Tue Oct 2 17:11:11 2018 +0200

    CLN: remove Index._to_embed (pandas-dev#22879)

    * CLN: remove Index._to_embed

    * pep8

commit 6247da0
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 08:50:41 2018 -0500

    Provide default implementation for `data_repated` (pandas-dev#22935)

commit 5ce06b5
Author: Matthew Roeschke <[email protected]>
Date:   Mon Oct 1 14:22:20 2018 -0700

     BUG: to_datetime preserves name of Index argument in the result (pandas-dev#22918)

    * BUG: to_datetime preserves name of Index argument in the result

    * correct test

* Squashed commit of the following:

commit bccfc3f
Merge: d65980e 9caf048
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 13:47:48 2018 -0500

    Merge remote-tracking branch 'upstream/master' into period-dtype-type

commit 9caf048
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 13:25:22 2018 -0500

    CI: change windows vm image (pandas-dev#22948)

commit d65980e
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:46:38 2018 -0500

    typo

commit e5c61fc
Merge: d7a8e1b 1d9f76c
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 10:57:59 2018 -0500

    Merge remote-tracking branch 'upstream/master' into period-dtype-type

commit d7a8e1b
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 10:57:56 2018 -0500

    Fixed

commit 598cc62
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 10:32:22 2018 -0500

    doc note

commit 83db05c
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 10:28:52 2018 -0500

    updates

commit 1d9f76c
Author: Joris Van den Bossche <[email protected]>
Date:   Tue Oct 2 17:11:11 2018 +0200

    CLN: remove Index._to_embed (pandas-dev#22879)

    * CLN: remove Index._to_embed

    * pep8

commit 6247da0
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 08:50:41 2018 -0500

    Provide default implementation for `data_repated` (pandas-dev#22935)

commit f07ab80
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 06:22:27 2018 -0500

    str, bytes

commit 8a8bdb0
Author: Tom Augspurger <[email protected]>
Date:   Mon Oct 1 21:40:59 2018 -0500

    import at top

commit 99bafdd
Author: Tom Augspurger <[email protected]>
Date:   Mon Oct 1 21:38:12 2018 -0500

    Update type for PeriodDtype

    Removed unused IntervalDtypeType

commit 5ce06b5
Author: Matthew Roeschke <[email protected]>
Date:   Mon Oct 1 14:22:20 2018 -0700

     BUG: to_datetime preserves name of Index argument in the result (pandas-dev#22918)

    * BUG: to_datetime preserves name of Index argument in the result

    * correct test

* fixup

* The rest of the EA tests

* docs

* rename to time_shift

* Squashed commit of the following:

commit 11a0d93
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 14:26:34 2018 -0500

    typerror

commit a0cd5e7
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 14:25:38 2018 -0500

    TypeError for Series

commit 2247461
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:29:29 2018 -0500

    Test op(Series[EA], EA])

commit c9fe5d3
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:21:33 2018 -0500

    make strict

commit 7ef697c
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:14:52 2018 -0500

    Use super

commit 35d4213
Merge: 0671e7d ee80803
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:11:05 2018 -0500

    Merge remote-tracking branch 'upstream/master' into ea-divmod

commit ee80803
Author: Matthew Roeschke <[email protected]>
Date:   Wed Oct 3 08:25:44 2018 -0700

     BUG: Correctly weekly resample over DST (pandas-dev#22941)

    * test resample fix

    * move the localization until needed

    * BUG: Correctly weekly resample over DST

    * Move whatsnew to new section

commit fea27f0
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 08:49:44 2018 -0500

    CI: pin moto to 1.3.4 (pandas-dev#22959)

commit 15d32bb
Author: jbrockmendel <[email protected]>
Date:   Wed Oct 3 04:32:35 2018 -0700

    [CLN] Dispatch (some) Frame ops to Series, avoiding _data.eval (pandas-dev#22019)

    * avoid casting to object dtype in mixed-type frames

    * Dispatch to Series ops in _combine_match_columns

    * comment

    * docstring

    * flake8 fixup

    * dont bother with try_cast_result

    * revert non-central change

    * simplify

    * revert try_cast_results

    * revert non-central changes

    * Fixup typo syntaxerror

    * simplify assertion

    * use dispatch_to_series in combine_match_columns

    * Pass unwrapped op where appropriate

    * catch correct error

    * whatsnew note

    * comment

    * whatsnew section

    * remove unnecessary tester

    * doc fixup

commit 3e3256b
Author: alimcmaster1 <[email protected]>
Date:   Wed Oct 3 12:23:22 2018 +0100

    Allow passing a mask to NanOps (pandas-dev#22865)

commit e756e99
Author: jbrockmendel <[email protected]>
Date:   Wed Oct 3 02:19:27 2018 -0700

    CLN: Use is_period_dtype instead of ABCPeriodIndex checks (pandas-dev#22958)

commit 03181f0
Author: Wenhuan <[email protected]>
Date:   Wed Oct 3 15:28:07 2018 +0800

    BUG: fix Series(extension array) + extension array values addition (pandas-dev#22479)

commit 04ea51d
Author: Joris Van den Bossche <[email protected]>
Date:   Wed Oct 3 09:24:36 2018 +0200

    CLN: small clean-up of IntervalIndex (pandas-dev#22956)

commit b0f9a10
Author: Tony Tao <[email protected]>
Date:   Tue Oct 2 19:01:08 2018 -0500

    DOC GH22893 Fix docstring of groupby in pandas/core/generic.py (pandas-dev#22920)

commit 08ecba8
Author: jbrockmendel <[email protected]>
Date:   Tue Oct 2 14:22:53 2018 -0700

    BUG: fix DataFrame+DataFrame op with timedelta64 dtype (pandas-dev#22696)

commit c44bad2
Author: Pamela Wu <[email protected]>
Date:   Tue Oct 2 17:16:25 2018 -0400

    CLN GH22873 Replace base excepts in pandas/core (pandas-dev#22901)

commit 8e749a3
Author: Pamela Wu <[email protected]>
Date:   Tue Oct 2 17:14:48 2018 -0400

    CLN GH22874 replace bare excepts in pandas/io/pytables.py (pandas-dev#22919)

commit 1102a33
Author: Joris Van den Bossche <[email protected]>
Date:   Tue Oct 2 22:31:36 2018 +0200

    DOC/CLN: clean-up shared_docs in generic.py (pandas-dev#20074)

commit 9caf048
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 13:25:22 2018 -0500

    CI: change windows vm image (pandas-dev#22948)

commit 0671e7d
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:10:42 2018 -0500

    Fixup

commit 1b4261f
Merge: c92a4a8 1d9f76c
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 10:58:43 2018 -0500

    Merge remote-tracking branch 'upstream/master' into ea-divmod

commit 1d9f76c
Author: Joris Van den Bossche <[email protected]>
Date:   Tue Oct 2 17:11:11 2018 +0200

    CLN: remove Index._to_embed (pandas-dev#22879)

    * CLN: remove Index._to_embed

    * pep8

commit 6247da0
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 08:50:41 2018 -0500

    Provide default implementation for `data_repated` (pandas-dev#22935)

commit c92a4a8
Author: Tom Augspurger <[email protected]>
Date:   Mon Oct 1 16:56:15 2018 -0500

    Update old test

commit 52538fa
Author: Tom Augspurger <[email protected]>
Date:   Mon Oct 1 16:51:48 2018 -0500

    BUG: divmod return type

commit 5ce06b5
Author: Matthew Roeschke <[email protected]>
Date:   Mon Oct 1 14:22:20 2018 -0700

     BUG: to_datetime preserves name of Index argument in the result (pandas-dev#22918)

    * BUG: to_datetime preserves name of Index argument in the result

    * correct test

* Squashed commit of the following:

commit 7714e79
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 10:13:06 2018 -0500

    Always return ndarray

commit 1921c6f
Merge: 01f7366 fea27f0
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 09:50:30 2018 -0500

    Merge remote-tracking branch 'upstream/master' into combine-exception

commit fea27f0
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 08:49:44 2018 -0500

    CI: pin moto to 1.3.4 (pandas-dev#22959)

commit 15d32bb
Author: jbrockmendel <[email protected]>
Date:   Wed Oct 3 04:32:35 2018 -0700

    [CLN] Dispatch (some) Frame ops to Series, avoiding _data.eval (pandas-dev#22019)

    * avoid casting to object dtype in mixed-type frames

    * Dispatch to Series ops in _combine_match_columns

    * comment

    * docstring

    * flake8 fixup

    * dont bother with try_cast_result

    * revert non-central change

    * simplify

    * revert try_cast_results

    * revert non-central changes

    * Fixup typo syntaxerror

    * simplify assertion

    * use dispatch_to_series in combine_match_columns

    * Pass unwrapped op where appropriate

    * catch correct error

    * whatsnew note

    * comment

    * whatsnew section

    * remove unnecessary tester

    * doc fixup

commit 3e3256b
Author: alimcmaster1 <[email protected]>
Date:   Wed Oct 3 12:23:22 2018 +0100

    Allow passing a mask to NanOps (pandas-dev#22865)

commit e756e99
Author: jbrockmendel <[email protected]>
Date:   Wed Oct 3 02:19:27 2018 -0700

    CLN: Use is_period_dtype instead of ABCPeriodIndex checks (pandas-dev#22958)

commit 03181f0
Author: Wenhuan <[email protected]>
Date:   Wed Oct 3 15:28:07 2018 +0800

    BUG: fix Series(extension array) + extension array values addition (pandas-dev#22479)

commit 04ea51d
Author: Joris Van den Bossche <[email protected]>
Date:   Wed Oct 3 09:24:36 2018 +0200

    CLN: small clean-up of IntervalIndex (pandas-dev#22956)

commit b0f9a10
Author: Tony Tao <[email protected]>
Date:   Tue Oct 2 19:01:08 2018 -0500

    DOC GH22893 Fix docstring of groupby in pandas/core/generic.py (pandas-dev#22920)

commit 08ecba8
Author: jbrockmendel <[email protected]>
Date:   Tue Oct 2 14:22:53 2018 -0700

    BUG: fix DataFrame+DataFrame op with timedelta64 dtype (pandas-dev#22696)

commit c44bad2
Author: Pamela Wu <[email protected]>
Date:   Tue Oct 2 17:16:25 2018 -0400

    CLN GH22873 Replace base excepts in pandas/core (pandas-dev#22901)

commit 8e749a3
Author: Pamela Wu <[email protected]>
Date:   Tue Oct 2 17:14:48 2018 -0400

    CLN GH22874 replace bare excepts in pandas/io/pytables.py (pandas-dev#22919)

commit 1102a33
Author: Joris Van den Bossche <[email protected]>
Date:   Tue Oct 2 22:31:36 2018 +0200

    DOC/CLN: clean-up shared_docs in generic.py (pandas-dev#20074)

commit 01f7366
Merge: 5372134 9caf048
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 13:50:28 2018 -0500

    Merge remote-tracking branch 'upstream/master' into combine-exception

commit 9caf048
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 13:25:22 2018 -0500

    CI: change windows vm image (pandas-dev#22948)

commit 5372134
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:35:07 2018 -0500

    fixed move

commit ce1a3c6
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:32:11 2018 -0500

    fixed move

commit b9c7e4b
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:28:57 2018 -0500

    remove old note

commit a4a2933
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:24:48 2018 -0500

    handle test

commit be63feb
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:19:17 2018 -0500

    move test

commit 0eef0cf
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:18:18 2018 -0500

    move back

commit 2183f7b
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:17:28 2018 -0500

    api

commit 85fc5d8
Merge: 9059c0d 1d9f76c
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:15:52 2018 -0500

    Merge remote-tracking branch 'upstream/master' into combine-exception

commit 1d9f76c
Author: Joris Van den Bossche <[email protected]>
Date:   Tue Oct 2 17:11:11 2018 +0200

    CLN: remove Index._to_embed (pandas-dev#22879)

    * CLN: remove Index._to_embed

    * pep8

commit 6247da0
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 08:50:41 2018 -0500

    Provide default implementation for `data_repated` (pandas-dev#22935)

commit 9059c0d
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 06:33:15 2018 -0500

    Note

commit 0c53f08
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 06:30:54 2018 -0500

    Imports

commit ce94bf9
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 06:28:16 2018 -0500

    Moves

commit fdd43c4
Author: Tom Augspurger <[email protected]>
Date:   Mon Oct 1 21:26:09 2018 -0500

    Closes pandas-dev#22850

commit 5ce06b5
Author: Matthew Roeschke <[email protected]>
Date:   Mon Oct 1 14:22:20 2018 -0700

     BUG: to_datetime preserves name of Index argument in the result (pandas-dev#22918)

    * BUG: to_datetime preserves name of Index argument in the result

    * correct test

* Squashed commit of the following:

commit 11a0d93
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 14:26:34 2018 -0500

    typerror

commit a0cd5e7
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 14:25:38 2018 -0500

    TypeError for Series

commit 2247461
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:29:29 2018 -0500

    Test op(Series[EA], EA])

commit c9fe5d3
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:21:33 2018 -0500

    make strict

commit 7ef697c
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:14:52 2018 -0500

    Use super

commit 35d4213
Merge: 0671e7d ee80803
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:11:05 2018 -0500

    Merge remote-tracking branch 'upstream/master' into ea-divmod

commit 0671e7d
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:10:42 2018 -0500

    Fixup

commit 1b4261f
Merge: c92a4a8 1d9f76c
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 10:58:43 2018 -0500

    Merge remote-tracking branch 'upstream/master' into ea-divmod

commit c92a4a8
Author: Tom Augspurger <[email protected]>
Date:   Mon Oct 1 16:56:15 2018 -0500

    Update old test

commit 52538fa
Author: Tom Augspurger <[email protected]>
Date:   Mon Oct 1 16:51:48 2018 -0500

    BUG: divmod return type

* fixed merge conflict

* Handle divmod test

* extension tests passing

* Squashed commit of the following:

commit c9d6e89
Author: Tom Augspurger <[email protected]>
Date:   Thu Oct 4 08:34:22 2018 -0500

    xpass -> skip

commit 95d5cbf
Author: Tom Augspurger <[email protected]>
Date:   Thu Oct 4 08:22:17 2018 -0500

    typo, import

commit 4e9b7f0
Author: Tom Augspurger <[email protected]>
Date:   Thu Oct 4 08:18:40 2018 -0500

    doc update

commit cc2bfc8
Merge: 11a0d93 fe67b94
Author: Tom Augspurger <[email protected]>
Date:   Thu Oct 4 08:15:46 2018 -0500

    Merge remote-tracking branch 'upstream/master' into ea-divmod

commit fe67b94
Author: Tom Augspurger <[email protected]>
Date:   Thu Oct 4 06:55:09 2018 -0500

    Update type for PeriodDtype / DatetimeTZDtype / IntervalDtype (pandas-dev#22938)

commit b12e5ba
Author: Tom Augspurger <[email protected]>
Date:   Thu Oct 4 06:30:29 2018 -0500

    Safer is dtype (pandas-dev#22975)

commit c19c805
Author: Tom Augspurger <[email protected]>
Date:   Thu Oct 4 06:27:54 2018 -0500

    Catch Exception in combine (pandas-dev#22936)

commit d553ab3
Author: Anjali2019 <[email protected]>
Date:   Thu Oct 4 13:24:06 2018 +0200

    TST: Fixturize series/test_combine_concat.py (pandas-dev#22964)

commit 4c78b97
Author: Anjali2019 <[email protected]>
Date:   Thu Oct 4 13:23:39 2018 +0200

    TST: Fixturize series/test_constructors.py (pandas-dev#22965)

commit 45d3bb7
Author: Anjali2019 <[email protected]>
Date:   Thu Oct 4 13:23:20 2018 +0200

    TST: Fixturize series/test_datetime_values.py (pandas-dev#22966)

commit f1a22ff
Author: Anjali2019 <[email protected]>
Date:   Thu Oct 4 13:22:21 2018 +0200

    TST: Fixturize series/test_dtypes.py (pandas-dev#22967)

commit abf68fd
Author: Anjali2019 <[email protected]>
Date:   Thu Oct 4 13:21:45 2018 +0200

    TST: Fixturize series/test_io.py (pandas-dev#22972)

commit e6b0c29
Author: Anjali2019 <[email protected]>
Date:   Thu Oct 4 13:20:46 2018 +0200

    TST: Fixturize series/test_missing.py (pandas-dev#22973)

commit 9b405b8
Author: Joris Van den Bossche <[email protected]>
Date:   Thu Oct 4 13:16:28 2018 +0200

    CLN: values is required argument in _shallow_copy_with_infer (pandas-dev#22983)

commit c282e31
Author: h-vetinari <[email protected]>
Date:   Thu Oct 4 03:34:35 2018 +0200

    Fix ASV import error (pandas-dev#22978)

commit 11a0d93
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 14:26:34 2018 -0500

    typerror

commit a0cd5e7
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 14:25:38 2018 -0500

    TypeError for Series

commit 2247461
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:29:29 2018 -0500

    Test op(Series[EA], EA])

commit c9fe5d3
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:21:33 2018 -0500

    make strict

commit 7ef697c
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:14:52 2018 -0500

    Use super

commit 35d4213
Merge: 0671e7d ee80803
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:11:05 2018 -0500

    Merge remote-tracking branch 'upstream/master' into ea-divmod

commit 0671e7d
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:10:42 2018 -0500

    Fixup

commit 1b4261f
Merge: c92a4a8 1d9f76c
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 10:58:43 2018 -0500

    Merge remote-tracking branch 'upstream/master' into ea-divmod

commit c92a4a8
Author: Tom Augspurger <[email protected]>
Date:   Mon Oct 1 16:56:15 2018 -0500

    Update old test

commit 52538fa
Author: Tom Augspurger <[email protected]>
Date:   Mon Oct 1 16:51:48 2018 -0500

    BUG: divmod return type

* merge conflict

* wip

* indexes passing

* op names

* extension, arrays passing

* fixup

* lint

* Fixed to_timestamp

* Same error message for index, series

* Fix freq handling in to_timestamp

* dtype update

* accept kwargs

* fixups

* updates

* explicit

* add to assert

* wip period_array

* wip period_array

* order

* sort order

* test for hashing

* update

* lint

* boxing

* fix fixtures

* infer

* Remove seemingly unreachable code

* lint

* wip

* Updates for master

* simplify

* wip

* remove view

* simplify

* lint

* Removed add_comparison_methods

* xfail op

* remove some

* constructors

* Constructor cleanup

* misc fixups

* more xfails

* typo

* Added asi8

* Allow setting nan

* revert breaking docs

* Override _add_sub_int_array

* lint

* Update PeriodIndex._simple_new

* Clean up uses of .values, ._values, ._ndarray_values, ._data

* one more values

* remove xfails

* Fixed freq handling in _shallow_copy with a freq

* test updates

* API: Keep PeriodIndex.values an ndarray

* BUG: Raise for non-equal freq in take

* Punt on DataFrame.replace specializing

* lint

* fixed xfail message

* TST: _from_datetime64

* Fixups

- Perf in period_array
- pyarrow error
- py2 compat

* escape

* dtype

* revert and unxfail values

* error catching

* isort

* Avoid PeriodArray.values

* clarify _box_func usage

* TST: unxfail ops tests

* Avoid use of .values

* __setitem__ type

* Misc cleanups

* docstring on PeriodArray
* examples for period_array
* remove _box_values_as_index
* names
* object_dtype
* use __sub__

* lint

* API: remove ordinal from period_array

* catch exception

* misc cleanup

* Handle astype integer size

* Bump test coverage

* remove partial test

* close bracket

* change the test

* isort

* consistent _data

* lint

* ndarray_values -> asi8

* colocate ops

* refactor PeriodIndex.item

remove unused method

* return NotImplemented for Series / Index

* remove xpass

* release note

* types, use data

* remove ufunc xpass
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
* WIP: PeriodArray

* WIP

* remove debug

* Just moves

* PeriodArray.shift definition

* _data type

* clean

* accessor wip

* some more wip

* tshift, shift

* Arithmetic

* repr changes

* wip

* freq setter

* Added disabled ops

* copy

* Support concat

* object ctor

* Updates

* lint

* lint

* wip

* more wip

* array-setitem

* wip

* wip

* Use ._tshift internally for datetimelike ops

In preperation for PeriodArray / DatetimeArray / TimedeltaArray.

Index.shift has a different meaning from ExtensionArray.shift.

- Index.shift pointwise shifts each element by some amount
- ExtensionArray.shift shits the *position* of each value in the array
  padding the end with NA

This is going to get confusing. This PR tries to avoid some of that by
internally using a new `_tshift` method (time-shift) when we want to do pointwise
shifting of each value. Places that know they want that behavior (like in the
datetimelike ops) should use that.

* deep

* Squashed commit of the following:

commit 23e5cfc
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 13:10:41 2018 -0500

    Use ._tshift internally for datetimelike ops

    In preperation for PeriodArray / DatetimeArray / TimedeltaArray.

    Index.shift has a different meaning from ExtensionArray.shift.

    - Index.shift pointwise shifts each element by some amount
    - ExtensionArray.shift shits the *position* of each value in the array
      padding the end with NA

    This is going to get confusing. This PR tries to avoid some of that by
    internally using a new `_tshift` method (time-shift) when we want to do pointwise
    shifting of each value. Places that know they want that behavior (like in the
    datetimelike ops) should use that.

commit 1d9f76c
Author: Joris Van den Bossche <[email protected]>
Date:   Tue Oct 2 17:11:11 2018 +0200

    CLN: remove Index._to_embed (pandas-dev#22879)

    * CLN: remove Index._to_embed

    * pep8

commit 6247da0
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 08:50:41 2018 -0500

    Provide default implementation for `data_repated` (pandas-dev#22935)

commit 5ce06b5
Author: Matthew Roeschke <[email protected]>
Date:   Mon Oct 1 14:22:20 2018 -0700

     BUG: to_datetime preserves name of Index argument in the result (pandas-dev#22918)

    * BUG: to_datetime preserves name of Index argument in the result

    * correct test

* Squashed commit of the following:

commit bccfc3f
Merge: d65980e 9caf048
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 13:47:48 2018 -0500

    Merge remote-tracking branch 'upstream/master' into period-dtype-type

commit 9caf048
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 13:25:22 2018 -0500

    CI: change windows vm image (pandas-dev#22948)

commit d65980e
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:46:38 2018 -0500

    typo

commit e5c61fc
Merge: d7a8e1b 1d9f76c
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 10:57:59 2018 -0500

    Merge remote-tracking branch 'upstream/master' into period-dtype-type

commit d7a8e1b
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 10:57:56 2018 -0500

    Fixed

commit 598cc62
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 10:32:22 2018 -0500

    doc note

commit 83db05c
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 10:28:52 2018 -0500

    updates

commit 1d9f76c
Author: Joris Van den Bossche <[email protected]>
Date:   Tue Oct 2 17:11:11 2018 +0200

    CLN: remove Index._to_embed (pandas-dev#22879)

    * CLN: remove Index._to_embed

    * pep8

commit 6247da0
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 08:50:41 2018 -0500

    Provide default implementation for `data_repated` (pandas-dev#22935)

commit f07ab80
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 06:22:27 2018 -0500

    str, bytes

commit 8a8bdb0
Author: Tom Augspurger <[email protected]>
Date:   Mon Oct 1 21:40:59 2018 -0500

    import at top

commit 99bafdd
Author: Tom Augspurger <[email protected]>
Date:   Mon Oct 1 21:38:12 2018 -0500

    Update type for PeriodDtype

    Removed unused IntervalDtypeType

commit 5ce06b5
Author: Matthew Roeschke <[email protected]>
Date:   Mon Oct 1 14:22:20 2018 -0700

     BUG: to_datetime preserves name of Index argument in the result (pandas-dev#22918)

    * BUG: to_datetime preserves name of Index argument in the result

    * correct test

* fixup

* The rest of the EA tests

* docs

* rename to time_shift

* Squashed commit of the following:

commit 11a0d93
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 14:26:34 2018 -0500

    typerror

commit a0cd5e7
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 14:25:38 2018 -0500

    TypeError for Series

commit 2247461
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:29:29 2018 -0500

    Test op(Series[EA], EA])

commit c9fe5d3
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:21:33 2018 -0500

    make strict

commit 7ef697c
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:14:52 2018 -0500

    Use super

commit 35d4213
Merge: 0671e7d ee80803
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:11:05 2018 -0500

    Merge remote-tracking branch 'upstream/master' into ea-divmod

commit ee80803
Author: Matthew Roeschke <[email protected]>
Date:   Wed Oct 3 08:25:44 2018 -0700

     BUG: Correctly weekly resample over DST (pandas-dev#22941)

    * test resample fix

    * move the localization until needed

    * BUG: Correctly weekly resample over DST

    * Move whatsnew to new section

commit fea27f0
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 08:49:44 2018 -0500

    CI: pin moto to 1.3.4 (pandas-dev#22959)

commit 15d32bb
Author: jbrockmendel <[email protected]>
Date:   Wed Oct 3 04:32:35 2018 -0700

    [CLN] Dispatch (some) Frame ops to Series, avoiding _data.eval (pandas-dev#22019)

    * avoid casting to object dtype in mixed-type frames

    * Dispatch to Series ops in _combine_match_columns

    * comment

    * docstring

    * flake8 fixup

    * dont bother with try_cast_result

    * revert non-central change

    * simplify

    * revert try_cast_results

    * revert non-central changes

    * Fixup typo syntaxerror

    * simplify assertion

    * use dispatch_to_series in combine_match_columns

    * Pass unwrapped op where appropriate

    * catch correct error

    * whatsnew note

    * comment

    * whatsnew section

    * remove unnecessary tester

    * doc fixup

commit 3e3256b
Author: alimcmaster1 <[email protected]>
Date:   Wed Oct 3 12:23:22 2018 +0100

    Allow passing a mask to NanOps (pandas-dev#22865)

commit e756e99
Author: jbrockmendel <[email protected]>
Date:   Wed Oct 3 02:19:27 2018 -0700

    CLN: Use is_period_dtype instead of ABCPeriodIndex checks (pandas-dev#22958)

commit 03181f0
Author: Wenhuan <[email protected]>
Date:   Wed Oct 3 15:28:07 2018 +0800

    BUG: fix Series(extension array) + extension array values addition (pandas-dev#22479)

commit 04ea51d
Author: Joris Van den Bossche <[email protected]>
Date:   Wed Oct 3 09:24:36 2018 +0200

    CLN: small clean-up of IntervalIndex (pandas-dev#22956)

commit b0f9a10
Author: Tony Tao <[email protected]>
Date:   Tue Oct 2 19:01:08 2018 -0500

    DOC GH22893 Fix docstring of groupby in pandas/core/generic.py (pandas-dev#22920)

commit 08ecba8
Author: jbrockmendel <[email protected]>
Date:   Tue Oct 2 14:22:53 2018 -0700

    BUG: fix DataFrame+DataFrame op with timedelta64 dtype (pandas-dev#22696)

commit c44bad2
Author: Pamela Wu <[email protected]>
Date:   Tue Oct 2 17:16:25 2018 -0400

    CLN GH22873 Replace base excepts in pandas/core (pandas-dev#22901)

commit 8e749a3
Author: Pamela Wu <[email protected]>
Date:   Tue Oct 2 17:14:48 2018 -0400

    CLN GH22874 replace bare excepts in pandas/io/pytables.py (pandas-dev#22919)

commit 1102a33
Author: Joris Van den Bossche <[email protected]>
Date:   Tue Oct 2 22:31:36 2018 +0200

    DOC/CLN: clean-up shared_docs in generic.py (pandas-dev#20074)

commit 9caf048
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 13:25:22 2018 -0500

    CI: change windows vm image (pandas-dev#22948)

commit 0671e7d
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:10:42 2018 -0500

    Fixup

commit 1b4261f
Merge: c92a4a8 1d9f76c
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 10:58:43 2018 -0500

    Merge remote-tracking branch 'upstream/master' into ea-divmod

commit 1d9f76c
Author: Joris Van den Bossche <[email protected]>
Date:   Tue Oct 2 17:11:11 2018 +0200

    CLN: remove Index._to_embed (pandas-dev#22879)

    * CLN: remove Index._to_embed

    * pep8

commit 6247da0
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 08:50:41 2018 -0500

    Provide default implementation for `data_repated` (pandas-dev#22935)

commit c92a4a8
Author: Tom Augspurger <[email protected]>
Date:   Mon Oct 1 16:56:15 2018 -0500

    Update old test

commit 52538fa
Author: Tom Augspurger <[email protected]>
Date:   Mon Oct 1 16:51:48 2018 -0500

    BUG: divmod return type

commit 5ce06b5
Author: Matthew Roeschke <[email protected]>
Date:   Mon Oct 1 14:22:20 2018 -0700

     BUG: to_datetime preserves name of Index argument in the result (pandas-dev#22918)

    * BUG: to_datetime preserves name of Index argument in the result

    * correct test

* Squashed commit of the following:

commit 7714e79
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 10:13:06 2018 -0500

    Always return ndarray

commit 1921c6f
Merge: 01f7366 fea27f0
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 09:50:30 2018 -0500

    Merge remote-tracking branch 'upstream/master' into combine-exception

commit fea27f0
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 08:49:44 2018 -0500

    CI: pin moto to 1.3.4 (pandas-dev#22959)

commit 15d32bb
Author: jbrockmendel <[email protected]>
Date:   Wed Oct 3 04:32:35 2018 -0700

    [CLN] Dispatch (some) Frame ops to Series, avoiding _data.eval (pandas-dev#22019)

    * avoid casting to object dtype in mixed-type frames

    * Dispatch to Series ops in _combine_match_columns

    * comment

    * docstring

    * flake8 fixup

    * dont bother with try_cast_result

    * revert non-central change

    * simplify

    * revert try_cast_results

    * revert non-central changes

    * Fixup typo syntaxerror

    * simplify assertion

    * use dispatch_to_series in combine_match_columns

    * Pass unwrapped op where appropriate

    * catch correct error

    * whatsnew note

    * comment

    * whatsnew section

    * remove unnecessary tester

    * doc fixup

commit 3e3256b
Author: alimcmaster1 <[email protected]>
Date:   Wed Oct 3 12:23:22 2018 +0100

    Allow passing a mask to NanOps (pandas-dev#22865)

commit e756e99
Author: jbrockmendel <[email protected]>
Date:   Wed Oct 3 02:19:27 2018 -0700

    CLN: Use is_period_dtype instead of ABCPeriodIndex checks (pandas-dev#22958)

commit 03181f0
Author: Wenhuan <[email protected]>
Date:   Wed Oct 3 15:28:07 2018 +0800

    BUG: fix Series(extension array) + extension array values addition (pandas-dev#22479)

commit 04ea51d
Author: Joris Van den Bossche <[email protected]>
Date:   Wed Oct 3 09:24:36 2018 +0200

    CLN: small clean-up of IntervalIndex (pandas-dev#22956)

commit b0f9a10
Author: Tony Tao <[email protected]>
Date:   Tue Oct 2 19:01:08 2018 -0500

    DOC GH22893 Fix docstring of groupby in pandas/core/generic.py (pandas-dev#22920)

commit 08ecba8
Author: jbrockmendel <[email protected]>
Date:   Tue Oct 2 14:22:53 2018 -0700

    BUG: fix DataFrame+DataFrame op with timedelta64 dtype (pandas-dev#22696)

commit c44bad2
Author: Pamela Wu <[email protected]>
Date:   Tue Oct 2 17:16:25 2018 -0400

    CLN GH22873 Replace base excepts in pandas/core (pandas-dev#22901)

commit 8e749a3
Author: Pamela Wu <[email protected]>
Date:   Tue Oct 2 17:14:48 2018 -0400

    CLN GH22874 replace bare excepts in pandas/io/pytables.py (pandas-dev#22919)

commit 1102a33
Author: Joris Van den Bossche <[email protected]>
Date:   Tue Oct 2 22:31:36 2018 +0200

    DOC/CLN: clean-up shared_docs in generic.py (pandas-dev#20074)

commit 01f7366
Merge: 5372134 9caf048
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 13:50:28 2018 -0500

    Merge remote-tracking branch 'upstream/master' into combine-exception

commit 9caf048
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 13:25:22 2018 -0500

    CI: change windows vm image (pandas-dev#22948)

commit 5372134
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:35:07 2018 -0500

    fixed move

commit ce1a3c6
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:32:11 2018 -0500

    fixed move

commit b9c7e4b
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:28:57 2018 -0500

    remove old note

commit a4a2933
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:24:48 2018 -0500

    handle test

commit be63feb
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:19:17 2018 -0500

    move test

commit 0eef0cf
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:18:18 2018 -0500

    move back

commit 2183f7b
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:17:28 2018 -0500

    api

commit 85fc5d8
Merge: 9059c0d 1d9f76c
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:15:52 2018 -0500

    Merge remote-tracking branch 'upstream/master' into combine-exception

commit 1d9f76c
Author: Joris Van den Bossche <[email protected]>
Date:   Tue Oct 2 17:11:11 2018 +0200

    CLN: remove Index._to_embed (pandas-dev#22879)

    * CLN: remove Index._to_embed

    * pep8

commit 6247da0
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 08:50:41 2018 -0500

    Provide default implementation for `data_repated` (pandas-dev#22935)

commit 9059c0d
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 06:33:15 2018 -0500

    Note

commit 0c53f08
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 06:30:54 2018 -0500

    Imports

commit ce94bf9
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 06:28:16 2018 -0500

    Moves

commit fdd43c4
Author: Tom Augspurger <[email protected]>
Date:   Mon Oct 1 21:26:09 2018 -0500

    Closes pandas-dev#22850

commit 5ce06b5
Author: Matthew Roeschke <[email protected]>
Date:   Mon Oct 1 14:22:20 2018 -0700

     BUG: to_datetime preserves name of Index argument in the result (pandas-dev#22918)

    * BUG: to_datetime preserves name of Index argument in the result

    * correct test

* Squashed commit of the following:

commit 11a0d93
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 14:26:34 2018 -0500

    typerror

commit a0cd5e7
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 14:25:38 2018 -0500

    TypeError for Series

commit 2247461
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:29:29 2018 -0500

    Test op(Series[EA], EA])

commit c9fe5d3
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:21:33 2018 -0500

    make strict

commit 7ef697c
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:14:52 2018 -0500

    Use super

commit 35d4213
Merge: 0671e7d ee80803
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:11:05 2018 -0500

    Merge remote-tracking branch 'upstream/master' into ea-divmod

commit 0671e7d
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:10:42 2018 -0500

    Fixup

commit 1b4261f
Merge: c92a4a8 1d9f76c
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 10:58:43 2018 -0500

    Merge remote-tracking branch 'upstream/master' into ea-divmod

commit c92a4a8
Author: Tom Augspurger <[email protected]>
Date:   Mon Oct 1 16:56:15 2018 -0500

    Update old test

commit 52538fa
Author: Tom Augspurger <[email protected]>
Date:   Mon Oct 1 16:51:48 2018 -0500

    BUG: divmod return type

* fixed merge conflict

* Handle divmod test

* extension tests passing

* Squashed commit of the following:

commit c9d6e89
Author: Tom Augspurger <[email protected]>
Date:   Thu Oct 4 08:34:22 2018 -0500

    xpass -> skip

commit 95d5cbf
Author: Tom Augspurger <[email protected]>
Date:   Thu Oct 4 08:22:17 2018 -0500

    typo, import

commit 4e9b7f0
Author: Tom Augspurger <[email protected]>
Date:   Thu Oct 4 08:18:40 2018 -0500

    doc update

commit cc2bfc8
Merge: 11a0d93 fe67b94
Author: Tom Augspurger <[email protected]>
Date:   Thu Oct 4 08:15:46 2018 -0500

    Merge remote-tracking branch 'upstream/master' into ea-divmod

commit fe67b94
Author: Tom Augspurger <[email protected]>
Date:   Thu Oct 4 06:55:09 2018 -0500

    Update type for PeriodDtype / DatetimeTZDtype / IntervalDtype (pandas-dev#22938)

commit b12e5ba
Author: Tom Augspurger <[email protected]>
Date:   Thu Oct 4 06:30:29 2018 -0500

    Safer is dtype (pandas-dev#22975)

commit c19c805
Author: Tom Augspurger <[email protected]>
Date:   Thu Oct 4 06:27:54 2018 -0500

    Catch Exception in combine (pandas-dev#22936)

commit d553ab3
Author: Anjali2019 <[email protected]>
Date:   Thu Oct 4 13:24:06 2018 +0200

    TST: Fixturize series/test_combine_concat.py (pandas-dev#22964)

commit 4c78b97
Author: Anjali2019 <[email protected]>
Date:   Thu Oct 4 13:23:39 2018 +0200

    TST: Fixturize series/test_constructors.py (pandas-dev#22965)

commit 45d3bb7
Author: Anjali2019 <[email protected]>
Date:   Thu Oct 4 13:23:20 2018 +0200

    TST: Fixturize series/test_datetime_values.py (pandas-dev#22966)

commit f1a22ff
Author: Anjali2019 <[email protected]>
Date:   Thu Oct 4 13:22:21 2018 +0200

    TST: Fixturize series/test_dtypes.py (pandas-dev#22967)

commit abf68fd
Author: Anjali2019 <[email protected]>
Date:   Thu Oct 4 13:21:45 2018 +0200

    TST: Fixturize series/test_io.py (pandas-dev#22972)

commit e6b0c29
Author: Anjali2019 <[email protected]>
Date:   Thu Oct 4 13:20:46 2018 +0200

    TST: Fixturize series/test_missing.py (pandas-dev#22973)

commit 9b405b8
Author: Joris Van den Bossche <[email protected]>
Date:   Thu Oct 4 13:16:28 2018 +0200

    CLN: values is required argument in _shallow_copy_with_infer (pandas-dev#22983)

commit c282e31
Author: h-vetinari <[email protected]>
Date:   Thu Oct 4 03:34:35 2018 +0200

    Fix ASV import error (pandas-dev#22978)

commit 11a0d93
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 14:26:34 2018 -0500

    typerror

commit a0cd5e7
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 14:25:38 2018 -0500

    TypeError for Series

commit 2247461
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:29:29 2018 -0500

    Test op(Series[EA], EA])

commit c9fe5d3
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:21:33 2018 -0500

    make strict

commit 7ef697c
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:14:52 2018 -0500

    Use super

commit 35d4213
Merge: 0671e7d ee80803
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:11:05 2018 -0500

    Merge remote-tracking branch 'upstream/master' into ea-divmod

commit 0671e7d
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:10:42 2018 -0500

    Fixup

commit 1b4261f
Merge: c92a4a8 1d9f76c
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 10:58:43 2018 -0500

    Merge remote-tracking branch 'upstream/master' into ea-divmod

commit c92a4a8
Author: Tom Augspurger <[email protected]>
Date:   Mon Oct 1 16:56:15 2018 -0500

    Update old test

commit 52538fa
Author: Tom Augspurger <[email protected]>
Date:   Mon Oct 1 16:51:48 2018 -0500

    BUG: divmod return type

* merge conflict

* wip

* indexes passing

* op names

* extension, arrays passing

* fixup

* lint

* Fixed to_timestamp

* Same error message for index, series

* Fix freq handling in to_timestamp

* dtype update

* accept kwargs

* fixups

* updates

* explicit

* add to assert

* wip period_array

* wip period_array

* order

* sort order

* test for hashing

* update

* lint

* boxing

* fix fixtures

* infer

* Remove seemingly unreachable code

* lint

* wip

* Updates for master

* simplify

* wip

* remove view

* simplify

* lint

* Removed add_comparison_methods

* xfail op

* remove some

* constructors

* Constructor cleanup

* misc fixups

* more xfails

* typo

* Added asi8

* Allow setting nan

* revert breaking docs

* Override _add_sub_int_array

* lint

* Update PeriodIndex._simple_new

* Clean up uses of .values, ._values, ._ndarray_values, ._data

* one more values

* remove xfails

* Fixed freq handling in _shallow_copy with a freq

* test updates

* API: Keep PeriodIndex.values an ndarray

* BUG: Raise for non-equal freq in take

* Punt on DataFrame.replace specializing

* lint

* fixed xfail message

* TST: _from_datetime64

* Fixups

- Perf in period_array
- pyarrow error
- py2 compat

* escape

* dtype

* revert and unxfail values

* error catching

* isort

* Avoid PeriodArray.values

* clarify _box_func usage

* TST: unxfail ops tests

* Avoid use of .values

* __setitem__ type

* Misc cleanups

* docstring on PeriodArray
* examples for period_array
* remove _box_values_as_index
* names
* object_dtype
* use __sub__

* lint

* API: remove ordinal from period_array

* catch exception

* misc cleanup

* Handle astype integer size

* Bump test coverage

* remove partial test

* close bracket

* change the test

* isort

* consistent _data

* lint

* ndarray_values -> asi8

* colocate ops

* refactor PeriodIndex.item

remove unused method

* return NotImplemented for Series / Index

* remove xpass

* release note

* types, use data

* remove ufunc xpass
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
* WIP: PeriodArray

* WIP

* remove debug

* Just moves

* PeriodArray.shift definition

* _data type

* clean

* accessor wip

* some more wip

* tshift, shift

* Arithmetic

* repr changes

* wip

* freq setter

* Added disabled ops

* copy

* Support concat

* object ctor

* Updates

* lint

* lint

* wip

* more wip

* array-setitem

* wip

* wip

* Use ._tshift internally for datetimelike ops

In preperation for PeriodArray / DatetimeArray / TimedeltaArray.

Index.shift has a different meaning from ExtensionArray.shift.

- Index.shift pointwise shifts each element by some amount
- ExtensionArray.shift shits the *position* of each value in the array
  padding the end with NA

This is going to get confusing. This PR tries to avoid some of that by
internally using a new `_tshift` method (time-shift) when we want to do pointwise
shifting of each value. Places that know they want that behavior (like in the
datetimelike ops) should use that.

* deep

* Squashed commit of the following:

commit 23e5cfc
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 13:10:41 2018 -0500

    Use ._tshift internally for datetimelike ops

    In preperation for PeriodArray / DatetimeArray / TimedeltaArray.

    Index.shift has a different meaning from ExtensionArray.shift.

    - Index.shift pointwise shifts each element by some amount
    - ExtensionArray.shift shits the *position* of each value in the array
      padding the end with NA

    This is going to get confusing. This PR tries to avoid some of that by
    internally using a new `_tshift` method (time-shift) when we want to do pointwise
    shifting of each value. Places that know they want that behavior (like in the
    datetimelike ops) should use that.

commit 1d9f76c
Author: Joris Van den Bossche <[email protected]>
Date:   Tue Oct 2 17:11:11 2018 +0200

    CLN: remove Index._to_embed (pandas-dev#22879)

    * CLN: remove Index._to_embed

    * pep8

commit 6247da0
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 08:50:41 2018 -0500

    Provide default implementation for `data_repated` (pandas-dev#22935)

commit 5ce06b5
Author: Matthew Roeschke <[email protected]>
Date:   Mon Oct 1 14:22:20 2018 -0700

     BUG: to_datetime preserves name of Index argument in the result (pandas-dev#22918)

    * BUG: to_datetime preserves name of Index argument in the result

    * correct test

* Squashed commit of the following:

commit bccfc3f
Merge: d65980e 9caf048
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 13:47:48 2018 -0500

    Merge remote-tracking branch 'upstream/master' into period-dtype-type

commit 9caf048
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 13:25:22 2018 -0500

    CI: change windows vm image (pandas-dev#22948)

commit d65980e
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:46:38 2018 -0500

    typo

commit e5c61fc
Merge: d7a8e1b 1d9f76c
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 10:57:59 2018 -0500

    Merge remote-tracking branch 'upstream/master' into period-dtype-type

commit d7a8e1b
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 10:57:56 2018 -0500

    Fixed

commit 598cc62
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 10:32:22 2018 -0500

    doc note

commit 83db05c
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 10:28:52 2018 -0500

    updates

commit 1d9f76c
Author: Joris Van den Bossche <[email protected]>
Date:   Tue Oct 2 17:11:11 2018 +0200

    CLN: remove Index._to_embed (pandas-dev#22879)

    * CLN: remove Index._to_embed

    * pep8

commit 6247da0
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 08:50:41 2018 -0500

    Provide default implementation for `data_repated` (pandas-dev#22935)

commit f07ab80
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 06:22:27 2018 -0500

    str, bytes

commit 8a8bdb0
Author: Tom Augspurger <[email protected]>
Date:   Mon Oct 1 21:40:59 2018 -0500

    import at top

commit 99bafdd
Author: Tom Augspurger <[email protected]>
Date:   Mon Oct 1 21:38:12 2018 -0500

    Update type for PeriodDtype

    Removed unused IntervalDtypeType

commit 5ce06b5
Author: Matthew Roeschke <[email protected]>
Date:   Mon Oct 1 14:22:20 2018 -0700

     BUG: to_datetime preserves name of Index argument in the result (pandas-dev#22918)

    * BUG: to_datetime preserves name of Index argument in the result

    * correct test

* fixup

* The rest of the EA tests

* docs

* rename to time_shift

* Squashed commit of the following:

commit 11a0d93
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 14:26:34 2018 -0500

    typerror

commit a0cd5e7
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 14:25:38 2018 -0500

    TypeError for Series

commit 2247461
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:29:29 2018 -0500

    Test op(Series[EA], EA])

commit c9fe5d3
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:21:33 2018 -0500

    make strict

commit 7ef697c
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:14:52 2018 -0500

    Use super

commit 35d4213
Merge: 0671e7d ee80803
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:11:05 2018 -0500

    Merge remote-tracking branch 'upstream/master' into ea-divmod

commit ee80803
Author: Matthew Roeschke <[email protected]>
Date:   Wed Oct 3 08:25:44 2018 -0700

     BUG: Correctly weekly resample over DST (pandas-dev#22941)

    * test resample fix

    * move the localization until needed

    * BUG: Correctly weekly resample over DST

    * Move whatsnew to new section

commit fea27f0
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 08:49:44 2018 -0500

    CI: pin moto to 1.3.4 (pandas-dev#22959)

commit 15d32bb
Author: jbrockmendel <[email protected]>
Date:   Wed Oct 3 04:32:35 2018 -0700

    [CLN] Dispatch (some) Frame ops to Series, avoiding _data.eval (pandas-dev#22019)

    * avoid casting to object dtype in mixed-type frames

    * Dispatch to Series ops in _combine_match_columns

    * comment

    * docstring

    * flake8 fixup

    * dont bother with try_cast_result

    * revert non-central change

    * simplify

    * revert try_cast_results

    * revert non-central changes

    * Fixup typo syntaxerror

    * simplify assertion

    * use dispatch_to_series in combine_match_columns

    * Pass unwrapped op where appropriate

    * catch correct error

    * whatsnew note

    * comment

    * whatsnew section

    * remove unnecessary tester

    * doc fixup

commit 3e3256b
Author: alimcmaster1 <[email protected]>
Date:   Wed Oct 3 12:23:22 2018 +0100

    Allow passing a mask to NanOps (pandas-dev#22865)

commit e756e99
Author: jbrockmendel <[email protected]>
Date:   Wed Oct 3 02:19:27 2018 -0700

    CLN: Use is_period_dtype instead of ABCPeriodIndex checks (pandas-dev#22958)

commit 03181f0
Author: Wenhuan <[email protected]>
Date:   Wed Oct 3 15:28:07 2018 +0800

    BUG: fix Series(extension array) + extension array values addition (pandas-dev#22479)

commit 04ea51d
Author: Joris Van den Bossche <[email protected]>
Date:   Wed Oct 3 09:24:36 2018 +0200

    CLN: small clean-up of IntervalIndex (pandas-dev#22956)

commit b0f9a10
Author: Tony Tao <[email protected]>
Date:   Tue Oct 2 19:01:08 2018 -0500

    DOC GH22893 Fix docstring of groupby in pandas/core/generic.py (pandas-dev#22920)

commit 08ecba8
Author: jbrockmendel <[email protected]>
Date:   Tue Oct 2 14:22:53 2018 -0700

    BUG: fix DataFrame+DataFrame op with timedelta64 dtype (pandas-dev#22696)

commit c44bad2
Author: Pamela Wu <[email protected]>
Date:   Tue Oct 2 17:16:25 2018 -0400

    CLN GH22873 Replace base excepts in pandas/core (pandas-dev#22901)

commit 8e749a3
Author: Pamela Wu <[email protected]>
Date:   Tue Oct 2 17:14:48 2018 -0400

    CLN GH22874 replace bare excepts in pandas/io/pytables.py (pandas-dev#22919)

commit 1102a33
Author: Joris Van den Bossche <[email protected]>
Date:   Tue Oct 2 22:31:36 2018 +0200

    DOC/CLN: clean-up shared_docs in generic.py (pandas-dev#20074)

commit 9caf048
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 13:25:22 2018 -0500

    CI: change windows vm image (pandas-dev#22948)

commit 0671e7d
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:10:42 2018 -0500

    Fixup

commit 1b4261f
Merge: c92a4a8 1d9f76c
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 10:58:43 2018 -0500

    Merge remote-tracking branch 'upstream/master' into ea-divmod

commit 1d9f76c
Author: Joris Van den Bossche <[email protected]>
Date:   Tue Oct 2 17:11:11 2018 +0200

    CLN: remove Index._to_embed (pandas-dev#22879)

    * CLN: remove Index._to_embed

    * pep8

commit 6247da0
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 08:50:41 2018 -0500

    Provide default implementation for `data_repated` (pandas-dev#22935)

commit c92a4a8
Author: Tom Augspurger <[email protected]>
Date:   Mon Oct 1 16:56:15 2018 -0500

    Update old test

commit 52538fa
Author: Tom Augspurger <[email protected]>
Date:   Mon Oct 1 16:51:48 2018 -0500

    BUG: divmod return type

commit 5ce06b5
Author: Matthew Roeschke <[email protected]>
Date:   Mon Oct 1 14:22:20 2018 -0700

     BUG: to_datetime preserves name of Index argument in the result (pandas-dev#22918)

    * BUG: to_datetime preserves name of Index argument in the result

    * correct test

* Squashed commit of the following:

commit 7714e79
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 10:13:06 2018 -0500

    Always return ndarray

commit 1921c6f
Merge: 01f7366 fea27f0
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 09:50:30 2018 -0500

    Merge remote-tracking branch 'upstream/master' into combine-exception

commit fea27f0
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 08:49:44 2018 -0500

    CI: pin moto to 1.3.4 (pandas-dev#22959)

commit 15d32bb
Author: jbrockmendel <[email protected]>
Date:   Wed Oct 3 04:32:35 2018 -0700

    [CLN] Dispatch (some) Frame ops to Series, avoiding _data.eval (pandas-dev#22019)

    * avoid casting to object dtype in mixed-type frames

    * Dispatch to Series ops in _combine_match_columns

    * comment

    * docstring

    * flake8 fixup

    * dont bother with try_cast_result

    * revert non-central change

    * simplify

    * revert try_cast_results

    * revert non-central changes

    * Fixup typo syntaxerror

    * simplify assertion

    * use dispatch_to_series in combine_match_columns

    * Pass unwrapped op where appropriate

    * catch correct error

    * whatsnew note

    * comment

    * whatsnew section

    * remove unnecessary tester

    * doc fixup

commit 3e3256b
Author: alimcmaster1 <[email protected]>
Date:   Wed Oct 3 12:23:22 2018 +0100

    Allow passing a mask to NanOps (pandas-dev#22865)

commit e756e99
Author: jbrockmendel <[email protected]>
Date:   Wed Oct 3 02:19:27 2018 -0700

    CLN: Use is_period_dtype instead of ABCPeriodIndex checks (pandas-dev#22958)

commit 03181f0
Author: Wenhuan <[email protected]>
Date:   Wed Oct 3 15:28:07 2018 +0800

    BUG: fix Series(extension array) + extension array values addition (pandas-dev#22479)

commit 04ea51d
Author: Joris Van den Bossche <[email protected]>
Date:   Wed Oct 3 09:24:36 2018 +0200

    CLN: small clean-up of IntervalIndex (pandas-dev#22956)

commit b0f9a10
Author: Tony Tao <[email protected]>
Date:   Tue Oct 2 19:01:08 2018 -0500

    DOC GH22893 Fix docstring of groupby in pandas/core/generic.py (pandas-dev#22920)

commit 08ecba8
Author: jbrockmendel <[email protected]>
Date:   Tue Oct 2 14:22:53 2018 -0700

    BUG: fix DataFrame+DataFrame op with timedelta64 dtype (pandas-dev#22696)

commit c44bad2
Author: Pamela Wu <[email protected]>
Date:   Tue Oct 2 17:16:25 2018 -0400

    CLN GH22873 Replace base excepts in pandas/core (pandas-dev#22901)

commit 8e749a3
Author: Pamela Wu <[email protected]>
Date:   Tue Oct 2 17:14:48 2018 -0400

    CLN GH22874 replace bare excepts in pandas/io/pytables.py (pandas-dev#22919)

commit 1102a33
Author: Joris Van den Bossche <[email protected]>
Date:   Tue Oct 2 22:31:36 2018 +0200

    DOC/CLN: clean-up shared_docs in generic.py (pandas-dev#20074)

commit 01f7366
Merge: 5372134 9caf048
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 13:50:28 2018 -0500

    Merge remote-tracking branch 'upstream/master' into combine-exception

commit 9caf048
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 13:25:22 2018 -0500

    CI: change windows vm image (pandas-dev#22948)

commit 5372134
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:35:07 2018 -0500

    fixed move

commit ce1a3c6
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:32:11 2018 -0500

    fixed move

commit b9c7e4b
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:28:57 2018 -0500

    remove old note

commit a4a2933
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:24:48 2018 -0500

    handle test

commit be63feb
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:19:17 2018 -0500

    move test

commit 0eef0cf
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:18:18 2018 -0500

    move back

commit 2183f7b
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:17:28 2018 -0500

    api

commit 85fc5d8
Merge: 9059c0d 1d9f76c
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:15:52 2018 -0500

    Merge remote-tracking branch 'upstream/master' into combine-exception

commit 1d9f76c
Author: Joris Van den Bossche <[email protected]>
Date:   Tue Oct 2 17:11:11 2018 +0200

    CLN: remove Index._to_embed (pandas-dev#22879)

    * CLN: remove Index._to_embed

    * pep8

commit 6247da0
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 08:50:41 2018 -0500

    Provide default implementation for `data_repated` (pandas-dev#22935)

commit 9059c0d
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 06:33:15 2018 -0500

    Note

commit 0c53f08
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 06:30:54 2018 -0500

    Imports

commit ce94bf9
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 06:28:16 2018 -0500

    Moves

commit fdd43c4
Author: Tom Augspurger <[email protected]>
Date:   Mon Oct 1 21:26:09 2018 -0500

    Closes pandas-dev#22850

commit 5ce06b5
Author: Matthew Roeschke <[email protected]>
Date:   Mon Oct 1 14:22:20 2018 -0700

     BUG: to_datetime preserves name of Index argument in the result (pandas-dev#22918)

    * BUG: to_datetime preserves name of Index argument in the result

    * correct test

* Squashed commit of the following:

commit 11a0d93
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 14:26:34 2018 -0500

    typerror

commit a0cd5e7
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 14:25:38 2018 -0500

    TypeError for Series

commit 2247461
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:29:29 2018 -0500

    Test op(Series[EA], EA])

commit c9fe5d3
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:21:33 2018 -0500

    make strict

commit 7ef697c
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:14:52 2018 -0500

    Use super

commit 35d4213
Merge: 0671e7d ee80803
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:11:05 2018 -0500

    Merge remote-tracking branch 'upstream/master' into ea-divmod

commit 0671e7d
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:10:42 2018 -0500

    Fixup

commit 1b4261f
Merge: c92a4a8 1d9f76c
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 10:58:43 2018 -0500

    Merge remote-tracking branch 'upstream/master' into ea-divmod

commit c92a4a8
Author: Tom Augspurger <[email protected]>
Date:   Mon Oct 1 16:56:15 2018 -0500

    Update old test

commit 52538fa
Author: Tom Augspurger <[email protected]>
Date:   Mon Oct 1 16:51:48 2018 -0500

    BUG: divmod return type

* fixed merge conflict

* Handle divmod test

* extension tests passing

* Squashed commit of the following:

commit c9d6e89
Author: Tom Augspurger <[email protected]>
Date:   Thu Oct 4 08:34:22 2018 -0500

    xpass -> skip

commit 95d5cbf
Author: Tom Augspurger <[email protected]>
Date:   Thu Oct 4 08:22:17 2018 -0500

    typo, import

commit 4e9b7f0
Author: Tom Augspurger <[email protected]>
Date:   Thu Oct 4 08:18:40 2018 -0500

    doc update

commit cc2bfc8
Merge: 11a0d93 fe67b94
Author: Tom Augspurger <[email protected]>
Date:   Thu Oct 4 08:15:46 2018 -0500

    Merge remote-tracking branch 'upstream/master' into ea-divmod

commit fe67b94
Author: Tom Augspurger <[email protected]>
Date:   Thu Oct 4 06:55:09 2018 -0500

    Update type for PeriodDtype / DatetimeTZDtype / IntervalDtype (pandas-dev#22938)

commit b12e5ba
Author: Tom Augspurger <[email protected]>
Date:   Thu Oct 4 06:30:29 2018 -0500

    Safer is dtype (pandas-dev#22975)

commit c19c805
Author: Tom Augspurger <[email protected]>
Date:   Thu Oct 4 06:27:54 2018 -0500

    Catch Exception in combine (pandas-dev#22936)

commit d553ab3
Author: Anjali2019 <[email protected]>
Date:   Thu Oct 4 13:24:06 2018 +0200

    TST: Fixturize series/test_combine_concat.py (pandas-dev#22964)

commit 4c78b97
Author: Anjali2019 <[email protected]>
Date:   Thu Oct 4 13:23:39 2018 +0200

    TST: Fixturize series/test_constructors.py (pandas-dev#22965)

commit 45d3bb7
Author: Anjali2019 <[email protected]>
Date:   Thu Oct 4 13:23:20 2018 +0200

    TST: Fixturize series/test_datetime_values.py (pandas-dev#22966)

commit f1a22ff
Author: Anjali2019 <[email protected]>
Date:   Thu Oct 4 13:22:21 2018 +0200

    TST: Fixturize series/test_dtypes.py (pandas-dev#22967)

commit abf68fd
Author: Anjali2019 <[email protected]>
Date:   Thu Oct 4 13:21:45 2018 +0200

    TST: Fixturize series/test_io.py (pandas-dev#22972)

commit e6b0c29
Author: Anjali2019 <[email protected]>
Date:   Thu Oct 4 13:20:46 2018 +0200

    TST: Fixturize series/test_missing.py (pandas-dev#22973)

commit 9b405b8
Author: Joris Van den Bossche <[email protected]>
Date:   Thu Oct 4 13:16:28 2018 +0200

    CLN: values is required argument in _shallow_copy_with_infer (pandas-dev#22983)

commit c282e31
Author: h-vetinari <[email protected]>
Date:   Thu Oct 4 03:34:35 2018 +0200

    Fix ASV import error (pandas-dev#22978)

commit 11a0d93
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 14:26:34 2018 -0500

    typerror

commit a0cd5e7
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 14:25:38 2018 -0500

    TypeError for Series

commit 2247461
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:29:29 2018 -0500

    Test op(Series[EA], EA])

commit c9fe5d3
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:21:33 2018 -0500

    make strict

commit 7ef697c
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:14:52 2018 -0500

    Use super

commit 35d4213
Merge: 0671e7d ee80803
Author: Tom Augspurger <[email protected]>
Date:   Wed Oct 3 13:11:05 2018 -0500

    Merge remote-tracking branch 'upstream/master' into ea-divmod

commit 0671e7d
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 11:10:42 2018 -0500

    Fixup

commit 1b4261f
Merge: c92a4a8 1d9f76c
Author: Tom Augspurger <[email protected]>
Date:   Tue Oct 2 10:58:43 2018 -0500

    Merge remote-tracking branch 'upstream/master' into ea-divmod

commit c92a4a8
Author: Tom Augspurger <[email protected]>
Date:   Mon Oct 1 16:56:15 2018 -0500

    Update old test

commit 52538fa
Author: Tom Augspurger <[email protected]>
Date:   Mon Oct 1 16:51:48 2018 -0500

    BUG: divmod return type

* merge conflict

* wip

* indexes passing

* op names

* extension, arrays passing

* fixup

* lint

* Fixed to_timestamp

* Same error message for index, series

* Fix freq handling in to_timestamp

* dtype update

* accept kwargs

* fixups

* updates

* explicit

* add to assert

* wip period_array

* wip period_array

* order

* sort order

* test for hashing

* update

* lint

* boxing

* fix fixtures

* infer

* Remove seemingly unreachable code

* lint

* wip

* Updates for master

* simplify

* wip

* remove view

* simplify

* lint

* Removed add_comparison_methods

* xfail op

* remove some

* constructors

* Constructor cleanup

* misc fixups

* more xfails

* typo

* Added asi8

* Allow setting nan

* revert breaking docs

* Override _add_sub_int_array

* lint

* Update PeriodIndex._simple_new

* Clean up uses of .values, ._values, ._ndarray_values, ._data

* one more values

* remove xfails

* Fixed freq handling in _shallow_copy with a freq

* test updates

* API: Keep PeriodIndex.values an ndarray

* BUG: Raise for non-equal freq in take

* Punt on DataFrame.replace specializing

* lint

* fixed xfail message

* TST: _from_datetime64

* Fixups

- Perf in period_array
- pyarrow error
- py2 compat

* escape

* dtype

* revert and unxfail values

* error catching

* isort

* Avoid PeriodArray.values

* clarify _box_func usage

* TST: unxfail ops tests

* Avoid use of .values

* __setitem__ type

* Misc cleanups

* docstring on PeriodArray
* examples for period_array
* remove _box_values_as_index
* names
* object_dtype
* use __sub__

* lint

* API: remove ordinal from period_array

* catch exception

* misc cleanup

* Handle astype integer size

* Bump test coverage

* remove partial test

* close bracket

* change the test

* isort

* consistent _data

* lint

* ndarray_values -> asi8

* colocate ops

* refactor PeriodIndex.item

remove unused method

* return NotImplemented for Series / Index

* remove xpass

* release note

* types, use data

* remove ufunc xpass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug ExtensionArray Extending pandas with custom dtypes or arrays.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Series(extension array) + extension array values addition cause runtime exception
5 participants