Closed yifeng021 closed 2 years ago
Every invocation of pivot_ui()
writes a file to disk, and by default it's the same file path, so subsequent calls overwrite the same file. You can set the file path manually with the outfile_path
keyword argument. If you set a different path for each call, you should be able to see multiple tables :)
I tried it and it works! Just like you said, so thank you. In some other libraries, I may create a separate object for each invocation, and I create different copies of outputs that way. In this case, since I cannot find an object, I was actually kind of guessing you might have designed one of the input arguments to store a key that uniquely identify one particular invocation, but I wasn't able to figure out outfile_path is that 'key'. Thanks for helping me put 2 and 2 together.
I am able to call pivot_ui() in Jupyter Notebook, and it works well.
What I want to do is to call pivot_ui() multiple times in a single notebook (may or may not be in the same cell). Each time pivot_ui() is called, I pass different input data into it, and I am hoping to get different pivot charts/tables, each reflecting its corresponding input data.
My example: test1.csv and test2.csv are 2 different data files. I want to create pivot charts in a same notebook page, subsequently. Here's my code:
If I run the code for test1.csv only, the I get the chart below.
If I run the code for test2.csv only, then I get the chart below.
However, if I 'Run All', then the pivot chart for test1.csv was overwritten with data from test2.csv.
Below are my 2 csv files. test1.csv test2.csv
Kindly advise if what I am hoping for is even possible. Thx!
Yifeng