Replace the elements and keep the structure


#1

Uploading…
I got a list of numbers with a structure as the image above, I want those points subtract 1 which are greater than 1 and keep the structure. Is anyone have a good idea to do this?


#2

Your image is not coming through.

Your list should keep the same structure when you’re only applying a single function. Try using a simple conditional statement.

n>1?n-1:n


#3

image
I am sorry for the mistake, here is the picture.
I am not quite understand how to use the conditional statement, but I will try.


#4


That exactly what I want, and it work perfectly.
Thank you.@Nick_Boyts