Skip to content

Commit aa5dfb0

Browse files
author
Andrew Archer
committed
adding series nan test
1 parent fe1ab74 commit aa5dfb0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pandas/tests/frame/test_analytics.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -2077,12 +2077,12 @@ def test_n_duplicate_index(self, df_duplicates, n, order):
20772077
def test_series_broadcasting(self):
20782078
# smoke test for numpy warnings
20792079
# GH 16378, GH 16306
2080-
df = DataFrame({'A': [np.nan, 2.0, np.nan]})
2080+
df = DataFrame([1.0, 1.0, 1.0])
2081+
df_nan = DataFrame({'A': [np.nan, 2.0, np.nan]})
20812082
s = Series([1, 1, 1])
2083+
s_nan = Series([np.nan, np.nan, 1])
20822084

20832085
with tm.assert_produces_warning(None):
2084-
df.clip_lower(s, axis=0)
2085-
df.gt(s, axis=0)
2086-
df.lt(s, axis=0)
2087-
df.le(s, axis=0)
2088-
df.ge(s, axis=0)
2086+
df_nan.clip_lower(s, axis=0)
2087+
for op in ['lt', 'le', 'gt', 'ge', 'eq', 'ne']:
2088+
getattr(df, op)(s_nan, axis=0)

0 commit comments

Comments
 (0)