Switching back to mac os from Ubuntu Problems
Yes, when you installed Ubuntu, you overwrote the partition named Macintosh HD. You will need to recreate this partition before installing macOS (OS X).

You can use the Disk Utility application to erase your drive. For name, use Macintosh HD. For the format, use either Mac OS Extended (Journaled) or Mac OS Extended (Journaled, Encrypted).

Sometimes when the previous operating system was Linux, this can fail. If so, perform the steps given below.


From the menu bar, select Utilities→Terminal.
In the Terminal windows enter the following commands.

diskutil  unmountdisk  disk0
diskutil  erasedisk  jhfs+  "Macintosh HD"  GPT  disk0

Quit the Terminal application.
If you want encryption, use the Disk Utility application to erase the drive again.
Install macOS (OS X).


Note: If you install or upgrade to High Sierra and your internal drive is a SSD, then this drive will probably to converted to use the new Apple File System (APFS) format.