Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Fix misalignment of columns added to confounds matrix #403

Merged
merged 1 commit into from
Apr 21, 2022
Merged

BUG: Fix misalignment of columns added to confounds matrix #403

merged 1 commit into from
Apr 21, 2022

Conversation

cookpa
Copy link
Collaborator

@cookpa cookpa commented Apr 21, 2022

The construction of the confounds matrix mixes pandas concat methods with direct addition of columns - the latter does not respect indices. Adding a call to sort_index reorganizes the FD / motion confounds data frame such that the indices are sequential. This means subsequent addition of columns with confounds['new_col'] = data work as expected, and the CSV file is written in the order most users would expect, with indices 0,1,...,N rather than 1,2,...N,0.

Fixes #397

@cookpa
Copy link
Collaborator Author

cookpa commented Apr 21, 2022

Looks like this will also fix #382

@cookpa cookpa linked an issue Apr 21, 2022 that may be closed by this pull request
@mattcieslak
Copy link
Collaborator

Thanks Phil!! Much appreciated

@mattcieslak mattcieslak merged commit d62f8eb into PennLINC:master Apr 21, 2022
@cookpa cookpa mentioned this pull request Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants