Note
Pandas (14) 본문
728x90
How to extract items at given positions from a series
# Input
ser = pd.Series(list('abcdefghijklmnopqrstuvwxyz'))
pos = [0, 4, 8, 14, 20]
# Solution
ser.take(pos)
# output
0 a
4 e
8 i
14 o
20 u
dtype: object
'Pandas' 카테고리의 다른 글
Pandas (16) (0) | 2022.08.07 |
---|---|
Pandas (15) (0) | 2022.08.06 |
Pandas (13) (0) | 2022.08.03 |
Pandas (12) (0) | 2022.08.02 |
Pandas (11) (0) | 2022.07.31 |
Comments