text

How to replace specific string in data frame column value?

How to replace specific string in data frame column value? Question: I have input.txt file that has 2 columns (file_name,text) and want to replace " " seprater charchter (which represnt tab here becuse I spreated txt file by this char) that apperar in text column example for input file : 0.jpg Jól olvasom? Összesen négy, …

Total answers: 2

How to return a sentence with an exact word not as a part of the other word

How to return a sentence with an exact word not as a part of the other word Question: I need to find all sentences with exact word match. Not inside of the other words. I’m trying this: text=’He’s using apple phone. I like apples. Did you install this app? Apply today!’ [sentence + ‘.’ for …

Total answers: 1

Extracting specific string format of digits

Extracting specific string format of digits Question: Let us suppose we have text like this : text ="new notebook was sold 8 times before 13:30 in given shop" here we have 3 number presented, one is single digit 8 and last two are two digit numbers, 13,30, main point is , that 13:30 express time, …

Total answers: 3

Regex function to extract selected rows

Regex function to extract selected rows Question: I have a text file like this Some text and random stuff that I don’t need 2 8 2 9 T 4 9 1 10 2 10 F 7 11 T More random stuff How should I construct a regex function to extract both the rows with just …

Total answers: 3

How to obtain substring of big string text in Python?

How to obtain substring of big string text in Python? Question: I have the following format of text files, which are outputs of an API: TASK [Do this] OK: { "changed":false, "msg": "check ok" } TASK [Do that] OK TASK [Do x] Fatal: "Error message x" TASK [Do y] OK TASK [Do z] Fatal: "Stopped …

Total answers: 2

Writing to a text file, last entry is missing

Writing to a text file, last entry is missing Question: This code calls no errors, but my text file is not getting betty and her grade. It’s only getting the first three out of the four combinations. What am I doing wrong? Thanks! students = [‘fred’,’wilma’,’barney’,’betty’] grades = [100,75,80,90] for i in range(4): file = …

Total answers: 3

Label specific points in seaborn based on x-values

Label specific points in seaborn based on x-values Question: I have a dataframe where idividuals have some scores. The idea is to highlight the reference indididual (check) in red and the individuals with a lower score in green. Following similar problem on StackOverflow (Adding labels in x y scatter plot with seaborn), I was able …

Total answers: 1

Python Pandas Extract text between words and symbols with regex

Python Pandas Extract text between words and symbols with regex Question: I am trying to extract certain words between some text and symbol using regex in Python Pandas. The problem is that sometimes there are non-characters after the word I want to extract, and sometimes there is nothing. Here is the input table. Here is …

Total answers: 2

Replace Data and Read Write in Text File

Replace Data and Read Write in Text File Question: I wanna make the editing processes to the input text file and rewrite the result as "new text file". In my case, I have and "input.txt" and "template.txt" as of the following. I wanna rewrite "template.txt" depending on "input.txt" data by "python". I wanna skip the …

Total answers: 1