extract

Python Substring Regex Extraction

Python Substring Regex Extraction Question: I have the following types of strings: FWI20010112 DC20030405 etc… I need to extract segments of the strings into separate variables like this (example): name: FWI year: 2001 month: 01 day: 12 So, the name segment of the string can vary between 2 or 3 characters, and the following digits …

Total answers: 1

Extracting only a number and letter F from the column of a pandas dataframe

Extracting only a number and letter F from the column of a pandas dataframe Question: I have some data as below, AST_NAME 2F 3F 4F 5F 2-F-C 3-F-A 4-F-C 4-F-D 5-F-E 5-F-F SwB 6-F-G SwB 7-F-A I want to extract the number and letter F only from those values like 2-F-C or 3-F-D. My desired …

Total answers: 2

Extract store and location using regex and pandas

Extract store and location using regex and pandas Question: I want to extract store name and location from the to_clean column. I would like to use some regex pattern that accounts for all the different patterns and stores the store name in the store column and the location name in the location column. Something like …

Total answers: 2

Pandas: extracting values via regex in 1 column

Pandas: extracting values via regex in 1 column Question: I’m trying to extract some values from 1 column. Some rows have 3 values I want to with different setups. My dataset: col1 0 1001100100 / hello street 2 a town1 1 1001100102 ;hello 3 towns2 2 STRZ19-0072 DT001001-0100 location1 town4 3 1001100103_hello street 3, town5 …

Total answers: 2

Pandas: extract different values via regex in a single column

Pandas: extract different values via regex in a single column Question: I’m trying to extract some values from 1 column. Some rows have 4 values I want to extract and different notations for that values. My dataset: wow 0 wow-555555 1000110001 DT000333-6403, Hellostreet 45 Town1 1 (wow-666666) – 1000110002; DT000333-6404 Hellostreet 55 Town2 2 wow …

Total answers: 1

Extract certain dataframes of lists of dataframes

Extract certain dataframes of lists of dataframes Question: I have a list of dataframes. Each is build up as followed: No i want to extract the dataframes beginning at a certain time. Collection=[] for i in range(len(subdfs)): if any(subdfs[i][‘Zeitpunkt’][subdfs[i][‘Zeitpunkt’].dt.hour.eq(12)]): Collection.append(subdfs[i][‘Zeitpunkt’]) With this code i am able to extract every dataframe where the hour 12 appears. …

Total answers: 2

Regex– How to extract the text after the second hyphen for each parenthesis?

Regex– How to extract the text after the second hyphen for each parenthesis? Question: I am new to the Regex and the grammar made me confused. Here is the original string field : (f-dqcn-bus1),(f-cdqc-bus2) I would like to have the new result like bus1,bus2. There could be one or several parenthesis but the bus name …

Total answers: 2

Extract time from string in dataframe's rows into new columns

Extract time from string in dataframe's rows into new columns Question: I have a a dataframe where each lines contains text, and the start of this text is a time that is in the format of 00:00:00-00:00:01. I would like to extract the starting time, the ending time but also the difference between those time …

Total answers: 3