Skip to content

Commit 451a29b

Browse files
authored
Update get.py
1 parent 4b07cbb commit 451a29b

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

braininventory/get.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,24 @@
1616

1717

1818
def __get_sha256_coverage(df):
19+
"""
20+
Calculate the average SHA256 coverage from a DataFrame.
21+
22+
Parameters:
23+
df (pandas.DataFrame): The DataFrame containing the 'sha256_coverage' column.
24+
25+
Returns:
26+
float: The average SHA256 coverage.
27+
28+
Raises:
29+
KeyError: If the 'sha256_coverage' column is not present in the DataFrame.
30+
31+
Example:
32+
>>> data = {'sha256_coverage': [0.75, 0.82, 0.91, 0.68, 0.79]}
33+
>>> df = pd.DataFrame(data)
34+
>>> __get_sha256_coverage(df)
35+
0.79
36+
"""
1937
average = df['sha256_coverage'].mean()
2038
return average
2139

0 commit comments

Comments
 (0)