import pandas as pd
dict1 = {
'列1': [1, 2, 3, 4],
'列2': [4, 5, 6, 5]
}
index1 = ['行1', '行2', '行3', '行3']
print(pd.DataFrame(dict1))
列1 列2
0 1 4
1 2 5
2 3 6
3 4 5
print(pd.DataFrame(dict1, index=index1))
列1 列2
行1 1 4
行2 2 5
行3 3 6
行3 4 5