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
Working on removing compat.lrange, I've found that Series will accept iterators and generators as input:
>>>pd.Series(reversed(range(3))) # Iterator work for Series001122dtype: int64>>>pd.Series((iforiinrange(3))) # Generators work for Series001122dtype: int64
If iterators and generators work when instantiating Series, I'd expect that they'd work as dict-values for DataFrames also, but they don't:
>>>pd.DataFrame({'A': reversed(range(3))}) # iterator do not workTypeError: objectof type 'range_iterator'hasnolen()
>>>pd.DataFrame({'A': (iforiinrange(3))}) # generator do not workTypeError: objectof type 'generator'hasnolen()
>>>pd.DataFrame({'A': range(3)}) # ranges workA001122
The docs say that list-likes will work as dict values, and because iterators and generators are iterables and list-like, they should work.
This issue is different than #26342, but the fix is still relatively straight forward.
I can can put up a PR one of the coming days,
The text was updated successfully, but these errors were encountered:
Working on removing
compat.lrange
, I've found that Series will accept iterators and generators as input:If iterators and generators work when instantiating Series, I'd expect that they'd work as dict-values for DataFrames also, but they don't:
The docs say that list-likes will work as dict values, and because iterators and generators are iterables and list-like, they should work.
This issue is different than #26342, but the fix is still relatively straight forward.
I can can put up a PR one of the coming days,
The text was updated successfully, but these errors were encountered: