Pattern matching and text manipulation Bram Kuijper
Python for scientific research
Pattern matching and text manipulation
Bram Kuijper
University of Exeter, Penryn Campus, UK
March 3, 2020
Bram Kuijper
Python for scientific research
What we've done so far
1 Declare variables using built-in data types and execute operations on them
2 Use flow control commands to dictate the order in which commands are run and when
3 Encapsulate programs into reusable functions, modules and packages
4 Use string manipulation and regex to work with textual data 5 Interact with the file system 6 Number crunching using NumPy/SciPy 7 Next: Introducing Matplotlib, Python's plotting library
Bram Kuijper
Python for scientific research
Introduction
s1 and s2
coherence
Matplotlib is a 2D and 3D plotting library that produces publication-ready scientific figures in most formats (e.g png, eps, svg)
0.05
0.00
0.05
1.00 0
1
2
3
time
4
0.75
0.50
0.25
0.00 0
10
20Frequency30
40
4 20 2 4
-----1000000001.........0.7153351701916446191 4 20 2 4
5 50
0.75 0.50 0.25 0.00
0.25 0.50 0.75
ylabel ylabel
violin plot
20
20
10
10
0
0
10
10
20
20
x1
x2
x3
x4
x1
xlabel
9
8
7
6
5
4
3
2
1
4
2
0
2
4
box plot
x2
x3
x4
xlabel
1.5
1.0 102
0.5
0.0
101
0.5
1.0
1.5
100
2.0 3
A line plot o9n0?a polar axis
135?
45?
180?
0.5
1.0
1.5
0? 2.0
225?
315?
270?
Simp0le.0s0t0default with labels
0.800
0.400 11.2.60000
-1.200
0.000
-0.800
-0.400
2
1
0
1
2
Bram Kuijper
Python for scientific research
Anatomy of a figure
4 Major tick
Minor tick 3 Major tick label
Anatomy of a figure
Title
Blue signal Red signal
Legend
Grid (linLeinpelot)
Y axis label
2 Y axis label
1
(scMatatrekreprslot)
Figure
Axes (linLeinpelot)
Spines
0
0 0.25 0.50 0.75 1 Minor tick label
1.25
1.50
1.7X5axis2
2.25 label
X axis label
2.50 2.75 3 Made with
3.25 3.50 3.75 4
Bram Kuijper
Python for scientific research
My first plot
1 import numpy as np 2 import matplotlib.pyplot as plt
3
4 # Generate sinusoidal data 5 x = np.linspace (0, 4*np.pi , 100) 6 y = np.sin(x)
7
8 # Plot sinusoidal curve 9 plt.plot(x, y, color="blue") 10 plt . xlabel ( " Time " ) 11 plt . ylabel ( " Amplitude " ) 12 plt . title ( " My first Python plot " )
Amplitude
My first Python plot 1.00
0.75
0.50
0.25
0.00
0.25
0.50
0.75
1.00
0
2
4
6
8
10 12
Time
Bram Kuijper
Python for scientific research
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related searches
- mental manipulation tasks speech therapy
- javascript pattern matching examples
- java string pattern matching example
- java pattern matching example
- bram x kendi
- dom manipulation methods
- sound manipulation power
- string manipulation matlab
- java string manipulation exercises
- identify the rural settlement pattern or rural survey pattern from the photo
- black and white pattern wallpaper
- states and capitals matching printable