forked from ray-project/ray
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DataFrame] Implementation for head, idxmax, idxmin, pop, tail, and R…
…ay Index (ray-project#1520) * Adding head implementation * Adding idxmax, idxmin, pop, tail * Adding index skeleton * Addressing reviewer comments * Fixing tests to reflect Series constructor changes
- Loading branch information
1 parent
ff8e7f8
commit fa37564
Showing
5 changed files
with
151 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from __future__ import absolute_import | ||
from __future__ import division | ||
from __future__ import print_function | ||
|
||
import pandas as pd | ||
|
||
|
||
class Index(object): | ||
|
||
def __init__(self, idx): | ||
self.idx = idx | ||
|
||
@classmethod | ||
def to_pandas(indices): | ||
if isinstance(indices[0], pd.RangeIndex): | ||
merged = indices[0] | ||
for index in indices[1:]: | ||
merged = merged.union(index) | ||
return merged | ||
else: | ||
return indices[0].append(indices[1:]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
|
||
@pytest.fixture | ||
def create_test_series(): | ||
return rdf.Series() | ||
return rdf.Series(None) | ||
|
||
|
||
def test_T(): | ||
|