class DataFrame(T, V)
- DataFrame(T, V)
- Reference
- Object
Defined in:
frame/frame.crConstructors
-
.new(index : Index(V), size : Int, **data : **T)
Create a
DataFrame
from an index, and a NamedTuple of values.
Class Method Summary
-
.from_items(**data : **U) forall U
Create a
DataFrame
from a variadic number of arguments.
Instance Method Summary
- #[](i : V)
- #add(other)
- #all
- #any
- #bitwise_and(other)
- #bitwise_or(other)
- #bitwise_xor(other)
- #c : T
- #divide(other)
- #each_with_index(&)
- #equal(other)
- #floordiv(other)
- #greater(other)
- #greater_equal(other)
- #index : Index(V)
- #left_shift(other)
- #less(other)
- #less_equal(other)
- #max
- #mean
- #min
- #modulo(other)
- #multiply(other)
- #not_equal(other)
- #power(other)
- #prod
- #right_shift(other)
- #size : Int32
- #std
- #subtract(other)
- #sum
- #to_a
- #unique
Constructor Detail
Create a DataFrame
from an index, and a NamedTuple
of values. This is private so that all other methods
can coerce the values of data
to Series
, so that
no other types can be present in a DataFrame
Arguments
#index
: Index(V)
Index for all Series in the DataFrame
data
: NamedTuple
Schema and Series of the DataFrame
Class Method Detail
def self.from_items(**data : **U) forall U
#
Create a DataFrame
from a variadic number of arguments.
The arguments can be of a flexible type, as long as they are
one dimensional and can be cast to Tensor
s, and therefore
Series
.
Arguments
data
: NamedTuple of Tensor's or Enumerables
Data to convert into a DataFrame
Examples
a = Tensor.random(0.0...10.0, [4])
b = [1, 2, 3, 4]
df = DataFrame.from_items(a: a, b: b)
puts df
a b
0 4.06169 1
1 7.55353 2
2 1.26119 3
3 1.16003 4