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

Method getNumpy

Algorithmia/datafile.py:96–106  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

94 return self.client.getHelper(self.url).json()
95
96 def getNumpy(self):
97 exists, error = self.existsWithError()
98 if not exists:
99 raise DataApiError('unable to get file {} - {}'.format(self.path, error))
100 np_loader = pkgutil.find_loader('numpy')
101 if np_loader is not None:
102 import numpy as np
103 payload = self.client.getHelper(self.url).json()
104 return np.array(payload)
105 else:
106 raise DataApiError("Attempted to .getNumpy() file without numpy available, please install numpy.")
107
108 def exists(self):
109 # In order to not break backward compatability keeping this method to only return

Callers 1

Calls 3

existsWithErrorMethod · 0.95
DataApiErrorClass · 0.90
getHelperMethod · 0.80

Tested by 1