0todd0000 / spm1d

One-Dimensional Statistical Parametric Mapping in Python
GNU General Public License v3.0
61 stars 21 forks source link

"online workshop", I need help; what is dataset? how can I make one? #215

Closed fastcloud-cho closed 2 years ago

fastcloud-cho commented 2 years ago

Hello, this is Dr. Cho at S-Korea. Recently I've purchased an access to your "online workshop", I use Python (Spyder) n Mac. As a novice at Python and Matlab, I am experiencing frustrations.. Above all, I need help understanding the first part of each script for the workshop, "#(0)Load dataset".

  1. where is the files for "dataset" on my Mac? what does dataset means? how can I open it and see numbers inside?
  2. can I have some introduction about Python command "dataset", "yA,yB = dataset.get_data()" ?
  3. I would like to apply spm1d principles to my EMG data files (.xlsx or .csv). How should I prepare my files and load it for spmd1d on Python ? Should I use Pandas?

I think "online workshop" need some consideration for the novices like me..

jiku-pro commented 2 years ago

where is the files for "dataset" on my Mac?

import spm1d
print(spm1d)

The print command above will likely return a result like this:

/Users/USERNAME/opt/anaconda3/lib/python3.9/site-packages/spm1d/__init__.py'

This means that the ./spm1d location is: /Users/USERNAME/opt/anaconda3/lib/python3.9/site-packages/spm1d




what does dataset means?




how can I open it and see numbers inside?

import numpy as np

filename = '/Users/USERNAME/opt/anaconda3/lib/python3.9/site-packages/spm1d/data/datafiles/ex_grf_speeds.npy'
a = np.load(filename)
print( a.shape )
(60, 10)

this means that the ex_grf_speeds.npy file contains a 60 x 10 (2D) array.




  1. can I have some introduction about Python command "dataset", "yA,yB = dataset.get_data()" ?
['A', 'STAT', 'Y', 'YA', 'YB', ... 'cite', 'datafile', 'design', 'df', 'dim', 'get_data', ...]
yA,yB = dataset.get_data()
yA = dataset.YA
yB = dataset.YB




I would like to apply spm1d principles to my EMG data files (.xlsx or .csv). How should I prepare my files and load it for spmd1d on Python ? Should I use Pandas?




I think "online workshop" need some consideration for the novices like me..

fastcloud-cho commented 2 years ago

I appreciate "Jiku-pro"'s kind and prompt reply. I'm happy about your "novice support". Two thumbs up! BTW, could you tell me how can I get a normal pdf copy of the open-source textbook "Data Analysis Practice In Python and Jupyter"?

0todd0000 commented 2 years ago

Thank you for the feedback!

There is unfortunately no PDF copy of the open-source textbook. All content is provided as a Jupyter notebooks (.ipynb files), for example: this section on functions and the lessons are meant to be standalone modules, without cross-referencing other lessons. It is indeed possible to convert these notebooks to PDF format, but after you start working with the notebooks you will likely find that the notebook format is quite nice to work with.

As one option, you can download all source code. Then you can open the HTML files individually for each section, like this one: ./Lessons/Lesson01/1-IntroductionToJupyter/IntroductionToJupyter.html.