MCPcopy Create free account
hub / github.com/Pometry/Raphtory / to_df

Method to_df

raphtory/src/python/graph/node_state/node_state_earliest_time.rs:365–371  ·  view source on GitHub ↗

Convert results to pandas DataFrame The DataFrame has two columns, "node" with the node ids and "value" with the corresponding values. Returns: DataFrame: A Pandas DataFrame.

(&self, py: Python<'py>)

Source from the content-addressed store, hash-verified

363 /// Returns:
364 /// DataFrame: A Pandas DataFrame.
365 fn to_df<'py>(&self, py: Python<'py>) -> PyResult<Bound<'py, PyAny>> {
366 let pandas = PyModule::import(py, "pandas")?;
367 let columns = PyDict::new(py);
368 columns.set_item("node", self.inner.nodes().id())?;
369 columns.set_item("value", self.values())?;
370 pandas.call_method("DataFrame", (columns,), None)
371 }
372}
373
374#[pymethods]

Callers

nothing calls this directly

Calls 3

idMethod · 0.45
nodesMethod · 0.45
valuesMethod · 0.45

Tested by

no test coverage detected