Tag: python

Home / python
The Ultimate Guide to Python Type Checking
Post

The Ultimate Guide to Python Type Checking

Table of Contents Type Systems Dynamic Typing Static Typing Duck Typing Hello Types Pros and Cons Annotations Function Annotations Variable Annotations Type Comments So, Type Annotations or Type Comments? Playing With Python Types, Part 1 Example: A Deck of Cards Sequences and Mappings Type Aliases Functions Without Return Values Example: Play Some Cards The Any...

Introduction to Python’s Collections Module
Post

Introduction to Python’s Collections Module

Introduction Collections in Python are containers that are used to store collections of data, for example, list, dict, set, tuple etc. These are built-in collections. Several modules have been developed that provide additional data structures to store collections of data. One such module is the Python collections module. Python collections module was introduced to improve the functionalities of the built-in...

Dynamic class definition in Python
Post

Dynamic class definition in Python

Here’s a neat Python trick you might just find useful one day. Let’s look at how you can dynamically define classes, and create instances of them as required. This trick makes use of Python’s object oriented programming (OOP) capabilities, so we’ll review those first. Classes and objects Python is an object-oriented language, meaning it lets you...

Memory Management in Python
Post

Memory Management in Python

Table of Contents Memory Is an Empty Book Memory Management: From Hardware to Software The Default Python Implementation The Global Interpreter Lock (GIL) Garbage Collection CPython’s Memory Management Pools Blocks Arenas Conclusion Ever wonder how Python handles your data behind the scenes? How are your variables stored in memory? When do they get deleted? In...

Make a Web App Using Python & Flask!
Post

Make a Web App Using Python & Flask!

Creating a Python Website from the Bottom Up Note: This post requires you know some basic Python. You should be comfortable with what functions are and how to write them. Here is a quick refresher! It would also be nice if you understood the basics of dictionaries: what they are, how to access elements of one, and...

How to manage multiple Python versions and virtual environments
Post

How to manage multiple Python versions and virtual environments

Before we start, let’s briefly go over the terms used in the title: Multiple Python versions: Different installations of Python on the same machine, 2.7 and 3.4 for example. Virtual environments: isolated independent environments that can have both a specific version of Python and of any project-specific packages installed within them, without affecting any other...

Installing Python and Anaconda on Windows
Post

Installing Python and Anaconda on Windows

This tutorial will show you how to install Python (via Anaconda) on your machine. Before getting started with the installation, let’s learn a bit more about what Anaconda exactly is. Python is the programming language which will be installed on the machine and on top of that different IDEs and packages can be installed. Python...

Conditional Statements in Python
Post

Conditional Statements in Python

Table of Contents Introduction to the if Statement Grouping Statements: Indentation and Blocks Python: It’s All About the Indentation What Do Other Languages Do? Which Is Better? The else and elif Clauses One-Line if Statements Conditional Expressions The pass Statement Conclusion From the previous tutorials in this series, you now have quite a bit of...

50 Popular Python open-source projects on GitHub in 2018
Post

50 Popular Python open-source projects on GitHub in 2018

This post is curated by IssueHunt that a crowdfunding and sourcing platform for open-source projects. 1) TensorFlow Models If you are interested in Machine learning and Deep learning, you must have heard about the TensorFlow. TensorFlow Models is the open-source repository to find many libraries and models related to deep learning. GitHub: https://github.com/tensorflow/models 2) Keras Keras is a high-level neural...

Modern Functions in Python 3
Post

Modern Functions in Python 3

Python has thrived over the past few decades as the language which lets you work quickly and effectively. Like many modern companies, we use Python quite extensively for a majority of our stack, but in many cases, continue to live on Python 2.7. The harsh reality is that Python 2.7 is going away, and honestly — it’s about...

Decorators in Python: What you need to know
Post

Decorators in Python: What you need to know

Python decorators are a powerful concept that allow you to “wrap” a function with another function. The idea of a decorator is to abstract away something that you want a function or class to do, besides its normal responsibility. This can be helpful for many reasons such as code reuse, and sticking to curlys law. By...

Python Tricks 101🐍
Post

Python Tricks 101🐍

Python tips which are relatively uncommon and are very useful. Talk is cheap show me the code Swapping values Create a single string from all the elements in list Find The Most Frequent Value In A List. Checking if two words are anagrams Reverse a String Reverse a list Transpose 2d array Chained Comparison Chained function call Copying List Dictionary Get Sort Dictionary by Value...

Hands on with Python 3.7: what’s new in the latest release
Post

Hands on with Python 3.7: what’s new in the latest release

Used for general purpose programming, data science, website backends, GUIs, and pretty much everything else; the first programming language for many, and claimed to be the fastest growing in the world, is of course Python. The newest version 3.7.0 has just recently been released. Naturally any release of Python, no matter how small, undergoes meticulous planning...

Cool New Features in Python 3.7
Post

Cool New Features in Python 3.7

Table of Contents The breakpoint() Built-In Data Classes Customization of Module Attributes Typing Enhancements Timing Precision Other Pretty Cool Features The Order of Dictionaries Is Guaranteed “async” and “await” Are Keywords “asyncio” Face Lift Context Variables Importing Data Files With “importlib.resources“ Developer Tricks Optimizations So, Should I Upgrade? Python 3.7 is officially released! This new Python...

Overview of Exploratory Data Analysis With Python
Post

Overview of Exploratory Data Analysis With Python

Exploratory data analysis plays a role in the work of data science and machine learning. In this post I am giving a brief intro of Exploratory data analysis(EDA) in Python with help of pandas and matplotlib. Let’s start now. What is Exploratory data analysis? According to Wikipedia: In statistics, exploratory data analysis (EDA) is an approach to analyzing data...

The Pythonic Guide to Logging
Post

The Pythonic Guide to Logging

When done properly, logs are a valuable component of your observability suite. Logs tell the story of how data has changed in your application. They let you answer questions such as: Why did John Doe receive an error during checkout yesterday? What inputs did he provide? The practice of logging ranges from very simple static...

Data Science Tutorials & Resources for Beginners
Post

Data Science Tutorials & Resources for Beginners

If you want to know more about Data Science but don’t know where to start this list is for you!  No previous knowledge required but Python and statistics basics will definitely come in handy. These ressources have been used successfully for many beginners at my local Data Science student group ML-KA. Contents What is Data Science?...