Question:
Erik Weisz was born in Budapest to a Jewish family. His parents were Rabbi Mayer Samuel Weisz (1829-1892) and Cecilia Steiner (1841-1913). Houdini was one of seven children: Herman M. (1863-1885) who was Houdini's half-brother, by Rabbi Weisz's first marriage; Nathan J. (1870-1927); Gottfried William (1872-1925); Theodore (1876-1945); Leopold D. (1879-1962); and Carrie Gladys (1882-1959), who was left almost blind after a childhood accident. Weisz arrived in the United States on July 3, 1878, on the SS Fresia with his mother (who was pregnant) and his four brothers.
Houdini performed at least three variations on a buried alive stunt during his career. The first was near Santa Ana, California in 1915, and it almost cost Houdini his life. Houdini was buried, without a casket, in a pit of earth six feet deep. He became exhausted and panicked while trying to dig his way to the surface and called for help. When his hand finally broke the surface, he fell unconscious and had to be pulled from the grave by his assistants. Houdini wrote in his diary that the escape was "very dangerous" and that "the weight of the earth is killing." Houdini's second variation on buried alive was an endurance test designed to expose mystical Egyptian performer Rahman Bey, who had claimed to use supernatural powers to remain in a sealed casket for an hour. Houdini bettered Bey on August 5, 1926, by remaining in a sealed casket, or coffin, submerged in the swimming pool of New York's Hotel Shelton for one and a half hours. Houdini claimed he did not use any trickery or supernatural powers to accomplish this feat, just controlled breathing. He repeated the feat at the YMCA in Worcester, Massachusetts on September 28, 1926, this time remaining sealed for one hour and eleven minutes. Houdini's final buried alive was an elaborate stage escape that featured in his full evening show. Houdini would escape after being strapped in a straitjacket, sealed in a casket, and then buried in a large tank filled with sand. While posters advertising the escape exist (playing off the Bey challenge by boasting "Egyptian Fakirs Outdone!"), it is unclear whether Houdini ever performed buried alive on stage. The stunt was to be the feature escape of his 1927 season, but Houdini died on October 31, 1926. The bronze casket Houdini created for buried alive was used to transport Houdini's body from Detroit to New York following his death on Halloween.
Answer this question using a quote from the text above:

how did he almost die?

Answer:
He became exhausted and panicked while trying to dig his way to the surface and called for help. When his hand finally broke the surface, he fell unconscious

Answer the question at the end by quoting:

William Thomson, 1st Baron Kelvin, (26 June 1824 - 17 December 1907) was a Scots-Irish mathematical physicist and engineer who was born in Belfast in 1824. At the University of Glasgow he did important work in the mathematical analysis of electricity and formulation of the first and second laws of thermodynamics, and did much to unify the emerging discipline of physics in its modern form. He worked closely with mathematics professor Hugh Blackburn in his work.
William's father was able to make a generous provision for his favourite son's education and, in 1841, installed him, with extensive letters of introduction and ample accommodation, at Peterhouse, Cambridge. In 1845 Thomson graduated as Second Wrangler. He also won the First Smith's Prize, which, unlike the tripos, is a test of original research. Robert Leslie Ellis, one of the examiners, is said to have declared to another examiner "You and I are just about fit to mend his pens." While at Cambridge, Thomson was active in sports, athletics and sculling, winning the Colquhoun Sculls in 1843. He also took a lively interest in the classics, music, and literature; but the real love of his intellectual life was the pursuit of science. The study of mathematics, physics, and in particular, of electricity, had captivated his imagination. In 1845, he gave the first mathematical development of Faraday's idea that electric induction takes place through an intervening medium, or "dielectric", and not by some incomprehensible "action at a distance". He also devised the mathematical technique of electrical images, which became a powerful agent in solving problems of electrostatics, the science which deals with the forces between electrically charged bodies at rest. It was partly in response to his encouragement that Faraday undertook the research in September 1845 that led to the discovery of the Faraday effect, which established that light and magnetic (and thus electric) phenomena were related. He was elected a fellow of St. Peter's (as Peterhouse was often called at the time) in June 1845. On gaining the fellowship, he spent some time in the laboratory of the celebrated Henri Victor Regnault, at Paris; but in 1846 he was appointed to the chair of natural philosophy in the University of Glasgow. At twenty-two he found himself wearing the gown of a learned professor in one of the oldest Universities in the country, and lecturing to the class of which he was a first year student but a few years before.

What did he study there?
The study of mathematics, physics, and in particular, of electricity, had captivated his imagination.