parameters: (X, columns=None)
docstring: Iterate over columns of a matrix.
  
      Parameters
      ----------
      X : ndarray or csc_matrix, shape (n_samples, n_features)
          Matrix over which to iterate.
  
      columns : iterable or None, default None
          Indices of columns to iterate over. If None, iterate over all columns.
  
      Yields
      ------
      x : ndarray, shape (n_samples,)
          Columns of `X` in dense format.
docstring_summary: Iterate over columns of a matrix.
docstring_tokens: Iterate over columns of a matrix .
function: def _iterate_columns(X, columns=None):
      """Iterate over columns of a matrix.
  
      Parameters
      ----------
      X : ndarray or csc_matrix, shape (n_samples, n_features)
          Matrix over which to iterate.
  
      columns : iterable or None, default None
          Indices of columns to iterate over. If None, iterate over all columns.
  
      Yields
      ------
      x : ndarray, shape (n_samples,)
          Columns of `X` in dense format.
      """
      if columns is None:
          columns = range(X.shape[1])
  
      if issparse(X):
          for i in columns:
              x = np.zeros(X.shape[0])
              start_ptr, end_ptr = X.indptr[i], X.indptr[i + 1]
              x[X.indices[start_ptr:end_ptr]] = X.data[start_ptr:end_ptr]
              yield x
      else:
          for i in columns:
              yield X[:, i]
function_tokens: def _iterate_columns ( X , columns = None ) : if columns is None : columns = range ( X . shape [ 1 ] ) if issparse ( X ) : for i in columns : x = np . zeros ( X . shape [ 0 ] ) start_ptr , end_ptr = X . indptr [ i ] , X . indptr [ i + 1 ] x [ X . indices [ start_ptr : end_ptr ] ] = X . data [ start_ptr : end_ptr ] yield x else : for i in columns : yield X [ : , i ]