Skip to content

Commit

Permalink
Fix index of the result of get_dtype_counts (#308)
Browse files Browse the repository at this point in the history
* Remove mapping index to numpy type and keep as string

* Remove sorting of index for get_dtype_counts

* Update get_dtype_counts test
  • Loading branch information
williamma12 authored and devin-petersohn committed Dec 20, 2018
1 parent 4ea8dee commit bb24a24
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 0 additions & 2 deletions modin/pandas/dataframe.py
Expand Up @@ -1672,8 +1672,6 @@ def get_dtype_counts(self):
"""
result = self.dtypes.value_counts()
result.index = result.index.map(lambda x: str(x))
result = result.sort_index()
result.index = result.index.map(lambda x: np.dtype(getattr(np, x)))
return result

def get_ftype_counts(self):
Expand Down
4 changes: 3 additions & 1 deletion modin/pandas/test/test_dataframe.py
Expand Up @@ -993,7 +993,9 @@ def test_get(ray_df, pandas_df, key):

@pytest.fixture
def test_get_dtype_counts(ray_df, pandas_df):
assert ray_df.get_dtype_counts().equals(pandas_df.get_dtype_counts())
ray_result = ray_df.get_dtype_counts().sort_index()
pandas_result = pandas_df.get_dtype_counts().sort_index()
assert ray_result.equals(pandas_result)


@pytest.fixture
Expand Down

0 comments on commit bb24a24

Please sign in to comment.