phdu package

Subpackages

Submodules

phdu.np_utils module

phdu.np_utils.rolling_view(x, window)[source]

Returns rolling view (no extra memory needed) over first axis of x. Output shape: (x.shape[0]-window+1, window, *x.shape[1:])

phdu.pd_utils module

pandas utils

Includes latex_table: f: pd.DataFrame -> latex table.

phdu.pd_utils.expand_sequences(df, dt=1, maxlen=None)[source]

Input: DataFrame. Each element is an array and all arrays start at the same time and have the same time step dt. Returns: MultiColumn DataFrame: (df.index, (df.columns, time_steps))

phdu.pd_utils.latex_table(df, index=False, **kwargs)[source]

Pandas DataFrame -> Latex table.

phdu.storage module

Move/delete data

phdu.storage.delete_files_by_ext(parent_dir, extensions, verbose=1)[source]

Removes files in parent_dir with extensions starting by (or being equal to) a certain character.

phdu.storage.delete_stdin_files(parent_dir='nuredduna_programmes/stdin_files', verbose=1)[source]

Removes nuredduna standard input (stdin) files, of the form python.exxxx (s. error) and python.oxxxx (s. output).

phdu.storage.empty_trash(verbose=1)[source]
phdu.storage.move_files(keyword, folder=None, parent_dir='data', verbose=1)[source]

Moves all files in the parent directory starting with a keyword to a folder. Attributes: - keyword: keyword to look for during file matching- - folder: Created folder to store all files matched by the keyword - parend_dir: Initial directory in which the files are contained.

Module contents