Skip to content

Conversation

@jbrockmendel
Copy link
Member

This will take a few passes to get rid of all the checks done in _simple_new that should be done elsewhere

Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

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

Big +1

@jbrockmendel jbrockmendel changed the title REF: by stricter about what we pass to _simple_new REF: be stricter about what we pass to _simple_new Jan 16, 2020
@jbrockmendel jbrockmendel added the Constructors Series/DataFrame/Index/pd.array Constructors label Jan 17, 2020
(self[:loc].asi8, [item.view(np.int64)], self[loc:].asi8)
)
return self._shallow_copy(new_i8s, freq=freq)
tda = type(self._data)._simple_new(new_i8s, freq=freq)
Copy link
Contributor

Choose a reason for hiding this comment

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

doen't this copy twice?

Copy link
Member Author

Choose a reason for hiding this comment

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

no, simple_new doesnt make a copy

Copy link
Contributor

Choose a reason for hiding this comment

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

k, that's what i thought, can you (followup ok), document this loudly in the _simple_new

@jreback jreback added this to the 1.1 milestone Jan 18, 2020
@jreback
Copy link
Contributor

jreback commented Jan 18, 2020

also I would document in simple_new what the copy guarantees are

@jreback jreback merged commit 55cfabb into pandas-dev:master Jan 18, 2020
@jreback
Copy link
Contributor

jreback commented Jan 18, 2020

thanks, followon comments

@jbrockmendel jbrockmendel deleted the ref-simple2 branch January 18, 2020 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Constructors Series/DataFrame/Index/pd.array Constructors

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants