We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0aa7e65 commit a1b0294Copy full SHA for a1b0294
neo/test/iotest/test_asciisignalio.py
@@ -156,6 +156,28 @@ def test_skiprows(self):
156
157
os.remove(filename)
158
159
+ def test_usecols(self):
160
+ filename = 'test_usecols.txt'
161
+ sample_data = [
162
+ (-65, -65, -65, 0.5),
163
+ (-64.8, -64.5, -64.0, 0.6),
164
+ (-64.6, -64.2, -77.0, 0.7),
165
+ (-64.3, -64.0, -99.9, 0.8),
166
+ (-66, -64.3, -61.0, 1.4),
167
+ ]
168
+ with open(filename, 'w') as datafile:
169
+ for row in sample_data:
170
+ datafile.write("\t ".join(map(str, row)) + "\t\n")
171
+ io = AsciiSignalIO(filename, usecols=3)
172
+ block = io.read_block()
173
+ signal = block.segments[0].analogsignals[0]
174
+ self.assertEqual(signal.shape, (5, 1))
175
+ self.assertEqual(len(block.segments[0].analogsignals[0]), 5)
176
+ self.assertEqual(len(block.segments[0].analogsignals), 1)
177
+ self.assertEqual(signal.units, pq.V)
178
+
179
+ os.remove(filename)
180
181
def test_timecolumn(self):
182
sample_data = np.random.uniform(size=(200, 3))
183
sampling_period = 0.5
0 commit comments