You can customize the structure of import statements in your Python code. Imports can be placed separately, grouped by the source, or left unstructured.
To make your choice, go to Settings/Preferences, select Editor | Code style | Python, and select the corresponding checkbox under Structure of "from" imports.