Message Boards Message Boards

0
|
3735 Views
|
4 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Combine data analyzed separately into one notebook?

Posted 3 years ago

I have a lot of data to analyze and it's all categorized by mass and volume. So I created my analysis notebook to work for each case separately. So far so good! Now I wanted to combine them so I can analyze them side by side. What is the best way to achieve this?

My best idea so far seems a little clumsy. For each case I run my notebook and at the end it saves all variables (global) into a .mx file. Then in a new notebook I want to read all these files and organize the data... in some way that makes my life easier. We are talking about a lot of variables and lists and different objects. Ideally I would like to have them all as they were originally with an extra index to denote which mass and volume it belongs.

POSTED BY: Diego Floor
4 Replies
Posted 3 years ago

Hi Diego,

Maybe in each notebook save an Association of the following form to the corresponding .mx file. Then load them all into the analysis notebook?

Put[<|"Mass" -> 123, "Volume" -> 456, "Results" -> {x, y, z}|>, 
 NotebookFileName[] <> ".mx"]
POSTED BY: Rohit Namjoshi

There are a few ways to achieve your goal. But the obvious one is to structure your notebook as you describe which is to read the data, organise then analyse them.

I would think hard before resorting to mx files, but they may be required if you have memory issues.

Don't forget that you can organise your notebooks into sections and subsections, and that you can use loops and relative paths to access data in files.

As per my attached notebook, setup some global variables, read a bunch of data into arrays, plot them and write the data so that they can be analysed further.

It is difficult to be more specific without and idea of data sizes and what you want to do with them

Attachments:
POSTED BY: David Annetts
Posted 3 years ago

There are a few ways to achieve your goal. But the obvious one is to structure your notebook as you describe which is to read the data, organise then analyse them.

Yes, I suspect as much. I ask because often someone comes with an obscure command I never heard of like "oh you can just use the SolveYourSpecificProblem function"

Don't forget that you can organise your notebooks into sections and subsections, and that you can use loops and relative paths to access data in files.

Wait, I thought sections and subsections were there for aesthetic reasons. Currently what I do is set the working directory at the top of the notebook to the folder where the specific data I'm interested is.

POSTED BY: Diego Floor

Sections etc,. help you organise your thoughts. I typically use them to hide details in steps in an analysis so that when I execute the entire notebook, I can reproduce an output such as a plot. Such an organisation assists debugging and self-documents the workflow.

POSTED BY: David Annetts
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract