class DataFrame(T, V)

Defined in:

frame/frame.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(index : Index(V), size : Int, **data : **T) #

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


[View source]

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 Tensors, 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

[View source]

Instance Method Detail

def [](i : V) #

[View source]
def add(other) #

[View source]
def all #

[View source]
def any #

[View source]
def bitwise_and(other) #

[View source]
def bitwise_or(other) #

[View source]
def bitwise_xor(other) #

[View source]
def c : T #

[View source]
def divide(other) #

[View source]
def each_with_index(&) #

[View source]
def equal(other) #

[View source]
def floordiv(other) #

[View source]
def greater(other) #

[View source]
def greater_equal(other) #

[View source]
def index : Index(V) #

[View source]
def left_shift(other) #

[View source]
def less(other) #

[View source]
def less_equal(other) #

[View source]
def max #

[View source]
def mean #

[View source]
def min #

[View source]
def modulo(other) #

[View source]
def multiply(other) #

[View source]
def not_equal(other) #

[View source]
def power(other) #

[View source]
def prod #

[View source]
def right_shift(other) #

[View source]
def size : Int32 #

[View source]
def std #

[View source]
def subtract(other) #

[View source]
def sum #

[View source]
def to_a #

[View source]
def unique #

[View source]