반응형
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
- Redshift
- gas
- Python
- PANDAS
- GIT
- Github
- SQL
- Kotlin
- hive
- PySpark
- django
- array
- list
- matplotlib
- math
- google apps script
- Mac
- c#
- Google Spreadsheet
- 파이썬
- string
- Google Excel
- Tkinter
- PostgreSQL
- numpy
- Apache
- Excel
- Java
- dataframe
Archives
- Today
- Total
목록sample (1)
달나라 노트
Python Pandas : sample (DataFrame 섞기, DataFrame에서 랜덤한 행 추출하기, DataFrame sample, DataFrame shuffle)
pandas의 sample method는 DataFrame에서 랜덤한 행을 추출해줍니다. Syntax DataFrame.sample(frac=float, replace=True/False, ignore_index=True/False) - frac 이 옵션은 0~1 사이의 실수를 받습니다. fraction의 약자로 원본 DataFrame의 존재하는 row의 개수 중 몇%를 추출할지를 결정합니다. 0.5는 원본 DataFrame에 존재하는 row의 개수가 10개라면 그의 50%인 5개만 추출합니다. 1은 원본 DataFrame에 존재하는 row의 개수가 10개라면 그의 100%인 10개를 추출합니다. - replace 이 옵션은 행을 중복되게 추출하는걸 허용할지를 결정합니다. replace = True ->..
Python/Python Pandas
2023. 7. 26. 21:29