title |
---|
Prerequisites |
This lesson assumes you have a working knowledge of Python and some previous exposure to the Bash shell.
These requirements can be fulfilled by:
- completing a Software Carpentry Python workshop or
- completing a Data Carpentry Ecology workshop (with Python) and a Data Carpentry Genomics workshop or
- coursework in or independent learning of both Python and the Bash shell.
The skill set listed below is covered in any Software Carpentry workshop, as well as in Data Carpentry's Genomics workshop. These skills can also be learned through coursework or independent learning.
Be able to:
- Identify and navigate to your home directory.
- Identify your current working directory.
- Navigating directories using
pwd
,ls
,cd <subdirectory>
, andcd ..
- Run a Python script from the command line.
This skill set listed below is covered in both Software Carpentry's Python workshop and in Data Carpentry's Ecology workshop with Python. These skills can also be learned through coursework or independent learning.
Be able to:
- Use the assignment operator to create
int
,float
, andstr
variables. - Perform basic arithmetic operations (e.g. addition, subtraction) on variables.
- Convert strings to ints or floats where appropriate.
- Create a
list
and alter lists by appending, inserting, or removing values. - Use indexing and slicing to access elements of strings, lists, and NumPy arrays.
- Use good coding practices to comment your code and choose appropriate variable names.
- Write a
for
loop that increments a variable. - Write conditional statements using
if
,elif
, andelse
. - Use comparison operators (
==
,!=
,<
,<=
,>
,>=
) in conditional statements. - Read data from a file using
read()
,readline()
, andreadlines()
. - Open, read from, write to, and close input and output files.
- Use
print()
andlen()
to inspect variables.
The following skills are useful, but not required:
- Apply a function to an entire NumPy array or to a single array axis.
- Write a user-defined function.
If you are signed up, or considering signing up for a workshop, and aren't sure whether you meet these reqirements, please get in touch with the workshop instructors or host.