| name | sciris-dicts |
| description | Use when working with Sciris dictionaries or dataframes — sc.odict, sc.objdict, sc.dataframe, integer indexing of dicts, enumitems, object-syntax access, dataframe creation with dtypes, appendrow, or sc.dataframe.cat. |
Sciris Dictionaries and Dataframes
Reference for Sciris container types. See full tutorial: docs/tutorials/tut_dicts.ipynb.
If you need more detail, use your MCP tools (Context7 or GitMCP) to look up current Sciris documentation, or consult the other Sciris skills.
odict — Ordered Dict with Index Access
od = sc.odict(a=['some', 'strings'], b=[1, 2, 3])
od['a']
od[0]
od.keys()[0]
for i, k, v in od.enumitems():
print(f'Item {i}: {k} = {v}')
When NOT to use odict: When your dict has integer keys (ambiguous with index access).
odict vs objdict: odict is slightly faster (nanoseconds per op). Use odict for millions of operations; objdict for everything else.
objdict — odict + Object Syntax
ob = sc.objdict(key1=[1, 2], key2=[3, 4])
ob.key1
ob['key1']
ob[0]
print(f'{ob.key1 = }')
dataframe — Enhanced pd.DataFrame
Creation shortcuts
df = sc.dataframe(x=x, y=y, z=z)
df = sc.dataframe(x=x, y=y, z=z, dtypes=[str, float, bool])
df = sc.dataframe(columns=dict(x=str, y=float, z=bool), data=data)
Display
df.disp()
df.disp(precision=1, ncols=5, nrows=10)
Indexing
df['values', 1]
df[1]
In-place manipulation
df.appendrow(['d', 4, 0])
df = sc.dataframe.cat(
sc.dataframe(x=['a'], y=[1]),
dict(x=['b'], y=[2]),
[['c', 3]],
)