Описание
Характеристики
Отзывы
Elegant SciPy
Год издания: 2017
Автор: Juan Nunez-Iglesias, Stéfan van der Walt & Harriet Dashnow
Жанр или тематика: Python
Издательство: O’Reilly
ISBN: 978-1-491-92287-3
Язык: Английский
Формат: PDF/EPUB/MOBI
Качество: Издательский макет или текст (eBook)
Интерактивное оглавление: Да
Количество страниц: 277
Описание: Welcome to Scientific Python and its community. If you’re a scientist who programs with Python, this practical guide not only teaches you the fundamental parts of SciPy and libraries related to it, but also gives you a taste for beautiful, easy-to-read code that you can use in practice. You’ll learn how to write elegant code that’s clear, concise, and efficient at executing the task at hand.
Throughout the book, you’ll work with examples from the wider scientific Python ecosystem, using code that illustrates principles outlined in the book. Using actual scientific data, you’ll work on real-world problems with SciPy, NumPy, Pandas, scikit-image, and other Python libraries.
Примеры страниц
Оглавление
Preface vii
1. Elegant NumPy: The Foundation of Scientific Python 1
Introduction to the Data: What Is Gene Expression? 2
NumPy N-Dimensional Arrays 6
Why Use ndarrays Instead of Python Lists? 8
Vectorization 10
Broadcasting 10
Exploring a Gene Expression Dataset 12
Reading in the Data with pandas 12
Normalization 14
Between Samples 14
Between Genes 21
Normalizing Over Samples and Genes: RPKM 24
Taking Stock 30
2. Quantile Normalization with NumPy and SciPy 31
Getting the Data 33
Gene Expression Distribution Differences Between Individuals 34
Biclustering the Counts Data 37
Visualizing Clusters 39
Predicting Survival 42
Further Work: Using the TCGA’s Patient Clusters 46
Further Work: Reproducing the TCGA’s clusters 46
3. Networks of Image Regions with ndimage 49
Images Are Just NumPy Arrays 50
Exercise: Adding a Grid Overlay 55
iiiFilters in Signal Processing 56
Filtering Images (2D Filters) 63
Generic Filters: Arbitrary Functions of Neighborhood Values 66
Exercise: Conway’s Game of Life 67
Exercise: Sobel Gradient Magnitude 68
Graphs and the NetworkX library 68
Exercise: Curve Fitting with SciPy 72
Region Adjacency Graphs 73
Elegant ndimage: How to Build Graphs from Image Regions 76
Putting It All Together: Mean Color Segmentation 78
4. Frequency and the Fast Fourier Transform 81
Introducing Frequency 81
Illustration: A Birdsong Spectrogram 84
History 90
Implementation 91
Choosing the Length of the DFT 92
More DFT Concepts 94
Frequencies and Their Ordering 94
Windowing 100
Real-World Application: Analyzing Radar Data 105
Signal Properties in the Frequency Domain 111
Windowing, Applied 115
Radar Images 117
Further Applications of the FFT 122
Further Reading 122
Exercise: Image Convolution 123
5. Contingency Tables Using Sparse Coordinate Matrices 125
Contingency Tables 127
Exercise: Computational Complexity of Confusion Matrices 128
Exercise: Alternative Algorithm to Compute the Confusion Matrix 128
Exercise: Multiclass Confusion Matrix 128
scipy.sparse Data Formats 129
COO Format 129
Exercise: COO Representation 130
Compressed Sparse Row Format 130
Applications of Sparse Matrices: Image Transformations 133
Exercise: Image Rotation 138
Back to Contingency Tables 139
Exercise: Reducing the Memory Footprint 140
Contingency Tables in Segmentation 140
iv | Table of ContentsInformation Theory in Brief 142
Exercise: Computing Conditional Entropy 144
Information Theory in Segmentation: Variation of Information 145
Converting NumPy Array Code to Use Sparse Matrices 147
Using Variation of Information 149
Further Work: Segmentation in Practice 156
6. Linear Algebra in SciPy 157
Linear Algebra Basics 157
Laplacian Matrix of a Graph 158
Exercise: Rotation Matrix 159
Laplacians with Brain Data 165
Exercise: Showing the Affinity View 170
Exercise Challenge: Linear Algebra with Sparse Matrices 170
PageRank: Linear Algebra for Reputation and Importance 171
Exercise: Dealing with Dangling Nodes 176
Exercise: Equivalence of Different Eigenvector Methods 176
Concluding Remarks 176
7. Function Optimization in SciPy 177
Optimization in SciPy: scipy.optimize 179
An Example: Computing Optimal Image Shift 180
Image Registration with Optimize 186
Avoiding Local Minima with Basin Hopping 190
Exercise: Modify the align Function 190
“What Is Best?”: Choosing the Right Objective Function 191
8. Big Data in Little Laptop with Toolz 199
Streaming with yield 200
Introducing the Toolz Streaming Library 203
k-mer Counting and Error Correction 206
Currying: The Spice of Streaming 210
Back to Counting k-mers 212
Exercise: PCA of Streaming Data 214
Markov Model from a Full Genome 214
Exercise: Online Unzip 217
Epilogue 221
Appendix: Exercise Solutions 225
Index 247
Год издания: 2017
Автор: Juan Nunez-Iglesias, Stéfan van der Walt & Harriet Dashnow
Жанр или тематика: Python
Издательство: O’Reilly
ISBN: 978-1-491-92287-3
Язык: Английский
Формат: PDF/EPUB/MOBI
Качество: Издательский макет или текст (eBook)
Интерактивное оглавление: Да
Количество страниц: 277
Описание: Welcome to Scientific Python and its community. If you’re a scientist who programs with Python, this practical guide not only teaches you the fundamental parts of SciPy and libraries related to it, but also gives you a taste for beautiful, easy-to-read code that you can use in practice. You’ll learn how to write elegant code that’s clear, concise, and efficient at executing the task at hand.
Throughout the book, you’ll work with examples from the wider scientific Python ecosystem, using code that illustrates principles outlined in the book. Using actual scientific data, you’ll work on real-world problems with SciPy, NumPy, Pandas, scikit-image, and other Python libraries.
Примеры страниц
Оглавление
Preface vii
1. Elegant NumPy: The Foundation of Scientific Python 1
Introduction to the Data: What Is Gene Expression? 2
NumPy N-Dimensional Arrays 6
Why Use ndarrays Instead of Python Lists? 8
Vectorization 10
Broadcasting 10
Exploring a Gene Expression Dataset 12
Reading in the Data with pandas 12
Normalization 14
Between Samples 14
Between Genes 21
Normalizing Over Samples and Genes: RPKM 24
Taking Stock 30
2. Quantile Normalization with NumPy and SciPy 31
Getting the Data 33
Gene Expression Distribution Differences Between Individuals 34
Biclustering the Counts Data 37
Visualizing Clusters 39
Predicting Survival 42
Further Work: Using the TCGA’s Patient Clusters 46
Further Work: Reproducing the TCGA’s clusters 46
3. Networks of Image Regions with ndimage 49
Images Are Just NumPy Arrays 50
Exercise: Adding a Grid Overlay 55
iiiFilters in Signal Processing 56
Filtering Images (2D Filters) 63
Generic Filters: Arbitrary Functions of Neighborhood Values 66
Exercise: Conway’s Game of Life 67
Exercise: Sobel Gradient Magnitude 68
Graphs and the NetworkX library 68
Exercise: Curve Fitting with SciPy 72
Region Adjacency Graphs 73
Elegant ndimage: How to Build Graphs from Image Regions 76
Putting It All Together: Mean Color Segmentation 78
4. Frequency and the Fast Fourier Transform 81
Introducing Frequency 81
Illustration: A Birdsong Spectrogram 84
History 90
Implementation 91
Choosing the Length of the DFT 92
More DFT Concepts 94
Frequencies and Their Ordering 94
Windowing 100
Real-World Application: Analyzing Radar Data 105
Signal Properties in the Frequency Domain 111
Windowing, Applied 115
Radar Images 117
Further Applications of the FFT 122
Further Reading 122
Exercise: Image Convolution 123
5. Contingency Tables Using Sparse Coordinate Matrices 125
Contingency Tables 127
Exercise: Computational Complexity of Confusion Matrices 128
Exercise: Alternative Algorithm to Compute the Confusion Matrix 128
Exercise: Multiclass Confusion Matrix 128
scipy.sparse Data Formats 129
COO Format 129
Exercise: COO Representation 130
Compressed Sparse Row Format 130
Applications of Sparse Matrices: Image Transformations 133
Exercise: Image Rotation 138
Back to Contingency Tables 139
Exercise: Reducing the Memory Footprint 140
Contingency Tables in Segmentation 140
iv | Table of ContentsInformation Theory in Brief 142
Exercise: Computing Conditional Entropy 144
Information Theory in Segmentation: Variation of Information 145
Converting NumPy Array Code to Use Sparse Matrices 147
Using Variation of Information 149
Further Work: Segmentation in Practice 156
6. Linear Algebra in SciPy 157
Linear Algebra Basics 157
Laplacian Matrix of a Graph 158
Exercise: Rotation Matrix 159
Laplacians with Brain Data 165
Exercise: Showing the Affinity View 170
Exercise Challenge: Linear Algebra with Sparse Matrices 170
PageRank: Linear Algebra for Reputation and Importance 171
Exercise: Dealing with Dangling Nodes 176
Exercise: Equivalence of Different Eigenvector Methods 176
Concluding Remarks 176
7. Function Optimization in SciPy 177
Optimization in SciPy: scipy.optimize 179
An Example: Computing Optimal Image Shift 180
Image Registration with Optimize 186
Avoiding Local Minima with Basin Hopping 190
Exercise: Modify the align Function 190
“What Is Best?”: Choosing the Right Objective Function 191
8. Big Data in Little Laptop with Toolz 199
Streaming with yield 200
Introducing the Toolz Streaming Library 203
k-mer Counting and Error Correction 206
Currying: The Spice of Streaming 210
Back to Counting k-mers 212
Exercise: PCA of Streaming Data 214
Markov Model from a Full Genome 214
Exercise: Online Unzip 217
Epilogue 221
Appendix: Exercise Solutions 225
Index 247
Характеристики
Тип упаковки
Пластиковый бокс
Вес
0.12 кг
Формат
(ЭЛЕКТРОННЫЙ)
Количество CD
1
Год
2017
Отзывов ещё нет — ваш может стать первым.
Все отзывы 0