NArrayMiss is a additional class processing of missing value with to NArray for Ruby.
To use NArrayMiss class, you need invoking "require 'narray_miss.rb'" in your script.
NArrayMiss::BYTE
type code for 1 byte unsigned integer.
NArrayMiss::SINT
type code for 2 byte signed integer.
NArrayMiss::INT
type code for 4 byte signed integer.
NArrayMiss::SFLOAT
type code for single precision float.
NArrayMiss::FLOAT
type code for double precision float.
NArrayMiss::SCOMPLEX
type code for single precision complex.
NArrayMiss::COMPLEX
type code for double precision complex.
NArrayMiss::OBJECT
type code for Ruby object.
go back to Index
NArrayMiss.new(typecode, size, ...)
create NArrayMiss
of typecode.
All elements are initialized with 0.
NArrayMiss.byte(size, ...)
same as NArrayMiss.new(NArrayMiss::BYTE, size, ...).
NArrayMiss.sint(size, ...)
same as NArrayMiss.new(NArrayMiss::SINT, size, ...).
NArrayMiss.int(size, ...)
same as NArrayMiss.new(NArrayMiss::INT, size, ...).
NArrayMiss.sfloat(size, ...)
same as NArrayMiss.new(NArrayMiss::SFLOAT, size, ...).
NArrayMiss.float(size, ...)
same as NArrayMiss.new(NArrayMiss::FLOAT, size, ...).
NArrayMiss.scomplex(size, ...)
same as NArrayMiss.new(NArrayMiss::SCOMPLEX, size, ...).
NArrayMiss.complex(size, ...)
same as NArrayMiss.new(NArrayMiss::COMPLEX, size, ...).
NArrayMiss.object(size, ...)
same as NArrayMiss.new(NArrayMiss::OBJECT, size, ...).
NArrayMiss[](value, ...)
create NArrayMiss
form [value, ...].
NArrayMiss.to_nam(array [,mask])
create NArrayMiss
from array.
array must be Array
or NArray
.
NArrayMiss.to_nam_no_dup(array [,mask])
convert from array to NArrayMiss
.
go back to Index
NArrayMiss#dim
return the dimension which is the number of indices.
NArrayMiss#rank
same as NArrayMiss#dim
.
NArrayMiss#shape
return the Array
of sizes of each index.
NArrayMiss#size
return the number of total elements.
NArrayMiss#total
alias to size
NArrayMiss#length
alias to size
NArrayMiss#rank_total
return the number of total of the shape.
NArrayMiss#typecode
return the typecode.
NArrayMiss#[index]
return the value at [index].
index must be Integer, Range, Array, true
.
Index order is FORTRAN type.
NArrayMiss#slice(index)
same as NArrayMiss#[]
but keeps the rank of original array by not elimiting dimensions whose length became equal to 1 (which NArrayMiss#[]
dose).
This is not the case with the 1-dimensional indexing and masking.
NArrayMiss#set_without_validation(index,value)
replace elements at index by value.
NArrayMiss#[index] = value
replace elements at index by value and make replaced elements valid.
NArrayMiss#indgen!([start[,step]])
set values from start with step increment.
NArrayMiss#indgen([start[,step]])
same as NArrayMiss#indgen!
but create new object.
NArrayMiss#fill!(value)
fill elements with value.
NArrayMiss#fill(value)
same as NArrayMiss#fill!
but create new object.
NArrayMiss#random!(max)
set random values between 0<=x<max.
NArrayMiss#random(max)
same as NArrayMiss#random!
but create new object.
NArrayMiss#randomn(max)
set normally distributed random values with mean=0, dispersion=1 (Box-Muller)
NArrayMiss#-@
NArrayMiss#+(other)
NArrayMiss#-(other)
NArrayMiss#*(other)
NArrayMiss#/(other)
NArrayMiss#%(other)
NArrayMiss#**(other)
NArrayMiss#abs
NArrayMiss#add!(other)
NArrayMiss#sbt!(other)
NArrayMiss#mul!(other)
NArrayMiss#div!(other)
NArrayMiss#mod!(other)
NArrayMiss#mul_add(other, dim, ...)
NArrayMiss#~@
NArrayMiss#&(other)
NArrayMiss#|(other)
NArrayMiss#^(other)
NArrayMiss#eq(other)
NArrayMiss#ne(other)
NArrayMiss#gt(other)
NArrayMiss#ge(other)
NArrayMiss#lt(other)
NArrayMiss#le(other)
NArrayMiss#>(other)
NArrayMiss#>=(other)
NArrayMiss#<(other)
NArrayMiss#<=(other)
NArrayMiss#and(other)
NArrayMiss#or(other)
NArrayMiss#xor(other)
NArrayMiss#not(other)
NArrayMiss#sum(dim, ... ["min_count"=>i])
return summation of elements in specified dimensions. Elements at which the number of elements for summation is less than {{|i|}} is invalid.
NArrayMiss#accum(dim, ...)
same as NArrayMiss#sum
but not elimiting dimensions whose length became equal to 1.
NArrayMiss#min(dim, ...)
return minimum in specified dimensions. Elements at which the number of valid elements in the dimension is less than {{|i|}} is invalid.
NArrayMiss#max(dim, ...)
return maximum in specified dimensions. Elements at which the number of valid elements in the dimension is less than {{|i|}} is invalid.
NArrayMiss#mean(dim, ...)
return mean of elements in specified dimensions. Elements at which the number of elements for then mean is less than {{|i|}} is invalid.
NArrayMiss#stddev(dim, ...)
return standard deviation of elements in specified dimensions. Elements at which the number of elements for calculation the standard deviation is less than {{|i|}} is invalid.
NArrayMiss#sort(dim)
sort in the 0..dim (All dimensions if omitted)
NArrayMiss#sort_index(dim)
return index of sort result.
NArrayMiss#transpose(dim0, dim1, ...)
transpose array. The 0-th dimension goes to the dim0-th dimension of new array.
NArrayMiss#reshape!(size, ...)
change shape of array.
NArrayMiss#reshape(size, ...)
same as NArrayMiss#reshape!
but create new object.
NArrayMiss#shape=(size, ...)
same as NArrayMiss#reshape!
.
NArrayMiss#newdim!(dim)
insert new dimension with size=1
NArrayMiss#newdim(dim)
same as NArrayMiss#newdim!
but create new object.
NArrayMiss#rewrank!(dim)
same as NArrayMiss#newdim!
.
NArrayMiss#rewrank=(dim)
same as NArrayMiss#newdim!
.
NArrayMiss#floor
return NArrayMiss
of integer whose elements processed floor
.
NArrayMiss#ceil
return NArrayMiss
of integer whose elements processed ceil
.
NArrayMiss#round
return NArrayMiss
of integer whose elements processed round
.
NArrayMiss#to_i
return NArrayMiss
of integer whose elements processed to_i
.
NArrayMiss#to_f
return NArrayMiss
of float whose elements processed to_f
.
NArrayMiss#to_type(typecode)
return NArrayMiss
of typecode.
NArrayMiss#to_a
convert NArrayMiss
to Array
.
NArrayMiss#to_na([missing_value])
convert NArrayMiss
to NArray
.
if there is argument, set missing_value for invalid elements.
NArrayMiss#to_s
convert NArrayMiss
to String
as a binary data.
NArrayMiss#to_string
create NArrayMiss
of object whose elements are processed to_s
NArrayMiss#each{|i| ...}
NArrayMiss#collect{|i| ...}
NArrayMiss#collect!{|i| ...}
NArrayMiss#count_false
return the number of elements whose value==0 and valid.
NArrayMiss#count_true
return the number of elements whose value!=0 and valid.
NArrayMiss#mask(mask)
return NArrayMiss#get_mask&mask
.
NArrayMiss#all?
return true if all the valid elements are not 0 else, false.
NArrayMiss#any?
return true if any valid element is not 0 else, false.
NArrayMiss#none?
return true if none of the valid elements is not 0 else, false.
NArrayMiss#where
return NArray
of indices where valid elements are not 0.
NArrayMiss#where2
return Array
including two NArray
s of indices,
where valid elements are not 0, and 0, respectively.
NArrayMiss#real
NArrayMiss#imag
NArrayMiss#conj
NArrayMiss#angle
NArrayMiss#imag=(other)
NArrayMiss#im
NArrayMiss#swap_byte
swap byte order.
NArrayMiss#hton
convert to network byte order.
NArrayMiss#ntoh
convert from network byte order.
NArrayMiss#htov
convert to VAX byte order.
NArrayMiss#vtoh
convert from VAX byte order.
NArrayMiss#validation(index)
invalidate element at index.
index must be Integer, Range, Array, or ture
.
NArrayMiss#invalidation(index)
valiadate element at index.
index must be Integer, Range, Array, or ture
.
NArrayMiss#all_valid
set all elements valid
NArrayMiss#all_invalid
set all elements invalid
NArrayMiss#set_mask(mask)
masking by mask
NArrayMiss#set_missing_value(value)
replace invalid elements by value.
NArrayMiss#get_mask
return NArray
of byte as mask.
NArrayMiss#get_array
return NArray
as data.
NArrayMiss#valid?
return Array
whose elements are true or false corresponding to valid or invalid of elements, respectively.
NArrayMiss#count_valid
return the number of valid elements.
NArrayMiss#count_invalid
return the number of invalid elements.
NArrayMiss#integer?
return true if NArrayMiss
is byte, sint or int, else false.
NArrayMiss#complex?
return true if NArrayMiss
is scomplex or complex, else false.
NArrayMiss#dup
NArrayMiss#coerce(object)
NArrayMiss#inspect
go back to Index