parsing

Comparing data from 2 text files in python

Comparing data from 2 text files in python Question: There are 2 text files, the first contains words (file1.txt) that will need to be searched in the lines of another file, for example: window factory scientist In another text file, data (file2.txt) where to look for, for example: window – Anton, game crossroads, snow factory …

Total answers: 1

Polars Python not converting to Datetime format when parsing

Polars Python not converting to Datetime format when parsing Question: Like the title says, I don’t know why it’s not converting to datetime. df = pl.read_csv(file, ignore_errors=True, parse_dates=True) df.columns = list(map(lambda x: x.replace(‘ ‘, ”), df.columns)) df_new = df.select(pl.col([‘Date_Convert’,’Region’])) print(df_new.head()) shape: (5, 2) enter image description here I tried doing it without parsing on load. …

Total answers: 2

Trouble with strptime() conversion of duration time string

Trouble with strptime() conversion of duration time string Question: I have some duration type data (lap times) as pl.Utf8 that fails to convert using strptime, whereas regular datetimes work as expected. Minutes (before 🙂 and Seconds (before .) are always padded to two digits, Milliseconds are always 3 digits. Lap times are always < 2 …

Total answers: 3

Adding a Substring to a String without knowing the position

Adding a Substring to a String without knowing the position Question: I want to add a char(newline) to a String by specifiying the location with a Substring. Is that possible in Python or Java? Here’s how I imagine it, Newline is added to the String at the position between two arrays ‘],’: str = [[a,b,c], …

Total answers: 1

Parsing / reformatting a tokenized list in python

Parsing / reformatting a tokenized list in python Question: I have lists of tokens of the form "(a OR b) AND c OR d AND c" or "(a OR b) AND c OR (d AND c)" I want to reformat these tokens into a string of the form: Expressions are of arbitrary form like (a …

Total answers: 1

Parser returns either 'None' or '[]'

Parser returns either 'None' or '[]' Question: Here’s the code: import requests from bs4 import BeautifulSoup as b URL = ‘https://ege.sdamgia.ru/’ r = requests.get(URL) soup = b(r.text, ‘html.parser’) topics = soup.find_all(class_="Link-U Link_wrap-U Link_pseudo-U Link_pseudoBlack-U") print(topics) Please help guys I want my parser to return topic titles from that site Asked By: UPTOWN || Source Answers: …

Total answers: 1

Splitting string using RegEx

Splitting string using RegEx Question: I’m trying to use RegEx Tokenize to split the following string data: "• General The general responsibilities of the role are XYZ • Physical Demands The Physical Demands of this role are XYZ • Education Requirements The education requirements for this role are • Bachelor’s Degree • Appropriate Certification • …

Total answers: 1

python text parsing to split list into chunks including preceding delimiters

python text parsing to split list into chunks including preceding delimiters Question: What I Have After OCR’ing some public Q&A deposition pdfs which have a Q&A form, I have raw text like the following: text = """nannQ So I do first want to bring up exhibit No. 46, which is in the binder in front …

Total answers: 3

Remove HTML markup (getting the desired text)

Remove HTML markup (getting the desired text) Question: When parsing data from an AJAX table, the data is parsed with the type "bs4.element.Tag" (checked via "type"): enter image description here Although I specified the text attribute when requesting: enter image description here And I can’t get the text i need inside the HTML markup. As …

Total answers: 1