Skip to content

TST: add NaN tests for all data types (#12535) #27378

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion pandas/tests/window/test_dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,18 @@ def get_expects(self):
"var": Series([np.nan, 2, 2, 2, 2], dtype="float64"),
"median": Series([np.nan, 9, 7, 5, 3], dtype="float64"),
},
"sr3": {
"count": Series([1, 2, 2, 1, 1], dtype="float64"),
"max": Series([np.nan, 1, 2, np.nan, np.nan], dtype="float64"),
"min": Series([np.nan, 0, 1, np.nan, np.nan], dtype="float64"),
"sum": Series([np.nan, 1, 3, np.nan, np.nan], dtype="float64"),
"mean": Series([np.nan, 0.5, 1.5, np.nan, np.nan], dtype="float64"),
"std": Series(
[np.nan] + [np.sqrt(0.5)] * 2 + [np.nan] * 2, dtype="float64"
),
"var": Series([np.nan, 0.5, 0.5, np.nan, np.nan], dtype="float64"),
"median": Series([np.nan, 0.5, 1.5, np.nan, np.nan], dtype="float64"),
},
"df": {
"count": DataFrame(
{0: Series([1, 2, 2, 2, 2]), 1: Series([1, 2, 2, 2, 2])},
Expand Down Expand Up @@ -99,9 +111,11 @@ def get_expects(self):
def _create_dtype_data(self, dtype):
sr1 = Series(np.arange(5), dtype=dtype)
sr2 = Series(np.arange(10, 0, -2), dtype=dtype)
sr3 = sr1.copy()
sr3[3] = np.NaN
df = DataFrame(np.arange(10).reshape((5, 2)), dtype=dtype)

data = {"sr1": sr1, "sr2": sr2, "df": df}
data = {"sr1": sr1, "sr2": sr2, "sr3": sr3, "df": df}

return data

Expand Down