sevnpy.io.readlogstring

sevnpy.io.logreader.readlogstring(string: str | List[str] | Tuple[str], events: str | List[str] | Tuple[str], capturing_cols: str | List[str | int] | Tuple[str] = 'default', names: str | int | List[str | int] | None = None, IDs: str | int | List[str | int] | None = None) DataFrame | Dict[str, DataFrame][source]

Read a log string retrieving the information for the events in input

Parameters:
  • string – string containing the log

  • capturing_cols – Columns to capture If string it has to be a special value, otherwise a list of column names and/or indexes The special values are - “all”: return all the column names - “default”: return only the column names with a regex patter to catch a str an int or a float - “header”: return only the colum names of the header It is possible to include duplicated values, but they will be neglected in the output

Returns:

  • log_info (DataFrame or Dictionary) –

    • If the events input is a string return a pandas DataFrame with the log info

    • If the events input is a list of event labels, return a dictionary of pairs labe_name:DataFrame with the log info

  • .. note:: – This method returns simply a pandas Dataframe instead of the instance of the class SEVNDataLog returned by the method readfiles(). In order to access the additional information stored in The SEVNDataLog class, save the string to a file and use readfiles().

Raises:

KeyError: – If the event in input is not present in the available event list