summaryrefslogtreecommitdiff
path: root/numpy/ma
diff options
context:
space:
mode:
authorBen Walsh <b@wumpster.com>2011-07-12 16:47:12 +0100
committerMark Wiebe <mwiebe@enthought.com>2011-07-19 14:54:18 -0500
commit1dd8eb73ec89b96d17cfd46dc98aae6d97762832 (patch)
treedb7b292923bae5b9ede095c909ad8bd9d9e5d951 /numpy/ma
parentecaf1e1765eb5697a27761b49a25081b1fffb90d (diff)
downloadnumpy-1dd8eb73ec89b96d17cfd46dc98aae6d97762832.tar.gz
BUG: datetime: Various fixes for datetime arrays.
Diffstat (limited to 'numpy/ma')
-rw-r--r--numpy/ma/core.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/numpy/ma/core.py b/numpy/ma/core.py
index 4c40a7c30..72aa0b2c4 100644
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -143,6 +143,8 @@ default_filler = {'b': True,
'u' : 999999,
'V' : '???',
'U' : 'N/A',
+ 'M8[D]' : np.datetime64('1970-01-01'),
+ 'M8[us]' : np.datetime64('1970-01-01 00:00:00.000000Z')
}
max_filler = ntypes._minvals
max_filler.update([(k, -np.inf) for k in [np.float32, np.float64]])
@@ -198,6 +200,8 @@ def default_fill_value(obj):
elif isinstance(obj, np.dtype):
if obj.subdtype:
defval = default_filler.get(obj.subdtype[0].kind, '?')
+ elif obj.kind == 'M':
+ defval = default_filler.get(obj.str[1:], '?')
else:
defval = default_filler.get(obj.kind, '?')
elif isinstance(obj, float):