How would I extract any word after second hyphen in pandas

Below is my DF df = pd.DataFrame({'A': ['a', 'b', 'c', '0'], 'B': ['0xF188-abc-cde', '0xF188-abc-abcde', '0xF188-abc-1234', '0xF188-abc-tu231er']}) Now I want to add NEW column “EXTRACT” which is an extraction of column ‘B’ after second hyphen. Below is the Expected Column. df= pd.DataFrame({'A': ['a', 'b', 'c', '0'], 'B': ["0xF188-abc-cde", '0xF188-abc-abcde', '0xF188-abc-1234', '0xF188-abc-tu231er'], 'Extract':['cde', 'abcde', '1234', 'tu231er']}) Answers: … Read more

How to get python Script output in Text file ,without overwriting current one text file

Hello I have written python code which run by task scheduler. This code delete the folder which are older than 5 days. code is working fine but I took output of this code in log text file. whenever code run existing log file overwritten. I want see every schedule log , that’s not possible now.
How I can get output of code in different file every time or in same file without overwriting data.

Looping through Dask array made of npy memmap files increases RAM without ever freeing it

Context I am trying to load multiple .npy files containing 2D arrays into one big 2D array to process it by chunk later.All of this data is bigger than my RAM so I am using the memmap storage/loading system here: pattern = os.path.join(FROM_DIR, '*.npy') paths = sorted(glob.glob(pattern)) arrays = [np.load(path, mmap_mode='r') for path in paths] … Read more