-
Notifications
You must be signed in to change notification settings - Fork 358
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
Implement Index.copy & MultiIndex.copy #939
Conversation
>>> midx = pd.MultiIndex([['a', 'b', 'c'],
... ['lama', 'cow', 'falcon'],
... ['speed', 'weight', 'length']],
... [[0, 0, 0, 0, 0, 0, 1, 1, 1],
... [0, 0, 0, 1, 1, 1, 2, 2, 2],
... [0, 0, 0, 0, 1, 2, 0, 1, 2]]
... )
>>> s = ks.Series([45, 200, 1.2, 30, 250, 1.5, 320, 1, 0.3],
... index=midx)
>>> s.index
MultiIndex([('a', 'lama', 'speed'),
('a', 'lama', 'speed'),
('a', 'lama', 'speed'),
('a', 'cow', 'speed'),
('a', 'cow', 'weight'),
('a', 'cow', 'length'),
('b', 'falcon', 'speed'),
('b', 'falcon', 'weight'),
('b', 'falcon', 'length')],
)
>>> s.index.copy()
MultiIndex([('a', 'lama', 'speed'),
('a', 'lama', 'speed'),
('a', 'lama', 'speed'),
('a', 'cow', 'speed'),
('a', 'cow', 'weight'),
('a', 'cow', 'length'),
('b', 'falcon', 'speed'),
('b', 'falcon', 'weight'),
('b', 'falcon', 'length')],
) |
Softagram Impact Report for pull/939 (head commit: 9b5bee7)⭐ Change Overview
📄 Full report
Impact Report explained. Give feedback on this report to [email protected] |
Codecov Report
@@ Coverage Diff @@
## master #939 +/- ##
==========================================
+ Coverage 94.46% 94.47% +<.01%
==========================================
Files 34 34
Lines 6382 6390 +8
==========================================
+ Hits 6029 6037 +8
Misses 353 353
Continue to review full report at Codecov.
|
def copy(self): | ||
""" | ||
Make a copy of this object. | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should add an example but I think it's fine for now since it's incomplete for now due to missing name anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for reviewing. i'm planning to implement name
, after then i'll add the example here also.
like pandas (https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Index.copy.html#pandas.Index.copy)
implement function
copy
for Index