r/dataanalysis • • 21d ago

Data Question Suggestions for streamlining data processing

Let me explain what is happening with experiments, data processing, and data visualisation at where I am working. I need advice on if there is a more streamlined way of doing this.

We are currently testing lots of samples on many identical instruments. The instruments can run different types of analysis but the data is mostly the same coming from it. It does need some "cleaning" after collection.

We get the files from the instrument (CSV or DTA) and import them into Microsoft Excel using macros that have been setup by god knows who. These macros "clean" the data (it knows where to look because of how standard the CSV files are) and drops it into the relevant places into the Excel sheet or column. We are doing this multiple times per experiment as the data becomes available. Data is visualised by preconfigured plots as it become available.

Once the experiment finishes, the Excel worksheet is then passed around and opened by researchers and they view the data there.

This works when the experiment is very standard because the macros don't need to change. When slight changes are made to the experiment, the macro does not function as the raw data (CSV or DTA) has changed in format slightly (extra columns).

Is there a better way of doing this that is more flexible and can be more automated?

My intuition and basic research is telling me that Python is the way to go here, watch the folder for new files, somehow get the sample ID and the data needed into pandas and clean it there. Not sure where I'd go after this.

Would love some suggestions!

3 Upvotes

4 comments sorted by

1

u/AutoModerator 21d ago

Automod prevents all posts from being displayed until moderators have reviewed them. Do not delete your post or there will be nothing for the mods to review. Mods selectively choose what is permitted to be posted in r/DataAnalysis.

If your post involves Career-focused questions, including resume reviews, how to learn DA and how to get into a DA job, then the post does not belong here, but instead belongs in our sister-subreddit, r/DataAnalysisCareers.

Have you read the rules?

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/gammacoder 21d ago

The fragile part is the cleaning step, so separate it from the workbook. Keep one versioned import pipeline, using Power Query or Python, that maps each instrument format into a consistent schema, then store runs and samples centrally instead of passing files around.

PHPRunner could provide the database-backed review forms, permissions, dashboards, and shared results UI. Watching folders and cleaning CSV or DTA files would be custom integration.

Full disclosure: I’m an author of PHPRunner.

1

u/KatFromSisense 20d ago

I'd fix the extra-column breakage first by picking columns by header name instead of position, which pandas supports directly when it reads a CSV. The raw CSV and DTA files stay untouched in their own folder, with cleaned output written somewhere else, so a run can be redone. A check that stops with a plain error when an expected column goes missing or a new one shows up would help, too. Otherwise, a changed setup can drop numbers into the wrong column, and the first sign is a plot that looks off.