This repository was archived by the owner on Feb 8, 2025. It is now read-only.
Display tract profiles grouped by var_interest#136
Open
pierre-nedelec wants to merge 1 commit intoyeatmanlab:mainfrom
Open
Display tract profiles grouped by var_interest#136pierre-nedelec wants to merge 1 commit intoyeatmanlab:mainfrom
pierre-nedelec wants to merge 1 commit intoyeatmanlab:mainfrom
Conversation
arokem
reviewed
Feb 10, 2023
|
|
||
|
|
||
| def plot_profiles_by_group( | ||
| tracto_df:pd.DataFrame, |
Contributor
There was a problem hiding this comment.
Type annotations! We haven't done any of those yet, but it's a good step into the future!
| tracto (pd.DataFrame): tractometry dataframe. | ||
|
|
||
| Returns: | ||
| pd.DataFrame: tractometry dataframe, with embelishments for |
Contributor
There was a problem hiding this comment.
This sentence seems to be curtailed.
|
|
||
|
|
||
|
|
||
| def optimize(df:pd.DataFrame) -> pd.DataFrame: |
Contributor
There was a problem hiding this comment.
This function name is rather generic. What does "optimize" mean here?
| @@ -0,0 +1,152 @@ | |||
| """Utility functions to manipulate tractometry type dataframe | |||
Contributor
There was a problem hiding this comment.
I think that these functions could be added to the existing "utils.py" file.
| def center_cut(df: pd.DataFrame, cut: tuple=(25,75)) -> pd.DataFrame: | ||
| """ Returns dataframe where the nodeID is cut between two indicated values. | ||
|
|
||
| Args: |
Contributor
There was a problem hiding this comment.
Please use the numpy docstring standard (used in other functions you wrote) here as well.
| sessions=1, | ||
| tracts=2, | ||
| ) -> pd.DataFrame: | ||
|
|
| tractometry data | ||
| var_df : pd.DataFrame | ||
| dataframe with categorical or pseudocontinuous variable of interest | ||
| center_cut : bool, optional |
Contributor
There was a problem hiding this comment.
Maybe we can allow center_cut to be a number between 0 and 1 that tells how much of the center to cut?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prototype of generic function to display tract profiles, grouped by a variable of interest.
Todos: