MCPcopy Index your code
hub / github.com/dask/dask / meta_nonempty_dataframe

Function meta_nonempty_dataframe

dask/dataframe/backends.py:361–374  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

359
360@meta_nonempty.register(pd.DataFrame)
361def meta_nonempty_dataframe(x):
362 idx = meta_nonempty(x.index)
363 dt_s_dict = dict()
364 data = dict()
365 for i in range(len(x.columns)):
366 series = x.iloc[:, i]
367 dt = series.dtype
368 if dt not in dt_s_dict:
369 dt_s_dict[dt] = _nonempty_series(x.iloc[:, i], idx=idx)
370 data[i] = dt_s_dict[dt]
371 res = pd.DataFrame(data, index=idx, columns=np.arange(len(x.columns)))
372 res.columns = x.columns
373 res.attrs = x.attrs
374 return res
375
376
377@meta_nonempty.register(pd.Index)

Callers

nothing calls this directly

Calls 2

_nonempty_seriesFunction · 0.85
arangeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…