<jupyter_start><jupyter_text>Uncertainties and DistributionsThe [astropy.uncertainty](http://docs.astropy.org/en/stable/uncertainty/index.html) sub-package is a relatively new sub-package which provides a framework for doing uncertainty propagation in calculations. For now, this is focused on the more accurate but slower method of tracking uncertainties by Monte-Carlo sampling. Since it is a relatively new sub-package, it is possible that it will evolve a little over time.  ObjectivesCreate distributionsPlot distributionsExtract useful statisticsCombine distributions  DocumentationThis notebook only shows a subset of the functionality in astropy.uncertainty. For more information about the features presented below as well as other available features, you can read the[astropy.uncertainty documentation](https://docs.astropy.org/en/stable/uncertainty/).<jupyter_code>%matplotlib inline
import matplotlib.pyplot as plt
plt.rc('image', origin='lower')
plt.rc('figure', figsize=(10, 6))<jupyter_output><empty_output><jupyter_text>Creating distributionsThe central object in astropy.uncertainty is the [Distribution](http://docs.astropy.org/en/stable/api/astropy.uncertainty.Distribution.htmlastropy.uncertainty.Distribution) class, which can be thought of as a quantity with an underlying distribution of values. Several helper functions are provided to create standard distributions: You can also create arbitrary distributions - see the [documentation](http://docs.astropy.org/en/stable/uncertainty/index.htmlcreating-distributions) for more details. The easiest way to visualize these distributions is to use the ``.distribution`` attribute of the ``Distribution`` objects, which returns the individual Monte-Carlo samples:<jupyter_code>from astropy.visualization import quantity_support
quantity_support()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07321041214750543, 'fraction_numerical': 0.0016268980477223427, 'mean_word_length': 6.7521008403361344, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 1, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '278078', 'license': 'CC-BY-4.0', 'n_tokens_mistral': 472, 'n_tokens_neox': 453, 'n_words': 173, 'path': '18-distributions.ipynb', 'repo_name': 'aperiosoftware/esac-astropy', 'size': '1844'}