Skip to content

Commit

Permalink
ENH: Use a boolean to tell whether to serialize the pandas df index
Browse files Browse the repository at this point in the history
Use a boolean to tell whether to serialize the pandas dataframe index.

Fixes:
```
scripts/dwi_gp_estimation_error_analysis.py:220: error:
 No overload variant of "to_csv" of "NDFrame" matches argument types "Any", "str", "None", "str"  [call-overload]
scripts/dwi_gp_estimation_error_analysis.py:220: note: Possible overload variants:
scripts/dwi_gp_estimation_error_analysis.py:220: note:     def (...)
```

raised for example in:
https://github.com/nipreps/nifreeze/actions/runs/12437972140/job/34728973936#step:8:121
  • Loading branch information
jhlegarreta committed Dec 22, 2024
1 parent 97d9edf commit 5c3e7d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/dwi_gp_estimation_error_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def main() -> None:
print(f"Finished {n}-fold cross-validation")

scores_df = pd.DataFrame(scores)
scores_df.to_csv(args.output_scores, sep="\t", index=None, na_rep="n/a")
scores_df.to_csv(args.output_scores, sep="\t", index=False, na_rep="n/a")

grouped = scores_df.groupby(["n_folds"])
print(grouped[["rmse"]].mean())
Expand Down

0 comments on commit 5c3e7d3

Please sign in to comment.