@Ashwath5245 here is an example with merged headers. You could adapt that.
Another option would be to use Openpyxl.