Write data_array to FeatureStorage starting from index. Notes ------ If index is None, append data_array to feature. If len(data_array) == 0; return If (index - self.end_index) >= 1, self[end_index+1: index] will be filled with np.nan E
(self, data_array: Union[List, np.ndarray, Tuple], index: int = None)
| 297 | raise NotImplementedError("Subclass of FeatureStorage must implement `clear` method") |
| 298 | |
| 299 | def write(self, data_array: Union[List, np.ndarray, Tuple], index: int = None): |
| 300 | """Write data_array to FeatureStorage starting from index. |
| 301 | |
| 302 | Notes |
| 303 | ------ |
| 304 | If index is None, append data_array to feature. |
| 305 | |
| 306 | If len(data_array) == 0; return |
| 307 | |
| 308 | If (index - self.end_index) >= 1, self[end_index+1: index] will be filled with np.nan |
| 309 | |
| 310 | Examples |
| 311 | --------- |
| 312 | .. code-block:: |
| 313 | |
| 314 | feature: |
| 315 | 3 4 |
| 316 | 4 5 |
| 317 | 5 6 |
| 318 | |
| 319 | |
| 320 | >>> self.write([6, 7], index=6) |
| 321 | |
| 322 | feature: |
| 323 | 3 4 |
| 324 | 4 5 |
| 325 | 5 6 |
| 326 | 6 6 |
| 327 | 7 7 |
| 328 | |
| 329 | >>> self.write([8], index=9) |
| 330 | |
| 331 | feature: |
| 332 | 3 4 |
| 333 | 4 5 |
| 334 | 5 6 |
| 335 | 6 6 |
| 336 | 7 7 |
| 337 | 8 np.nan |
| 338 | 9 8 |
| 339 | |
| 340 | >>> self.write([1, np.nan], index=3) |
| 341 | |
| 342 | feature: |
| 343 | 3 1 |
| 344 | 4 np.nan |
| 345 | 5 6 |
| 346 | 6 6 |
| 347 | 7 7 |
| 348 | 8 np.nan |
| 349 | 9 8 |
| 350 | |
| 351 | """ |
| 352 | raise NotImplementedError("Subclass of FeatureStorage must implement `write` method") |
| 353 | |
| 354 | def rebase(self, start_index: int = None, end_index: int = None): |
| 355 | """Rebase the start_index and end_index of the FeatureStorage. |
no outgoing calls
no test coverage detected