반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- Google Excel
- array
- dataframe
- Mac
- Redshift
- PySpark
- Tkinter
- string
- c#
- hive
- Excel
- SQL
- 파이썬
- PANDAS
- Google Spreadsheet
- django
- google apps script
- Apache
- matplotlib
- list
- Kotlin
- GIT
- gas
- Python
- Java
- numpy
- PostgreSQL
- Github
- math
Archives
- Today
- Total
목록UNIQUE (1)
달나라 노트
Python Pandas : Series.unique (중복없는 값 추출)
Syntax Series.unique() unique method는 Series에 적용할 수 있으며 적용한 Series에 있는 값들 중 중복 없는 unique한 값들만을 numpy array의 형태로 return합니다. 다음은 unique method의 적용 예시입니다. import pandas as pd dict_item = { 'col1': [1, 2, 3, 4, 5, 4, 3, 2, 1], 'col2': [5, 4, 3, 2, 1, 8, 9, 2, 6], } df_item = pd.DataFrame(dict_item) unique_values = df_item.loc[:, 'col1'].unique() print(type(unique_values)) print(unique_values) -- Res..
Python/Python Pandas
2022. 5. 3. 01:32