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
.apply(int) invokes a Python-level loop with individual function calls per element, which is much slower and more memory-intensive than .astype(int), especially for large DataFrames. Using .astype() leverages optimized, compiled code for bulk operations, making it both faster and more memory-efficient.
The text was updated successfully, but these errors were encountered:
https://github.com/pypest/pyemu/blob/22c26e96761952fc95845213eb628885e8a7fde8/autotest/utils/to_pestpp.py#L42C1-L45C50
Hi, I’d like to suggest a performance improvement to the following assignments:
These can be more efficiently rewritten using Pandas’ vectorized .astype(int) method:
.apply(int) invokes a Python-level loop with individual function calls per element, which is much slower and more memory-intensive than .astype(int), especially for large DataFrames. Using .astype() leverages optimized, compiled code for bulk operations, making it both faster and more memory-efficient.
The text was updated successfully, but these errors were encountered: