The Pyramid at the End of the World: The Fact File
The shoot for the episode began on Monday, 28 November, 2016 and finished Tuesday, 17 January.

Togo Igawa plays the Secretary General of the UN in this episode, but he’s no stranger to the world of Doctor Who. In the first season of Torchwood he played Dr Tanizaki in Cyberwoman.
The Secretary General refers to the fact that the Doctor is President of Earth. In Death in Heaven it was revealed that in times of crisis (specifically if an invasion occurs), an ‘Earth President’ is inducted immediately, with complete authority over every nation state. As Kate Stewart remarked, ‘There was only one practical candidate.’ The Doctor! The position seems to have become a permanent office by the 26th Century. In Frontier in Space, the Doctor and Jo Grant met the President of Earth, an apparently elected politician, who initially suspected the Time Lord was a Draconian spy!
Much of the action takes place in Turmezistan. This is a fictitious country which first appeared in The Zygon Invasion.
The Doomsday Clock is a concept that seeks to represent the likelihood and nearness of an apocalyptic, man-made catastrophe. Its original setting (in 1947) was seven minutes to midnight, with midnight denoting the point of cataclysm. As such, the minute hand on the Doomsday Clock is a metaphor for how vulnerable the planet is to catastrophe. You can find out more about the Doomsday Clock and its history in this video.
Aside from the regular cast, The Pyramid at the End of the World marks the return of cast members Jamie Hill (the Monk), Tim Bentinck (Voice of the Monks) and Ronke Adekoluejo (Penny) from the previous episode.

‘It’s a matter of a pyramid…’ The Doctor visited the ‘real’ Great Pyramid of Giza in part 9 of The Daleks’ Master Plan. Co-incidentally, that episode also saw him pitted against a foe known as ‘The Monk’.
The idea that a harmful force cannot enter a home without the owner’s permission is a concept most closely identified with vampires, as Bill suggests, but various mythologies attribute the same limitations to other harmful creatures, such as vampire-hybrids and the Devil. Bram Stoker’s Dracula cemented this element of folklore but prior to that story’s publication in 1897, ‘creatures of the night’ such as the eponymous ‘Varney the Vampire,’ weren’t always bound by the convention.
Douglas and Erica work for Agrofuel Research Operations. An ‘agrofuel’ is (broadly speaking!) any biofuel produced by agricultural means.
‘She’s got it! By George, she’s got it!’ Here the Doctor is quoting Henry Higgins who, in My Fair Lady, declares, ‘I think she’s got it… By George, she’s got it!’ referring to Eliza Doolittle. In Ghost Light, in a clear allusion to that character, the Doctor called his companion ‘Eliza’. Incidentally, My Fair Lady is a musical version of Pygmalion, by George Bernard Shaw. Maybe the Time Lord is a fan of his… In Dragonfire we saw him reading Bernard Shaw’s 1906 work, The Doctor’s Dilemma.