Author |
Topic  |
|
Neena1695
Canada
117 Posts |
Posted - 07/03/2021 : 4:10:40 PM
|
Hello Origin users,

What function can I use to get values in column B? I want to subtract values in each row with the previous row.
Thank you, Neena |
|
easwar
USA
1965 Posts |
Posted - 07/03/2021 : 5:04:34 PM
|
Hi Neena,

Easwar OriginLab |
 |
|
Neena1695
Canada
117 Posts |
Posted - 07/03/2021 : 8:33:25 PM
|
Thank you Easwar,
A similar question: What function can I use to get values in column M? Column L is the addition of values in K sequentially from row 1. How can I get output M where the addition is done sequentially from last row to first row?

Many thanks, Neena
|
 |
|
easwar
USA
1965 Posts |
|
Neena1695
Canada
117 Posts |
Posted - 07/03/2021 : 11:32:36 PM
|
Thank you so much Easwar again!
However, the output I want is not just the reverse of the sum column. But perform the sum from the bottom row and way up to the first row. The output is different (below).

Thanks, Neena |
 |
|
easwar
USA
1965 Posts |
Posted - 07/04/2021 : 08:24:23 AM
|
Hi Neena,
Sorry...
Change the Python function to:
import numpy as np
def revcumsum(y):
y= np.cumsum(y[::-1])
return y[::-1]
Change the LabTalk code to:
range rin=1, rout=2;
rout = rin;
colreverse rout;
rout=sum(rout);
colreverse rout;
Easwar |
 |
|
Neena1695
Canada
117 Posts |
Posted - 07/04/2021 : 10:56:27 AM
|
Thank you so much Easwar! Origin is a powerful analysis platform! |
 |
|
easwar
USA
1965 Posts |
Posted - 07/04/2021 : 11:55:28 AM
|
Hi Neena,
Thank you for the comment on Origin. Can you share the user story on why you need to compute such reverse cumulative sum?
Best regards,
Easwar |
 |
|
Neena1695
Canada
117 Posts |
Posted - 07/06/2021 : 6:31:14 PM
|
Hi Easwar,
I am working with a protein for which I need to look into some properties that are different when reading the protein sequence in the forward and reverse direction. Hence, I needed the sum of input values (property of interest) in the forward and reverse direction.
Regards, Neena |
 |
|
easwar
USA
1965 Posts |
Posted - 07/06/2021 : 8:04:29 PM
|
Hi Neena,
Thank you for the response.
Easwar |
 |
|
|
Topic  |
|