We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
An interesting comparison suggested by Arne Welzel that could be added:
# coding: utf-8 # In[1]: import timeit s = " ".join(["128" for x in range(86400)]) def do_split(): return [int(e) for e in s.split()] do_split()[:10] get_ipython().magic('timeit -n 100 -r 3 do_split()') # In[2]: def do_split2(): return list(map(int, s.split())) do_split2()[:10] get_ipython().magic('timeit -n 100 -r 3 do_split2()') # In[3]: import numpy as np def do_split_numpy(): return np.fromstring(s, dtype=np.int, sep=" ") do_split_numpy()[:10] get_ipython().magic('timeit -n 100 -r 3 do_split_numpy()') # In[4]: def do_split_numpy2(): return np.array(s.split()).astype(np.int) do_split_numpy2()[:10] get_ipython().magic('timeit -n 100 -r 3 do_split_numpy()')
The text was updated successfully, but these errors were encountered:
No branches or pull requests
An interesting comparison suggested by Arne Welzel that could be added:
The text was updated successfully, but these errors were encountered: