Hi all, I’m trying to get my first parallel processing function working using Numba, but I’m stuck with a TypingError in nopython mode. I adapted my function to speed up array operations, yet I’m getting an error mentioning a non-precise type in my array.
Below is a sample of my adapted code:
import numpy as np
from numba import njit
sample_events = np.array([''])
@njit(parallel=True, nopython=True)
def process_events(event_data, event_list):
idx = event_data.where(event_data == 'Repair')
collected = np.array('')
remaining = event_data[idx:]
if ('LOMT' in remaining) and ('DIMT' in remaining):
for ev in remaining:
if 'FU' not in ev:
collected.append(ev)
else:
break
if len(collected) >= 5:
event_list.append(collected)
for item in progress_bar(package_list):
event_data = np.array(data['Event'].loc[data['Package'] == item].values)
process_events(event_data, sample_events)
I get an error referring to array(pyobject, 1d, C) during the Numba compilation stage. I’m unsure how to resolve this type issue. Has anyone encountered this problem or know how to fix it? Thanks for your help!