parameters: (self, freq=None, copy=True)
return_statement: return self._constructor(new_values, index=new_index).__finalize__(self)
docstring: Convert Series from DatetimeIndex to PeriodIndex with desired
          frequency (inferred from index if not passed).
  
          Parameters
          ----------
          freq : str, default None
              Frequency associated with the PeriodIndex.
          copy : bool, default True
              Whether or not to return a copy.
  
          Returns
          -------
          Series
              Series with index converted to PeriodIndex.
docstring_summary: Convert Series from DatetimeIndex to PeriodIndex with desired
          frequency (inferred from index if not passed).
docstring_tokens: Convert Series from DatetimeIndex to PeriodIndex with desired frequency ( inferred from index if not passed ) .
function: def to_period(self, freq=None, copy=True):
          """
          Convert Series from DatetimeIndex to PeriodIndex with desired
          frequency (inferred from index if not passed).
  
          Parameters
          ----------
          freq : str, default None
              Frequency associated with the PeriodIndex.
          copy : bool, default True
              Whether or not to return a copy.
  
          Returns
          -------
          Series
              Series with index converted to PeriodIndex.
          """
          new_values = self._values
          if copy:
              new_values = new_values.copy()
  
          new_index = self.index.to_period(freq=freq)
          return self._constructor(new_values, index=new_index).__finalize__(self)
function_tokens: def to_period ( self , freq = None , copy = True ) : new_values = self . _values if copy : new_values = new_values . copy ( ) new_index = self . index . to_period ( freq = freq ) return self . _constructor ( new_values , index = new_index ) . __finalize__ ( self )