MCPcopy Create free account
hub / github.com/alibaba/GraphScope / process_numpy

Method process_numpy

python/graphscope/framework/loader.py:201–211  ·  view source on GitHub ↗

Transform arrays to equivalent DataFrame, note the transpose is necessary.

(self, source: Sequence[np.ndarray])

Source from the content-addressed store, hash-verified

199 self.source = source
200
201 def process_numpy(self, source: Sequence[np.ndarray]):
202 """Transform arrays to equivalent DataFrame,
203 note the transpose is necessary.
204 """
205 col_names = ["f%s" % i for i in range(len(source))]
206 df = pd.DataFrame(source, col_names).T
207 types = {}
208 for i, _ in enumerate(source):
209 types[col_names[i]] = source[i].dtype
210 df = df.astype(types)
211 return self.process_pandas(df)
212
213 def process_pandas(self, source: pd.DataFrame):
214 self.protocol = "pandas"

Callers 1

resolveMethod · 0.95

Calls 1

process_pandasMethod · 0.95

Tested by

no test coverage detected