Skip to content

Commit 69b99f5

Browse files
authored
Update get.py
1 parent eefec85 commit 69b99f5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

braininventory/get.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@
33
import json
44
from datetime import date
55

6+
def get_jsonFile(df):
7+
"""
8+
Input: dataframe
9+
Expected Output: link that opens the jsonFile that was located in the randomly chosen row
10+
Current Output: broken link resulting in Error 404 on the webpage
11+
"""
12+
isNotZero = df[df["score"] != 0.0] #only select rows != 0
13+
randomRow = isNotZero.iloc[random.randint(0, len(isNotZero))] #select a random row of random index bt 0 and len of isNotZero
14+
jsonFile = randomRow.json_file.replace("/bil/data", "https://brainimagelibrary.org", 1) #replace (/bil/data) from the json_file
15+
print(jsonFile) #ERROR 404
616

717
def today():
818
"""

0 commit comments

Comments
 (0)