MCPcopy Index your code
hub / github.com/algorithmiaio/algorithmia-python / putNumpy

Method putNumpy

Algorithmia/datafile.py:155–164  ·  view source on GitHub ↗
(self, array)

Source from the content-addressed store, hash-verified

153 return self
154
155 def putNumpy(self, array):
156 # Post numpy array as json payload
157 np_loader = pkgutil.find_loader('numpy')
158 if np_loader is not None:
159 import numpy as np
160 encoded_array = array.tolist()
161 self.putJson(encoded_array)
162 return self
163 else:
164 raise DataApiError("Attempted to .putNumpy() a file without numpy available, please install numpy.")
165
166 def putAsZip(self, path):
167 """Zip file/directory and upload to data API location defined by `DataFile` object.

Callers 1

Calls 2

putJsonMethod · 0.95
DataApiErrorClass · 0.90

Tested by 1