Commit cad6fc0a authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

TEST: test isSparse with date data

parent 80c87400
......@@ -7,6 +7,7 @@
import string
import random
import datetime
import itertools as it
import pytest
......@@ -269,6 +270,23 @@ def test_isSparse_naval():
assert core.isSparse(data, minpres=91, naval=0) == (True, 'minpres', 90)
def test_isSparse_date():
data = []
for i in range(100):
data.append(datetime.date(2020,
np.random.randint(1, 13),
np.random.randint(1, 29)))
data = pd.Series(data)
data.iloc[:10] = np.nan
assert core.isSparse(data, minpres=89) == (False, None, None)
assert core.isSparse(data, minpres=90) == (False, None, None)
assert core.isSparse(data, minpres=91) == (True, 'minpres', 90)
def test_redundantColumns():
size = 50
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment