2020
12-14
12-14
pandas将list数据拆分成行或列的实现
数据importnumpyasnpimportpandasaspddata=[{'Name':'小明','Chinese':[70,80],'Math':[90,80]},{'Name':'小红','Chinese':[70,80,90],'Math':[90,80,70]}]data=pd.DataFrame(data)data拆分成行defsplit_row(data,column):'''拆分成行:paramdata:原始数据:paramcolumn:拆分的列名:typedata:pandas.core.frame.DataFrame:typecolumn:str'''row_len=list(map(len,data[col...
继续阅读 >