You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File py_linq\py_linq.py:199, in Enumerable.first(self, func)
192 """
193 Returns the first element in a collection
194 :func: predicate as lambda expression used to filter collection
195 :return: data element as object or NoElementsError if transformed data
196 contains no elements
197 """
198 if func is not None:
--> 199 return self.where(func).element_at(0)
200 return self.element_at(0)
File py_linq\py_linq.py:175, in Enumerable.element_at(self, n)
173 result = self[n]
174 if result is None:
--> 175 raise IndexError
176 return result
IndexError:
My gut feeling is that it's something to do with memory and how many items the Enumerable can handle, because when I run len(ACI) I don't always get 256. Any idea about it?
The text was updated successfully, but these errors were encountered:
Hi, I'm a big fan of this library and have been using it for a while, however recently I ran into a problem for which I don't understand the reason.
I define an Enumerable object, as shown below:
However, when I try to do some query on the Enumerable like
ACI.first(lambda c: c["aci"] == 100)
, in some cases I get this error:IndexError Traceback (most recent call last)
Cell In[61], line 1
----> 1 ACI.first(lambda c: c["aci"] == 100)
File py_linq\py_linq.py:199, in Enumerable.first(self, func)
192 """
193 Returns the first element in a collection
194 :func: predicate as lambda expression used to filter collection
195 :return: data element as object or NoElementsError if transformed data
196 contains no elements
197 """
198 if func is not None:
--> 199 return self.where(func).element_at(0)
200 return self.element_at(0)
File py_linq\py_linq.py:175, in Enumerable.element_at(self, n)
173 result = self[n]
174 if result is None:
--> 175 raise IndexError
176 return result
IndexError:
My gut feeling is that it's something to do with memory and how many items the Enumerable can handle, because when I run
len(ACI)
I don't always get 256. Any idea about it?The text was updated successfully, but these errors were encountered: