oph_replace

Description

Behaviour

Returns an array in which the occurrences of a number in input array are replaced with another number.

Parameters

  • input measure type: Ophidia typing. Supported types are: ‘oph_double’; ‘oph_float’; ‘oph_long’; ‘oph_int’; ‘oph_short’; ‘oph_byte’.
  • output measure type: Ophidia typing. Supported types are: ‘oph_double’; ‘oph_float’; ‘oph_long’; ‘oph_int’; ‘oph_short’; ‘oph_byte’.
  • measure: input measure.
  • old_value: number to be replaced or suppressed.
  • new_value: new value for the element to be replaced. By default ‘old_value’ is suppressed from the array.

Return type

Binary-array.

Examples

Replace all the occurences of number 1 with 2 in a measure.

oph_replace('OPH_DOUBLE','OPH_DOUBLE',measure,1,2)

Operation type

Reduce.

Arguments

Argument name Type Mandatory Values Default Min/Max-value Min/Max-times
input measure type “oph_type” “yes” “‘oph_double’|’oph_float’|’oph_int’|’oph_long’|’oph_short’|’oph_byte’”     “1” / “1”
output measure type “oph_type” “yes” “‘oph_double’|’oph_float’|’oph_int’|’oph_long’|’oph_short’|’oph_byte’”     “1” / “1”
measure “binary-array” “yes”       “1” / “1”
old_value “double” “no”   “0”   “0” / “1”
new_value “double” “no”   “suppress the item”   “0” / “1”