pub struct EdgesDataFrame<'a> { /* private fields */ }Available on crate feature
polars only.Expand description
A wrapper around a Polars DataFrame that represents edges in a graph.
The EdgesDataFrame struct provides a view into a Polars DataFrame with associated
source and target index columns.
This is used to facilitate operations on edge data within a DataFrame.
§Examples
use graphster::prelude::EdgesDataFrame;
use polars::prelude::*;
let s0 = Series::new("source", &[0, 1, 2]);
let s1 = Series::new("target", &[1, 2, 0]);
let s2 = Series::new("weight", &[1.0, 2.0, 3.0]);
let df = DataFrame::new(vec![s0, s1, s2]).unwrap();
let edges_df = EdgesDataFrame::new(&df, "source", "target");Implementations§
Source§impl EdgesDataFrame<'_>
impl EdgesDataFrame<'_>
Sourcepub fn new<'a>(
dataframe: &'a DataFrame,
source_index_column: &'a str,
target_index_column: &'a str,
) -> EdgesDataFrame<'a>
pub fn new<'a>( dataframe: &'a DataFrame, source_index_column: &'a str, target_index_column: &'a str, ) -> EdgesDataFrame<'a>
Creates a new EdgesDataFrame with the specified DataFrame, source index column,
and target index column.
§Examples
use graphster::prelude::EdgesDataFrame;
use polars::prelude::*;
let s0 = Series::new("source", &[0, 1, 2]);
let s1 = Series::new("target", &[1, 2, 0]);
let s2 = Series::new("weight", &[1.0, 2.0, 3.0]);
let df = DataFrame::new(vec![s0, s1, s2]).unwrap();
let edges_df = EdgesDataFrame::new(&df, "source", "target");Trait Implementations§
Source§impl<'a> Clone for EdgesDataFrame<'a>
impl<'a> Clone for EdgesDataFrame<'a>
Source§fn clone(&self) -> EdgesDataFrame<'a>
fn clone(&self) -> EdgesDataFrame<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for EdgesDataFrame<'a>
impl<'a> Debug for EdgesDataFrame<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for EdgesDataFrame<'a>
impl<'a> !UnwindSafe for EdgesDataFrame<'a>
impl<'a> Freeze for EdgesDataFrame<'a>
impl<'a> Send for EdgesDataFrame<'a>
impl<'a> Sync for EdgesDataFrame<'a>
impl<'a> Unpin for EdgesDataFrame<'a>
impl<'a> UnsafeUnpin for EdgesDataFrame<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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