Lately, I discovered pathlib.
from pathlib import Path
cwd = Path.cwd()
goal_dir = cwd.parent.parent / "my_dir"
Or, using the file of the current script:
cwd = Path(__file__).parent
goal_dir = cwd.parent.parent / "my_dir"
In both cases, the absolute path in simplified form can be found like this:
goal_dir = goal_dir.resolve()