Differences between revisions 3 and 4
Revision 3 as of 2009-12-03 13:24:12
Size: 1337
Editor: anonymous
Comment:
Revision 4 as of 2009-12-04 09:32:31
Size: 1335
Editor: anonymous
Comment:
Deletions are marked like this. Additions are marked like this.
Line 29: Line 29:
 *  

Basic Python

  • Allowed names for identifier
  • Assignments, e.g. a=1, a,b=1,2, a+=1

  • Comparisons, e.g. ==, !=

  • Lists and their methods, e.g. L.append()

  • Strings and their methods, e.g. .replace(), .split(),

  • Dictionaries and their methods, e.g. D.keys()

  • Indexing and slicing, e.g. L[-2:]

  • Loops, e.g. for i,j in enumerate(['Hund','Katze','Maus']):

  • Control statements, e.g. if

  • Importing modules, e.g. import scipy

  • Getting help, e.g. help()

  • Defining functions, e.g. def function(x,y):

  • Working with files, e.g. fid=open(filename,'r')

Standard modules

  • System, e.g. sys.argv

  • OS, e.g. os.system()

  • File globbing, e.g. glob.glob('*.txt')

scipy, numpy, pylab

  • Array creation, e.g. zeros(), array(), linspace()

  • Array methods, e.g. .shape(), .reshape(), .tofile(), .flat(), .transpose()

  • Plotting, e.g. plot(), contour()

  • Netcdf, e.g. fid=scipy.io.netcdf_file(filename,'r'), fid.variables

LehreWiki: OpenSource2010/Lesson8 (last edited 2009-12-04 09:32:31 by anonymous)