Note

Pandas (4) 본문

Pandas

Pandas (4)

알 수 없는 사용자 2022. 7. 24. 23:05
728x90

How to combine many series to form a dataframe?

# Input
import numpy as np
ser1 = pd.Series(list('abcedfghijklmnopqrstuvwxyz'))
ser2 = pd.Series(np.arange(26))

# Solution 1
df = pd.concat([ser1, ser2], axis=1)

# Solution 2
df = pd.DataFrame({'col1': ser1, 'col2': ser2})

'Pandas' 카테고리의 다른 글

Pandas (6)  (0) 2022.07.26
Pandas (5)  (0) 2022.07.25
Pandas (3)  (0) 2022.07.20
Pandas (2)  (0) 2022.07.19
Pandas (1)  (0) 2022.07.18
Comments