2019年8月2日

pd.MultiIndex()多层次索引

摘要: In[38]:import pandas as pd m_index1=pd.MultiIndex(levels=[['A','B'],['x1','x2']],labels=[[0,1],[0,1]],name=[None,"class2"]) m_index1 Out[38]: MultiInd 阅读全文

posted @ 2019-08-02 08:54 离云1 阅读(3247) 评论(0) 推荐(0) 编辑

pd.wide_to_long()

摘要: pd.wide_to_long() pd.wide_to_long(df,stubnames(提取以指定字符串开头的列),i(用作索引的列),j(提取开头后剩余的部分会成一列,在此指定列名),sep(分隔符),suffix(捕获正则表达式匹配的后缀)) pd.wide_to_long() pd.wi 阅读全文

posted @ 2019-08-02 08:29 离云1 阅读(963) 评论(0) 推荐(0) 编辑

导航