Skip to content

Commit cf01cac

Browse files
authored
Merge branch 'main' into 30-technique-frequency
2 parents bd5d9ff + cd48026 commit cf01cac

File tree

2 files changed

+40
-12
lines changed

2 files changed

+40
-12
lines changed

braininventory/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
from .get import *
1+
from .get import *

braininventory/get.py

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,12 @@ def __get_contributor(df):
5454
def __get_affilation(df):
5555
return df["affiliation"].value_counts().to_dict()
5656

57+
def __get_awards(df):
58+
return df["award_number"].unique()
5759

58-
def __get_award_numbers(df):
59-
return df["award_number"].value_counts().to_dict()
6060

61+
def __get_award_number(df):
62+
return df["award_number"].value_counts().to_dict()
6163

6264
def __get_species(df):
6365
return df["species"].value_counts().to_dict()
@@ -66,19 +68,22 @@ def __get_species(df):
6668
def __get_cnbtaxonomy(df):
6769
return df["cnbtaxonomy"].value_counts().to_dict()
6870

71+
def __get_genotypes(df):
72+
"""
73+
Write documentation here.
74+
"""
75+
return df["genotype"].unique()
6976

70-
def __get_samplelocalid(df):
71-
return df["samplelocalid"].value_counts().to_dict()
72-
73-
74-
def __get_genotype(df):
75-
return df["genotype"].value_counts().to_dict()
77+
def __get_genotype_frequency(df):
78+
"""
79+
Write documentation here.
80+
"""
81+
return df["genotypes"].value_counts().to_dict()
7682

7783

7884
def __get_generalmodality(df):
7985
return df["generalmodality"].value_counts().to_dict()
8086

81-
8287
def __get_techniques(df):
8388
"""
8489
Write documentation here.
@@ -92,13 +97,36 @@ def techniques_frequency(df):
9297
"""
9398
return df["technique"].value_counts().to_dict()
9499

95-
96100
def __get_locations(df):
97101
return df["locations"].value_counts().to_dict()
98102

103+
def __get_contributors(df):
104+
"""
105+
This returns an array of contributor names from the contributorname column.
106+
"""
107+
return df["contributorname"].unique()
108+
109+
110+
def __get_list_of_projects(df):
111+
"""
112+
Get the list of names for unique projects
113+
114+
Input parameter: dataframe
115+
Output: list of projects
116+
"""
117+
118+
return df["project"].unique().to_dict()
119+
99120

100-
technique_frequency(df)
121+
def __get_number_of_projects(df):
122+
"""
123+
Get the number of unique projects
124+
125+
Input parameter: dataframe
126+
Output: number of projects
127+
"""
101128

129+
return len(df["project"].unique())
102130

103131
def report():
104132
# Get today's date

0 commit comments

Comments
 (0)