txt

Create txt file from Pandas Dataframe

Create txt file from Pandas Dataframe Question: I would like to save my dataframe in a way that matches an existing txt file (I have a trained model based on the this txt file and I now want to predict on new data, that needs to match this format). The target txt file looks like …

Total answers: 2

Replace one column is txt file

Replace one column is txt file Question: I have several .txt files of annotation frame coordinates of objects in images. The .txt file looks like below, the number of rows are not fixed and different for each .txt file. 2 0.063542 0.192593 0.021528 0.185185 2 0.106944 0.298148 0.030556 0.300000 2 0.186806 0.600000 0.061111 0.577778 Now …

Total answers: 3

Write array to .txt-file

Write array to .txt-file Question: In Python I need to write a list of numpy-arrays (see attached picture) to a txt.-file and then reuse that original list of arrays in a new python-file. How can I do that? read_files = open("read_files.txt","w+") content = str(df) read_files.write(content) read_files.close() Then in the new python-file I did: file = …

Total answers: 1

How do you read .txt files and export a csv file in Python

How do you read .txt files and export a csv file in Python Question: I have 4x .txt files. I want to set a list with certain words e.g. analyse, stack, ceiling, sky and I want to read from those .txt files and export a csv file with a table showing if the words in …

Total answers: 1

Convert txt python dictionary file to csv data file?

Convert txt python dictionary file to csv data file? Question: I have a text file with 300,000 records. A sample is below: {‘AIG’: ‘American International Group’, ‘AA’: ‘Alcoa Corporation’, ‘EA’: ‘Electronic Arts Inc.’} I would like to export the records into a csv file like this: I tried the following, but it does not put …

Total answers: 1

Pandas Read txt with ID duplication on the end

Pandas Read txt with ID duplication on the end Question: I would like to ask for help with the following problem: I need to use a downloaded txt data with this duplicate id at the end of the row structure. UID value1 value2 A01 99 10 A01 A02 29 12 A02 A03 96 14 A03 …

Total answers: 1

Read txt files in google colab using google drive

Read txt files in google colab using google drive Question: I would like to read txt files using google drive. In my google drive I have a dataset into this folder ‘/content/gdrive/My Drive/DATASETS/DOXES/*.txt’ the data looks like this 1) For some reason I cannot see in the ending of names the txt, is that a …

Total answers: 1

How to convert many txt files to json data in python?

How to convert many txt files to json data in python? Question: I have many txt files, and i need to megre all them in one file or variable, and i want to do them readable. Example one file content: [{‘id’: ‘dc0920dc-3fc4-4be6-be96-26d896623469’, ‘courseId’: ’00e6f05f-a395-4ad0-b10c-e5ff575d26b7′, ‘description’: ‘Если цена отклоняется от рыночной в несколько раз, это может …

Total answers: 1

Taking txt files with unknown names as parameters (Python)

Taking txt files with unknown names as parameters (Python) Question: I am trying to write a program in Pycharm that can take the name of 2 txt files as an input and then use that input to execute some set of instructions. I understand I can put the name of a txt file in the …

Total answers: 1