Skip to content
Snippets Groups Projects
Commit 90e5052c authored by Sortofamudkip's avatar Sortofamudkip
Browse files

get_is_narcissist_col()

parent 391c7257
No related branches found
No related tags found
No related merge requests found
......@@ -31,7 +31,7 @@ class Dataset:
return dataframe
def get_combined_anxiety_score(self, dataframe: pd.DataFrame) -> pd.Series:
"""Get the combined axiety score, as a column.
"""Get the combined anxiety score, as a column.
This score is based on the GAN, SPIN and SWL metrics.
Each of the three columns are first normalised,
then the mean is returned.
......@@ -54,7 +54,17 @@ class Dataset:
combined = (gad_normalised + spin_normalised + swl_flipped) / 3
return combined
def get_is_narcissist_col(self, dataframe: pd.DataFrame):
def get_is_narcissist_col(self, dataframe: pd.DataFrame) -> pd.Series:
"""Get a boolean narcissist column.
The Narcissism score of 1.0 is considered Not a Narcissist,
while all values above that are above are considered Narcissist.
Args:
dataframe (pd.DataFrame): the dataframe
Returns:
pd.Series: the boolean narcissist column.
"""
return np.where(dataframe["Narcissism"] <= 1.0, True, False)
def get_dataframe(self) -> pd.DataFrame:
......
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