parameters: (arr, dtype="M8[ns]")
return_statement: return np.array(arr, dtype=dtype)
docstring: provide compat for construction of an array of strings to a
      np.array(..., dtype=np.datetime64(..))
      tz-changes in 1.11 that make '2015-01-01 09:00:00Z' show a deprecation
      warning, when need to pass '2015-01-01 09:00:00'
docstring_summary: provide compat for construction of an array of strings to a
      np.array(..., dtype=np.datetime64(..))
      tz-changes in 1.11 that make '2015-01-01 09:00:00Z' show a deprecation
      warning, when need to pass '2015-01-01 09:00:00'
docstring_tokens: provide compat for construction of an array of strings to a np . array ( ... dtype = np . datetime64 ( .. )) tz - changes in 1 . 11 that make 2015 - 01 - 01 09 : 00 : 00Z show a deprecation warning when need to pass 2015 - 01 - 01 09 : 00 : 00
function: def np_array_datetime64_compat(arr, dtype="M8[ns]"):
      """
      provide compat for construction of an array of strings to a
      np.array(..., dtype=np.datetime64(..))
      tz-changes in 1.11 that make '2015-01-01 09:00:00Z' show a deprecation
      warning, when need to pass '2015-01-01 09:00:00'
      """
      # is_list_like; can't import as it would be circular
      if hasattr(arr, "__iter__") and not isinstance(arr, (str, bytes)):
          arr = [_tz_replacer(s) for s in arr]
      else:
          arr = _tz_replacer(arr)
  
      return np.array(arr, dtype=dtype)
function_tokens: def np_array_datetime64_compat ( arr , dtype = "M8[ns]" ) : # is_list_like; can't import as it would be circular if hasattr ( arr , "__iter__" ) and not isinstance ( arr , ( str , bytes ) ) : arr = [ _tz_replacer ( s ) for s in arr ] else : arr = _tz_replacer ( arr ) return np . array ( arr , dtype = dtype )