I have opened this large XML file and isolated the dates. I have converted each specific date into an array, but I want to place them into a single array and after that sort them.
Here is the code:
import numpy as np
with open('dblp-2020-04-01.xml','r' , encoding="ISO-8859-1") as f:
for i, line in enumerate(f):
if "<year>" in line:
data = line[6:10]
data_list = np.array([data])
print(data_list)
The desired output is:
['2010']
['2002']
['1992']
['2002']
['1994']
...