我有一个这样的data.txt
16.37.235.153|119.222.242.130|38673|161|17|62|4646|
16.37.235.153|119.222.242.112|56388|161|17|62|4646|
16.37.235.200|16.37.235.153|59009|514|17|143|21271|
我想得到一份表格:
list=[['16.37.235.153','119.222.242.130',38673,161,17,62,4646]
['16.37.235.153','119.222.242.112',56388,161,17,62,4646]
['16.37.235.200','16.37.235.153',59009,514,17,143,21271]]
我试图在dtype=none的情况下使用numpy.genfromtxt,但是我得到:
VisibleDeprecationWarning: Reading unicode strings without specifying the encoding argument is deprecated. Set the encoding, use None for the system default.
list = numpy.genfromtxt('results.rw', dtype=None, delimiter = '|')
以下为列表:
[['8.254.200.14' 'False']
['8.254.200.14' 'False']
['8.254.200.46' 'False']
...
['217.243.224.144' 'False']
['217.243.224.144' 'False']
['217.243.224.144' 'False']]
谢谢你的帮助,提前谢谢你。
您好:)