@@ -254,7 +254,7 @@ def extend_all(module):
254254einsum = multiarray .einsum
255255isna = multiarray .isna
256256
257- def asarray (a , dtype = None , order = None ):
257+ def asarray (a , dtype = None , order = None , maskna = None , ownmaskna = False ):
258258 """
259259 Convert the input to an array.
260260
@@ -269,6 +269,13 @@ def asarray(a, dtype=None, order=None):
269269 order : {'C', 'F'}, optional
270270 Whether to use row-major ('C') or column-major ('F' for FORTRAN)
271271 memory representation. Defaults to 'C'.
272+ maskna : bool or None, optional
273+ If this is set to True, it forces the array to have an NA mask.
274+ If this is set to False, it forces the array to not have an NA
275+ mask.
276+ ownmaskna : bool, optional
277+ If this is set to True, forces the array to have a mask which
278+ it owns.
272279
273280 Returns
274281 -------
@@ -322,9 +329,10 @@ class ndarray is returned.
322329 True
323330
324331 """
325- return array (a , dtype , copy = False , order = order )
332+ return array (a , dtype , copy = False , order = order ,
333+ maskna = maskna , ownmaskna = ownmaskna )
326334
327- def asanyarray (a , dtype = None , order = None ):
335+ def asanyarray (a , dtype = None , order = None , maskna = None , ownmaskna = False ):
328336 """
329337 Convert the input to an ndarray, but pass ndarray subclasses through.
330338
@@ -339,6 +347,13 @@ def asanyarray(a, dtype=None, order=None):
339347 order : {'C', 'F'}, optional
340348 Whether to use row-major ('C') or column-major ('F') memory
341349 representation. Defaults to 'C'.
350+ maskna : bool or None, optional
351+ If this is set to True, it forces the array to have an NA mask.
352+ If this is set to False, it forces the array to not have an NA
353+ mask.
354+ ownmaskna : bool, optional
355+ If this is set to True, forces the array to have a mask which
356+ it owns.
342357
343358 Returns
344359 -------
@@ -374,9 +389,10 @@ def asanyarray(a, dtype=None, order=None):
374389 True
375390
376391 """
377- return array (a , dtype , copy = False , order = order , subok = True )
392+ return array (a , dtype , copy = False , order = order , subok = True ,
393+ maskna = maskna , ownmaskna = ownmaskna )
378394
379- def ascontiguousarray (a , dtype = None ):
395+ def ascontiguousarray (a , dtype = None , maskna = None , ownmaskna = False ):
380396 """
381397 Return a contiguous array in memory (C order).
382398
@@ -386,6 +402,13 @@ def ascontiguousarray(a, dtype=None):
386402 Input array.
387403 dtype : str or dtype object, optional
388404 Data-type of returned array.
405+ maskna : bool or None, optional
406+ If this is set to True, it forces the array to have an NA mask.
407+ If this is set to False, it forces the array to not have an NA
408+ mask.
409+ ownmaskna : bool, optional
410+ If this is set to True, forces the array to have a mask which
411+ it owns.
389412
390413 Returns
391414 -------
@@ -410,9 +433,10 @@ def ascontiguousarray(a, dtype=None):
410433 True
411434
412435 """
413- return array (a , dtype , copy = False , order = 'C' , ndmin = 1 )
436+ return array (a , dtype , copy = False , order = 'C' , ndmin = 1 ,
437+ maskna = maskna , ownmaskna = ownmaskna )
414438
415- def asfortranarray (a , dtype = None ):
439+ def asfortranarray (a , dtype = None , maskna = None , ownmaskna = False ):
416440 """
417441 Return an array laid out in Fortran order in memory.
418442
@@ -422,6 +446,13 @@ def asfortranarray(a, dtype=None):
422446 Input array.
423447 dtype : str or dtype object, optional
424448 By default, the data-type is inferred from the input data.
449+ maskna : bool or None, optional
450+ If this is set to True, it forces the array to have an NA mask.
451+ If this is set to False, it forces the array to not have an NA
452+ mask.
453+ ownmaskna : bool, optional
454+ If this is set to True, forces the array to have a mask which
455+ it owns.
425456
426457 Returns
427458 -------
@@ -446,7 +477,8 @@ def asfortranarray(a, dtype=None):
446477 True
447478
448479 """
449- return array (a , dtype , copy = False , order = 'F' , ndmin = 1 )
480+ return array (a , dtype , copy = False , order = 'F' , ndmin = 1 ,
481+ maskna = maskna , ownmaskna = ownmaskna )
450482
451483def require (a , dtype = None , requirements = None ):
452484 """
0 commit comments