<jupyter_start><jupyter_text>Normalization==============A selection of reference compositions are included in pyrolite, and can be easilyaccessed with :func:`pyrolite.geochem.norm.get_reference_composition` (see the listat the bottom of the page for a complete list):<jupyter_code>import pandas as pd
import matplotlib.pyplot as plt
import pyrolite.plot
from pyrolite.geochem.ind import REE
from pyrolite.geochem.norm import get_reference_composition, all_reference_compositions
chondrite = get_reference_composition("Chondrite_PON")<jupyter_output><empty_output><jupyter_text>To use the compositions with a specific set of units, you can change them with:func:`~pyrolite.geochem.norm.Composition.set_units`:<jupyter_code>CI = chondrite.set_units("ppm")<jupyter_output><empty_output><jupyter_text>The :func:`~pyrolite.geochem.pyrochem.normalize_to` method can be used tonormalise DataFrames to a given reference (e.g. for spiderplots):<jupyter_code>fig, ax = plt.subplots(1)

for name, ref in list(all_reference_compositions().items())[::2]:
    if name != "Chondrite_PON":
        ref.set_units("ppm")
        df = ref.comp.pyrochem.REE.pyrochem.normalize_to(CI, units="ppm")
        df.pyroplot.REE(unity_line=True, ax=ax, label=name)

ax.set_ylabel("X/X$_{Chondrite}$")
ax.legend(frameon=False, facecolor=None, loc="upper left", bbox_to_anchor=(1.0, 1.0))
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12294496068620443, 'fraction_numerical': 0.004288777698355968, 'mean_word_length': 7.187134502923977, 'pattern_counts': {'":': 1, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '471075', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 503, 'n_tokens_neox': 478, 'n_words': 101, 'path': 'docs/source/examples/geochem/normalization.ipynb', 'repo_name': 'bomtuckle/pyrolite', 'size': '1399'}