Skip to content

Commit 0d74a58

Browse files
authored
Update README (#112)
1 parent ca9e580 commit 0d74a58

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,33 @@ pyXDF is a Python importer for [XDF](https://github.com/sccn/xdf) files.
1111
## Sample usage
1212

1313
``` python
14-
import pyxdf
1514
import matplotlib.pyplot as plt
1615
import numpy as np
1716

18-
data, header = pyxdf.load_xdf('test.xdf')
17+
import pyxdf
18+
19+
data, header = pyxdf.load_xdf("test.xdf")
1920

2021
for stream in data:
21-
y = stream['time_series']
22+
y = stream["time_series"]
2223

2324
if isinstance(y, list):
2425
# list of strings, draw one vertical line for each marker
25-
for timestamp, marker in zip(stream['time_stamps'], y):
26+
for timestamp, marker in zip(stream["time_stamps"], y):
2627
plt.axvline(x=timestamp)
2728
print(f'Marker "{marker[0]}" @ {timestamp:.2f}s')
2829
elif isinstance(y, np.ndarray):
2930
# numeric data, draw as lines
30-
plt.plot(stream['time_stamps'], y)
31+
plt.plot(stream["time_stamps"], y)
3132
else:
32-
raise RuntimeError('Unknown stream format')
33+
raise RuntimeError("Unknown stream format")
3334

3435
plt.show()
3536
```
3637

3738
## CLI examples
3839

39-
`pyxdf` has an `examples` module. These can be run from the command line for basic functionality.
40+
`pyxdf` has an `examples` module, which can be run from the command line for basic functionality.
4041

4142
* `print_metadata` will enable a DEBUG logger to log read messages, then it will print basic metadata about each found stream.
4243
* `python -m pyxdf.examples.print_metadata -f=/path/to/my.xdf`

0 commit comments

Comments
 (0)