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

Method to_df

raphtory/src/python/graph/node_state/node_state_latest_time.rs:412–418  ·  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

410 /// Returns:
411 /// DataFrame: A Pandas DataFrame.
412 fn to_df<'py>(&self, py: Python<'py>) -> PyResult<Bound<'py, PyAny>> {
413 let pandas = PyModule::import(py, "pandas")?;
414 let columns = PyDict::new(py);
415 columns.set_item("node", self.inner.nodes().id())?;
416 columns.set_item("value", self.values())?;
417 pandas.call_method("DataFrame", (columns,), None)
418 }
419}
420
421#[pymethods]

Callers

nothing calls this directly

Calls 3

idMethod · 0.45
nodesMethod · 0.45
valuesMethod · 0.45

Tested by

no test coverage detected