Skip to main content


Showing posts from August, 2017

Interactive Plotting with Python and Matplotlib

Hello my friends, in this new entry I am going to show you how to make cool animations with some algebra and Python, algebra? Yes my friend, because animating an object is based on some transformation of coordinates, translating or rotating for example,  but we will get into that don't worry; Now let's talk about the Python Tools that we are going to use. ·Numpy ·Matplotlib With numpy we can make and manipulate arrays with Python, the  array type in this package has methods that can use for common operations in algebra, among other uses with also are going to take into account the trigonometric functions, sin and cos, useful for rotations. With matplotlib we can create pretty cool plots, and turning the interactive mode on, we can make some iteractive plots hence a cool animation. Let me show you the final result for our code so you can have a pretty good idea.

Data Processing using Python Generators

Hello my friends in this Entry we are going to talk about data processing with Python, but we are going to process data using a pipeline approach, to a better understanding on this you can go back an entry earlier were I explained Iterators and Generators. In this entry we are going to move forward in applying generators to process data with pipelines. But first let's talk about Comprehension. Python ComprehensionComprehension is a way of creating sequences from iterators in a one line simple statement; we have several kinds of comprehensions  Python List ComprehensionFor example if we want to build a list with the first 10 squares values of the positive integer numbers we can do it like this >>>squares= [x **2for x inrange(1, 11)] >>>squares [1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
We can also create compounds lists with if statements, let's now build the same squares but only taking the even ones. >>>squares=[x**2forxinrange(1,

A Python Tale of Iterators and Generators

Hello my friends in this Entry we are going to talk about a really cool topic (Well that's what I think) that is Iterators and Generators with the Python Programming Language, and for explaining each of this I'm going to build a class representing a Linked List data structure and how you can use Python Built-in Functions to iterate, create iterators or generators on custom classes.

Singleton - Design Patterns in Python

Hello my friends, here in this quickly entry we are going to talk about the most basic but very useful Design Pattern and that is the Singleton, but first let's discuss as always a little about theory.
Design PatternsThis is the next step in the programing learning curve, after Object Oriented Programming there is a list of topics that you could learn next, I strongly recommend Python Design Patterns. Accordingly to the Wikipedia, “a software design pattern is a general reusable solution to a commonly occurring problem within a given context in software design”, in other words is the same code to the same kind of problems; in general we tend to find the same kind of problems when we are designing our software, and we tend to solve this problems with the same solution, in time and each time this solution is improved and finally is considered a standard or a pattern in software design, so it becomes a design pattern.