Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openstructure
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
schwede
openstructure
Commits
7135d208
Commit
7135d208
authored
11 years ago
by
Tobias Schmidt
Browse files
Options
Downloads
Patches
Plain Diff
additional table class documentation and examples
parent
60d4e5cc
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/doc/table.rst
+33
-1
33 additions, 1 deletion
modules/doc/table.rst
with
33 additions
and
1 deletion
modules/doc/table.rst
+
33
−
1
View file @
7135d208
...
@@ -12,7 +12,7 @@ matplotlib.
...
@@ -12,7 +12,7 @@ matplotlib.
Basic Usage
Basic Usage
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Populate table with data:
Populate table with
data and plot the
data:
.. code-block:: python
.. code-block:: python
...
@@ -51,6 +51,37 @@ Iterating over table items:
...
@@ -51,6 +51,37 @@ Iterating over table items:
for foo, bar in tab.Zip('foo','bar'):
for foo, bar in tab.Zip('foo','bar'):
print foo, bar
print foo, bar
Doing element wise mathematical operations on whole colums:
.. code-block:: python
# create table with two columns, foo and bar both of int type
# and fill with values
tab=Table(['foo', 'bar'], 'ii', foo=[1,2,3,4], bar=[1,4,9,16])
# add new column by doing an element wise
# addition of column foo and column bar
tab.AddCol('qux', 'f', tab['foo']+tab['bar'])
print tab
Select part of the table based on a query:
.. code-block:: python
# create table with two columns, foo and bar both of int type
# and fill with values
tab=Table(['foo', 'bar'], 'ii', foo=[1,2,3,4], bar=[1,4,9,16])
# select all rows where foo>=2 and bar<10
subtab = tab.Select('foo>=2 and bar<10')
print subtab
# select all rows where foo>3 or bar=1
subtab = tab.Select('foo>3 or bar=1')
print subtab
Functions You Might be Interested In
Functions You Might be Interested In
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
...
@@ -64,6 +95,7 @@ Functions You Might be Interested In
...
@@ -64,6 +95,7 @@ Functions You Might be Interested In
:meth:`~ost.table.Merge` merge two tables together
:meth:`~ost.table.Merge` merge two tables together
:meth:`~ost.table.Table.Sort` sort table by column
:meth:`~ost.table.Table.Sort` sort table by column
:meth:`~ost.table.Table.Filter` filter table by values
:meth:`~ost.table.Table.Filter` filter table by values
:meth:`~ost.table.Table.Select` select subtable based on query
:meth:`~ost.table.Table.Zip` extract multiple columns at once
:meth:`~ost.table.Table.Zip` extract multiple columns at once
:meth:`~ost.table.Table.SearchColNames` search for matching column names
:meth:`~ost.table.Table.SearchColNames` search for matching column names
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment