'Reading a folder containing all XML files into dataframe
I have the following data set
Unique_id Labels doc_id
0 00001 C [9149180, 3781329]
1 00002 B [4396080, 9207819, 9757979, 344087, 361152, 20...
2 00003 B [1519858, 11734712]
3 00004 A [15547167]
4 00005 C [11392916]
Now each number in the column doc_id represent an XML file(9149180.XML) in the folder name trainset.
path = "/Users/public_dat/trainset"
files = os.listdir(path)
print(len(files))
1463
Each of the XML files contains several data, I am interested in extracting the data in the file under the heading
<abstract>
The influence of different contraceptive techniques on the incidence of pelvic inflammatory disease (PID) in 672 patients was studied. The lowest frequency of PID was found in patients using hormonal
<\abstract>
and make a column with titled abstract. If the doc_id has two files then merge the data.
So I want to read the first file from the folder. To test if it's reading I did the following code
list_of_files=os.listdir(path)
file_path_file1 = os.path.join(path, list_of_files[0])
pd.read_xml(file_path_file1)
It give the output as follows
medlinecitation pubmeddata
0 NaN NaN
I was expecting a column with title 'abstract'. I am wondering how read all the files into dataframe where each row have id by the file number and column as abstract.
Solution 1:[1]
We've found that the culprit were missing Proguard rules:
-keep class okhttp3.** { *; }
-keep interface okhttp3.** { *; }
-dontwarn okhttp3.**
These were originally part of RN but they were removed: https://github.com/facebook/react-native/pull/30514
Also I don't understand why these are not documented here: https://github.com/wix/Detox/blob/master/examples/demo-react-native/android/app/proguard-rules.pro
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | sebastiandurandeu |
