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

Method to_df

raphtory/src/python/graph/node_state/node_state_history.rs:375–381  ·  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

373 /// Returns:
374 /// DataFrame: A Pandas DataFrame.
375 fn to_df<'py>(&self, py: Python<'py>) -> PyResult<Bound<'py, PyAny>> {
376 let pandas = PyModule::import(py, "pandas")?;
377 let columns = PyDict::new(py);
378 columns.set_item("node", self.inner.nodes().id())?;
379 columns.set_item("value", self.values())?;
380 pandas.call_method("DataFrame", (columns,), None)
381 }
382}
383
384impl

Callers

nothing calls this directly

Calls 3

idMethod · 0.45
nodesMethod · 0.45
valuesMethod · 0.45

Tested by

no test coverage detected