Changeset 9636:e1a9df059e31 in orange


Ignore:
Timestamp:
02/05/12 22:14:35 (2 years ago)
Author:
markotoplak
Branch:
default
rebase_source:
d962a5c37205e86fdaf5afd91528eb8f6bdabd87
Message:

Orange.data.table documentation fixes.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • docs/reference/rst/Orange.data.table.rst

    r9372 r9636  
    66 
    77Class `Orange.data.Table` holds a list of data instances of type 
    8 :obj:`Orange.data.Instance`. All instances belong to the same domain. 
     8:obj:`Orange.data.Instance`. All instances belong to the same domain 
     9(:obj:`Orange.data.Domain`). 
     10 
     11Data tables are usually loaded from a file (see :doc:`/Orange.data.formats`):: 
     12 
     13    import Orange 
     14    data = Orange.data.Table("titanic") 
     15 
     16Data tables can also be created programmatically, as in the :ref:`code 
     17below <example-table-prog1>`. 
     18 
    919 
    1020------------------- 
     
    1222------------------- 
    1323 
    14 :obj:`Table` supports most list-like operations: gettins, setting, 
     24:obj:`Table` supports most list-like operations: getting, setting, 
    1525removing data instances, as well as methods :obj:`append` and 
    1626:obj:`extend`. The limitation is that table contain instances of 
     
    2939As usual in Python, the data table is considered False, when empty. 
    3040 
    31 ----------- 
    32   
    3341.. class:: Table 
    3442 
     
    3846        attribute is read-only. 
    3947 
    40     .. attribute:: owns_examples 
     48    .. attribute:: owns_instances 
    4149 
    4250        True, if the table contains the data instances, False if it 
     
    5260        An integer that is increased whenever the table is 
    5361        changed. This is not foolproof, since the object cannot 
    54         detect when individual examples are changed. It will, however, 
     62        detect when individual instances are changed. It will, however, 
    5563        catch any additions and removals from the table. 
    5664 
     
    6674       If the table was loaded from a file, this list of flags tells 
    6775       whether the feature descriptors were reused and how they 
    68        matched. See :ref:`file-formats` for details. 
     76       matched. See :ref:`descriptor reuse <variable_descriptor_reuse>` for details. 
    6977 
    7078    .. attribute:: meta_attribute_load_status 
     
    7785        Read data from the given file. If the name includes the 
    7886        extension it must be one of the known file formats (see 
    79         :ref:`file-formats`). If no extension is given, the directory 
     87        :doc:`/Orange.data.formats`). If no extension is given, the directory 
    8088        is searched for any file with recognized extensions. If the 
    8189        file is not found, Orange will also search the directories 
     
    8391 
    8492        The optional flag `create_new_on` decides when variable 
    85         descriptors are reused. See :ref:`file-formats` for more details. 
     93        descriptors are reused. See :ref:`descriptor reuse 
     94        <variable_descriptor_reuse>` for more details. 
    8695 
    8796        :param filename: the name of the file 
     
    9099        :type create_new_on: int 
    91100 
     101    .. _example-table-prog1: 
     102 
    92103    .. method:: __init__(domain) 
    93104 
    94105        Construct an empty data table with the given domain. 
     106 
     107        .. literalinclude:: code/datatable1.py 
     108            :lines: 7-16 
     109 
     110        The example :ref:`continues <example-table-prog2>`. 
    95111 
    96112        :param domain: domain descriptor 
    97113        :type domain: Orange.data.Domain 
    98  
    99         ..literalinclude:: code/datatable1.py 
    100         :lines: 7-16 
    101114 
    102115    .. method:: __init__(instances[, references]) 
     
    116129        :param references: if True, the new table contains references 
    117130        :type references: bool 
     131 
     132    .. _example-table-prog2: 
    118133 
    119134    .. method:: __init__(domain, instances) 
     
    130145        :type instances: Table or list or numpy.array 
    131146 
    132         The following example fills the data table created above with 
    133         some data from a list. 
     147        The following example fills the data table created :ref:`above 
     148        <example-table-prog1>` with some data from a list. 
    134149 
    135150        .. literalinclude:: code/datatable1.py 
     
    186201        following script. 
    187202 
    188         ..literalinclude:: code/datatable_merge.py 
     203        .. literalinclude:: code/datatable_merge.py 
    189204 
    190205        This is what the output looks like:: 
     
    208223 
    209224        Merging succeeds since the values of `a1` and `m1` are the 
    210         same for all matching examples from both tables. 
     225        same for all matching instances from both tables. 
    211226 
    212227    .. method:: append(inst) 
     
    249264        :param filt: filter list 
    250265        :type filt: list of integers 
    251         :param idx: selects which examples to pick 
     266        :param idx: selects which instances to pick 
    252267        :type idx: int 
    253268        :param negate: negates the selection 
     
    306321        :param filt: filter list 
    307322        :type filt: list of integers 
    308         :param idx: selects which examples to pick 
     323        :param idx: selects which instances to pick 
    309324        :type idx: int 
    310325        :param negate: negates the selection 
     
    315330 
    316331        Same as :obj:`select`, except that it returns a Python list 
    317     with data instances. 
     332    with data instances. 
    318333 
    319334        :param filt: filter list 
    320335        :type filt: list of integers 
    321         :param idx: selects which examples to pick 
     336        :param idx: selects which instances to pick 
    322337        :type idx: int 
    323338        :param negate: negates the selection 
     
    449464            Return True if any instance has a missing class value. 
    450465 
    451     .. method:: random_example() 
    452  
    453             Return a random example from the 
     466    .. method:: random_instance() 
     467 
     468            Return a random instance from the 
    454469            table. Data table's own :obj:`random_generator` is used, 
    455470            which is initially seeded to 0, so results are 
  • orange/Orange/data/variable.py

    r9349 r9636  
    285285(such as "meta" or "class"), and are separated by spaces.  
    286286 
     287.. _variable_descriptor_reuse: 
     288 
    287289Reuse of descriptors 
    288290-------------------- 
  • source/orange/_aliases.txt

    r8042 r9636  
    3232filterbool filter_bool 
    3333randomexample random_example 
     34randomexample random_instance 
    3435 
    3536ClassifierByExampleTable 
Note: See TracChangeset for help on using the changeset viewer.