mad-lab-fau / BioPsyKit

A Python package for the analysis of biopsychological data.
MIT License
42 stars 8 forks source link

questionnaire functions return 0.0 when row entries are NaN --> should return NaN #48

Open victoria1509 opened 1 year ago

victoria1509 commented 1 year ago

Description Returning 0.0 instead of NaN in certain questionnaire functions in Biopsykit when the entries (rows) contain only NaN values, particularly when calculating the sum. For instance, NaN is returned as the value when calculating the mean for a subscale/score.

To Reproduce Steps to reproduce the behavior:

  1. Use Biopsykit functions that involve sum calculations for subscales/scores.
  2. Provide a dataset with rows containing only NaN values.3.
  3. Calculate the score/subscales
  4. Check NaN rows in returned df

Expected behavior When calculating the sum for a subscale/score, the function should return NaN if the participant's row contains only NaN values.

System Specifications: