From 0ce9893ab148110ddf820b38edc19ea82ca11d20 Mon Sep 17 00:00:00 2001 From: Michael Dayan Date: Fri, 4 Jun 2021 16:49:34 +0200 Subject: [PATCH] Last commit (or maybe not) --- code/6_sMRI_quantification_stats.ipynb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/code/6_sMRI_quantification_stats.ipynb b/code/6_sMRI_quantification_stats.ipynb index 06a746c9..04215d85 100644 --- a/code/6_sMRI_quantification_stats.ipynb +++ b/code/6_sMRI_quantification_stats.ipynb @@ -3193,7 +3193,13 @@ "execution_count": null, "metadata": {}, "outputs": [], - "source": [] + "source": [ + "subjects_info_withna = bids_layout.get(suffix=\"participants\", extension=\".tsv\")[0].get_df()\n", + "subjects_info = subjects_info_withna.copy()\n", + "subjects_info[\"age\"] = subjects_info_withna[\"age\"].fillna(subjects_info_withna[\"age\"].mean())\n", + "subjects_info[\"sex\"] = subjects_info_withna[\"sex\"].fillna(subjects_info_withna[\"sex\"].mode()[0])\n", + "subjects_info.loc[subjects_info.isnull().any(axis=1), :]" + ] }, { "cell_type": "markdown",