Skip to content
Advertisement

Tag: string

Converting time to take away

Hiya so I have a data frame which has the time something occurs in one column and the time that it ends in the next column. I need to try and find the time difference between the two, but theyre both strings so it wont simply let me compare them, is there a way I can change them to ints

Regular Expression split w/ Lookbehind loses second half

I have a string that contains a number of keywords. I would like to split the string into a list of those keywords (but keep the keywords because they identify what the following data means) Take the following string for example: the important keywords are “ttyp”, “pfil”, “tsng”, “tart”. I would like to split the file so the output looks:

Split number into the primes inside it

So I have a list of numbers that look like “3723311723” and “13617172343”. As you can see these numbers can be split into prime numbers e.g “3723311723” could be split into 37, 23, 31 ect. How could I write a python program that takes a number like this as an input and returns a list of the primes inside it

Advertisement