'Script for getting specific values from a huge amount of measurements
I did a bending test with some material and need to calculate the modulus of elasticity. For the calculation I need three values from a list (csv or xslx) of 2500 values in 800 measurements! I would prefer not to do this in Excel, but unfortunately I am not that experienced in scripting. Maybe one of you can help:
There are four columns: "Platten_ID" that's what identifies my sample, "Force" is the value I am looking for, "Distance" also a value I need, "Time" a value that is not important.
For each sample I got round about 2500 values for Force, Distance and Time. I need the Maximum of Force (easy with Pivot-Table, but not all I need) and the value of 10% and 40% of the Maximum Force with the associated Distance value. These values must be found for each sample in the data BEFORE Maximum of Force.
The first idea was to get the minimal difference of Force to a calculated value of 10% and 40% of Max-Force, but then I get a lot of values AFTER Max-Force. I need the first value that is bigger than 10 % or 40 %. I can imagine to write some kind of for-Loop to find the Force value that is bigger than (>=) 10% or 40% respectively. Has someone an idea how to do that? I can barely understand what's happening in e.g. Python scripts, but I can not write something like that on my own. Hope you can help me! :)
Thanks a lot! Pizzabra
Solution 1:[1]
You can use Dataframe of pandas library
import pandas
df = pandas.read_csv('your_csv')
# process your file here with df
Here is the official documentation
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Community |
