Combinations of all possible values from single columns

I’ve tried to find this specific question answered but not had any luck. Suppose I have a pandas dataframe with the following columns: A B C 1 2 3 4 5 6 All I’m trying to achieve is a new dataframe that has all combinations of the unique values in the individual columns themselves, so:… Read More Combinations of all possible values from single columns

python/string: how to get all the possible combinations in string considering only space for splitting the string

I have a string dt = ‘301 302 303’ how can I get different combinations of above string with considering only spaces while splitting the string. # output 301 302 303 301 302 301 303 302 303 301 302 303 >Solution : Please use itertools module turn the string to a list and then iterate… Read More python/string: how to get all the possible combinations in string considering only space for splitting the string

Remove all combination of set at the end of string REGEX

I want to write a REGEX that removes all combination of a group of characters from the end of strings. For instance removes "k", "t", "a", "u" and all of their combinations from the end of the string: Input: ["Rajakatu","Lapinlahdenktau","Nurmenkaut","Linnakoskenkuat"] Output: ["Raja","Lapinlahden","Nurmen","Linnakosken"] >Solution : How about something like this [ktau]{4}\b? https://regex101.com/r/BVwTcs/1 This will match at… Read More Remove all combination of set at the end of string REGEX