Slide 1

Slide 1 text

Yonsei University Graduate Class Energy Materials: Design, Discovery and Data Python for science and engineering Lucy Whalley PhD student Imperial College London / Centre for Doctoral Training in Photovoltaics [email protected]

Slide 2

Slide 2 text

About Me 2007 - 2011: MSci degree (physics) from University of Birmingham 2011 - 2012: PGCE (mathematics) from Birmingham City University 2015 - current: PhD student at Imperial College London and CDT in Photovoltaics

Slide 3

Slide 3 text

Question Why programming / Python?

Slide 4

Slide 4 text

Why Python?

Slide 5

Slide 5 text

Why Python? You can do cool things, easily!

Slide 6

Slide 6 text

What do I use Python for? (not python!) (for the future) •  Clear, transparent data pipeline •  Reduces errors •  Re-usable code •  Easy to make changes

Slide 7

Slide 7 text

Workshop outline Part one Part two

Slide 8

Slide 8 text

To run: Module 4

Slide 9

Slide 9 text

Module 4 Use in-built help Read error messages

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

Workshop outline Part one Part two

Slide 12

Slide 12 text

Module 4 https://dx.doi.org/10.1039/C3TA10518K

Slide 13

Slide 13 text

Python plots can be beautiful From: http://blog.olgabotvinnik.com/blog/2013/08/21/2013-08-21-prettyplotlib-painlessly-create-beautiful-matplotlib/

Slide 14

Slide 14 text

Next steps Use the terminal as a calculator Search online Use built-in help Keep a Jupyter lab book Start a (mini?) project Tutorials

Slide 15

Slide 15 text

Mini project: carbon_calculator.py Define function Correct indentation Docstring to describe what the module does Import modules Assign variable Nested for loops Conditional `If` statement Write to file Math functions Print statements String formatting