Elements One Through One Hundred Eighteen


import pandas as pd
from pathlib import Path

# --- Data Definition ---
# A comprehensive list of all 118 chemical elements, including their atomic number (Z),
# symbol, full name, key isotopes, primary role, common applications, and notable facts.
# This dataset is designed for scientific, educational, and data analysis purposes.

rows = [
    # --- Elements 1–10: The Basics of Matter ---
    (1, "H", "Hydrogen", "1H, 2H(D), 3H(T)", "Life, water, fusion", "Water, fuels, fusion energy", "Fundamental building block; 3H is radioactive (beta decay, 12.3 y)"),
    (2, "He", "Helium", "3He, 4He", "Cryogenics, inert gas", "MRI cooling, superfluids, welding", "Noble gas; 4He exhibits superfluidity near absolute zero"),
    (3, "Li", "Lithium", "6Li, 7Li", "Energy storage, medicine", "Li-ion batteries, mood stabilizers", "Highly reactive alkali metal; 6Li is a key fusion fuel component"),
    (4, "Be", "Beryllium", "9Be", "Alloys, neutron moderation", "Aerospace components, X-ray windows", "Toxic; lightweight metal with high stiffness"),
    (5, "B", "Boron", "10B, 11B", "Neutron absorption, materials", "Nuclear control rods, BNCT, borosilicate glass", "10B has a high neutron capture cross-section"),
    (6, "C", "Carbon", "12C, 13C, 14C", "Life, materials, dating", "Polymers, graphite, diamond, graphene", "Basis of organic chemistry; 14C used for radiometric dating"),
    (7, "N", "Nitrogen", "14N, 15N", "Biochemistry, atmosphere", "Ammonia (fertilizers), cryogenics", "78% of Earth's atmosphere; essential for proteins and DNA"),
    (8, "O", "Oxygen", "16O, 17O, 18O", "Respiration, oxidation", "Medicine, steel production, water", "Highly reactive; essential for aerobic life; 21% of atmosphere"),
    (9, "F", "Fluorine", "19F", "Polymers, pharmaceuticals", "PTFE (Teflon), toothpaste, medical imaging", "Most electronegative element; highly reactive halogen"),
    (10, "Ne", "Neon", "20Ne, 21Ne, 22Ne", "Lighting, cryogenics", "Iconic neon signs, lasers, refrigerants", "Inert noble gas known for its bright reddish-orange glow"),
    # --- Elements 11–20: Building Blocks of Earth and Life ---
    (11, "Na", "Sodium", "23Na", "Electrolyte, biochemistry", "Table salt, streetlights, chemical synthesis", "Essential ion for nerve function; highly reactive"),
    (12, "Mg", "Magnesium", "24Mg, 25Mg, 26Mg", "Biochemistry, alloys", "Lightweight alloys, chlorophyll, antacids", "Central atom in chlorophyll, enabling photosynthesis"),
    (13, "Al", "Aluminum", "27Al", "Materials science", "Aerospace, packaging, construction", "Abundant, lightweight, corrosion-resistant due to oxide layer"),
    (14, "Si", "Silicon", "28Si, 29Si, 30Si", "Semiconductors, geology", "Computer chips, solar cells, glass, silicones", "Foundation of modern electronics; major component of Earth's crust"),
    (15, "P", "Phosphorus", "31P", "Biochemistry, agriculture", "Fertilizers, DNA/ATP backbone, detergents", "Crucial for energy transfer (ATP) in all known life"),
    (16, "S", "Sulfur", "32S, 33S, 34S, 36S", "Biochemistry, industry", "Sulfuric acid, vulcanization, amino acids", "Key component of amino acids cysteine and methionine"),
    (17, "Cl", "Chlorine", "35Cl, 37Cl", "Disinfection, chemistry", "Water treatment, PVC plastic, salt", "Reactive halogen; essential electrolyte (chloride)"),
    (18, "Ar", "Argon", "36Ar, 38Ar, 40Ar", "Inert gas, dating", "Welding, lighting, K-Ar geochronology", "Abundant noble gas; 40Ar is a product of 40K decay"),
    (19, "K", "Potassium", "39K, 40K, 41K", "Biochemistry, agriculture", "Fertilizers, electrolyte replacement", "Essential for nerve function; 40K is a natural long-lived radioisotope"),
    (20, "Ca", "Calcium", "40Ca, 44Ca, 48Ca", "Biology, construction", "Bones, teeth, cement, cell signaling", "Most abundant mineral in the human body; 48Ca is a double-beta decay candidate"),
    # --- Elements 21–30: The Transition Metals ---
    (21, "Sc", "Scandium", "45Sc", "Alloys, lighting", "Aerospace alloys, high-intensity lamps", "Has only one stable isotope"),
    (22, "Ti", "Titanium", "46–50Ti", "Materials, biomedical", "Implants, aerospace, white pigment (TiO2)", "High strength-to-weight ratio and corrosion resistance"),
    (23, "V", "Vanadium", "50V, 51V", "Alloys, catalysis", "Steel hardening, catalysts", "50V is a very long-lived primordial radioisotope"),
    (24, "Cr", "Chromium", "50,52,53,54Cr", "Metallurgy, pigments", "Stainless steel, chrome plating", "Hexavalent chromium Cr(VI) is highly toxic"),
    (25, "Mn", "Manganese", "55Mn", "Biochemistry, alloys", "Steel production, batteries", "Essential trace element for enzymes"),
    (26, "Fe", "Iron", "54,56,57,58Fe", "Biology, industry", "Steel, hemoglobin, planetary cores", "Most common element on Earth by mass"),
    (27, "Co", "Cobalt", "59Co, 60Co", "Alloys, medicine", "Magnets, vitamin B12, radiotherapy (60Co)", "60Co is a critical gamma radiation source for sterilization and therapy"),
    (28, "Ni", "Nickel", "58,60,61,62,64Ni", "Alloys, catalysis", "Superalloys, batteries, coins", "Key component of Earth's core"),
    (29, "Cu", "Copper", "63Cu, 65Cu", "Electronics, biology", "Electrical wiring, plumbing, antimicrobial surfaces", "Excellent electrical and thermal conductor"),
    (30, "Zn", "Zinc", "64,66,67,68,70Zn", "Biology, materials", "Galvanization, brass, immune function", "Essential nutrient for numerous enzymes"),
    # --- Elements 31–40 ---
    (31, "Ga", "Gallium", "69Ga, 71Ga", "Semiconductors", "LEDs, integrated circuits (GaAs)", "Liquid metal near room temperature; melts in hand"),
    (32, "Ge", "Germanium", "70,72,73,74,76Ge", "Semiconductors, optics", "Infrared optics, fiber optics, detectors", "Used in neutrinoless double-beta decay research"),
    (33, "As", "Arsenic", "75As", "Semiconductors, toxicology", "GaAs semiconductors, historical pigments", "Famous poison, but also has medicinal uses"),
    (34, "Se", "Selenium", "74,76,77,78,80,82Se", "Biochemistry, electronics", "Photoconductors, glass, dietary supplement", "Essential trace element in selenoproteins"),
    (35, "Br", "Bromine", "79Br, 81Br", "Chemistry, flame retardants", "Fire safety, pharmaceuticals", "One of two elements liquid at room temperature"),
    (36, "Kr", "Krypton", "78–86Kr", "Lighting, lasers", "High-intensity lamps, nuclear fission tracer", "Noble gas"),
    (37, "Rb", "Rubidium", "85Rb, 87Rb", "Atomic clocks, dating", "Laser cooling, Rb-Sr geochronology", "87Rb has a half-life of 49 billion years"),
    (38, "Sr", "Strontium", "84,86,87,88Sr", "Materials, medicine", "Fireworks (red color), 90Sr radiotherapy", "Chemically similar to calcium"),
    (39, "Y", "Yttrium", "89Y", "Superconductors, lasers", "YBCO superconductors, red phosphors", "Has only one stable isotope"),
    (40, "Zr", "Zirconium", "90,91,92,94,96Zr", "Nuclear technology", "Nuclear reactor cladding (Zircaloy)", "Very low neutron-capture cross-section"),
    # --- Elements 41–50 ---
    (41, "Nb", "Niobium", "93Nb", "Superconductors, alloys", "MRI magnets, superalloys for jet engines", "Has only one stable isotope"),
    (42, "Mo", "Molybdenum", "92–100Mo, 99Mo", "Biology, alloys", "High-strength steel, 99Mo for 99mTc generation", "Essential cofactor for enzymes in life"),
    (43, "Tc", "Technetium", "99mTc", "Medical imaging", "SPECT scans", "Lightest element with no stable isotopes; 99mTc is a key medical tracer"),
    (44, "Ru", "Ruthenium", "96–104Ru, 106Ru", "Catalysis, electronics", "Hard drives, solar cells", "106Ru is a fission product used in radiotherapy"),
    (45, "Rh", "Rhodium", "103Rh", "Catalysis", "Catalytic converters for vehicles", "Rare and valuable precious metal"),
    (46, "Pd", "Palladium", "102–110Pd, 107Pd", "Catalysis, H storage", "Catalytic converters, fuel cells", "Can absorb large volumes of hydrogen gas"),
    (47, "Ag", "Silver", "107Ag, 109Ag", "Conductivity, medicine", "Electronics, jewelry, antimicrobial agent", "Highest electrical conductivity of any element"),
    (48, "Cd", "Cadmium", "106–116Cd", "Neutron absorption", "Nuclear control rods, historical pigments", "Toxic heavy metal"),
    (49, "In", "Indium", "113In, 115In", "Electronics", "Indium tin oxide (ITO) for touchscreens", "Soft, malleable metal"),
    (50, "Sn", "Tin", "112–124Sn", "Alloys, electronics", "Solder, bronze, pewter", "Has the most stable isotopes of any element (10)"),
    # --- Elements 51–60: Lanthanides Begin ---
    (51, "Sb", "Antimony", "121Sb, 123Sb", "Alloys, electronics", "Flame retardants, lead-acid batteries", "Metalloid"),
    (52, "Te", "Tellurium", "120–130Te", "Thermoelectrics, solar", "Solar cells (CdTe), alloys", "Several isotopes are candidates for double-beta decay searches"),
    (53, "I", "Iodine", "127I, 131I", "Biology, medicine", "Thyroid hormones, antiseptic, radiotherapy", "Essential nutrient for thyroid function"),
    (54, "Xe", "Xenon", "124–136Xe", "Lighting, medicine", "Anesthesia, hyperpolarized MRI, ion propulsion", "135Xe is a significant neutron poison in nuclear reactors"),
    (55, "Cs", "Cesium", "133Cs, 137Cs", "Timekeeping, tracers", "Atomic clocks (defines the second), drilling fluids", "137Cs is a major fission product and environmental tracer"),
    (56, "Ba", "Barium", "130–138Ba", "Medicine, materials", "Medical imaging contrast agent, ceramics", "Used in superconductors"),
    (57, "La", "Lanthanum", "138La, 139La", "Catalysis, optics", "Camera lenses, petroleum refining catalysts", "First element of the lanthanide series"),
    (58, "Ce", "Cerium", "136–142Ce", "Catalysis, materials", "Glass polishing, catalytic converters", "Most abundant of the rare-earth elements"),
    (59, "Pr", "Praseodymium", "141Pr", "Magnets, materials", "High-strength magnets, glass colorant (yellow-green)", "Rare-earth metal"),
    (60, "Nd", "Neodymium", "142–150Nd", "Magnets, lasers", "NdFeB magnets (wind turbines, EVs), laser pointers", "Crucial for high-performance permanent magnets"),
    # --- Elements 61–70: The Heart of the Lanthanides ---
    (61, "Pm", "Promethium", "145Pm, 147Pm", "Luminosity, power", "Luminous paint (historical), betavoltaic batteries", "Has no stable isotopes"),
    (62, "Sm", "Samarium", "144–154Sm", "Magnets, neutron absorption", "SmCo magnets, nuclear control rods", "153Sm is used in cancer therapy"),
    (63, "Eu", "Europium", "151Eu, 153Eu", "Phosphors", "Red phosphor in CRT screens and fluorescent lamps", "Key to color television technology"),
    (64, "Gd", "Gadolinium", "152–160Gd", "Medical imaging, reactors", "MRI contrast agent, neutron absorber", "157Gd has one of the highest neutron capture cross-sections"),
    (65, "Tb", "Terbium", "159Tb", "Phosphors, magnets", "Green phosphor in lighting and displays", "Has only one stable isotope"),
    (66, "Dy", "Dysprosium", "156–164Dy", "Magnets", "Additive in NdFeB magnets to improve heat resistance", "High magnetic anisotropy"),
    (67, "Ho", "Holmium", "165Ho", "Magnets, medicine", "Magnetic alloys, medical lasers", "Has the highest magnetic moment of any element"),
    (68, "Er", "Erbium", "162–170Er", "Telecommunications", "Erbium-doped fiber amplifiers (EDFAs)", "Essential for long-haul optical fiber communication"),
    (69, "Tm", "Thulium", "169Tm", "Medical devices", "Portable X-ray sources, lasers", "Rarest of the stable lanthanides"),
    (70, "Yb", "Ytterbium", "168–176Yb", "Quantum optics, lasers", "Atomic clocks, fiber lasers", "Used in quantum computing research"),
    # --- Elements 71–80: Heavy and Precious Metals ---
    (71, "Lu", "Lutetium", "175Lu, 176Lu, 177Lu", "Medicine, geochronology", "Targeted radiotherapy (177Lu), Lu-Hf dating", "Last element in the lanthanide series"),
    (72, "Hf", "Hafnium", "174–180Hf, 178m2Hf", "Nuclear technology", "Nuclear submarine control rods", "178m2Hf is a long-lived nuclear isomer"),
    (73, "Ta", "Tantalum", "181Ta, 180mTa", "Electronics", "High-performance capacitors in smartphones", "Highly corrosion-resistant"),
    (74, "W", "Tungsten", "180–186W", "High-temp materials", "Incandescent light bulb filaments, superalloys", "Highest melting point of any metal"),
    (75, "Re", "Rhenium", "185Re, 187Re", "Alloys, catalysts", "Jet engine turbine blades, petroleum catalysts", "187Re decay is used for Re-Os geochronology"),
    (76, "Os", "Osmium", "184–192Os", "Alloys, geochemistry", "Hard alloys (fountain pen tips), mantle tracer", "Densest naturally occurring element"),
    (77, "Ir", "Iridium", "191Ir, 193Ir", "Geology, materials", "K-Pg boundary marker (asteroid impact)", "Second-densest element; extremely corrosion-resistant"),
    (78, "Pt", "Platinum", "190–198Pt", "Catalysis, jewelry", "Catalytic converters, fuel cells, chemotherapy", "Highly unreactive precious metal"),
    (79, "Au", "Gold", "197Au", "Value, electronics", "Monetary standard, nanotechnology, dentistry", "Extremely malleable and non-reactive"),
    (80, "Hg", "Mercury", "196–204Hg", "Industry, environment", "Thermometers (historical), environmental tracer", "Liquid at room temperature; toxic"),
    # --- Elements 81–92: The End of Stability ---
    (81, "Tl", "Thallium", "203Tl, 205Tl, 201Tl", "Medical imaging, toxicology", "SPECT cardiac imaging", "Highly toxic heavy metal"),
    (82, "Pb", "Lead", "204,206,207,208Pb", "Shielding, dating", "Radiation shielding, batteries, U-Pb dating", "End-point of uranium and thorium decay chains"),
    (83, "Bi", "Bismuth", "209Bi", "Alloys, medicine", "Lead replacement in alloys, Pepto-Bismol", "209Bi was long thought stable, but is weakly radioactive"),
    (84, "Po", "Polonium", "210Po", "Power sources, alpha therapy", "Radioisotope thermoelectric generators (RTGs)", "Extremely potent alpha emitter; discovered by Marie Curie"),
    (85, "At", "Astatine", "211At", "Medicine", "Targeted alpha therapy research", "Rarest naturally occurring element on Earth"),
    (86, "Rn", "Radon", "222Rn", "Environmental hazard", "Geological tracer, health physics concern", "Radioactive noble gas; a significant source of natural radiation"),
    (87, "Fr", "Francium", "223Fr", "Research", "Nuclear physics studies", "Most unstable of the first 103 elements"),
    (88, "Ra", "Radium", "226Ra, 223Ra", "Medicine", "Bone cancer therapy, historical luminous paints", "Its radioactivity led to the development of radiotherapy"),
    (89, "Ac", "Actinium", "225Ac, 227Ac", "Medicine", "Targeted alpha therapy for cancer", "First element of the actinide series"),
    (90, "Th", "Thorium", "232Th", "Nuclear fuel, dating", "Thorium fuel cycle research, U-Th dating", "Primordial and fertile nuclear material"),
    (91, "Pa", "Protactinium", "231Pa", "Geochronology", "Ocean sediment dating", "One of the rarest and most expensive natural elements"),
    (92, "U", "Uranium", "235U, 238U", "Nuclear fuel, weapons", "Power reactors, nuclear weapons, armor", "Heaviest primordial element; cornerstone of nuclear technology"),
    # --- Elements 93–103: The Transuranics ---
    (93, "Np", "Neptunium", "237Np", "Research, waste", "Tracer in nuclear waste management", "First transuranic element synthesized"),
    (94, "Pu", "Plutonium", "238Pu, 239Pu", "Weapons, power", "Nuclear weapons, RTGs for space probes (NASA)", "Key fissile material; 238Pu powers deep space missions"),
    (95, "Am", "Americium", "241Am", "Sensors", "Ionization smoke detectors", "The only synthetic element found in households"),
    (96, "Cm", "Curium", "244Cm, 247Cm", "Power sources", "RTGs, alpha particle sources", "Named for Marie and Pierre Curie"),
    (97, "Bk", "Berkelium", "247Bk, 249Bk", "Research", "Target for synthesizing heavier elements", "Named after Berkeley, California"),
    (98, "Cf", "Californium", "249-252Cf", "Neutron source", "Nuclear reactor startup, cancer therapy", "252Cf is an exceptionally strong neutron emitter"),
    (99, "Es", "Einsteinium", "252Es", "Research", "Target for synthesizing mendelevium", "First discovered in the debris of the first hydrogen bomb"),
    (100, "Fm", "Fermium", "257Fm", "Research", "Studies of heavy actinides", "Named for Enrico Fermi"),
    (101, "Md", "Mendelevium", "258Md", "Research", "Chemical properties of heavy elements", "Named for Dmitri Mendeleev, creator of the periodic table"),
    (102, "No", "Nobelium", "259No", "Research", "Nuclear shell structure studies", "Named for Alfred Nobel"),
    (103, "Lr", "Lawrencium", "266Lr", "Research", "End of the actinide series", "Named for Ernest Lawrence, inventor of the cyclotron"),
    # --- Elements 104–118: The Superheavy Frontier ---
    (104, "Rf", "Rutherfordium", "267Rf", "Research", "Transactinide chemistry", "Named for Ernest Rutherford"),
    (105, "Db", "Dubnium", "268Db", "Research", "Studies on the island of stability", "Named for Dubna, Russia"),
    (106, "Sg", "Seaborgium", "269Sg", "Research", "Heavy-ion synthesis experiments", "Named for Glenn T. Seaborg"),
    (107, "Bh", "Bohrium", "270Bh", "Research", "Nuclear shell model verification", "Named for Niels Bohr"),
    (108, "Hs", "Hassium", "270Hs", "Research", "Superheavy element properties", "Named for the German state of Hesse"),
    (109, "Mt", "Meitnerium", "278Mt", "Research", "Nuclear physics experiments", "Named for Lise Meitner"),
    (110, "Ds", "Darmstadtium", "281Ds", "Research", "Shell structure of superheavy nuclei", "Named for Darmstadt, Germany"),
    (111, "Rg", "Roentgenium", "282Rg", "Research", "Fundamental nuclear science", "Named for Wilhelm Röntgen, discoverer of X-rays"),
    (112, "Cn", "Copernicium", "285Cn", "Research", "Frontier of the periodic table", "Named for Nicolaus Copernicus"),
    (113, "Nh", "Nihonium", "286Nh", "Research", "Discovery confirmation experiments", "Named for Japan (Nihon)"),
    (114, "Fl", "Flerovium", "289Fl", "Research", "Probing the island of stability", "Named for the Flerov Laboratory in Russia"),
    (115, "Mc", "Moscovium", "290Mc", "Research", "Superheavy synthesis", "Named for the Moscow Oblast"),
    (116, "Lv", "Livermorium", "293Lv", "Research", "Collaboration in discovery", "Named for Lawrence Livermore National Laboratory"),
    (117, "Ts", "Tennessine", "294Ts", "Research", "Halogen group properties", "Named for the state of Tennessee"),
    (118, "Og", "Oganesson", "294Og", "Research", "Properties of the heaviest elements", "Named for Yuri Oganessian, a pioneer in superheavy element research"),
]

# --- DataFrame Creation and Export ---
# Convert the list of rows into a pandas DataFrame with clearly defined column headers.
df = pd.DataFrame(rows, columns=[
    "Z", "Symbol", "Element", "Key_Isotopes", "Immediate_Role",
    "Applications", "Notes"
])

# Define output file paths.
output_dir = Path("./element_data")
# Create the directory if it doesn't already exist to prevent errors.
output_dir.mkdir(parents=True, exist_ok=True)

csv_path = output_dir / "unified_master_matrix_full.csv"
xlsx_path = output_dir / "unified_master_matrix_full.xlsx"

# Save the DataFrame to both CSV and Excel formats for maximum compatibility.
df.to_csv(csv_path, index=False)
df.to_excel(xlsx_path, index=False)

print(f"Successfully created files:\n- {csv_path}\n- {xlsx_path}")