Reputation: 1
I'm working with Microsoft Fabric's PySpark notebook and I got the Copilot spitting out good stuff about my data that I want to keep by using the chat_magics %%chat tool. I want to keep that output into a variable as a string so I can later put it somewhere useful, because just the output of a cell isn't a final solution.
Nothing seems to be working. Potential solutions I have otherwise found in order to get the output of the previous cell include using the single underscore (_) variable, subprocess.getoutput("ls -l"), and ipython.last_execution_result.result (after installing their respective libraries, of course).
The weird thing is that these solutions will work for output from a cell if it's like a calculated variable or something that's being spit out. Why not the text from the AI result? Does AI output just have to live and die in the output of the cell?
Upvotes: 0
Views: 58