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>
pub fn ncols(&self) -> usize
pub fn nrows(&self) -> usize
pub fn column(&self, i: usize) -> &NamedColumn
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());
}
pub fn arrow_schema(&self) -> Schema
Trait Implementations§
Source§impl From<&DataFrame> for RecordBatch
impl From<&DataFrame> for RecordBatch
Source§impl From<DataFrame> for RecordBatch
impl From<DataFrame> for RecordBatch
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
Source§impl TryFrom<&RecordBatch> for DataFrame
impl TryFrom<&RecordBatch> for DataFrame
Auto Trait Implementations§
impl Freeze for DataFrame
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more