Skip to content
Advertisement

Read through a text file and output to a dataframe by Python

I have an text file as below format. I want to read through all the records in the file and output in a dataframe.


JavaScript

Expected output:

JavaScript

There will be two types of trans description. Code I am trying as below, but it only works for one line of the text file. How can I modify to read through all the records in the files? Thanks!

JavaScript

Advertisement

Answer

Try this :

JavaScript

>>> display(out)

enter image description here

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement