Elijah Lopez
Dec 20, 2022

--

First let me thank you for for contributing something. Secondly, you should really understand how to use numpy. You used two list comprehensions instead of using a single .transpose(). By using a transpose instead of two list comps, I shaved 5.2 seconds when reading a FLAC file of mine.

```

t1 = time.time()

ch1 = np.array([data[i][0] for i in range(n)]) # channel 1

print(time.time() - t1) # 2.6 seconds

ch2 = np.array([data[i][1] for i in range(n)]) # channel 2

print(time.time() - t1) # 5.2 seconds total

t2 = time.time()

ch1, ch2 = data.transpose()

print(time.time() - t2) # 0 seconds!

```

I don't use numpy in my day to day life and I was able to optimize your code, so I know that my expectations for top tier code is not that high!

I still need to add support for making the graph look nice, but this was a good start nonetheless.

--

--

Elijah Lopez

Github pages + Hugo is better than medium. Creator of the Matte Black Firefox themes and Music Caster. https://elijahlopez.ca/