FFT_tools: use // for explicit integer (floor) division (PEP238)
authorW. Trevor King <wking@tremily.us>
Sun, 18 Nov 2012 22:33:42 +0000 (17:33 -0500)
committerW. Trevor King <wking@tremily.us>
Sun, 18 Nov 2012 22:33:45 +0000 (17:33 -0500)
// has been supported since Python 2.2.  / changed to float division
in Python 3.

FFT_tools.py

index 78c4e29b97c0faef3ebed2fc0b4717d3c3348629..7df0dbe5c9d3b00fb61fbc518c2c85381b90ec1b 100644 (file)
@@ -561,7 +561,7 @@ def avg_power_spectrum(data, freq=1.0, chunk_size=2048,
         raise ValueError(
             'chunk_size {} should be a power of 2'.format(chunk_size))
 
-    nchunks = len(data)/chunk_size  # integer division = implicit floor
+    nchunks = len(data)//chunk_size  # integer division = implicit floor
     if overlap:
         chunk_step = chunk_size/2
     else: