def check_compressed_file(results_filename):
    """Check if results file is from compressed experiments."""

    def string_is_int(s):
        # https://stackoverflow.com/a/1267145
        try:
            int(s)
            return True
        except ValueError:
            return False

    # if a file uses compressed data, one component of the filename
    # should have the format 'n{integer}'
    for rs in results_filename.split('_'):
        if rs.startswith('n') and string_is_int(rs.split('n')[1]):
            return True
    return False