Reputation: 11
How I can get dataframe out of @interact function for next cell? My interact function looks something like this:
@interact(eutPlace=eutPlaces)
def selectByEut (eutPlace):
rdsTable = tabelSisse.drop(['Id', 'Serial_number', 'User_modified'], axis='columns')
rdsTable = rdsTable.loc[rdsTable['EUT_place'] == eutPlace]
print(rdsTable.shape)
return rdsTable
Upvotes: 0
Views: 121
Reputation: 11
Found one solution. Use interactive instead of @interact.
def selectByEut (eutPlace):
rdsTable = tabelSisse.drop(['Id', 'Serial_number', 'User_modified'], axis='columns')
rdsTable = rdsTable.loc[rdsTable['EUT_place'] == eutPlace]
display(rdsTable)
return rdsTable
intrFilt = interactive(selectByEut, eutPlace=eutPlaces)
intrFilt
And in the next cell i can get the resulting dataframe with:
reducedTable = intrFilt.result
Upvotes: 1