Pandas 언피봇

1 개요[ | ]

Pandas 언피봇
Pandas melt
import pandas as pd

df = pd.read_csv("https://raw.githubusercontent.com/mwaskom/seaborn-data/master/iris.csv")
pd.melt(df)
import pandas as pd

df = pd.DataFrame(columns =
  ['Name' ,'English','Math'], data = [
  ['Alice', 90      , 60   ],
  ['Bob'  , 80      , None ],
  ['Carol', None    , 80   ],
  ['Dave' , 60      , 80   ],
  ['Erwin', 85      , 85   ],
  ])
pd.melt(df, id_vars=['Name'], value_vars=['English','Math'])

2 같이 보기[ | ]

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