## list 转化为 pandas DataFrame
import pandas as pd
list = [['c1', 'c2', 0.5], ['c2', 'c3', 1.0]]
df = pd.DataFrame(list,columns=['from','to','rate']
## dict 转化为 DataFrame
## dict.items() return list type,then turn the dict to dataframe the same as list
dict = {'c2': 0.33333, 'c3': 0.0, 'c1': 0.66667}
df2 = pd.DataFrame(list(dict.items()),columns=['source','con_rate'])
## dict 转化为DataFrame, key 作为column 列
dict = {'c2': 0.33333, 'c3': 0.0, 'c1': 0.66667}
df2 = pd.DataFrame(dict,index=[0])