vice.dataframe¶
The VICE Dataframe: base class
Provides a means of storing and accessing data with both case-insensitive strings and integers, allowing both indexing and calling.
Signature: vice.dataframe(frame)
Parameters¶
- frame
dict
A python dictionary to construct the dataframe from. Keys must all be of type
str
.
Raises¶
- TypeError
frame has a key that is not of type
str
Allowed Data Types¶
- Keys
str
[case-insensitive]column labelA label given to the stored quantity (or list/array thereof).
- Values
All
Indexing¶
str
[case-insensitive]column labelA label given to the quantities stored.
int
index for values which are array-like.If all values stored by the dataframe are array-like, the i’th value of all of them can be obtained by indexing the dataframe with
i
.
Calling¶
The VICE dataframe and all subclasses can be called rather than indexed to achieve the same result.
Functions¶
keys
todict
remove
filter
Example Code¶
>>> import vice
>>> example = vice.dataframe({
"a": [1, 2, 3],
"b": [4, 5, 6],
"c": [7, 8, 9]})
>>> example["A"]
[1, 2, 3]
>>> example("a")
[1, 2, 3]
>>> example[0]
vice.dataframe{
a --------------> 1
b --------------> 4
c --------------> 7
}
>>> example.keys()
['a', 'b', 'c']
>>> example.todict()
{'a': [1, 2, 3], 'b': [4, 5, 6], 'c': [7, 8, 9]}
>>> example.filter("c", "<", 9)
vice.dataframe{
a --------------> [1, 2]
b --------------> [4, 5]
c --------------> [7, 8]
}
- vice.dataframe.keys
- vice.dataframe.todict
- vice.dataframe.remove
- vice.dataframe.filter
- vice.core.dataframe.agb_yield_settings
- vice.core.dataframe.ccsn_yield_table
- vice.core.dataframe.channel_entrainment
- vice.core.dataframe.elemental_settings
- vice.core.dataframe.evolutionary_settings
- vice.core.dataframe.fromfile
- vice.core.dataframe.history
- vice.core.dataframe.noncustomizable
- vice.core.dataframe.saved_yields
- vice.core.dataframe.tracers
- vice.core.dataframe.yield_settings