Skip to main content

All Questions

Tagged with
0 votes
1 answer
69 views

Split the string so that special characters remain in the previous word

I'm trying to solve a problem to split a string into words, but keeping the delimeter near the previous word. I think it will be clearer with examples 'Company Name: Back in future' -> ['Company', '...
Paul's user avatar
  • 227
2 votes
2 answers
85 views

Splitting string into two parts with digits occurring in both parts

I have a sample string like 3425%4368, % in the string devide it into two parts, I want to find all digitals in the first part that has occurrence in the second part. you can see, 3 and 4 in the first ...
chariots of fire's user avatar
0 votes
3 answers
78 views

Python split() function :: Need to split "int_32\n' " so that I get int_32 alone [duplicate]

Need to split "int_32\n' " so that I get int_32 alone. I tried x = "int_32\n' " x.split("\n") I also tried x = "int_32\n' " x.splitlines() Both do not yield ...
Software Fan's user avatar
0 votes
1 answer
31 views

String cleaning removing consecutive value and put comma in the end

I have this string from an email I'm scraping: TICKET\xa0\xa0 STATE\xa0\xa0\xa0\xa0 ACCOUNT IDENTIFIER\xa0\xa0\xa0 FILE DIRECTORY\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\...
Maku's user avatar
  • 1,610
2 votes
1 answer
72 views

How to separate the string by specific symbols and write it to list?

I have the following string: my_string='11AB2AB33' I'd like to write this string in a list, so 'AB' is a single element of this list in the following way: ['1', '1', 'AB', '2', 'AB', '3', '3'] I ...
Curious's user avatar
  • 276
0 votes
1 answer
63 views

How can a number range and value be extracted from this complicated string using Python?

I have a complicated string that includes a kilometer range and a fee for users that fall into that range. Ideally, I would like to transform the string into something that I could use to easily ...
Feiznia's user avatar
  • 15
1 vote
1 answer
89 views

How to get the last characters after the third "_" in Jinja [duplicate]

Need help to get the string after the third "_" Example r_a_B_TEXAS r_asda_Bads_DALLAS r_asda_Bads_DISNEY_LAND rdd_asda_Bads_Florida_MIAMI_NICE I need this output: TEXAS DALLAS DISNEY_LAND ...
Joel Ventura Ortiz's user avatar
-1 votes
2 answers
55 views

seperating dictionary values by digits and letters [duplicate]

I'm trying to figure out how to take a dictionary value that contains digits and letters, split the digits from the letters, convert the digits to a float, prompt the user for numerical input, add ...
Bobolinger87's user avatar
0 votes
3 answers
77 views

How to convert a split string into floats but ignore objects in Python?

I have a text file 'lines.txt' as shown: 0.02 7 433 649 239 32 0.04 84 43 594 2 321 0.06 65 34 94 5 138 0.08 43 56 23 10 432 1.00 2 382 37 29 102 1.20 573 475 82 757 29 Time (s) Number (unit) Third (...
Liz N's user avatar
  • 3
-1 votes
3 answers
96 views

Split string based on delimiter into specific substrings in python stored in multiple columns

I would like to split this string A->B->C->D->E->F into substrings as A->B,B->C,C->D,D->E,E->F. I tried using split and the delimiter as '->' but that doesn't give the ...
Nivs's user avatar
  • 1
1 vote
1 answer
72 views

split object in dataframe pandas without delimiters

I'm learning python and now I want to split a string without delimiters. string is in a dataframe column pandas and I want to divide the string into multiple columns. What is the best way? Data: "...
Abco Janse's user avatar
-2 votes
4 answers
108 views

get the value after a search string in python

I need to retrieve the values from logs that contain the lines in similar below format as My input line looks like this: line = "(last_bytes wrote 66560002, cur_bytes read 33280206, curr_bytes ...
user3555115's user avatar
-4 votes
2 answers
58 views

How do i convert a list of strings into a list of dictionaries in python? [closed]

I'd like to convert a list of structurally similar strings into a list of dictionaries. Example list of strings: list_of_strings = [ 'ID payment_method email issue_date payment_date amount currency', '...
Julian B's user avatar
1 vote
4 answers
121 views

str.split() includes empty elements in returned List

I'm trying to use the split() function to split a path's name into tokens separated by '/'. Example: path = "/a/b///c/../d/.//f" list = path.split('/') I expected the output list to be ['a',...
Hoang Nguyen's user avatar
0 votes
2 answers
65 views

How to split a string with spaces into one element?

When I have the string GJ 581 g 3.1 1.36 1.22 1.67 1.51 0.15 278 248 I want to split it so it becomes ['GJ 581 g', '3.1', '1.36', '1.22', '1.67', '1.51', '0.15', '...
David Nilsson's user avatar

15 30 50 per page
1
2 3 4 5
99