MCPcopy
hub / github.com/huggingface/datasets / xnumpy_load

Function xnumpy_load

src/datasets/utils/file_utils.py:1238–1245  ·  view source on GitHub ↗
(filepath_or_buffer, *args, download_config: Optional[DownloadConfig] = None, **kwargs)

Source from the content-addressed store, hash-verified

1236
1237
1238def xnumpy_load(filepath_or_buffer, *args, download_config: Optional[DownloadConfig] = None, **kwargs):
1239 import numpy as np
1240
1241 if hasattr(filepath_or_buffer, "read"):
1242 return np.load(filepath_or_buffer, *args, **kwargs)
1243 else:
1244 filepath_or_buffer = str(filepath_or_buffer)
1245 return np.load(xopen(filepath_or_buffer, "rb", download_config=download_config), *args, **kwargs)
1246
1247
1248def xpandas_read_csv(filepath_or_buffer, download_config: Optional[DownloadConfig] = None, **kwargs):

Callers 1

test_xnumpy_loadFunction · 0.90

Calls 2

xopenFunction · 0.85
loadMethod · 0.45

Tested by 1

test_xnumpy_loadFunction · 0.72