Unique 고유값

Published by onesixx on

List데이터타입을 set으로 변경

r에서는 unique()함수.

myList = ['a', 'b', 'c', 'a', 'b', 'c', 'a']
set(myList)        # {'a', 'b', 'c'}
list(set(myList))  # ['b', 'c', 'a']

pandas.core.series.Series는 unique()

import plotly.express as px
iris = px.data.iris()
iris['species'].unique()
#array(['setosa', 'versicolor', 'virginica'], dtype=object)
list(iris['species'].unique())
# ['setosa', 'versicolor', 'virginica']

myList = ['a', 'b', 'c', 'a', 'b', 'c', 'a']
list(set(myList))  # ['b', 'c', 'a']
list(pd.Series(myList).unique())


iris['species'].value_counts()

df_eda[idx

Categories: pandas

onesixx

Blog Owner

Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x