Articles, news, and tips on Django and Python, page 3

Guide: Pandas DataFrames for Data Analysis

“Data scientist” is one of the hottest jobs in tech, and Python is the lingua franca of data science. Python’s easy-to-learn syntax, open ecosystem, and strong community has made it one of the fastest growing languages in recent years. In this post, we’ll learn about Pandas, a high-performance open-source package for doing data analysis in Python.

Finally, Real-Time Django Is Here: Get Started with Django Channels

When Django was created, over ten years ago, the web was a less complicated place. The majority of web pages were static. Database-backed, Model/View/Controller-style web apps were the new spiffy thing. Ajax was barely starting to be used, and only in narrow contexts.

Flask vs. Django: Choose Your Python Web Framework

По данным исследования 2018 Python Developers Survey, Flask и Django, безусловно, являются самыми популярными веб-фреймворками для разработчиков на Python. Вы вряд ли ошибетесь с выбором любого из этих фреймворков, если решаете, какой из них использовать для нового веб-приложения.

What is Django? A Quick Django Tutorial Part 1

Written in Python, Django is the self-proclaimed web framework for perfectionists with deadlines – and I have to agree. Django provides so much power out of the box and is built on Python – which has its own repository of libraries, PyPI – that you can lean on. It’s easy to understand why Django is the top Python web framework today and is among the top six of all programming frameworks.

The Pandas Library for Python

So, what is Pandas – practically speaking? In short, it’s the major data analysis library for Python. For scientists, students, and professional developers alike, Pandas represents a central reason for any learning or interaction with Python, as opposed to a statistics-specific language like R, or a proprietary academic package like SPSS or Matlab.

Python For Loops: Quick Answers and Examples

Much of the benefit we get from using computers is from programming them to do the same task multiple times in a row, which requires repeating the same block of code again and again. This is where for each loops are useful in Python, or any other object-oriented programming (OOP) language. We will use for loop and for each loop interchangeably, as the Python for loop is always associated with some collection of items to which the each refers, and it is helpful to think about the items to be worked with. Officially, the Python documentation refers to the for loop as the “for statement.”

Python Decorators

Decorators are quite a useful Python feature. However, it can seem that any resources or insights surrounding them makes the whole concept impossible to understand. But decorators are, in fact, quite simple. Read on, and we’ll show you why.

Python List Comprehensions

Lists are easy to recognize in Python. Whenever we see brackets ‘[]’, we know that lists are afoot. Declaring lists is just about as easy as gets in Python.

Pyton Regular Expressions

REGEX is a module used for regular expression matching in the Python programming language. In fact, REGEX is actually just short for regular expressions, which refer to the pattern of characters used in a string. This concept can apply to simple words, phone numbers, email addresses, or any other number of patterns.

Modeling Trees with SQLAlchemy ORM and Postgres Ltree

When writing software, you’ll often encounter situations where a tree is the most appropriate data structure for working with hierarchical data. Although Python lacks a built-in native implementation of trees, it’s relatively straightforward to implement one yourself, especially with help from third-party libraries.

Guide to Python Dictionaries

Second to a Python list, the dictionary or “dict” is a place in memory to store a series of values – also called a collection. The dictionary is special because values are not referenced in order using a numerical index. Rather, in a dictionary, values are referenced with a user-defined key, just as words in a physical dictionary are “keys” associated with the “value” of their meaning. This key is usually a string, but could be any number of data types.

Guide to String Formatting with Python

String formatting is a robust and powerful part of any python programmer’s toolkit – nearly every piece of production software takes advantage of it in one way or another. The means of formatting strings, though, have greatly evolved over Python’s lifetime. From the % formatting, to the format() method, to formatted string literals, there’s no limit as to the potential of string crafting.

A Guide to Python’s Flask Web Interface

Flask is a bare-bones Python framework for building apps that use the web browser as the front-end, rather than the command-line as the front-end. Flask abstracts away lower-level tasks, such as setting up a development web server, managing information flow from the browser to the Python interpreter, and more. Using Flask thus allows you, the developer, to focus on the application logic rather than worrying about infrastructural things.

Practical Machine Learning with Python and Keras

Machine learning is a field of artificial intelligence that uses statistical techniques to give computer systems the ability to “learn” (e.g., progressively improve performance on a specific task) from data, without being explicitly programmed. Think of how efficiently (or not) Gmail detects spam emails, or how good text-to-speech has become with the rise of Siri, Alexa, and Google Home.

Best Practices for Using Functional Programming in Python

Python is a very versatile, high-level programming language. It has a generous standard library, support for multiple programming paradigms, and a lot of internal transparency. If you choose, you can peek into lower layers of Python and modify them – and even modify the runtime on the fly as the program executes.

TensorFlow or PyTorch? A Guide to Python Machine Learning Libraries (with examples!)

Python is the fastest-growing programming language out there. That isn’t surprising given that it’s simple, easy to use, free, and applicable for many computing tasks. Data scientists in particular have embraced Python’s efficient syntax, learnability, and easy integrations with other languages such as C and C++.

Web Scraping with Python: A Tutorial on the BeautifulSoup HTML Parser

Web scraping is a technique employed to extract a large amount of data from websites and format it for use in a variety of applications. Web scraping allows us to automatically extract data and present it in a usable configuration, or process and store the data elsewhere. The data collected can also be part of a pipeline where it is treated as an input for other programs.

Python in the Command Line: A Tutorial on Click

While I was spending my weekend on one of my favorite pastimes, writing Python code, and found a way to generate a 3D QR code of my WIFI password. In the process, I had some interesting epiphanies, mainly that Command Line Interfaces (CLIs) and Web Apps share some striking commonalities.

How to Use Pandas GroupBy, Counts and Value Counts

If you’re a data scientist, you likely spend a lot of time cleaning and manipulating data for use in your applications. One of the core libraries for preparing data is the Pandas library for Python.

Data Science, the Good, the Bad, and the… Future

How often do you think you’re touched by data science in some form or another? Finding your way to this article likely involved a whole bunch of data science (whooaa). To simplify things a bit, I’ll explain what data science means to me. “Data Science is the art of applying scientific methods of analysis to any kind of data so that we can unlock important information.”