parameters: (data, freq, tz=None)
return_statement: return libperiod.dt64arr_to_periodarr(data.view("i8"), base, tz), freq
docstring: Convert an datetime-like array to values Period ordinals.
  
      Parameters
      ----------
      data : Union[Series[datetime64[ns]], DatetimeIndex, ndarray[datetime64ns]]
      freq : Optional[Union[str, Tick]]
          Must match the `freq` on the `data` if `data` is a DatetimeIndex
          or Series.
      tz : Optional[tzinfo]
  
      Returns
      -------
      ordinals : ndarray[int]
      freq : Tick
          The frequency extracted from the Series or DatetimeIndex if that's
          used.
docstring_summary: Convert an datetime-like array to values Period ordinals.
docstring_tokens: Convert an datetime - like array to values Period ordinals .
function: def dt64arr_to_periodarr(data, freq, tz=None):
      """
      Convert an datetime-like array to values Period ordinals.
  
      Parameters
      ----------
      data : Union[Series[datetime64[ns]], DatetimeIndex, ndarray[datetime64ns]]
      freq : Optional[Union[str, Tick]]
          Must match the `freq` on the `data` if `data` is a DatetimeIndex
          or Series.
      tz : Optional[tzinfo]
  
      Returns
      -------
      ordinals : ndarray[int]
      freq : Tick
          The frequency extracted from the Series or DatetimeIndex if that's
          used.
  
      """
      if data.dtype != np.dtype("M8[ns]"):
          raise ValueError(f"Wrong dtype: {data.dtype}")
  
      if freq is None:
          if isinstance(data, ABCIndexClass):
              data, freq = data._values, data.freq
          elif isinstance(data, ABCSeries):
              data, freq = data._values, data.dt.freq
  
      freq = Period._maybe_convert_freq(freq)
  
      if isinstance(data, (ABCIndexClass, ABCSeries)):
          data = data._values
  
      base, mult = libfrequencies.get_freq_code(freq)
      return libperiod.dt64arr_to_periodarr(data.view("i8"), base, tz), freq
function_tokens: def dt64arr_to_periodarr ( data , freq , tz = None ) : if data . dtype != np . dtype ( "M8[ns]" ) : raise ValueError ( f"Wrong dtype: {data.dtype}" ) if freq is None : if isinstance ( data , ABCIndexClass ) : data , freq = data . _values , data . freq elif isinstance ( data , ABCSeries ) : data , freq = data . _values , data . dt . freq freq = Period . _maybe_convert_freq ( freq ) if isinstance ( data , ( ABCIndexClass , ABCSeries ) ) : data = data . _values base , mult = libfrequencies . get_freq_code ( freq ) return libperiod . dt64arr_to_periodarr ( data . view ( "i8" ) , base , tz ) , freq