Skip to content

Commit

Permalink
Merge remote-tracking branch 'pandas-dev/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
harisbal committed Feb 28, 2018
2 parents 4a4f3f2 + 7561eb8 commit f00a2d1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 55 deletions.
2 changes: 1 addition & 1 deletion ci/requirements-3.6.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ python=3.6*
python-dateutil
pytz
nomkl
numpy=1.13.*
numpy
cython
8 changes: 4 additions & 4 deletions pandas/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class StringMixin(object):
# Formatting

def __unicode__(self):
raise com.AbstractMethodError(self)
raise AbstractMethodError(self)

def __str__(self):
"""
Expand Down Expand Up @@ -278,10 +278,10 @@ def _gotitem(self, key, ndim, subset=None):
subset to act on
"""
raise com.AbstractMethodError(self)
raise AbstractMethodError(self)

def aggregate(self, func, *args, **kwargs):
raise com.AbstractMethodError(self)
raise AbstractMethodError(self)

agg = aggregate

Expand Down Expand Up @@ -1247,4 +1247,4 @@ def duplicated(self, keep='first'):
# abstracts

def _update_inplace(self, result, **kwargs):
raise com.AbstractMethodError(self)
raise AbstractMethodError(self)
6 changes: 3 additions & 3 deletions pandas/core/resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def _convert_obj(self, obj):
return obj

def _get_binner_for_time(self):
raise com.AbstractMethodError(self)
raise AbstractMethodError(self)

def _set_binner(self):
"""
Expand Down Expand Up @@ -372,10 +372,10 @@ def transform(self, arg, *args, **kwargs):
arg, *args, **kwargs)

def _downsample(self, f):
raise com.AbstractMethodError(self)
raise AbstractMethodError(self)

def _upsample(self, f, limit=None, fill_value=None):
raise com.AbstractMethodError(self)
raise AbstractMethodError(self)

def _gotitem(self, key, ndim, subset=None):
"""
Expand Down
47 changes: 0 additions & 47 deletions pandas/tests/frame/test_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,53 +28,6 @@
_check_mixed_int)


class TestDataFrameArithmetic(object):

@pytest.mark.xfail(reason='GH#7996 datetime64 units not converted to nano')
def test_frame_sub_datetime64_not_ns(self):
df = pd.DataFrame(date_range('20130101', periods=3))
dt64 = np.datetime64('2013-01-01')
assert dt64.dtype == 'datetime64[D]'
res = df - dt64
expected = pd.DataFrame([pd.Timedelta(days=0), pd.Timedelta(days=1),
pd.Timedelta(days=2)])
tm.assert_frame_equal(res, expected)

@pytest.mark.parametrize('data', [
[1, 2, 3],
[1.1, 2.2, 3.3],
[pd.Timestamp('2011-01-01'), pd.Timestamp('2011-01-02'), pd.NaT],
['x', 'y', 1]])
@pytest.mark.parametrize('dtype', [None, object])
def test_frame_radd_str_invalid(self, dtype, data):
df = DataFrame(data, dtype=dtype)
with pytest.raises(TypeError):
'foo_' + df

@pytest.mark.parametrize('dtype', [None, object])
def test_frame_with_dtype_radd_int(self, dtype):
df = pd.DataFrame([1, 2, 3], dtype=dtype)
expected = pd.DataFrame([2, 3, 4], dtype=dtype)
result = 1 + df
assert_frame_equal(result, expected)
result = df + 1
assert_frame_equal(result, expected)

@pytest.mark.parametrize('dtype', [None, object])
def test_frame_with_dtype_radd_nan(self, dtype):
df = pd.DataFrame([1, 2, 3], dtype=dtype)
expected = pd.DataFrame([np.nan, np.nan, np.nan], dtype=dtype)
result = np.nan + df
assert_frame_equal(result, expected)
result = df + np.nan
assert_frame_equal(result, expected)

def test_frame_radd_str(self):
df = pd.DataFrame(['x', np.nan, 'x'])
assert_frame_equal('a' + df, pd.DataFrame(['ax', np.nan, 'ax']))
assert_frame_equal(df + 'a', pd.DataFrame(['xa', np.nan, 'xa']))


class TestDataFrameOperators(TestData):

def test_operators(self):
Expand Down

0 comments on commit f00a2d1

Please sign in to comment.