.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/load_single_file_io.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note You can download :ref:`below ` the full example code. and run it online in `Codespaces `__ .. image:: https://github.com/codespaces/badge.svg :target: https://codespaces.new/spark-cleantech-l3/sda-copy?quickstart=1 --- .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_load_single_file_io.py: Load any file from the Lab. ========================== This example shows how to open a test data file using :py:func:`sda.io.load.loadany`). The same workflow can be used with the ``fplot`` command from a Bash/Cmd terminal : Run: fplot path/to/file.txt or : fplot # opens a GUI # then drag-and-drop a file into the GUI .. GENERATED FROM PYTHON SOURCE LINES 19-28 .. code-block:: Python from sda.io.load import loadany from sda.misc.utils import getTestFile file_path = getTestFile("data/spectrum.txt") # replace with your own file path # Open: data = loadany(getTestFile("data/spectrum.txt")) print(f"Loaded spectrum: {len(data)} series, lengths: {[len(s) for s in data]}") .. _sphx_glr_download_auto_examples_load_single_file_io.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: load_single_file_io.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: load_single_file_io.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: load_single_file_io.zip `