Skip to content
Snippets Groups Projects

Make a copy of the data upon adding

1 file
+ 6
4
Compare changes
  • Side-by-side
  • Inline
+ 6
4
@@ -87,18 +87,20 @@ class DataStore1001:
"""
if not isinstance(newData, np.ndarray):
raise TypeError("Input data needs to be numpy ndarray.")
if newData.dtype.names is None:
workData = newData.copy()
if workData.dtype.names is None:
try:
newData.dtype = [(name, newData.dtype) for name in self.varnames]
workData.dtype = [(name, workData.dtype) for name in self.varnames]
except:
ValueError(
"Could not assign names to data structure, are you providing an array containing all variables?"
)
if self.data is None:
self.data = newData
self.data = workData
else:
self.data = np.append(self.data, newData)
self.data = np.append(self.data, workData)
def denanify(self, d):
dd = d.copy()
Loading