A heatwave affecting the eastern part of the U.S. has put a strain on power grids, resulting in outages over parts of New York City and leaving tens of thousands without electricity.