[BUG] STFT CSV export has incorrect shape and column format #43

Closed
opened 2025-04-19 16:12:36 +00:00 by nuluh · 0 comments
nuluh commented 2025-04-19 16:12:36 +00:00 (Migrated from github.com)

Bug Description

The notebook is exporting STFT data to CSV with incorrect dimensions and column formatting. The exported CSV has 11 rows with 263,169 columns instead of the expected 2,565 rows with 513 columns. This indicates a fundamental problem with how the STFT data is being processed or exported.

Steps to Reproduce

  1. Run the STFT transformation notebook on raw accelerometer data
  2. Export the results to CSV using the current code
  3. Load the CSV and inspect its shape:
import pandas as pd
data = pd.read_csv("stft_data1_1.csv")
data.info()

Expected Behavior

The CSV file should have the correct dimensions matching the STFT output:

  • Row count: 2,565 entries (time frames)
  • Column count: 513 columns (frequency bins)
  • Column names should follow the format "Freq_X.XX" for each frequency bin
  • Total memory usage around 10.0 MB

As confirmed by previous working exports:

data.info()
# <class 'pandas.core.frame.DataFrame'>
# RangeIndex: 2565 entries, 0 to 2564
# Columns: 513 entries, Freq_0.00 to Freq_512.00
# dtypes: float64(513)
# memory usage: 10.0 MB

Actual Behavior

The CSV file has completely incorrect dimensions:

  • Row count: Only 11 entries
  • Column count: 263,169 columns
  • Column names are floating point numbers instead of the expected "Freq_X.XX" format
  • Memory usage is much higher at 22.1 MB
data.info()
# <class 'pandas.core.frame.DataFrame'>
# RangeIndex: 11 entries, 0 to 10
# Columns: 263169 entries, 0.0005546800602091881 to 0.0009552282034601476
# dtypes: float64(263169)
# memory usage: 22.1 MB

Error Logs

No error messages are displayed during execution, but the resulting data structure is clearly incorrect.

Component

Jupyter Notebook

Version/Commit

2868101

Environment

No response

Additional Context

No response

### Bug Description The notebook is exporting STFT data to CSV with incorrect dimensions and column formatting. The exported CSV has 11 rows with 263,169 columns instead of the expected 2,565 rows with 513 columns. This indicates a fundamental problem with how the STFT data is being processed or exported. ### Steps to Reproduce 1. Run the STFT transformation notebook on raw accelerometer data 2. Export the results to CSV using the current code 3. Load the CSV and inspect its shape: ```python import pandas as pd data = pd.read_csv("stft_data1_1.csv") data.info() ``` ### Expected Behavior The CSV file should have the correct dimensions matching the STFT output: - Row count: 2,565 entries (time frames) - Column count: 513 columns (frequency bins) - Column names should follow the format "Freq_X.XX" for each frequency bin - Total memory usage around 10.0 MB As confirmed by previous working exports: ```sh data.info() # <class 'pandas.core.frame.DataFrame'> # RangeIndex: 2565 entries, 0 to 2564 # Columns: 513 entries, Freq_0.00 to Freq_512.00 # dtypes: float64(513) # memory usage: 10.0 MB ``` ### Actual Behavior The CSV file has completely incorrect dimensions: - Row count: Only 11 entries - Column count: 263,169 columns - Column names are floating point numbers instead of the expected "Freq_X.XX" format - Memory usage is much higher at 22.1 MB ```sh data.info() # <class 'pandas.core.frame.DataFrame'> # RangeIndex: 11 entries, 0 to 10 # Columns: 263169 entries, 0.0005546800602091881 to 0.0009552282034601476 # dtypes: float64(263169) # memory usage: 22.1 MB ``` ### Error Logs ```shell No error messages are displayed during execution, but the resulting data structure is clearly incorrect. ``` ### Component Jupyter Notebook ### Version/Commit 2868101 ### Environment _No response_ ### Additional Context _No response_
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nuluh/thesis#43