Struct ella_tensor::DataFrame
source · pub struct DataFrame { /* private fields */ }Implementations§
source§impl DataFrame
impl DataFrame
pub fn col<T, S>(&self, name: &str) -> Result<Tensor<T, S>>where T: TensorValue, S: Shape,
pub fn icol<T, S>(&self, col: usize) -> Result<Tensor<T, S>>where T: TensorValue, S: Shape,
pub fn rows<R: RowFormat>(&self) -> Result<R::View>
sourcepub fn pretty_print(&self) -> impl Display + '_
pub fn pretty_print(&self) -> impl Display + '_
Examples found in repository?
examples/tensor.rs (line 22)
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
fn main() {
let x = Tensor::linspace(0_f32, 10., 100).cos();
let y = Tensor::linspace(0_f32, 10., 100).sin();
let mask = Tensor::range(0_i32, 100, 1) % 2;
let y = y.with_mask(mask.eq(0));
let z = x.unsqueeze(0) * y.unsqueeze(-1);
println!("{:?}", z);
let s1 = tensor::tensor!["A".to_string(), "B".to_string(), "C".to_string()];
let s2 = tensor::tensor![Some("A".to_string()), None, Some("B".to_string())];
println!("{:?}", s1);
println!("{:?}", s1.eq(s2));
let df = tensor::frame!(
x = Tensor::linspace(0_f32, 10., 100).cos().reshape((10, 10)),
y = Tensor::linspace(0_f32, 10., 10).sin(),
);
println!("{}", df.pretty_print());
}Trait Implementations§
source§impl FromIterator<NamedColumn> for DataFrame
impl FromIterator<NamedColumn> for DataFrame
source§fn from_iter<T: IntoIterator<Item = NamedColumn>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = NamedColumn>>(iter: T) -> Self
Creates a value from an iterator. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for DataFrame
impl Send for DataFrame
impl Sync for DataFrame
impl Unpin for DataFrame
impl !UnwindSafe for DataFrame
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more