Numy v0.1.2 Numy.Enumy View Source
Extend Enum for homogeneous enumerables.
Link to this section Summary
Functions
Check if all elements of a list are floats.
Check if all elements of a list are integers.
Convert all numerical elements of a list to float
type.
The dot product is the sum of the products of the corresponding entries of the two sequences of numbers.
Get mean (average) of a sequence of numbers.
Link to this section Functions
Check if all elements of a list are floats.
Examples
iex(10)> import Numy.Enumy
Numy.Enumy
iex(11)> all_floats?([1.1, 2.2, 3.3])
true
iex(12)> all_floats?([1.1, 2.2, 3])
false
Link to this function
all_integers?(enumerable)
View Sourceall_integers?(Enumerable.t()) :: boolean()
Check if all elements of a list are integers.
Examples
iex(1)> import Numy.Enumy
Numy.Enumy
iex(2)> all_integers?([1, 2, 3])
true
iex(3)> all_integers?([1.1, 2, 3])
false
Link to this function
all_numbers?(enumerable)
View Sourceall_numbers?(Enumerable.t()) :: boolean()
Link to this function
all_to_float(enumerable)
View Sourceall_to_float(Enumerable.t()) :: [float()]
Convert all numerical elements of a list to float
type.
Examples
iex(13)> all_to_float([1.1, 2.2, 3])
[1.1, 2.2, 3.0]
The dot product is the sum of the products of the corresponding entries of the two sequences of numbers.
Examples
iex> dot_product([1,2,3],[2,3,0])
8
Get mean (average) of a sequence of numbers.
Examples
iex(14)> mean([1,2,3,4,5,6,7,8,9])
5.0