Skip to content
Snippets Groups Projects
Commit 03c47c5e authored by niklasfranz's avatar niklasfranz
Browse files

feat: added column unique function

parent 10abf5ba
No related branches found
No related tags found
No related merge requests found
...@@ -117,6 +117,21 @@ class Dataset: ...@@ -117,6 +117,21 @@ class Dataset:
pd.Series: The sorted column. pd.Series: The sorted column.
""" """
return self.dataframe[colname].sort_values(ascending=ascending) return self.dataframe[colname].sort_values(ascending=ascending)
def get_unique_column_values(
self, colname: str):
"""Returns a count of categorical values in the dataset.
Args:
colname (str): the column name.
Returns:
string array: an array of strings containing the unique values
present in the column
"""
return self.dataframe[colname].explode().unique()
def get_category_counts( def get_category_counts(
self, colname: str, ascending: bool = None self, colname: str, ascending: bool = None
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment