PyNEST - Hello World!

Modeling networks of spiking neurons using NEST

Python Module of the Week, 03.05.2019

Alexander van Meegen

This is a basic 'Hello World!' example. Enjoy!


In [ ]:
%pylab inline
import nest
import nest.voltage_trace
nest.ResetKernel()

In [ ]:
neuron = nest.Create('iaf_psc_exp')
spikegenerator = nest.Create('spike_generator')
nest.SetStatus(spikegenerator, {'spike_times': [10., 50.]})
voltmeter = nest.Create('voltmeter')
nest.Connect(spikegenerator, neuron, syn_spec={'weight': 1e3})
nest.Connect(voltmeter, neuron)
nest.Simulate(100.)

In [ ]:
nest.voltage_trace.from_device(voltmeter)