Author Topic: transmission[-1]  (Read 2104 times)

0 Members and 1 Guest are viewing this topic.

Offline jaco

  • Regular QuantumATK user
  • **
  • Posts: 10
  • Country: ca
  • Reputation: 0
    • View Profile
transmission[-1]
« on: July 3, 2013, 03:37 »
dear Professor:
    i saw a script in the web and how is the mean of [-1]:
    #read the transmission spectrum
transmission = nlread('dtb_analysis.nc',TransmissionSpectrum)[-1]
    Thanks in advance!
     best regards
jaco

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5538
  • Country: dk
  • Reputation: 90
    • View Profile
    • QuantumATK at Synopsys
Re: transmission[-1]
« Reply #1 on: July 21, 2013, 23:39 »
In Python, you can access the last item in a list by using the -1 notation. Example:
Code: python
x=[1,2,3]
print x[-1]
will print 3.