Skip to content

Commit 1b8ce21

Browse files
committed
- Fixed get_species function to calculate the number of unique species in the given DataFrame.
- Removed __get_md5_coverage function. - Removed report function. - Removed species_num function.
1 parent e4cf990 commit 1b8ce21

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

braininventory/get.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,19 @@
2020
import squarify
2121

2222

23+
def get_species(df):
24+
"""
25+
Calculate the number of unique species in the given DataFrame.
26+
27+
Parameters:
28+
df (pandas.DataFrame): The DataFrame containing the data.
29+
30+
Returns:
31+
int: The number of unique species present in the 'species' column of the DataFrame.
32+
"""
33+
return len(df["species"].unique())
34+
35+
2336
def __get_md5_coverage(df):
2437
"""
2538
Calculate the average MD5256 coverage from a DataFrame.
@@ -1339,9 +1352,3 @@ def report():
13391352
get_projects_treemap(df)
13401353

13411354
return report
1342-
1343-
1344-
def species_num():
1345-
#returns number of unique species. currently needs fixing because of capitalization differences
1346-
return len(df['species'].unique())
1347-

0 commit comments

Comments
 (0)