fjpereny / freeFFT

GNU General Public License v3.0
4 stars 2 forks source link

Expected csv format #3

Open deining opened 9 months ago

deining commented 9 months ago

README.md states:

I'm struggling to make that work, however.

Very basic data.csv:

1,0
2,1
3,2
4,1
5,0
6,1
7,2
8,1

With this data set:

freefft data.csv 
Traceback (most recent call last):
  File "/home/user/.local/bin/freefft", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/user/.local/pipx/venvs/freefft/lib/python3.11/site-packages/freefft/__main__.py", line 535, in main
    main = Window(file)
           ^^^^^^^^^^^^
  File "/home/user/.local/pipx/venvs/freefft/lib/python3.11/site-packages/freefft/__main__.py", line 139, in __init__
    self.open_file(file)
  File "/home/user/.local/pipx/venvs/freefft/lib/python3.11/site-packages/freefft/__main__.py", line 309, in open_file
    self.load_csv(file_path)
  File "/home/user/.local/pipx/venvs/freefft/lib/python3.11/site-packages/freefft/__main__.py", line 201, in load_csv
    self.time_elapsed = self.data[-1, 0] - self.data[0, 0]
                        ~~~~~~~~~^^^^^^^
IndexError: index -1 is out of bounds for axis 0 with size 0

I can see you are using pandas to read csv file, but I didn't dig further here. What is the expected data format here? What column separators are expected?

fjpereny commented 9 months ago

Not sure what the issue is there, because the format of the data is juts a 2 column csv like below: image