Skip to content

Commit

Permalink
FIX: Cleanup messed up files for PR
Browse files Browse the repository at this point in the history
  • Loading branch information
hexgnu committed Dec 28, 2017
1 parent 2612dcc commit 7b34c07
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion doc/source/whatsnew/v0.23.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ Reshaping
- Bug in :func:`Series.rank` where ``Series`` containing ``NaT`` modifies the ``Series`` inplace (:issue:`18521`)
- Bug in :func:`cut` which fails when using readonly arrays (:issue:`18773`)
- Bug in :func:`Dataframe.pivot_table` which fails when the ``aggfunc`` arg is of type string. The behavior is now consistent with other methods like ``agg`` and ``apply`` (:issue:`18713`)
- Bug in :func:`get_dummies` which doesn't cast all columns as sparse which causes reindex to fail. (:issue:`18914`)
- Bug in :func:`pandas.core.dtypes.concat._get_series_result_type` which returns SparseDataFrame even if not all contained in Frame are sparse. (:issue:`18914`)


Numeric
Expand Down
5 changes: 0 additions & 5 deletions pandas/core/internals.py
Original file line number Diff line number Diff line change
Expand Up @@ -2756,11 +2756,6 @@ class SparseBlock(NonConsolidatableMixIn, Block):
_holder = SparseArray
_concatenator = staticmethod(_concat._concat_sparse)

def __init__(self, values, placement, ndim=None, fastpath=False, **kwargs):
super(SparseBlock, self).__init__(self._holder(values),
placement, ndim=ndim,
fastpath=fastpath, **kwargs)

@property
def shape(self):
return (len(self.mgr_locs), self.sp_index.length)
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/sparse/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from pandas.core.dtypes.cast import maybe_upcast, find_common_type
from pandas.core.dtypes.common import _ensure_platform_int, is_scipy_sparse

from pandas.core.common import _try_sort, is_sparse
from pandas.core.common import _try_sort
from pandas.compat.numpy import function as nv
from pandas.core.index import Index, MultiIndex, _ensure_index
from pandas.core.series import Series
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/reshape/test_reshape.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ def test_dataframe_dummies_preserve_categorical_dtype(self, dtype):

tm.assert_frame_equal(result, expected)

def test_get_dummies_sparsify_all_columns(self):
def test_get_dummies_dont_sparsify_all_columns(self):
# GH18914
df = DataFrame.from_items([('GDP', [1, 2]), ('Nation', ['AB', 'CD'])])
df = get_dummies(df, columns=['Nation'], sparse=True)
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/sparse/test_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ def test_to_dense(self):
with tm.assert_produces_warning(FutureWarning,
check_stacklevel=False):
SparseArray(vals).to_dense(fill=2)

def test_getitem(self):
def _checkit(i):
assert_almost_equal(self.arr[i], self.arr.values[i])
Expand Down
3 changes: 3 additions & 0 deletions pandas/tests/sparse/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,9 @@ def test_density(self):

assert df.density == 0.75

def test_sparse_to_dense(self):
pass

def test_sparse_series_ops(self):
self._check_frame_ops(self.frame)

Expand Down

0 comments on commit 7b34c07

Please sign in to comment.