如果我有一列DataFrame
中的一系列数字,例如:
import pandas as pd
data = [4, 5, 6, 7, 8, 9, 10, 11]
pd.DataFrame(data)
如下所示(左列=索引,右列=数据):
0 4
1 5
2 6
3 7
4 8
5 9
6 10
7 11
我如何将它变成一个序列号,在Python 或Pandas 中是SO(4 5 6 7 8 9 10 11)? 因为我想把它放到XML文件中,所以它看起来像这样
<Or>
<numbers>
<example>4 5 6 7 8 9 10 11</example>
</numbers>
</Or>