About numpylines code
I'm trying to use numpylines branch, but got some exception. After inspect the code, I think the numpylines might not work properly. For example:
class LineBuffer(LineSingle): def forward(self, value=NAN, size=1): self.idx += size self.lencount += size if size > 1: if BCOLZLEVEL >= 1: # Use bcolz also for resized arrays self.array = bcolz.fill(size, dflt=NAN, expectedlen=size, dtype=np.float64) else: if not PANDIZE: self.array = array.array(str('d'), [NAN] * size) else: self.array = pd.Series([NAN] * size, dtype=np.float64) #Is this right? return if False and len(self) == 1: print(self._owner, 'current len:', len(self)) print('array is:', self.array) for i in range(size): self.array.append(value)
self.array = pd.Series([NAN] * size, dtype=np.float64) #Is this right?
I think the code will overwrite data in self.array instead of appending Nan
Am I right?
run-out last edited by
@yacc2000 If you are going to ask about numpy overwrites in the linebuffer forward method, you are going to need to provide a LOT more information about what you are doing.
@yacc2000 That code is just expanding the buffer with empty values (
NAN). Later in the routine, the value is appended to the buffer. If you notice, even if
PANDIZEis false, it's still just expanding the buffer with
NANvalues, this time using a numpy array vs. a Pandas Series.