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
In the FData class, the mean function is calculated with the sum function, which has a skipna option that ignores NaN values. However, for the division it is assumed that all elements are present, which could not be correct in all cases.
Code to reproduce the bug
fromskfda.representation.gridimportFDataGriddata_matrix=np.array([
[1.0, 2.0, 3.0],
[np.nan, 2.0, 3.0],
[1.0, 2.0, np.nan],
])
fd=FDataGrid(data_matrix)
mean_fd=fd.mean(skipna=True)
print("Computed mean with skipna=True:")
print(mean_fd.data_matrix)
Bug description summary
In the FData class, the mean function is calculated with the sum function, which has a skipna option that ignores NaN values. However, for the division it is assumed that all elements are present, which could not be correct in all cases.
Code to reproduce the bug
Expected result
Computed mean with skipna=True:
[ 1.0 2.0 3.0]
Actual result
Computed mean with skipna=True:
[ 0.66 2.0 2.0]
Traceback (if an exception is raised)
No response
Software versions
scikit-fda version: 0.9.2.dev0
OS: Ubuntu 20.04.6 LTS (Focal Fossa)
Additional context
No response
The text was updated successfully, but these errors were encountered: