Pandas transpose

1 개요[ | ]

Pandas T
Pandas transpose()

2 예시1[ | ]

import pandas as pd
df = pd.DataFrame({'col1': [1, 2, 3], 'col2': [4, 5, 6]})
df
df.T
df.transpose()

3 예시2[ | ]

import pandas as pd
d2 = {'name': ['Alice', 'Bob'],
      'score': [9.5, 8],
      'employed': [False, True],
      'kids': [0, 0]}
df2 = pd.DataFrame(data=d2)
df2
df2_transposed = df2.T # 또는 df2.transpose()
df2_transposed

4 같이 보기[ | ]

5 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}