Note
Pandas (2) 본문
728x90
How to create a series from a list, numpy array and dict?
# Inputs
import numpy as np
mylist = list('abcedfghijklmnopqrstuvwxyz')
myarr = np.arange(26)
mydict = dict(zip(mylist, myarr))
# Solution
ser1 = pd.Series(mylist)
ser2 = pd.Series(myarr)
ser3 = pd.Series(mydict)
print(ser3.head())
'Pandas' 카테고리의 다른 글
Pandas (6) (0) | 2022.07.26 |
---|---|
Pandas (5) (0) | 2022.07.25 |
Pandas (4) (0) | 2022.07.24 |
Pandas (3) (0) | 2022.07.20 |
Pandas (1) (0) | 2022.07.18 |
Comments