Skip to content

Commit 06af281

Browse files
committed
modified visium read function by correcting header argument of pd.read_csv when reading tissue_positions.csv
1 parent 83a11d5 commit 06af281

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/squidpy/read/_read.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ def visium(
8080

8181
coords = pd.read_csv(
8282
tissue_positions_file,
83-
header=1 if tissue_positions_file.name == "tissue_positions.csv" else None,
83+
# if file name is tissue_positions.csv, then it has header, so use header=0. Else use
84+
# header=None to assign colnames as 1,2,3... explicitly
85+
header=0 if tissue_positions_file.name == "tissue_positions.csv" else None,
8486
index_col=0,
8587
)
8688
coords.columns = ["in_tissue", "array_row", "array_col", "pxl_col_in_fullres", "pxl_row_in_fullres"]

0 commit comments

Comments
 (0)