Deleted OSX Partition but Wish to Install OSX Again
You can use OS X Internet Recovery to install the version of OS X that came with your machine. See the Apple web site: About OS X Recovery. Be sure to hold down the three keys at startup: OptionCommand (⌘)R. From this, you can go to the App Store and download and install newer versions of OS X.

An alternative would be to use another Mac to download OS X. You can then transfer the download to a USB drive. You then use the USB drive to install OS X on your Mac. The instructions are given the Apple web site: Create a bootable installer for OS X.