Skip to content

Add example to README#7

Merged
mattcieslak merged 1 commit intomainfrom
readme-example
Jun 13, 2025
Merged

Add example to README#7
mattcieslak merged 1 commit intomainfrom
readme-example

Conversation

@mattcieslak
Copy link
Contributor

Closes #6

@mattcieslak
Copy link
Contributor Author

@smeisler could you check the pandas example?
And @tientong98 could you check R?
Both demonstrably worked with example data when I ran them, but do those idioms seem up to date?

Copy link

@smeisler smeisler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pandas example looks good! I asked ChatGPT if there was any way to optimize it, and it returned the following, only slightly different:

import pandas as pd

# Load TSVs into DataFrames
fspost_data = pd.read_csv(
    "sub-01_atlas-Schaefer2018100Parcels7Networks_surfacestats.tsv", 
    sep="\t"
)

xcpd_reho = pd.read_csv(
    "sub-01_task-emotion_dir-LR_run-1_space-fsLR_seg-4S156Parcels_stat-reho_bold.tsv", 
    sep="\t"
)

# Wide to long conversion with efficient column renaming
xcpd_reho_long = xcpd_reho.melt(var_name="StructName", value_name="reho")
xcpd_reho_long["StructName"] = xcpd_reho_long["StructName"].radd("7Networks_")

merged_data = pd.merge(fspost_data, xcpd_reho_long, on="StructName")

Copy link
Contributor

@tien-tong tien-tong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The R example looks good to me.

@mattcieslak mattcieslak merged commit 25aedde into main Jun 13, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add section to README showing how to mix with xcpd

3 participants