Skip to Main Content
It looks like you're using Internet Explorer 11 or older. This website works best with modern browsers such as the latest versions of Chrome, Firefox, Safari, and Edge. If you continue with this browser, you may see unexpected results.

Statistical Software: Python Koujue

This guide contains resources to assist faculty, researchers, staff, and students in learning statistical software, such as R, Python, SAS, Stata, SPSS

Quick Tips

Python commands are case-sensitive.

help() is used to display the documentation of modules, functions, classes, keywords etc.

#comment follows.

""" (triple quotes) starts a multi line comment and another """ (triple quotes) ends the comment.

= is assignment operator, like a = 'Hello World'.

a.upper()- an example for a Python method (result is 'HELLO WORLD').

a.lower()returns the lowercase version of a string.

print()prints an object to the screen: print("Hello World").

abs()returns the absolute value of a numeric value (e.g. integer or float).

round()returns the rounded value of a numeric value.

 A list, [2, 3, 5, 6], or ['a', 'c', 'd', 'a'].

len() returns the number of elements in a list or the number of characters in a string.

min()returns the smallest item of a list or of the typed-in arguments.

max()returns the largest item of a list or of the typed-in arguments.

sorted()sorts a list into ascending order.

sum()sums a list.

type()returns the type of an object.

a.strip()removes white space in a string

a.replace('old', 'new')replaces a given string with another string.

a.split('delimiter')splits a string into a list. a.split(' ') returns ['Hello', 'World']

'delimiter'.join(a)joins elements of a list into one string. ','.join(a) returns 'Hello, World'

dir() returns a list of valid attributes of an object.



#1 Python Tutorial for Beginners | Introduction to Python

Python - Matplotlib Tutorial for Beginners

Top 6 Python Libraries for Beginners | Python Explained

Python Workshops/Webinars

Python Sessions


Profile Photo
Jianjun Hua
Dartmouth College

Hanover NH 03755


This guide has a user friendly interface.

Strongly agree: 12 votes (70.59%)
Agree: 4 votes (23.53%)
Neutral: 0 votes (0%)
Disagree: 0 votes (0%)
Strongly disagree: 1 votes (5.88%)
Total Votes: 17

Post-Workshop Survey