Outils pour utilisateurs

Outils du site


issue104:critique2

August 2015, 264 pp. ISBN: 978-1-59327-640-9 Are your students future scientists or mathematicians? Do they seem to enjoy exploring the world or playing with numbers? Or perhaps they just like creating things on the computer? Doing Math with Python is a possible choice for a student or a teacher to use to teach and enhance a student's skills. For some students, it could help them get a better understand of some of the mathematical topics discussed. For young, budding scientists, the book can help them learn how to collect and analyze data. The programmer will learn to break complicated problems into smaller ones in order to find a solution. The book was written by Amit Saha, a software engineer. He also created and maintains Fedora Scientific, a Linux distribution for scientific and educational users. The language of the book is simple and easy to follow. The book does assume you are familiar with the basics of Python. The author does a good job of teaching how to break complicated formulas down into pieces in order to avoid long complicated statements in Python. In many cases, I felt like I understood the formula better after this process. The division of large formulas into smaller expressions could help a struggling math or science student to succeed. The explanations of the mathematics and the programming are clear and easy to follow. This book is as much a math and science book as it is a programming book. Amit has brought the three topics together in a very natural and pleasing way. Using the computer makes it quicker and easier to change and play with the results. I must admit, I had a few eureka moments myself, and times when I had to force myself to move on because I was spending a lot of time playing with the numbers to get new results.

Août 2015, 264 pages ISBN : 978-1-59327-640-9

Vos étudiants sont-ils de futurs scientifiques ou mathématiciens ? Semblent-ils prendre plaisir à explorer le monde ou jouer avec les chiffres ? Ou, peut-être, aiment-ils juste créer des choses sur l'ordinateur ? Doing Math with Python est un choix possible, utilisable par un étudiant, ou par un professeur, pour enseigner et améliorer les compétences d'un étudiant. Pour certains étudiants, il les aidera à mieux comprendre quelques sujets mathématiques présentés. Pour des jeunes scientifiques en herbe, le livre peut les aider à apprendre comment emmagasiner et analyser des données. Le programmeur apprendra à diviser un problème complexe en plus petites parties pour trouver une solution.

Le livre a été écrit par Amit Saha, un ingénieur logiciel. Il a aussi créé et maintient Fedora Scientific, une distribution Linux pour des utilisateurs scientifiques ou universitaires.

Le langage du livre est simple et compréhensible. Le livre part du principe que vous connaissez bien les bases de Python. L'auteur fait vraiment du bon travail en démontrant comment diviser des formules compliquées en morceaux pour éviter de longues déclarations compliquées en Python. Dans de nombreux cas, j'avais l'impression de mieux comprendre la formule après application de ce procédé. La division des grandes formules en plus petites expressions pourrait aider un étudiant en difficulté en maths ou en sciences à réussir. Les explications des mathématiques et de la programmation sont claires et faciles à suivre. Le livre est autant un livre de maths et de sciences qu'un livre de programmation. Amit a réuni les trois sujets de façon naturelle et plaisante. L'utilisation de l'ordinateur accélère et facilite les modifications pour jouer avec les résultats. Je dois l'admettre, j'ai eu moi-même quelques moments « eurêka » et des fois où j'ai dû me forcer à avancer, car je passais beaucoup de temps à jouer avec les chiffres pour obtenir de nouveaux résultats.

The book is divided into 7 chapters. The following is a short synopsis of each chapter. Chapter 1, Working with Numbers, is an introduction to the book. You review the different types of numbers you can create in Python, including fractions and complex numbers. You also see how to use the basic mathematical operators (plus, minus, multiplication, division, modulo, and exponents) built into Python. You learn to assign a label to a number for use later in a program. He calls them labels rather than the traditional variable to avoid confusion when the term is used in the mathematical sense. You see how to create and work with fractions and complex numbers as well as do mathematical operations with these number types. Getting and verifying user's input is given a once-over and discussed often in the course of the book. Your first program is a program that calculates the factors of a supplied number. The first big step in the book is translating the root of a quadratic equation using the functions and operators built into Python. Chapter 2, Visualizing Data Using Graphs, teaches you the basics of plotting a graph using the matplotlib module. You learn to feed data into the plot function, give the graph a title and labels, create a legend, and control the minimum and maximum values of the X and Y axes. After plotting several single-line charts, you plot a series of multiple-line plots, showing you how to use a graph to do a comparison of two sets of data. Finally, you use a formula to generate the data you plot on your graph. This is an important step in the evolution of your skills with the matplotlib module. In the challenges at the end of the chapter, you even learn how to create a bar chart using the matplotlib.

Le livre est divisé est 7 chapitres. Voici un court résumé de chacun d'eux.

Le chapitre 1, Working with numbers (Utiliser les nombres), est l'introduction du livre. Vous passez en revue les différents nombres que vous pouvez créer dans Python, y compris les fractions et les nombres complexes. Vous voyez aussi comment utiliser les opérateurs mathématiques de base (plus, moins, multiplier, diviser, module et exposant) disponibles dans Python. Vous apprenez à assigner une étiquette à un nombre pour l'utiliser plus tard dans un programme. Il les appelle « étiquettes » plutôt que le traditionnel « variable » pour éviter la confusion avec le terme utilisé au sens mathématique. Vous voyez comment créer et utiliser les fractions et les nombres complexes ainsi que les opérations mathématiques avec ces types de nombres. La saisie et la vérification des entrées de l'utilisateur est examinée, puis présentée souvent tout au long du livre. Votre premier programme est un programme qui calcule les facteurs d'un nombre fourni. Le premier gros morceau de ce livre est de traduire la racine d'une équation du second degré en utilisant les fonctions et opérateurs disponibles dans Python.

Le chapitre 2, Visualizing Data Using Graphs (Visualiser les données avec des graphiques), vous apprend les bases du tracé d'un graphique en utilisant le module matplotlib. Vous apprenez à alimenter la fonction plot en données, mettre un titre et des étiquettes sur le graphique, créer une légende, et déterminer les valeurs maximum et minimum des axes X et Y. Après avoir tracé plusieurs graphiques à ligne unique, vous tracez une série de graphiques multilignes, avec une présentation de comment utiliser un graphique pour comparer deux jeux de données. Enfin, vous utilisez une formule pour générer les données que vous tracez sur votre graphique. C'est une étape importante dans l'évolution de votre connaissance du module matplotlib. Dans les exercices de fin de chapitre, vous apprenez même à créer un graphique en barres avec matplotlib.

Chapter 3, Describing Data with Statistics, you dive into the exciting world of statistics. You create functions for calculating the basic equations of statistics, mean, median, mode, range, variance, and standard deviation. Although not directly discussed in the book, these functions would make a good library collected into one file. You work through the complicated formula for calculating a Correlation Coefficient between two sets of numbers. You then learn how to create a scatter plot in matplotlib. If you have never used a scatter plot before, you learn that even though the mean, standard deviation, and correlation of sets may look the same, scatter plots can give a view of the data that tells a whole new story. With a scatter plot, you can see the outliers that can skew your numbers. You then get a refresher on how to import data from a text file, and more importantly, how to import data from a comma-separated value (CSV) file. CSV files are a good way to get large amounts of data into your program. Chapter 4, Algebra and Symbolic Math with SymPy, plunges you into the world of Algebra and symbolic math. SymPy is a module that allows you to use symbols in your formula and get results. After learning how to create a symbol object, you begin to work with Algebraic expressions, factoring expressions, creating series, simplifying expressions, and substituting values for symbols. Then you are off solving equations and plotting equations using SymPy. This naturally led to plotting multiple expressions on one chart.

Le chapitre 3, Describing Data with Statistics (Décrire des données par les statistiques), vous plonge dans le monde passionnant des statistiques. Vous créez des fonctions pour calculer des équations statistiques de base, moyenne, mode, rang, variance et déviation standard. Bien qu'elles ne soient pas présentées directement dans le livre, ces fonctions, rassemblées en un seul fichier, feraient une bonne bibliothèque. Vous étudiez la formule compliquée pour calculer le coefficient de corrélation entre deux jeux de valeurs. Puis vous apprenez à créer un graphique en nuage de points avec matplotlib. Si vous n'avez jamais utilisé un graphique en nuage de points auparavant, vous apprenez que même si la moyenne, la déviation standard et la corrélation de données peuvent se ressembler, le graphique en nuage de points peut rendre les données autrement compréhensibles. Avec le nuage de points, vous pouvez voir les aberrations qui peuvent fausser vos chiffres. Puis vous trouvez un rappel de comment importer des données à partir d'un fichier texte et, plus important, comment importer des données depuis un fichier avec une virgule comme séparateur (CSV). Les fichiers CSV sont une bonne manière d'alimenter votre programme avec de grandes quantités de données.

Le chapitre 4, Algebra and Symbolic Math with SymPy (Algèbre et mathématiques symboliques avec SymPy), vous plonge dans le monde de l'algèbre et des maths symboliques. SymPy est un module qui vous permet d'utiliser des symboles dans vos formules pour obtenir des résultats. Après avoir appris comment créer un objet symbolique, vous commencez à travailler avec des expressions algébriques, factorisant des expressions, créant des séries, simplifiant des expressions et substituant des valeurs aux symboles. Ensuite, vous commencez d'emblée à résoudre des équations et à en faire le tracé en utilisant SymPy. Ceci conduit naturellement à tracer plusieurs expressions sur un seul graphique.

Chapter 5, Playing with Sets and Probability, introduces you to creating sets in SymPy. SymPy sets behave just like mathematical sets and give you the ability to calculate subsets, supersets, and power sets. It also has the set operators for union, intersection, and Cartesian product. With these tools in hand, you find yourself applying sets to formulas and getting results. You are also introduced to working with probability using sets. This uses the union and intersection of sets to create an event set for calculating the probability of the resulting set. The work with probability includes both uniform and nonuniform probabilities. Chapter 6, Drawing Geometric Shapes and Fractals, will be your favorite chapter if you enjoy geometry. You discover how to draw circles, animate them on a graph, and even create an animated trajectory chart. Next, you learn about fractals and how they are made. You start with a simple zigzag with four formulas with equal probability, then move on to a Bransley Fern that uses the skills of nonuniform probability introduced in the previous chapter. Overall a good time of learning and creating interesting charts.

Le chapitre 5, Playing with Sets and Probability (Faire des probabilités avec des jeux de données), vous montre comment créer des jeux de données dans SymPy. Ces jeux SymPy se comportent comme des ensembles mathématiques et vous permettent de calculer des sous-ensembles, des sur-ensembles et les ensembles des parties des sous-ensembles. Il contient aussi les opérateurs d'union, d'intersection et le produit cartésien des ensembles. Avec ces outils en main, vous êtes capable d'appliquer ces ensembles à des formules pour obtenir des résultats. L'utilisation des probabilités avec les jeux de données vous est aussi présenté. L'union et l'intersection d'ensembles sont utilisées pour créer le jeu d'un événement afin de calculer la probabilité du jeu résultant. Cette utilisation des probabilités inclut les probabilités uniformes et non-uniformes.

Le chapitre 6, Drawing Geometric Shapes and Fractals (Dessiner des formes géométriques et des fractales), sera votre chapitre favori, si vous aimez la géométrie. Vous découvrez comment tracer des cercles, les animer sur un graphique et même créer un graphique avec une trajectoire animée. Ensuite, vous apprenez les fractales et comment elles sont faites. Vous débutez par un simple zigzag avec quatre formules d'égale probabilité, puis vous passez à une Bransley Fern qui utilise les connaissances sur les probabilités non-uniformes vues au chapitre précédent. Au total, vous passerez un bon moment en apprenant à créer des graphiques intéressants.

Chapter 7, Solving Calculus Problems, brings everything together to discuss the most advanced math in the book. Amit begins by defining what a function is. After a quick overview of common mathematical functions, you dive into finding the limit of functions. This includes some new methods in SymPy. You use Python to calculate compound interest and rate of change. Then you plunge into derivatives, including partial derivatives and high-order derivatives. You find and plot the global maximum using gradient ascent. Next, you learn how to use SymPy to find the integrals of functions. Finally, you learn about the probability density functions. Whether your student is a budding mathematician, scientist, programmer, or maybe even struggling with one of the subjects, ‘Doing Math with Python’ is a great book for exploring the topics of computer programming, mathematics, or science. Each topic builds on the previous to build a solid knowledge of each topic. After ‘Teach Your Kids to Code’ by Bryson Payne (see review in FCM#98), Doing Math with Python would make a good follow-up book for a secondary school level code club. If you teach mathematics or science, you might want to consider it as a supplemental text, or the topics could be expanded to create a class on its own.

Le chapitre 7, Solving Calculus Problems (Résoudre des problèmes de calcul), réunit tout pour présenter les mathématiques les plus avancées du livre. Amit commence par définir ce qu'est une fonction. Après une rapide revue des fonctions mathématiques courantes, vous plongez dans la recherche des limites d'une fonction. Ceci comprend quelques nouvelles méthodes dans SymPy. Vous utilisez Python pour calculer des intérêts composés et le taux de variation. Puis vous vous plongez dans les dérivées, y compris les dérivées partielles et les dérivées d'ordre élevé. Vous trouvez et tracez le maximum global en utilisant le gradient de montée. Ensuite, vous apprenez comment utiliser SymPy pour trouver les intégrales des fonctions. Enfin, vous apprenez les fonctions de densité de probabilité.

Que votre étudiant soit un mathématicien en herbe, scientifique, programmeur ou peut-être même en difficulté sur un des sujets, Doing Math with Python est un excellent livre pour explorer les sujets de la programmation informatique, des mathématiques ou des sciences. Chaque sujet est construit sur le précédent pour en développer une connaissance solide. Après Teach Your Kids to Code (Apprenez le code à vos enfants) de Bryson Payne (voir la critique dans le FCM n° 98), Doing Math with Python ferait un bon livre de complément pour un club informatique de niveau lycée. Si vous enseignez les mathématiques ou les sciences, vous pourriez le considérer comme un texte additionnel, ou alors, les sujets pourraient être développés pour former un module automnome.

issue104/critique2.txt · Dernière modification : 2016/01/16 08:36 de auntiee