mirror of
https://github.com/sahinakkaya/til.git
synced 2024-11-09 18:49:37 +01:00
543 B
543 B
This returns a numpy array:
arr = df["cluster"].to_numpy()
This returns a numpy array of unique values:
unique_arr = df["cluster"].unique()
You can also use numpy to get the unique values, although there are differences between the two methods(df.unique
doesn't sort while np.unique
does):
arr = df["cluster"].to_numpy()
unique_arr = np.unique(arr)