simaiinox
simaiinox
Mmarimo
Created by simaiinox on 11/1/2024 in #help-support
register data source / dataframe?
Say I have a python call that returns a dataframe. without assigning it to a variable within the notebook itself, is there a way I can register it as a data source? like from a module i'm importing? Example:
def run_agent(input):
for event in agent.run(input):
# if is tabular
df = pd.DataFrame(event.content)
**mo.state.register_datasource(df, event.name + event.tool_args + "_df") # <------ saves df to var "nearest_gene_tool_chr15_88569444_df"**
mo.output.append(df)
...
...
def run_agent(input):
for event in agent.run(input):
# if is tabular
df = pd.DataFrame(event.content)
**mo.state.register_datasource(df, event.name + event.tool_args + "_df") # <------ saves df to var "nearest_gene_tool_chr15_88569444_df"**
mo.output.append(df)
...
...
10 replies