|
741 | 741 | "threshold = 0.5\n", |
742 | 742 | "\n", |
743 | 743 | "# find activity above threshold\n", |
744 | | - "above_thrs = (activity > threshold).astype(np.int) \n", |
| 744 | + "above_thrs = (activity > threshold).astype(int) \n", |
745 | 745 | "\n", |
746 | 746 | "plt.plot(activity)\n", |
747 | 747 | "plt.plot(above_thrs)\n", |
|
762 | 762 | "metadata": {}, |
763 | 763 | "outputs": [], |
764 | 764 | "source": [ |
765 | | - "rising = (np.diff(above_thrs) > 0).astype(np.int) # find rising edge of crossing threshold\n", |
| 765 | + "rising = (np.diff(above_thrs) > 0).astype(int) # find rising edge of crossing threshold\n", |
766 | 766 | "spikes = np.hstack((0, rising)) # prepend 0 to account for shortening due to np.diff\n", |
767 | 767 | "\n", |
768 | 768 | "plt.plot(activity)\n", |
|
807 | 807 | "threshold = # enter different threshold values here\n", |
808 | 808 | "\n", |
809 | 809 | "# find activity above threshold\n", |
810 | | - "above_thrs = (activity > threshold).astype(np.int) \n", |
| 810 | + "above_thrs = (activity > threshold).astype(int) \n", |
811 | 811 | "\n", |
812 | | - "rising = (np.diff(above_thrs) > 0).astype(np.int) # find rising edge of crossing threshold\n", |
| 812 | + "rising = (np.diff(above_thrs) > 0).astype(int) # find rising edge of crossing threshold\n", |
813 | 813 | "spikes = np.hstack((0, rising)) # prepend 0 to account for shortening due to np.diff\n", |
814 | 814 | "\n", |
815 | 815 | "count = spikes.sum() # compute total spike counts\n", |
|
999 | 999 | " activity = (Neuron() & key).fetch1('activity')\n", |
1000 | 1000 | " threshold = (SpikeDetectionParam() & key).fetch1('threshold')\n", |
1001 | 1001 | "\n", |
1002 | | - " above_thrs = (activity > threshold).astype(np.int) # find activity above threshold\n", |
1003 | | - " rising = (np.diff(above_thrs) > 0).astype(np.int) # find rising edge of crossing threshold\n", |
| 1002 | + " above_thrs = (activity > threshold).astype(int) # find activity above threshold\n", |
| 1003 | + " rising = (np.diff(above_thrs) > 0).astype(int) # find rising edge of crossing threshold\n", |
1004 | 1004 | " spikes = np.hstack((0, rising)) # prepend 0 to account for shortening due to np.diff\n", |
1005 | 1005 | "\n", |
1006 | 1006 | " count = spikes.sum() # compute total spike counts\n", |
|
1336 | 1336 | } |
1337 | 1337 | ], |
1338 | 1338 | "metadata": { |
| 1339 | + "jupytext": { |
| 1340 | + "formats": "ipynb,py:light" |
| 1341 | + }, |
1339 | 1342 | "kernelspec": { |
1340 | 1343 | "display_name": "Python 3", |
1341 | 1344 | "language": "python", |
|
1351 | 1354 | "name": "python", |
1352 | 1355 | "nbconvert_exporter": "python", |
1353 | 1356 | "pygments_lexer": "ipython3", |
1354 | | - "version": "3.7.0" |
| 1357 | + "version": "3.5.6" |
1355 | 1358 | } |
1356 | 1359 | }, |
1357 | 1360 | "nbformat": 4, |
|
0 commit comments