MCPcopy
hub / github.com/dmlc/dgl / load_from_csv

Method load_from_csv

python/dgl/data/csv_dataset_base.py:280–292  ·  view source on GitHub ↗
(
        meta: MetaGraph, data_parser: Callable, base_dir=None, separator=","
    )

Source from the content-addressed store, hash-verified

278
279 @staticmethod
280 def load_from_csv(
281 meta: MetaGraph, data_parser: Callable, base_dir=None, separator=","
282 ):
283 df = BaseData.read_csv(meta.file_name, base_dir, separator)
284 graph_ids = BaseData.pop_from_dataframe(df, meta.graph_id_field)
285 if graph_ids is None:
286 raise DGLError(
287 "Missing graph id field [{}] in file [{}].".format(
288 meta.graph_id_field, meta.file_name
289 )
290 )
291 gdata = data_parser(df)
292 return GraphData(graph_ids, gdata)
293
294 @staticmethod
295 def to_dict(graph_data: "GraphData", graphs_dict: dict) -> dict:

Callers

nothing calls this directly

Calls 5

DGLErrorClass · 0.85
read_csvMethod · 0.80
pop_from_dataframeMethod · 0.80
formatMethod · 0.80
GraphDataClass · 0.70

Tested by

no test coverage detected