class_docstr: Accessor for SparseSparse from other sparse matrix data types.
class_docstr_tok: ["Accessor","for","SparseSparse","from","other","sparse","matrix","data","types","."]
docstr: Create a Series with sparse values from a scipy.sparse.coo_matrix.
  
  Parameters
  ----------
  A : scipy.sparse.coo_matrix
  dense_index : bool, default False
      If False (default), the index consists of only the
      coords of the non-null entries of the original coo_matrix.
      If True, the index consists of the full sorted
      (row, col) coordinates of the coo_matrix.
  
  Returns
  -------
  s : Series
      A Series with sparse values.
  
  Examples
  --------
  >>> from scipy import sparse
  
  >>> A = sparse.coo_matrix(
  ...     ([3.0, 1.0, 2.0], ([1, 0, 0], [0, 2, 3])), shape=(3, 4)
  ... )
  >>> A
  <3x4 sparse matrix of type '<class 'numpy.float64'>'
  with 3 stored elements in COOrdinate format>
  
  >>> A.todense()
  matrix([[0., 0., 1., 2.],
  [3., 0., 0., 0.],
  [0., 0., 0., 0.]])
  
  >>> ss = pd.Series.sparse.from_coo(A)
  >>> ss
  0  2    1.0
     3    2.0
  1  0    3.0
  dtype: Sparse[float64, nan]
docstr_tok: ["Create","a","Series","with","sparse","values","from","a","scipy.sparse.coo_matrix",".","Parameters","--","--","--","--","--","A",":","scipy.sparse.coo_matrix","dense_index",":","bool",",","default","False","If","False","(","default",")",",","the","index","consists","of","only","the","coords","of","the","non-null","entries","of","the","original","coo_matrix",".","If","True",",","the","index","consists","of","the","full","sorted","(","row",",","col",")","coordinates","of","the","coo_matrix",".","Returns","--","--","--","-","s",":","Series","A","Series","with","sparse","values",".","Examples","--","--","--","--",">",">",">","from","scipy","import","sparse",">",">",">","A","=","sparse.coo_matrix","(","...","(","[","3.0",",","1.0",",","2.0","]",",","(","[","1",",","0",",","0","]",",","[","0",",","2",",","3","]",")",")",",","shape=","(","3",",","4",")","...",")",">",">",">","A","<","3x4","sparse","matrix","of","type","'","<","class","'numpy.float64","'",">","'","with","3","stored","elements","in","COOrdinate","format",">",">",">",">","A.todense","(",")","matrix","(","[","[","0.",",","0.",",","1.",",","2",".","]",",","[","3.",",","0.",",","0.",",","0",".","]",",","[","0.",",","0.",",","0.",",","0",".","]","]",")",">",">",">","ss","=","pd.Series.sparse.from_coo","(","A",")",">",">",">","ss","0","2","1.0","3","2.0","1","0","3.0","dtype",":","Sparse","[","float64",",","nan","]"]
code: def from_coo(cls, A, dense_index: bool = False) -> Series:
      """
      Create a Series with sparse values from a scipy.sparse.coo_matrix.
  
      Parameters
      ----------
      A : scipy.sparse.coo_matrix
      dense_index : bool, default False
          If False (default), the index consists of only the
          coords of the non-null entries of the original coo_matrix.
          If True, the index consists of the full sorted
          (row, col) coordinates of the coo_matrix.
  
      Returns
      -------
      s : Series
          A Series with sparse values.
  
      Examples
      --------
      >>> from scipy import sparse
  
      >>> A = sparse.coo_matrix(
      ...     ([3.0, 1.0, 2.0], ([1, 0, 0], [0, 2, 3])), shape=(3, 4)
      ... )
      >>> A
      <3x4 sparse matrix of type '<class 'numpy.float64'>'
      with 3 stored elements in COOrdinate format>
  
      >>> A.todense()
      matrix([[0., 0., 1., 2.],
      [3., 0., 0., 0.],
      [0., 0., 0., 0.]])
  
      >>> ss = pd.Series.sparse.from_coo(A)
      >>> ss
      0  2    1.0
         3    2.0
      1  0    3.0
      dtype: Sparse[float64, nan]
      """
      from pandas import Series
      from pandas.core.arrays.sparse.scipy_sparse import (
          coo_to_sparse_series,
      )
  
      result = coo_to_sparse_series(A, dense_index=dense_index)
      result = Series(result.array, index=result.index, copy=False)
  
      return result
  
imports: from __future__ import annotations
  from typing import TYPE_CHECKING
  import numpy
  from pandas.compat._optional import import_optional_dependency
  from pandas.core.dtypes.cast import find_common_type
  from pandas.core.accessor import PandasDelegate, delegate_names
  from pandas.core.arrays.sparse.array import SparseArray
  from pandas.core.arrays.sparse.dtype import SparseDtype
label_desc: Use image node_id 4 for calling the SparseAccessor obj's underlying member method code with example usage: obj.from_coo(cls, A, dense_index) and returns: result