It has been called a “gem” and “pretty much the coolest thing ever,” and if you have not heard of it, then you are missing out on one of the greatest corners of the Python 3 standard library: itertools. A handful of excellent resources exist for learning what functions are available in the itertools module. […]
Category: Data Structures
Data Retrieval and Cleaning: Tracking Migratory Patterns
Advancing your skills is an important part of being a data scientist. When starting out, you mostly focus on learning a programming language, proper use of third party tools, displaying visualizations, and the theoretical understanding of statistical algorithms. The next step is to test your skills on more difficult data sets. Sometimes these data sets […]
The Ultimate Guide to Data Classes in Python 3.7
One new and exciting feature coming in Python 3.7 is the data class. A data class is a class typically containing mainly data, although there aren’t really any restrictions. It is created using the new @dataclass decorator, as follows: from dataclasses import dataclass @dataclass class DataClassCard: rank: str suit: str Note: This code, as well […]
Operator and Function Overloading in Custom Python Classes
If you’ve used the + or * operator on a str object in Python, you must have noticed its different behavior when compared to int or float objects: >>> 1 + 2 # Adds the two numbers 3 >>> ‘Real’ + ‘Python’ # Concatenates the two strings ‘RealPython’ >>> 3 * 2 # Gives the […]
Working With JSON Data in Python
Since its inception, JSON has quickly become the de facto standard for information exchange. Chances are you’re here because you need to transport some data from here to there. Perhaps you’re gathering information through an API or storing your data in a document database. One way or another, you’re up to your neck in JSON, […]
Look Ma, No For-Loops: Array Programming With NumPy
It is sometimes said that Python, compared to low-level languages such as C++, improves development time at the expense of runtime. Fortunately, there are a handful of ways to speed up operation runtime in Python without sacrificing ease of use. One option suited for fast numerical operations is NumPy, which deservedly bills itself as the […]
Python Debugging With Pdb
Debugging applications can sometimes be an unwelcome activity. You’re busy working under a time crunch and you just want it to work. However, at other times, you might be learning a new language feature or experimenting with a new approach and want to understand more deeply how something is working. Regardless of the situation, debugging […]
Jupyter Notebook for Beginners: A Tutorial
The Jupyter Notebook is an incredibly powerful tool for interactively developing and presenting data science projects. A notebook integrates code and its output into a single document that combines visualisations, narrative text, mathematical equations, and other rich media. The intuitive workflow promotes iterative and rapid development, making notebooks an increasingly popular choice at the heart […]
11 Beginner Tips for Learning Python Programming
We are so excited that you have decided to embark on the journey of learning Python! One of the most common questions we receive from our readers is “What’s the best way to learn Python?” I believe that the first step in learning any programming language is making sure that you understand how to learn. […]
Thinking Recursively in Python
Of all ideas I have introduced to children, recursion stands out as the one idea that is particularly able to evoke an excited response.Seymour Papert, Mindstorms Problems (in life and also in computer science) can often seem big and scary. But if we keep chipping away at them, more often than not we can break […]
What is the Python Global Interpreter Lock (GIL)?
The Python Global Interpreter Lock or GIL, in simple words, is a mutex (or a lock) that allows only one thread to hold the control of the Python interpreter. This means that only one thread can be in a state of execution at any point in time. The impact of the GIL isn’t visible to […]
Object-Oriented Programming (OOP) in Python 3
In this article you’ll pick up the following basic concepts of OOP in Python: Python Classes Object Instances Defining and Working with Methods OOP Inheritance Free Bonus: Click here to get access to a free Python OOP Cheat Sheet that points you to the best tutorials, videos, and books to learn more about Object-Oriented Programming […]
Python + Memcached: Efficient Caching in Distributed Applications
When writing Python applications, caching is important. Using a cache to avoid recomputing data or accessing a slow database can provide you with a great performance boost. Python offers built-in possibilities for caching, from a simple dictionary to a more complete data structure such as functools.lru_cache. The latter can cache any item using a Least-Recently […]
Introduction to Functional Programming in Python
Most of us have been introduced to Python as an object-oriented language; a language exclusively using classes to build our programs. While classes, and objects, are easy to start working with, there are other ways to write your Python code. Languages like Java can make it hard to move away from object-oriented thinking, but Python […]
Python – TechEuler
Python – TechEulerUnOrdered Linked list – Prepend, Append, Insert At, Reverse, Remove, SearchUse of __slots__ in Python ClassUsage of Underscores before and after function name in Python Warning: Cannot modify header information – headers already sent by (output started at /home/manikandancsea/public_html/index.php:4) in /home/manikandancsea/public_html/wp-includes/feed-rss2.php on line 8http://www.techeuler.com A Tech blog for nerds Thu, 28 Jul 2016 […]