XD blog

blog page

pandas, python


2018-01-03 Small change and potentially big impact (pandas)

pandas updated its interface in its version 0.22. More particularly v0.22.0 (December 29, 2017),

print(pd.Series([]).sum())
0.0  # It was nan in 0.21.

This is typically the kind of change which could have a huge impact on many functions if you don't have unit tests to capture that. According to the documentation of sum, the previous behaviour can be retrieved by adding min_count=1.

print(pd.Series([]).sum(min_count=1))
nan

And in 10 days, computers might slow down: Kernel-memory-leaking Intel processor design flaw forces Linux, Windows redesign. See also KASLR is Dead: Long Live KASLR.


<-- -->

Xavier Dupré