Sistema de Consulta Abierta
Sistema de consulta abierta con módulo de análisis semántico
 Todo Clases Namespaces Funciones Variables Páginas
Métodos públicos | Atributos públicos | Lista de todos los miembros
Referencia de la Clase vsm.viewer.labeleddata.DataTable
Diagrama de herencias de vsm.viewer.labeleddata.DataTable
Inheritance graph
[significado de colores y flechas]
Diagrama de colaboración para vsm.viewer.labeleddata.DataTable:
Collaboration graph
[significado de colores y flechas]

Métodos públicos

def __init__
 
def __getslice__
 
def __str__
 
def __str_compact__
 
def __str_full__
 

Atributos públicos

 table_header
 
 compact_view
 
 subcolhdr_compact
 
 subcolhdr_full
 

Descripción detallada

A subclass of list whose purpose is to store labels and
formatting information for a list of 1-dimensional structured
arrays. It also provides pretty-printing routines.

Globally, the table has a default display length for the columns
and a table header.

A column can have a column-specific header.

A subcolumn wraps the data found under a given field name. Each
subcolumn has a label and a display width.
 
:param l: List of 1-dimensional structured arrays.
:type l: list

:param table_header: The title of the object. Default is `None`.
:type table_header: string, optional
  
:param compact_view: If `True` the DataTable is displayed with its
    tokens only without the probabilities. Default is `True`
:type compact_view: boolean, optional

:attributes:
    * **table_header** (string)
        The title of the object. Default is `None`.
    * **compact_view** (boolean)
        Option of viewing tokens with or without the probabilities.
:methods:
    * **__str__**
        Returns a pretty printed string version of the object.
    * **_repr_html_**
        Returns an html table in ipython online session.

**Examples**

>>>  words = ['there','will','be','an','answer']
>>>  values = [random.random() for w in words]
>>>  arr = np.array(zip(words, values), 
        dtype=[('i', np.array(words).dtype), 
        ('value', np.array(values).dtype)])
>>>  lc = LabeledColumn(arr, 'Lyrics')
>>>  l = [lc.copy() for i in xrange(2)]
>>>  dt = DataTable(l, 'Let it be', subcolhdr_compact=['Topic', 'Words'],
               subcolhdr_full=['Word', 'Prob'], compact_view=True)
>>>  print dt
--------------------------------------------
                 Let it be                  
--------------------------------------------
Topic      Words      
--------------------------------------------
Lyrics     there      will       be         
           an         answer     
--------------------------------------------
Lyrics     there      will       be         
           an         answer     
--------------------------------------------

>>> dt.compact_view = False
>>>  print dt
    Let it be      
---------------------
        Words        
---------------------
Word       Value     
---------------------
there      0.58793   
will       0.29624   
be         0.00209   
an         0.27221   
answer     0.96118   
---------------------
        Words        
---------------------
Word       Value     
---------------------
there      0.22608   
will       0.64567   
be         0.02832   
an         0.31118   
answer     0.23083      

Documentación del constructor y destructor

def vsm.viewer.labeleddata.DataTable.__init__ (   self,
  l,
  table_header = None,
  compact_view = True,
  subcolhdr_compact = None,
  subcolhdr_full = None 
)
 

Documentación de las funciones miembro

def vsm.viewer.labeleddata.DataTable.__getslice__ (   self,
  i,
  j 
)
 
def vsm.viewer.labeleddata.DataTable.__str__ (   self)
Pretty prints the DataTable when `print` method is used.
def vsm.viewer.labeleddata.DataTable.__str_compact__ (   self,
  subcol_headers 
)
Prints DataTable when `compact_view` is `True`.
def vsm.viewer.labeleddata.DataTable.__str_full__ (   self,
  subcol_headers 
)
Prints DataTable when `compact_view` is `False`.

La documentación para esta clase fue generada a partir del siguiente fichero: