.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "_examples\sqi\plot_sample_01.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr__examples_sqi_plot_sample_01.py: Sample 01 ==================== This examples computes the three most basic standard SQIs (kurtosis, skewness and entropy). In addition, it shows the code in a one big section. It is just an example. .. warning:: The ``dtw`` module seems to be loaded even though we are not really using it. Instead, load it only when required. .. GENERATED FROM PYTHON SOURCE LINES 14-60 .. image:: /_examples/sqi/images/sphx_glr_plot_sample_01_001.png :alt: plot sample 01 :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out Out: .. code-block:: none Result: kurtosis -1.492500e+00 skewness -1.605493e-16 entropy 4.997679e+00 dtype: float64 | .. code-block:: default :lineno-start: 15 # Libraries generic import numpy as np import pandas as pd # Libraries specific from vital_sqi.sqi.standard_sqi import perfusion_sqi from vital_sqi.sqi.standard_sqi import kurtosis_sqi from vital_sqi.sqi.standard_sqi import skewness_sqi from vital_sqi.sqi.standard_sqi import entropy_sqi from vital_sqi.sqi.standard_sqi import signal_to_noise_sqi # --------------------------- # Main # --------------------------- # Create samples x = np.linspace(-10*np.pi, 10*np.pi, 201) # Create signal signal = np.sin(x) # Loop computing sqis k = kurtosis_sqi(signal) s = skewness_sqi(signal) e = entropy_sqi(signal) # Create Series result = pd.Series( data=[k, s, e], index=['kurtosis', 'skewness', 'entropy'] ) # Show print("\nResult:") print(result) # --------------- # Create plot # --------------- # Library import matplotlib.pyplot as plt # Plot plt.plot(x, signal) # Show plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.074 seconds) .. _sphx_glr_download__examples_sqi_plot_sample_01.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_sample_01.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_sample_01.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_