Tag: Python

87 Lesser-known Python Features

If you’ve been using Python for years and know enough to get the job done, it’s probably not a wise use of your time to read through several thousand pages of documentation just to maybe discover a handful of new tricks. So I’ve put together a short (by comparison) list o...

How I Learned Python in a Day

After several hours of headaches and questioning reality, I finally felt that I had learned Python. I have been interested in learning this language for quite some time, with no intention of diving into data science or AI. Having heard Python is an easier language compared to others I’ve le...

No-code in the front, Python in the back. Streamsync.

The origins About a year ago, one of my colleagues introduced me to Streamlit. I thought it was a great concept, but far from masterfully executed. To prove a point, I quickly assembled a proof-of-concept using Python, Vue and WebSockets and wrote a Medium article about it. The mechanic...

Python water quality EDA and Potability analysis

Being able to provide enough fresh drinking water is a core requirement. Within the climate change debate, one of the largest challenges is ensuring enough freshwater to survive. Water quality is a big concern that impacts all the specifies. Only about three percent of Earth’s water is fr...

How to Write a Simple Math Interpreter in Python

Not long ago, I had to write a certain feature for my project. It involved parsing a mathematical expression from plaintext and evaluating it. This feature had to work with basic numerical expressions like 2 + 3, support context to use variables: apples + 2 * oranges, and parentheses:&nbsp...

Boost Your Python Code With Rust Extensions

As most of you already know, Python is a general-purpose programming language optimized for simplicity and ease of use. While it’s a great tool for light tasks, code execution speed can soon become a major bottleneck in your programs. In this article, we’ll discuss why Python is so sl...

ata Mastery with Python and SQL: Unleashing Efficiency and Security through 4 Strategic Use Cases

Data analysis and management are essential components of any modern enterprise’s operations. To effectively harness the power of data, professionals rely on a combination of programming languages and tools that enable efficient data processing, manipulation, and analysis. In this article, we e...

A Quick Fix for Your Sluggish Python Code

omputationally intensive tasks are everywhere now. We are using resource-intensive techniques such as LLMs and Generative AI a lot these days. Whoever uses precious resources would know how daunting it is to do the same task again, even though we know the results will be the same. You’d ...

Unknown Python Parameters That Will Save Your Time

Python was first introduced in the year 1991. It was created by Guido van Rossum, a Dutch programmer, who released the initial version of Python, known as Python 0.9.0, in February 1991. Guido van Rossum wanted to create a programming language that focused on code readability and simplicity, which l...

Create a Dashboard Using Python and Dash

In the realm of data science and analytics, the power of data is unleashed not just by extracting insights but also by effectively communicating these insights; this is where data visualization comes into play. Data visualization is a graphical representation of information and data. It...

Master These 3 Must-Know Python Programs

1. Check Armstrong Number in Python Using Recursion The given code checks whether a given number is an Armstrong number in Python using recursion. Armstrong number is a number that is equal to the sum of its digits raised to the power of the number of digits. 2. Fibonacci Series in Pyth...

Python in Excel Will Reshape How Data Analysts Work

As Microsoft said, this is a significant evolution in the analytical capabilities available within Excel. They want to combine the power of Python with the flexibility of Excel. The best of both worlds! With this integration, you can write Python code in Excel cells, create advanced visualization...

30 Python Concepts I Wish I Knew Way Earlier

Everyone’s Python journey is different, and we all learn different concepts at different speeds, in different sequences. But some things ay off a lot more when you learn them early. Here are 30 Python concepts I wish I learn much earlier in my own Python journey. 1) f-strings (formatted str...

Why Spreadsheets Are The Biggest Gateway To Coding

Every once in a while, people wonder “what’s the most popular programming language on the planet?” If you check the recent surveys, usually they’ll say it’s Javascript or Python. But I always argue these surveys are off base. I maintain that if you ...

Python Tips And Concepts To Improve Your Code

Python is easy to write and understand but you can quickly use it the wrong way and jump into a minefield of anti-patterns. This post curates a list of 21 concise tips that improve your code readability and efficiency. They are drawn from personal projects, thorough code reviews, and inspiring di...

Python Logs Aren’t Code A Communication Tool

Your Present & Future Self Will Hate You For Forgetting To Do This Programming Chore Nothing will ruin a programming session faster than bad coffee shop WiFi. And on the particular day I’m recounting, as much as I needed the vanilla latte sitting to my left, I really needed that sweet, ...

20 Python Scripts with Code to Automate Your Work

In this article, we’ll explore 20 Python scripts along with their code that can help you automate various tasks and boost your productivity. Whether you’re a developer, data analyst, or just someone looking to simplify their workflow, these scripts have got you covered. Table of Conte...

Understanding the 10 Most Difficult Python Concepts

Python has a simple syntax and is easy to learn, making it an ideal choice for beginners. However, as you delve deeper into Python, you may encounter some challenging concepts that can be difficult to understand. In this article, I will explain the 10 most difficult Python concepts including recu...

Stop Using dict[key] to Access Values in Python Dictionaries!

We probably learnt to use dict[key] to access a value in a dictionary at the start. But here’s a better way to do that. The original dict[key] method d = {'apple':4, 'orange':5, 'pear':6} x = d['apple'] # 4 y = d['orange'] # 5 ...

Conditional code execution via decorator in Python

Conditional code execution is like giving your code a set of instructions: “If this happens, do this; otherwise, do that.” It’s the secret sauce behind many of the dynamic and interactive applications we use every day, from mobile apps to web services. Whether you’re a season...

250+ Python and Data Science Tips — Covering Pandas, NumPy, ML Basics, Sklearn, Jupyter, and More.

Being a data scientist demands expertise in plenty of areas. You need to be good at using appropriate tools, like Pandas, NumPy, Sklearn, etc. These are indispensable to the development life cycle of many data-driven projects, making them essential skills to begin/maintain a career in data scienc...

Strumming Through Code with 10 Python Libraries and Their Country Theme Songs

Buckle up partner and grab your coding boots!  By the time we’re done here you’ll understand why Python’s top libraries are as irresistible as the twangs and tales of country music. Whether you’re a code-slinging cowboy/cowgirl or a country-loving coder, saddle up and le...

Five Python Decorators That Can Reduce Your Code By Half

Python is by far my favorite programming language due to its simple syntax and powerful application in various domains such as machine learning and web development. Although I’ve been coding for over five years, decorators were seldom on my radar unless absolutely necessary, like employing ...

15 Essential Python Pandas Code Snippets for Data Scientists

Python’s Pandas library is a fundamental tool for data scientists, offering powerful data manipulation and analysis capabilities. In this article, we’ll explore 15 advanced Pandas code snippets that every data scientist should have in their toolkit. These snippets will help you streamlin...

6 Things I Wish I Knew Earlier About requirements.txt

1) How to install everything inside requirements.txt requirements.txt contains the required libraries for a project that needs to be installed (usually using pip). A simple example: library-one==1.0.1 library-two==3.1.4 library-three==100.1.0 To install all 3 libraries, we can run ...

Python Exception Handling: 5 Tricks You Didn’t Know

Custom Exceptions for Clearer Code Instead of relying solely on Python’s built-in exceptions, create custom ones for specific scenarios in your application. This makes your code more readable and provides descriptive error messages. class NegativeNumberError(Exception): def __str__(...

A/B Testing in Python

A/B testing, also known as split testing, is a method used in marketing, product development, and web design to compare two versions of something (typically a webpage, email, or application) to determine which one performs better. It’s a statistical approach to optimize various elements of a p...

How to Write a Simple Math Interpreter in Python

Not long ago, I had to write a certain feature for my project. It involved parsing a mathematical expression from plaintext and evaluating it. This feature had to work with basic numerical expressions like 2 + 3, support context to use variables: apples + 2 * oranges, and parentheses:&nbsp...

Cracking Sudoku — How to Explore Backtracking Algorithms With Python

This article is designed to guide you through the intricacies of the Sudoku puzzle, the concept of backtracking in algorithms, and how the two intersect. Whether you’re an experienced Python programmer or a beginner eager to improve your problem-solving skills, this exploration is for you. ...

10 Amazing Automation Scripts You Need To Try Using Python

Automation refers to the execution of tasks without the need for human intervention. Numerous programming languages offer various approaches to automate tasks, but Python is often the preferred and primary choice. This preference stems from Python’s simplicity in syntax and its vast collection...

13 Fun Python Scripts

Hello friend, I hope you’re doing well! I’m writing to you today because I am truly passionate about sharing my knowledge and helping others learn. If you’ve found my articles to be valuable and they’ve made a positive impact on your life, I would be overjoyed if you could su...

Earn money with Python in 2023 Secret Way

I know that you may have read this title of earn money with Python and you have seen that everyone tell you the same things like freelancing, creating a website or blog, getting a full-time job, becoming a Python teacher, participating in coding competitions, etc. But the problem with competition me...

A Quick Fix for Your Sluggish Python Code

We are using resource-intensive techniques such as LLMs and Generative AI a lot these days. Whoever uses precious resources would know how daunting it is to do the same task again, even though we know the results will be the same. You’d blame yourself for not storing the results of its prev...

Python Exception Handling: 5 Tricks You Didn’t Know

Custom Exceptions for Clearer Code Instead of relying solely on Python’s built-in exceptions, create custom ones for specific scenarios in your application. This makes your code more readable and provides descriptive error messages. Read More

Mastering Strings in Python: From Basics to Advanced Manipulation

Now that we have cleared our first hurdle — choosing a suitable IDE — let’s dive into the first fundamental concept you need to grasp: strings. Before we get started to delve deep into the realm of strings we shall first brief ourselves with what strings really are , a string is a ...

The Right Way to Run Shell Commands From Python

Python is a popular choice for automating anything and everything, that includes automating system administration tasks or tasks that require running other programs or interacting with the operating system. However, there are many ways to achieve this in Python, most of which are arguably bad. So...

15 Levels Of Writing Python Functions

1) Basic functions with 0 arguments def hello(): print('hello') print('world') hello() # hello # world The absolute most basic function you can write — a function that takes in 0 arguments, but does only one uncustomizable thing. 2) Functions that ta...

Color/Render a 3D Pointcloud in Python

Point Clouds and Spherical Images Introduction By harnessing the duality between 3D point clouds and 2D spherical colored images, we can synergize robust 3D reconstruction algorithms with powerful 2D object detection techniques. To simultaneously capture spherical colored images and point c...

Calculating the Average of 10 Dice Throws using Python

In the world of programming, tasks often involve dealing with numbers and performing various calculations. One common scenario is when we need to simulate random events and analyze their outcomes. In this article, we will explore a simple yet interesting Python program that calculates the average va...

Python in Excel Will Reshape How Data Analysts Work

As Microsoft said, this is a significant evolution in the analytical capabilities available within Excel. They want to combine the power of Python with the flexibility of Excel. The best of both worlds! With this integration, you can write Python code in Excel cells, create advanced visualization...

Best Data Analysis Library in Python

Imagine you have a bunch of data in Jupyter Notebook that you want to analyze and visualize. PyGWalker is like a magic tool that makes it super easy for you. It takes your data and turns it into a special kind of table that you can interact with, just like using Tableau. You can explore yo...

The Clustering of Water Consumption with SOM (Self-Organizing Maps) Algorithm in Python

Hello everyone! Today, I would like to share one of my college projects, namely the clustering of water consumption by the Jetis Kulon society. Jetis Kulon is a place, located in GunungKidul, DI Yogyakarta, Indonesia. In this article, we will use the SOM Algorithm to make a cluster model. Befo...

Coroutines on Android (part I): Getting the background

Fetching a webpage or interacting with an API both involve making a network request. Similarly, reading from a database or loading an image from disk involve reading a file. These sorts of things are what I call long running tasks — tasks that take far too long for your app to stop and wait fo...

250+ Python and Data Science Tips — Covering Pandas, NumPy, ML Basics, Sklearn, Jupyter, and More.

Being a data scientist demands expertise in plenty of areas. You need to be good at using appropriate tools, like Pandas, NumPy, Sklearn, etc. These are indispensable to the development life cycle of many data-driven projects, making them essential skills to begin/maintain a career in data scienc...

Six Amazing Unknown Python Libraries

I’ve been using Python extensively for the last two years. As a result, I’m always looking for amazing libraries that can enhance my work in Data Engineering and Business Intelligence projects. 1. Pendulum Although many libraries are available in Python for DateTime, I find Pendulu...

Create Your Own Navier-Stokes Spectral Method Fluid Simulation (With Python)

For today’s recreational coding exercise, we solve the Navier-Stokes equations for an incompressible viscous fluid. To do so, we will implement a spectral method. The Navier-Stokes equations approximately describe the motions of a fluid such as water. The equations can capture the phenomenon o...

5 Awesome Python Projects: Create Interactive Dashboards, OCR, Go Paperless, Perform Data Visualization, and Deploy Language Models Vol. 5

In this article, I’ll unveil five cute projects that showcase Python’s incredible potential Python is being used by many developers all around the globe due to its simplicity and effectiveness. With its vast array of libraries and frameworks, Python has become the go-to choice for num...

20 Python Scripts with Code to Automate Your Work

Python is a popular programming language known for its simplicity and readability. It provides a vast collection of libraries and modules that make it an excellent choice for automating various tasks. Let’s dive into the world of automation and discover 20 Python scripts that can simplify y...

When Arts Meet Python: Artistic Drawing with Your Code

Have you ever imagined doing artistic creation on your terminal with Python? I did. Because I believe that programming is not necessarily just for building software. It can also make my day. This article will help you explore the useless but artistic side of Python. The code examples are not s...

The Ultimate VS Code Setup for Python

Having a well-optimized setup for your Visual Studio Code (VS Code) is nothing short of a game-changer when it comes to unleashing your coding potential. Imagine an environment tailored precisely to your needs, where every keystroke brings forth a symphony of efficiency and creativity. A good setup ...

13 Fun Python Scripts

Hello friend, I hope you’re doing well! I’m writing to you today because I am truly passionate about sharing my knowledge and helping others learn. If you’ve found my articles to be valuable and they’ve made a positive impact on your life, I would be overjoyed if you could su...

THIS Python Library Simplifies Working With Pandas

In this article, we will be looking into another great Python’s library called Sketch. It does not only let’s you ask your dataframe questions, but also gives you the actual pandas code. Let’s take a quick look at how it works. The initial step involves installation, which is ef...

10 Python Projects with Code

Python is a versatile programming language known for its simplicity and readability. It is widely used for web development, data analysis, machine learning, and automation. One of the best ways to improve your Python skills is by working on practical projects. In this blog post, we will explore ten ...

12 Python Features Every Data Scientist Should Know

As a data scientist, you’re no stranger to the power of Python. From data wrangling to machine learning, Python has become the de facto language for data science. But are you taking advantage of all the features that Python has to offer? In this article, we’ll take a deep dive into...

Stop Using print() Every Time In Python — Use pprint() Instead

Enter our benevolent saviour pprint() pprint is built-in, so we don’t need to install anything. from pprint import pprint pprint(x) one simple from pprint import pprint line is needed it makes our messy data more human-readable it doesn’t require us to...

15 Levels Of Writing Python Functions

1) Basic functions with 0 arguments def hello(): print('hello') print('world') hello() # hello # world The absolute most basic function you can write — a function that takes in 0 arguments, but does only one uncustomizable thing. 2) Functions that ta...

Regular Expressions in Python: Mastering String Manipulation

In the realm of programming, one often encounters situations where text or string data needs to be manipulated, extracted, validated, or transformed. Python, a versatile and popular programming language, offers a powerful tool to tackle such tasks: regular expressions. Regular expressions, of...

PYTHON

In 1991, Guido van Rossum released Python: a widely used general-purpose, high level programming language, interpreted, object-oriented, with dynamic semantics (interpreted by bytecode). This programming language was further developed by the Python Software Foundation. As it is an ...

Make your Python code more elegant, readable, or modern using one command

Refurb is a Python library that can modernize or redesign your Python code using one single command, but one important point is stated on their site: Refurb is not a style/type checker. It is meant for making good code even better. Here is the link to their GitHub Repository: https://gi...

Introduction to EASYOCR: A Simple and Accurate Python Library for Optical Character Recognition

Want to become an instant expert on this EasyOCR? Here are all the key insights I gained after 10 hours of research, condensed into just 5 minutes. OCR stands for Optical Character Recognition and refers to the technology used to convert scanned images, PDFs, or other documents into editable ...

5 Easy Python Concepts Made Difficult # Sorry in advance

) Variables x = 4 y = 5 A variable in Python is a symbolic representation of an object. Following the allocation of some object to a Python variable, we amass the aptitude to reference this aforementioned object by its nomenclature. Note that the value of said variable persists statically. ...

Mastering Python — Section 4: (f-string) An efficient and easy-to-read way to format strings in

In Python 3.6 and above, strings prefixed with f or F are known as f-strings (formatted string literals). This is a modern and faster way to format strings compared to using the .format() method or the % operator. In f-strings, you can evaluate expressions ...

Why You Should Stop Using List Comprehensions in Python

Ok, the title admittedly is a little clickbait; you shouldn’t completely stop using list comprehensions in Python. List comprehensions are very commonly used and are a very Pythonic way to perform a wide range of tasks. Especially in simple applications, they’re defin...

10 Python Shortcuts

List Comprehensions Instead of using loops to create lists, use list comprehensions for readable code. numbers = [x for x in range(10)] Dictionary Comprehensions Similar to list comprehensions, you can create dictionaries in a compact way. squares = {x: x*x for x in range(5)} M...

8 Levels of Using Type Hints in Python

Dynamic typing, which means that the type of a variable is determined only during runtime, makes Python flexible and convenient. However, every coin has two sides. Messy typing of variables is usually the root of hidden bugs. Robust programs should be type-safe. Therefore, Python provides the ...

A Callable Float? Fun and Creativity in Python

Among the built-in data types in Python, we have a number of types representing numbers, the most important being int and float. As everything in Python, their instances are objects; and as objects, they have their own attributes and methods. For example, this is what instances of the...

Top 10 Resources to Learn Python

Whether you’re a beginner eager to learn your first programming language or an experienced developer looking to expand your skill set, we’ve got you covered! I’ve compiled a list of the top 10 resources that will help you learn Python efficiently. 1. Codecademy Codecademy...

38 Python Tips and Ticks To Learn Before You Write Your Next Code

Python is a widely-used and versatile programming language with an extensive collection of libraries and frameworks. Beyond the well-known features, there exist lesser-known Python coding tricks and libraries that can significantly make your life as a developer easier and your code more efficient. T...

Python: Probably More than 90% of Coders are Missing This Easy Trick

If you are already familiar with online interviews and coding practice websites, you would for sure, love this easy Python feature. Read this completely for a better understanding! For example, I ask you to print a list of values. You would do that using a for loo...

Microsoft Announced Python In Excel. I knew It!

I knew it! We have Python in Excel! As you may recall, if you’re subscribed to my articles, a year ago I was reporting that: As a Python programmer you have to remember when four years ago Microsoft was considering to introduce Python as a scripting language for Excel &mdas...

MEV templates written in Python, Javascript, and Rust

Today, I’m going to get you all set up for the MEV journey ahead. It’s going to be a long and a bumpy ride — one that requires a full dive at times, and one that may not be as fruitful for everyone. But, it’s also: one that will inspire you to...

Exploring Healthcare Patient Payer Data in Python

Healthcare patient payer claims data contains insurance claim information for medical services such as PCP visits, emergency room visits, dental procedure, surgical procedures and more. The data contains sensitive patient information such as member insurance ID, details about healthcare services and...

Building SaaS with DDD & Clean Architecture in Python — Issue 1

It's been a few weeks, and I decided to work on a SaaS application — I had a bunch of ideas for some time now and was looking to focus on a problem space worth solving. I chose Python as the programming language, as I felt a bit rusty — I have been a Node.js developer for a while ...

Building SaaS with DDD & Clean Architecture in Python — Issue 1

It's been a few weeks, and I decided to work on a SaaS application — I had a bunch of ideas for some time now and was looking to focus on a problem space worth solving. I chose Python as the programming language, as I felt a bit rusty — I have been a Node.js developer for a while ...

Rust for Python Programmers #3 — Numeric Types!

Welcome back, intrepid learners! In this exciting part of our Rust journey for Python programmers, we’re diving deep into numeric types. We’ll explore the available types, operations, and conversions in both Python and Rust, shedding light on Rust’s unique concepts along the way. ...

Deploying Python Applications to Azure

As a cloud engineer who’s also a dabbler in building applications at home, I’ve taken a big interest recently in how we can take the local prototypes & applications built by techies and turn them into valuable tools available to other members of an organisation, particularly when loo...

Control and monitor your Docker containers with Python

Use Python to control your docker containers! Here is a walkthrough how to get started. It is based on a test of three popular packages for handling tabular data. Git Repo: https://github.com/martinkarlssonio/polars-pandas-spark If you would like to read on the data aspect of this test th...

Free From Limitations: The Validation of Machine Hallucinations at MoMA

Since 1929, the Museum of Modern Art (MoMA) in New York City has served as an art lover’s mecca. It’s a lighthouse that shines a light on avant-garde paintings and sculptures, and since the definition of “modern art” is continually in flux, its collections are, too. Now, this...

Exploring Multithreading in Python: A Simple Guide with Examples

Multithreading is a powerful concept in computer science that allows programs to execute multiple threads (smaller units of a process) concurrently within a single process. This means that a program can perform multiple tasks at the same time, improving efficiency and responsiveness. In this article...

Exploring Global Diversity: Pyetho — Python Library for Language and Country Insights

People around the world are more linguistically connected. We can’t integrate with everyone if we don’t know the languages that are used. Languages are therefore more significant. Unity’s largest barrier is translation. We may all pool our finest strategies through translation to c...

Fine-Tuning a Llama-2 7B Model for Python Code Generation

About 2 weeks ago, the world of generative AI was shocked by the company Meta's release of the new Llama-2 AI model. Its predecessor, Llama-1, was a breaking point in the LLM industry, as with the release of its weights along with new finetuning techniques, there was a massive creation of open-s...

THIS Python Library Simplifies Working With Pandas

In this article, we will be looking into another great Python’s library called Sketch. It does not only let’s you ask your dataframe questions, but also gives you the actual pandas code. Let’s take a quick look at how it works. The initial step involves installation, which is ef...

Best Data Analysis Library in Python

Imagine you have a bunch of data in Jupyter Notebook that you want to analyze and visualize. PyGWalker is like a magic tool that makes it super easy for you. It takes your data and turns it into a special kind of table that you can interact with, just like using Tableau. You can explore yo...

Quantifying Stock Trends: The Rolling Hurst Exponent in Python

Ever tried catching the rhythm of the stock market? If you have, you’d know trends aren’t just about rising and falling arrows on a graph. They’re the pulse of market sentiment, the stories of gains and losses. In such environment, navigating the stock market can be likened to sail...

Exploring Healthcare Patient Payer Data in Python

Healthcare patient payer claims data contains insurance claim information for medical services such as PCP visits, emergency room visits, dental procedure, surgical procedures and more. The data contains sensitive patient information such as member insurance ID, details about healthcare services and...

How to Create a Polar Histogram With Python and Matplotlib

Hi, and welcome to this Python + Matplotlib tutorial, where I will show you how to create the beautiful polar histogram you see above. Polar histograms are great when you have too many values for a standard bar chart. The circular shape where each bar gets thinner towards the middle allows us to ...

Advanced Model Selection Using PyCaret in Python

In the realm of predictive analytics, selecting the right model can be daunting, especially when time is of the essence. Enter PyCaret: a Python library designed to streamline this process. Background I am working on a development of a predictive analysis for financial markets. Drawing inspira...

Python Logs Aren’t Code. They’re A Communication Tool.

Your Present & Future Self Will Hate You For Forgetting To Do This Programming Chore Nothing will ruin a programming session faster than bad coffee shop WiFi. And on the particular day I’m recounting, as much as I needed the vanilla latte sitting to my left, I really needed that sweet, ...

Boolean Operators in Python Aren’t What You Think

I consider myself a decent Python programmer. I’ve worked with the language extensively in the past and it’s the one I generally feel most comfortable using. But even well within the cozy confines of our comfort zones, every now and then, we all come across energizingly unfamiliar &ld...

250+ Python and Data Science Tips — Covering Pandas, NumPy, ML Basics, Sklearn, Jupyter, and More.

Being a data scientist demands expertise in plenty of areas. You need to be good at using appropriate tools, like Pandas, NumPy, Sklearn, etc. These are indispensable to the development life cycle of many data-driven projects, making them essential skills to begin/maintain a career in data scienc...

Learning Python Pandas Library: A Comprehensive Guide with Code Examples

Python’s Pandas library is a powerful tool for data manipulation and analysis. It provides data structures and functions to efficiently manipulate large datasets and perform various tasks like cleaning, transforming, and analyzing data. Whether you’re a beginner or an experienced program...

Awesome Python Scripts

Higuys! Today I want to share with you some useful scripts for python. I am a big fan of scripts, because they facilitate routine work, improve projects, as well as give a visual representation of the use of knowledge in practice Let’s go! 1. Convert JSON to CSV import json if...

10 killer Python automation scripts

Repeating tasks are always time-consuming and boring. Imagine cutting 100 photos one by one or doing tasks such as Fetching APIs, correcting spelling and grammar, etc., all of which take a lot of time. Why not automate them? In today’s article, I will share with you 10 Python automation script...

Building Web Applications with Django and FastAPI: Combining the Best of Both Worlds

In python ecosystem there are multiple frameworks available for making a robust backend. Django and FastAPI are the most popular ones. Django comes with many out-of-the-box features such as ORM, Middleware, Authentication, Admin Panel etc. FastAPI on the other hand comes with Async-ready support and...

BUILDING GEOSPATIAL WEB APPLICATIONS IN PYTHON VIA DJANGO FRAMEWORK

Django is a popular web framework written in Python that simplifies the development of web applications. You can check out django documentation here to get to understand the basic concepts and how it works here: Django The web framework for perfectionists with deadlines. docs.djangoproject....

Python in Excel Will Reshape How Data Analysts Work

Last year, I published a free course called “Python for Excel Users” on the freeCodeCamp YouTube channel, and even though the video has more than 1M views, I realized some people didn’t get the purpose of the course. Some of them commented, - Why do Excel users need Python?...

Predictive Modeling for Future Stock Prices in Python: A Step-by-Step Guide

Predictive modeling plays a crucial role in the world of finance, especially when it comes to making informed decisions in the stock market. In this article, I will walk you through the process of building a model for predicting stock prices using Python. We will cover data manipulation, fetching st...

How to Use Chat-GPT and Python to Build a Knowledge Graph in Neo4j Based on Your Own Articles

In this article, I will show how you can structure and explore the content of your own articles using graph technology and some programming. The idea of using NLP techniques for structuring unstructured data is not new, however, the latest progress in LLMs (Large Language Models) has sparked coun...

PYTHON: A SERPENTINE JOURNEY INTO AI, ML, AND DL

With the monsoons here, slithering snakes are bound to fill the KGP campus along with the already present ‘Saanp’s’ in your class. So, why not get to know another ‘SNAKE’, which instead of hiding everything from you, helps you to not only break down past data but also p...

Interactive Dashboards in Python 2023

Interactive dashboards are revolutionizing the way data is explored, analyzed, and presented. In the world of data-driven decision-making, these powerful tools provide an intuitive and engaging interface for users to interact with complex data sets and gain valuable insights. Python, being one of th...

Crafting a CI Pipeline: My Experience with GitHub Actions, Python & AWS

Integrating code consistently and ensuring it meets best practices is challenging but essential. Today, I aim to share a reliable GitHub Actions setup that I’ve tailored specifically for Python Serverless projects on AWS. Additionally, I’ll introduce a Makefile I’ve designed to str...

Data Engineering End-to-End Project — Spark, Kafka, Airflow, Docker, Cassandra, Python

First of all, please visit my repo to be able to understand the whole process better. This project will illustrate a streaming data pipeline and also includes many modern Data tech stack. I also want to mention that I used MacOS for this project. Tech Stack Python API Apache Airflow A...

Building ETL Job: Transferring Data from MySQL to Redshift using Python

Extract, Transform, Load (ETL) is a data pipeline process that involves extracting data from a source system, transforming it in some way, and then loading it into a target system. In this article, we’ll demonstrate how to build an ETL job that extracts data from a MySQL database and loads it ...

Plotting Smarter Stock Entries & Exits with K-Reversal in Python

Amid the vast arsenal of tools and techniques stands the K-Reversal Indicator — an unassuming, yet remarkably effective instrument. In this article, we not only demystify its mechanics but also showcase its practical implementation, enabling you to enhance your trading arsenal. 2. The K-Rev...

Python Logs Aren’t Code. They’re A Communication Tool.

Nothing will ruin a programming session faster than bad coffee shop WiFi. And on the particular day I’m recounting, as much as I needed the vanilla latte sitting to my left, I really needed that sweet, sweet public broadband because the power was out at home and, more importantly, so was the c...

Automate the exploratory data analysis (EDA) to understand the data faster and easier

EDA is one of the most important things we need to do as an approach to understand the dataset better. Almost all data analytics or data science professionals do this process before generating insights or doing data modeling. In real life, this process took a lot of time, depending on the compl...

Fine-Tuning a Llama-2 7B Model for Python Code Generation

About 2 weeks ago, the world of generative AI was shocked by the company Meta's release of the new Llama-2 AI model. Its predecessor, Llama-1, was a breaking point in the LLM industry, as with the release of its weights along with new finetuning techniques, there was a massive creation of open-s...

You’re Decent At Python If You Can Find These 4 Mistakes

How this works There’ll be 4 Python functions, and each does something Each function has ONE wrong line You need to take steps to identify the ONE wrong line Try not to read the comments for clues If you can’t find the mistakes in these 4 functions, this doesn’t me...

20 Python Concepts I Wish I Knew Way Earlier

There are lots of concepts we need to grasp in Python. And everyone learns them differently, in different sequences. Here are some things I wish I learnt much earlier when I was still a Python beginner. 1) Tuple Unpacking + Tuple Unpacking With * person = ['bob', 30, 'male'] ...

Mastering AI in Finance Top 5 Book Recommendations.

The world of finance is increasingly being reshaped by artificial intelligence (AI), with applications ranging from algorithmic trading to risk assessment. If you’re eager to dive into the intersection of finance and AI, you’ll want to equip yourself with the right knowledge. In this art...

ReactPy: Building Dynamic Frontend Applications with Python

In the world of web development, ReactJS has emerged as a dominant player, offering developers a powerful toolset for creating dynamic and interactive user interfaces. However, what if you prefer the versatility and simplicity of Python for your backend, and wish to leverage its capabilities in the ...

Python in Machine Learning: The Path to AI Excellence

In the realm of artificial intelligence (AI) and machine learning, Python reigns as the undisputed champion. Its widespread adoption is not a mere coincidence but rather a reflection of the language’s exceptional capabilities and versatility. In this article, we will delve into why Python is t...

Why did Elon Musk say that Rust is the language of AGI?

Today’s LLM applications, including inference apps and agents, are mostly written in Python. But this is about to change. Python is simply too slow, too bloated, and paradoxically too unwieldy for the new wave of developers. In fact, Chris Lattner, the inventor of LLVM, Clang, and Swift, ...

Mastering Python for Data Analysis in Digital Marketing

In the digital marketing realm, data is the driving force behind effective decision-making. Marketers need to harness the power of data to understand consumer behavior, optimize campaigns, and stay ahead of the competition. Python, a versatile and accessible programming language, has become an inval...

10x faster python test iteration via fork(2)

It’s ideal to get feedback on your code faster — to make a code change and see the result instantly. But, as projects get larger, reload times get longer. Each incremental dependency or bootstrap code block that adds 200ms feels worth it, but 50 of them later and it takes 10 seconds to s...

Repository Pattern is INSANE if you know how to use it properly — Python

This is a complete and practical guide with full project code about Repository Pattern. Even if the code in this is written in Python, these ideas are general programming concepts and design patterns that can be implemented in almost t...

Python water quality EDA and Potability analysis

Being able to provide enough fresh drinking water is a core requirement. Within the climate change debate, one of the largest challenges is ensuring enough freshwater to survive. Water quality is a big concern that impacts all the specifies. Only about three percent of Earth’s water is freshwa...

Elevate Your Python Projects: Automate Five Key Development Tasks with Pre-Commit Hooks

you’ve spent days perfecting your Python code, meticulously crafting every function and class to create a masterpiece. But just as you’re about to push it to your repository, you realise — a sinking feeling in your stomach — that there might be lurking bugs, style violations,...

20 extremely useful single-line Python codes

Hello everyone, in this article, I am sharing with you 20 Python one-liner codes that you can easily learn in 30 seconds or less. These one-liner codes will save you time and make your code look cleaner and more readable. 1.One-line For Loop For loops are multi-line statements, but in Pyth...

Python Optimization Guide: Make Your Code Run 5X Faster

In the world of programming languages, Python stands tall as one of the most versatile languages that offer simplicity and readability. Python has become popular among developers due to its easy-to-read syntax, object-oriented nature, community support and large pool of libraries. It can be used in ...

Best Data Analysis Library in Python

Imagine you have a bunch of data in Jupyter Notebook that you want to analyze and visualize. PyGWalker is like a magic tool that makes it super easy for you. It takes your data and turns it into a special kind of table that you can interact with, just like using Tableau. You can explore yo...

Customer Segmentation Using K-Means Clustering in Python

In today’s data-driven business landscape, understanding your customers is essential for making informed decisions and delivering personalized experiences. Customer segmentation, the process of dividing your customer base into distinct groups, can provide valuable insights into customer behavi...

Visualising Forest Cover Evolution in India using Python

We will use python visualisations to observe trends of state-wise forest cover over the years in India Introduction India is famous for its natural diversity and one of the most contributing factor to this diversity is, its forests. From the very childhood, however, I have been reading about d...

Automated Feature Selection for Machine Learning in Python

Feature selection is the process of identifying the most important and informative features within a dataset. It is one of the most important steps of machine learning modeling pipeline, since it has significant impact on model performance and its predictive power. Simple Visualization of Fea...

Like Streamlit, but faster and with a visual UI editor. Streamsync.

Streamsync is a new open-source framework for creating data apps. It allows you to build the user interface using a visual editor, while retaining the power of Python in the backend. It’s all contained in a pip-installable package. Streamsync’s visual editor, Streamsync Builder. ...

Writing Versatile Python Scripts and Modules | __name__ and __main_

In Python, the __name__ variable is a special built-in variable that is used to determine whether a Python script is being run as the main program or if it is being imported as a module into another script. It allows us to write code that can be used both as a standalone script and as a mo...

NLTK vs. OpenAI vs. Upgini: A Comparative Study of Machine Learning Prediction Accuracy Based on Python Library-Generated Features

The subject of this benchmark is to determine a Python library that generates the most powerful features from the text for ML models. Benchmark participants The three approaches to feature generation from texts that we will compare: NLTK (Natural Language Toolkit) is a popular Pytho...

Hugging Face has written a new ML framework in Rust, now open-sourced!

Recently, Hugging Face open sourced a heavyweight ML framework, Candle, which is a departure from the usual Python approach to machine learning, written in Rust with a focus on performance (including GPU support) and ease of use. According to Hugging Face, Candle’s core goal is to make...

Data Mastery with Python and SQL: Unleashing Efficiency and Security through 4 Strategic Use Cases

Data analysis and management are essential components of any modern enterprise’s operations. To effectively harness the power of data, professionals rely on a combination of programming languages and tools that enable efficient data processing, manipulation, and analysis. In this article, we e...

10 Python Projects with Code

Python is a versatile programming language known for its simplicity and readability. It is widely used for web development, data analysis, machine learning, and automation. One of the best ways to improve your Python skills is by working on practical projects. In this blog post, we will explore ten ...

Plotly and Python: Creating Interactive Heatmaps for Petrophysical & Geological Data

Interpreting the subsurface requires understanding how geological and petrophysical data varies across a region. This often involves dealing with well log measurements and interpreted properties scattered across the area, which leads to the challenge of estimating the values between these measuremen...

The Walrus Operator (:=) in Python

In this post we’ll have a look at Python’s walrus operator (:=), which can be used to assign and return a value in one expression. This can sometimes lead to shorter and more readable code, or save compute. Python is a popular programming language known for its simplicity, flexibility...

Data Types in python

Hi there, Welcome to series three of our Python journey. In our previous lesson, we looked at variables and how to assign values to them. if you missed it, you can take a 3-minute read on it in my previous post. Today, we are going to serve ourselves with data types. Does the topic sound confusing? ...

You Don’t Really Need For-Loops in Python, Let’s Eliminate them!

Python, with its simplicity and versatility, offers various ways to achieve tasks without the need for traditional for-loops. By exploring alternative techniques, we can write cleaner, more concise, and more efficient code. In this blog, we’ll dive into various Pythonic approaches that can ...

Python Project — Decimal to Binary Number Converter

What are Decimal Numbers? In the decimal number system, the numbers are represented with base 10. It is also called the base-10 number system which consists of 10 digits, such as 0,1,2,3,4,5,6,7,8,9. What are Binary Numbers? In our computer systems, the Binary Number System is used to manip...

Demystifying Python Context Managers: A Comprehensive Guide

Python is a versatile and powerful programming language known for its readability and ease of use. One of its lesser-known yet extremely useful features is context managers. Context managers provide a way to manage resources, such as files, database connections, and network sockets, in a clean and e...

Python Profiling — Why and Where Your Code is Slow

Picture this: you write a script to process some data on your laptop, go for a coffee break, and when you return in 15 minutes, it’s barely 10% done. Why is it so slow? Which part is slow? Is it reading the data, processing it, or saving it? How do I make it faster? Is it even actually...

19 Sweet Python Syntax Sugar for Improving Your Coding Experience

Making a function work is one thing. Implementing it with precise and elegant code is another. As the Zen of Python mentioned, “beautiful is better than ugly.” A good programming language like Python will always provide appropriate syntax sugar to help developers write elegant code...

Exploring Quantum Computing: From Essential Mathematical Equations to Python Scripts and…

We’re back to explore more of the quantum computing world, and guess what? Math is still our best buddy on this journey. In Part 1, we familiarized with complex numbers, matrix math, and even did some fun with Python. Now, in Part 2, we’re going deeper into quantum computing. TL;DR: ...

Python Comments: The Voice of Code Explanation

Comments in Python are like the storytellers of your code. They explain, they clarify, and sometimes, they even stay quiet to let the code shine. In this article, we’ll dive into the world of Python comments and learn how they play an essential role in the programming narrative. Understandi...

Python Type Hinting: Duck Type Compatibility and Consistent-With

Sometimes, Python type hinting can make things easier. True, not always — but at least in my opinion, quite often it does — given that it’s done wisely. Some disagree, but I am not going to dispute with them: in my eyes, this is quite a subjective subject. I wrote what I think a...

How to Fine-Tune Llama2 for Python Coding on Consumer Hardware

Our previous article covered Llama 2 in detail, presenting the family of Large Language models (LLMs) that Meta introduced recently and made available for the community for research and commercial use. There are variants already designed for specific tasks; for example, Llama2-Chat for chat applicat...

How I improved my python code Performance by 371%!

Before getting started let’s discuss the problem statement in hand. I wanted to analyze some data stored in a text file. Each row contained four numerical values demlimited by a space, for a total of 46.66M rows. The size of the file is around 1.11 GB, and I am attaching a small screen shot of...

Predicting Stock Prices using ChatGPT and Finazon with Python

While it’s important to note that predicting stock prices with absolute certainty is nearly impossible due to the complex and unpredictable nature of the market, advancements in technology and artificial intelligence have provided us with tools that can assist in making informed decisions. ...

Accessing and Visualizing Digital Elevation Models with Python

Digital Elevation Models (DEMs) represent a 3D surface model of the terrain. It represents a continuous topographic elevation surface through a series of cells where each cell represents the elevation (Z) of a feature at its location (X and Y). Digital Elevation Models only contain information ...

Don't Install Python for Data Science. Use Docker Instead!

Docker containers provide a lightweight and efficient way to package and deploy applications, making it easier to move them between different environments, such as development, testing, and production. However, while Docker is widely used for deployment, it has been underutilized by developers for t...

Microsoft Announced Python In Excel. I knew it!

I knew it! We have Python in Excel! As you may recall, if you’re subscribed to my articles, a year ago I was reporting that: As a Python programmer you have to remember when four years ago Microsoft was considering to introduce Python as a scripting language for Excel &mdas...

__init__ Files in Python: How to Organize Your Code into Logical and Reusable Units

Python’s module system is a powerful tool that helps developers to organize their code into reusable, logical units, thereby enhancing maintainability and readability. This article explores the intricacies of Python modules, with a focus on the __init__.py file, various import approa...

The Platonic Solids in Python

As a follow-up to my last article about convex hulls, we will use that skill to visualize the famous platonic solids. Platonic Solids are a unique set of three-dimensional shapes with specific properties that have fascinated mathematicians and scientists for centuries. Each face, edge, and angle wit...

6 Things I Wish I Knew Earlier About requirements.txt

1) How to install everything inside requirements.txt requirements.txt contains the required libraries for a project that needs to be installed (usually using pip). A simple example: library-one==1.0.1 library-two==3.1.4 library-three==100.1.0 To install all 3 libraries, we can run ...

Rust in Python: Perfect Balance of Performance and Productivity

Python and Rust are two of the most beloved languages in software development where Python is known for its simplicity and productivity and Rust is famous for its performance and system control. Developing features in Python is very fast but it leads to mediocre performance for performance intensive...

Python Saving Objects with Pickle

Python’s pickle module is a tool for serializing and deserializing Python objects. Serialization is the process of converting Python objects into a byte stream, which can be saved to a file or transmitted over a network. Deserialization is the reverse process, where you reconst...

Feature Importance Analysis in Machine Learning

Hello, everyone! My name is Anar. I am a machine learning engineer and, as a side gig, a co-owner of SPUNCH, where I have the honor of exploring new horizons in Data Science :) In this series of articles, I will focus on real-life cases from the business world that have helped me and, I hope, will...

Handling User Input in Python: Creating Interactive Programs

Hey there, fellow Pythonistas! Welcome back to another exciting tech blog. I’m thrilled to dive into the fascinating world of user input handling in Python and explore the art of crafting interactive programs. So, grab your favorite beverage, sit back, and let’s embark on this coding adv...

Python: What is Global Interpreter Lock? (with examples)

The global interpreter lock (GIL) is a controversial topic in the Python community. It prevents one Python process from executing more than one Python bytecode instruction at any given time. This means that even if we have multiple threads on a machine with multiple cores, a Python process can ha...

Real Multithreading is Coming to Python — Learn How You Can Use It Now

Python is 32 years old language, yet it still doesn’t have proper, true parallelism/concurrency. This is going to change soon, thanks to the introduction of a “Per-Interpreter GIL” (Global Interpreter Lock) which will land in Python 3.12. While the release of Python 3.12 ...

Custom Instructions: A New Feature You Must Enable to Improve ChatGPT Responses

Remember that prompt engineering technique called Role Prompting that allows us to control the default behavior of ChatGPT to get customized results? It started with something like “Act as a …”. and you had to include it in every single chat to get better responses. ...

Exploring Python Polymorphism

Hello, fellow learners!  Welcome to Day 16 of our 100-day Python learning journey. Today, we’re unraveling the intriguing concept of Python Polymorphism, a fundamental feature of Object-Oriented Programming (OOP). Whether you’re just starting or have some coding experience, get read...

How to be a pro in Python using Decorators

In Python, a decorator is a way of modifying or enhancing the behavior of a function or class without changing its source code. Decorators are essentially functions that take a function as input and return a modified function as output. Decorators are defined using the “@” symbol...

Use These Methods to Make Your Python Concurrent Tasks Perform Better

Where the Problem Lies It has always been the case that Python’s multi-threaded performance has never lived up to expectations because of GIL. So since version 3.4, Python has introduced the asyncio package to execute IO-bound tasks through concurrency concurrently. After several iterati...

__all__ in Python and What It Does

Let’s say we have 2 Python scripts. main.py — the script that we want to run helper.py — main.py imports stuff from this script these 2 scripts are in the same folder # helper.py a = 4 b = 5 c = 6 def test(): print('test') # main.py from help...

13 Fun Python Scripts

Hello friend, I hope you’re doing well! I’m writing to you today because I am truly passionate about sharing my knowledge and helping others learn. If you’ve found my articles to be valuable and they’ve made a positive impact on your life, I would be overjoyed if you could su...

Hidden Functionality of Try and Accept Blocks in Python

If you code in Python than, you have probably already worked with a lot of try and except blocks. In this blog, we will explore some of the hidden functionality of these blocks. We will demonstrate this by creating a function called divide, which divides a by ...

Mastering Python Tuples: A Comprehensive Guide to Efficient Coding

Python is an incredibly versatile and powerful programming language, and one of the reasons for its popularity is its rich set of built-in data structures. Among these, Python tuples stand out as a valuable and often underutilized asset. In this introductory section, we’ll explore why Python t...

Stop Using dict key to Access Values in Python Dictionaries!

We probably learnt to use dict[key] to access a value in a dictionary at the start. But here’s a better way to do that. The original dict[key] method d = {'apple':4, 'orange':5, 'pear':6} x = d['apple'] # 4 y = d['orange'] # 5 ...

Python in Excel Will Reshape How Data Analysts Work

Last year, I published a free course called “Python for Excel Users” on the freeCodeCamp YouTube channel, and even though the video has more than 1M views, I realized some people didn’t get the purpose of the course. Some of them commented, - Why do Excel users need Python?...

How to Use Chat-GPT and Python to Build a Knowledge Graph in Neo4j Based on Your Own Articles

In this article, I will show how you can structure and explore the content of your own articles using graph technology and some programming. The idea of using NLP techniques for structuring unstructured data is not new, however, the latest progress in LLMs (Large Language Models) has sparked coun...

Probabilistic ML with Quantile Matching: an Example with Python

When we train regressive models, we obtain point predictions. However, in practice we are often interested in estimating the uncertainty associated to each prediction. To achieve that, we assume that the value we are trying to predict is a random variable, and the goal is to estimate its distributio...

An Introduction to Asynchronous Programming in Python 3

Python is considered one of the easiest languages to learn. The Python approach to asynchronous code, on the other hand, can be quite confusing. This article will walk through key concepts and examples of async Python code to make it more approachable. In particular, you should take away the foll...

Fine-Tuning a Llama-2 7B Model for Python Code Generation

About 2 weeks ago, the world of generative AI was shocked by the company Meta's release of the new Llama-2 AI model. Its predecessor, Llama-1, was a breaking point in the LLM industry, as with the release of its weights along with new finetuning techniques, there was a massive creation of open-s...

Understanding args and kwargs in Python with an Additional Django Example

When I started learning Python, I was very confused regarding what args, kwargs, * and ** does. And I feel there are many like me who had this confusion and problem. With this post, I intend to reduce (hopefully I can eliminate) that confusion. In Python or any o...

250+ Python and Data Science Tips — Covering Pandas, NumPy, ML Basics, Sklearn, Jupyter, and More.

Being a data scientist demands expertise in plenty of areas. You need to be good at using appropriate tools, like Pandas, NumPy, Sklearn, etc. These are indispensable to the development life cycle of many data-driven projects, making them essential skills to begin/maintain a career in data scienc...

PYTHON: A SERPENTINE JOURNEY INTO AI, ML, AND DL

With the monsoons here, slithering snakes are bound to fill the KGP campus along with the already present ‘Saanp’s’ in your class. So, why not get to know another ‘SNAKE’, which instead of hiding everything from you, helps you to not only break down past data but also p...

Embedded Software Engineer Roadmap

Programming Languages : Embedded C (Must Have) C++ (Must Have) Python (Nice To Have)  Assembly Language (Nice To Have) Start by mastering Embedded C and C++, as they are essential for developing embedded software. Operating Systems and RTOS : Operating System Fundamentals (Must Have)...

From Python to Beyond: A Memoir

As I typed the very first print(‘hello world’) statement and hit run on my battered Dell Latitude E5400 laptop, (the said machine truly deserves a standing ovation) my eyes lit up with excitement. I was following along Mark Lutz’ masterpiece — Learnin...

Asyncio, Async & Await in Python Explained Simply

Asynchronous programming in a nutshell A programming paradigm that allows for non-blocking operations. In simpler words, instead of waiting for a response from a request, the program continues doing other stuff while waiting. Which enables our code to be more efficient. Asyncio in a nutshel...

Automated Feature Selection for Machine Learning in Python

Feature selection is the process of identifying the most important and informative features within a dataset. It is one of the most important steps of machine learning modeling pipeline, since it has significant impact on model performance and its predictive power. Simple Visualization of Fea...

Running Python Scripts in Power BI Desktop: A Game-Changer for Data Visualization

Hey there, data enthusiasts! I’m Gabe A, and I’m thrilled to share some exciting news with you today. If you’re like me, someone deeply passionate about Python and data visualization, you’ll be ecstatic to know that you can now run Python scripts directly in Power BI Desktop....

Introduction to Python API Building

Python is a powerful programming language with many applications. In this post we will explore its ability to build REST APIs. We will leverage the FastAPI, Pydantic, and SQLAlchemy python libraries, along with Postgres to build a REST API that can support a simple TODO list application. By the end ...

Level Up in Python with Dependency Inversion and Entry Points

Python programmers don’t use Dependency Inversion (DI) enough. There are a number of reasons why not: It’s tricky — it inverts certain intuitive understandings of code flow. Sometimes people do dependency injection and think they’ve done Dependency...

Hypermodern Python Toolbox

very Python developer is challenged by the size and velocity of Python’s large & dynamic ecosystem  From newbies finding their first workflow to senior developers keeping up with new packages, we all struggle to keep up with the intersection of the new and the useful in Python. ...

21 Python Tips And Concepts To Improve Your Code

Python is easy to write and understand but you can quickly use it the wrong way and jump into a minefield of anti-patterns. This post curates a list of 21 concise tips that improve your code readability and efficiency. They are drawn from personal projects, thorough code reviews, and inspiring di...

Stop Using Python Strings To Represent File Paths!

We probably learn to deal with files and file paths pretty early on in our Python journey. We might use a string folder/subfolder/subsubfolder to represent a certain filepath. I still use normal Python strings to build these filepaths until recently. But, working with large enterprise P...

Reduce — The Power of a Single Python Function

While Python is not a pure functional programming language, you can still do a lot of functional programming in it. Just one function — reduce — can do most of it, and in this article, I will (try to) show you all the things one can do just with reduce. Reduce Let&rs...

How to Fine-Tune Llama2 for Python Coding on Consumer Hardware

Introduction Our previous article covered Llama 2 in detail, presenting the family of Large Language models (LLMs) that Meta introduced recently and made available for the community for research and commercial use. There are variants already designed for specific tasks; for example, Llama2-Chat f...

Write Python Apps using Layered Architecture and Design Patterns

This is a complete and practical guide with full project code about Layered Architecture. Even if the code in this is written in Python, these ideas are general programming concepts and design patterns that can be implemented in almost&nbsp...

A Quick Fix for Your Sluggish Python Code

Computationally intensive tasks are everywhere now. We are using resource-intensive techniques such as LLMs and Generative AI a lot these days. Whoever uses precious resources would know how daunting it is to do the same task again, even though we know the results will be the same. You’d...

Automatic Differentiation with Python and C++ for Deep Learning

This story explores automatic differentiation, a feature of modern Deep Learning frameworks that automatically calculates the parameter gradients during the training loop. The story introduces this technology in conjunction with practical examples using Python and C++. Figure 1: Coding A...

Tl;dr Approximate Inference methods made easy

“MCMC vs VI” is no longer a discussion about your favourite Roman numeral. If you share my trepidation for model performance in the face of data sparsity, or you simply suffer from anxiety uncertainty, you might be tempted into the Bayesian world. Years later at the precipice of your car...

How fast is your MEV bot? Comparing Javascript/Python/Rust

Choosing a programming language for your projects can be a challenging task. In fact, individuals often have varying preferences when asked, citing reasons such as speed, readability, or simply familiarity with a particular language. This diversity in opinions is quite common. I’ve enc...

Lessons Learned while doing Machine Learning at scale using Python and Google Cloud.

I recently worked on a number of projects for implementing machine learning pipelines at scale while optimizing them to save costs. Here are my titbits to make your ML projects time and cost-efficient. 1. Perform Feature Generation in the Database Query itself. This is probably the biggest and...

Six Amazing Unknown Python Libraries

I’ve been using Python extensively for the last two years. As a result, I’m always looking for amazing libraries that can enhance my work in Data Engineering and Business Intelligence projects. 1. Pendulum Although many libraries are available in Python for DateTime, I find Pendulu...

Introducing IceCream: Never Use Print() To Debug Your Python Code Again

Errors are almost inevitable while programming. In fact, it is rightly said that a programmer spends a significant amount of their time debugging to make their code error-free. While debugging, using print() statements to understand the flow of the pipeline and spot unexpected behavior ...

Probabilistic ML with Quantile Matching: an Example with Python

When we train regressive models, we obtain point predictions. However, in practice we are often interested in estimating the uncertainty associated to each prediction. To achieve that, we assume that the value we are trying to predict is a random variable, and the goal is to estimate its distributio...

Deep Learning Roadmap with Python

Machine learning is a good approach for small and medium datasets. But, when it comes to analyzing big data, this approach is unsuccessful. I learned machine learning techniques easily, but when performing deep learning projects, there are many challenges, especially for beginners. This blog will...

Decision Analysis and Trees in Python — The Case of the Oakland A’s

Just recently, the owner of the Oakland Athletics baseball team, John Fischer, announced that the team had purchased close to 50 acres of land in Las Vegas, Nevada. [1] This puts the future of Oakland’s last remaining professional sports team in jeopardy. In the last 5 years, Oakland has seen ...

200+ Python and Data Science Tips —  Covering Pandas, NumPy, ML Basics, Sklearn, Jupyter, and More

Being a data scientist demands expertise in plenty of areas. You need to be good at using appropriate tools, like Pandas, NumPy, Sklearn, etc. These are indispensable to the development life cycle of many data-driven projects, making them essential skills to begin/maintain a career in data scienc...

How I Used Python to Make Everyday Tasks Easier

Hey there! As a busy person with a lot on my plate, I’m always looking for ways to make my life easier. One way I’ve found to do this is by automating tasks using Python. In this article, I’ll share some of the ways I’ve used Python to automate my life and make my day-t...

Introducing PandasAI: The Generative AI Python Library

Today, I want to share an exciting development in the world of data analysis: PandasAI. This revolutionary tool is designed to supercharge your data analysis tasks, making them faster, more efficient, and downright enjoyable. Section 1: Why PandasAI is the Future of Data Analysis W...

My Personal Python Arsenal: Essential Frameworks for Seamless Development

Hey there, tech enthusiasts! I’m Jane, a twenty-something professional navigating the exciting and ever-evolving landscape of the tech industry. Throughout my journey, I’ve had the honor of breaking down barriers and uplifting fellow women in technology — a mission that truly warms...

Value Your Password

Ever have trouble remembering all your pin numbers and passwords? Well, imagine if you were the guy that forgot the password to an account that held $220m? That's what has happened to a San Fransisco man who wrote the password of his bitcoin account on a piece of paper. Oh yeah - you ...

10 Useful Python Libraries Every Data Scientist Should Be Using

Python has become an essential tool for data scientists across the world. To help you boost your efficiency doing data science, we’ve put together a list of the 10 most useful Python libraries for data scientists. From speeding up your workflow with distributed computing to helping you p...

Building VanillaNN: A Simplified Neural Network Framework from Scratch in Python

In this article, we’ll delve into creating a foundational framework for a neural network, reminiscent of the Keras model, entirely from scratch in Python. Before proceeding, it’s essential to have a foundational grasp of neural networks, including concepts like forward-backward propagati...

Fake webcam for your online meetings, with Python

Picture this. You’re in an online meeting, and for one reason or another you don’t really feel like putting your webcam on. But you see that everybody else has it on. So you feel obligated, you quickly arrange your hair and make sure your clothes look appropriate, and you switch the came...

Create a dxf file via Python (AutoCAD)

Most engineering firms use AutoCAD, therefore it would be great to automate some work which includes drafting. Wouldn’t it be cool to create a .dxf via Python and save precious time? This is what we are going to learn today. Let’s get started! The table of contents is presented below:...

How I Created Generative Art with Python That 10000 DALL-E Credits Could Not Buy

Python and Pillow: How to Code Something DALL-E Cannot Do In this blog post, I will showcase some of the generative art I created using the Python programming language, specifically utilizing the Pillow and Torch libraries. The inspiration for my artwork came from the visual compositions of Roman...

Python in Game Development: Unleash Your Creativity

Python, the versatile and beginner-friendly programming language, has been making waves in the world of game development. From indie game studios to major players in the industry, Python is becoming a go-to choice for creating captivating and engaging games. Let’s dive into the realm of Python...

Ray Tracing From Scratch in Python

In this post I will give you a glimpse of what computer graphics algorithms may look like. I will explain the ray tracing algorithm and show a simple implementation in Python. By the end of this article you’ll be able to make a program that will generate the above image, without m...

Cracking Sudoku — How to Explore Backtracking Algorithms With Python

This article is designed to guide you through the intricacies of the Sudoku puzzle, the concept of backtracking in algorithms, and how the two intersect. Whether you’re an experienced Python programmer or a beginner eager to improve your problem-solving skills, this exploration is for you. ...

Create Your Own Hangman With Python

The famous hangman game… No matter what language you speak, I’m sure you’ve played this game. One of the most known games in the world. So, are you ready to design this game yourself using Python? You know the first sentence of all programmers in programming: Hello world. ...

Building a Tic-Tac-Toe Game with Reinforcement Learning in Python: A Step-by-Step Tutorial

Welcome to this step-by-step tutorial on how to build a Tic-Tac-Toe game using reinforcement learning in Python. In this tutorial, we will learn how to create an agent that learns to play the game by trial and error, taking actions and receiving rewards or penalties depending on whether the action l...

Ray Tracing From Scratch in Python

In this post I will give you a glimpse of what computer graphics algorithms may look like. I will explain the ray tracing algorithm and show a simple implementation in Python. By the end of this article you’ll be able to make a program that will generate the above image, without m...

Python Backtesting: A Beginner’s Guide to Building Your Own Backtester

In my last post, I wrote about to use the Binance API to pull historical prices for various Crypto assets. In this article, we will start to build the foundation for simple backtester. A backtester is a software tool that allows traders and investors to simulate the performa...

Automating EC2 instance creation with Python and boto3

Amazon Web Services (AWS) is a powerful cloud computing platform that allows you to create virtual servers known as EC2 instances. You can automate the process of creating these instances using Python and a library called Boto3. Why Boto3? Boto3 is the Amazon Web Services (AWS) Software D...

Data Engineering Hands-on with Databricks and Python in 30 minutes

In today’s tech landscape, you’re surrounded by buzzwords like Big Data, Data Engineering, data ingestion and transformation, Python, Spark, and DataBricks. You may have read numerous articles and definitions, yet still find yourself wondering about their practical applications. In this ...

Docker For Beginners — With a Python Example

I’ve only been using Docker for a short time, simply because I had trouble understanding what it was and what it could be used for. Indeed, even after reading various articles and the Docker documentation, I find that it’s not very clear for someone who knows nothing about containers. ...

Value Investing Using Python & Azure — Introduction

Leaving behind the remnants of the financial crisis that broke out in 2008, the stock market quickly regained strength thanks to helicopter Ben. Since then, the so-called growth stocks stood at the forefront to drive the market forward. Cheap loans made businesses flourish, companies were not afraid...

Creating the Perfect Python Dockerfile

In a previous project, I built an elastic transcoder farm that used Docker (Alpine), Python, and FFmpeg. Since the system had to be very cost-efficient, I wanted to make sure the underlying docker image wasn’t creating too much overhead. After some research, I stumbled upon this ...

How to make your Python Docker images secure, fast & small

In the world of microservices, having secure, efficient, and compact Docker images is crucial for successful deployments. This blog will explore the key factors that contribute to building such images, including the importance of not running images as the root user, updating and upgra...

Exposing Python Metrics with Prometheus

Prometheus is a powerful monitoring and alerting system that collects and stores time-series data. In this step-by-step guide, we will demonstrate how to expose metrics for a simple Python API app and monitor them using Prometheus. We will also instrument the app to track request metrics. To make it...

3 Ways to Convert Python App into APK

In August 2020, I started a medium blog series called Building Android App in Python, where I explained the usage of Kivy and Kivymd. These libraries allow you to create cross-platform apps using Python. In that series, I described how android apps are configured in Python, it’s limitations, a...

The Right Way to Run Shell Commands From Python

Python is a popular choice for automating anything and everything, that includes automating system administration tasks or tasks that require running other programs or interacting with the operating system. However, there are many ways to achieve this in Python, most of which are arguably bad. So...

asdf conquer python

I just speack about asdf into Muliple version of kubectl? Easy with asdf it is a software that allow you to use and configure simply version of nodejs, ruby, kubectl, terraform and many command line tools. In this article we can see how to configure python plugin. Inst...

Python OS Library Fundamentals

You can use the OS module to interact with your computer’s operating system in a number of ways. Command-line prompts are available for you to use. You will see various uses for the OS library in Python in this article. If you are familiar with command-line prompts, I will provide the equiv...

3 Ways to Convert Python App into APK

In August 2020, I started a medium blog series called Building Android App in Python, where I explained the usage of Kivy and Kivymd. These libraries allow you to create cross-platform apps using Python. In that series, I described how android apps are configured in Python, it’s limitations, a...

Post-Quantum Cryptography with Python and Linux

If we believe Edward Snowden, encryption is “the only true protection against surveillance” [1]. However, advances in quantum technology might endanger this safeguard. Our article discusses why quantum computing poses a threat to data security and what to do about it. Instead of a purely...

Setup a python script as a service through systemctl/systemd

There are several ways you can run your program as a background service in Linux such as crontab, .bashrc, etc but today I’ll write about systemd. I was initially looking for a way to run my python script as a background service so even if the server restarts for some reason, my scri...

Setting up your Apple Silicon Mac for Python development with Visual Studio Code

In this post, I will show you how you can set up a new Apple Silicon Mac for Python development with Visual Studio Code. I will explain how you set up everything you need to start working efficiently with Python code in Visual Studio Code. This includes the basics, such as installing Python and V...

How to Install Python Pyenv on macOS

One of the hardest processes to learning python for beginners is installing python. Sometimes it was a version problem, the machine doesn’t recognize commands, etc. I was included with people who deal with that problems. My solution at that time is just to install the Anaconda package. But ...

Installing Python 3.x dev environment on MacOS the right way and automating new project setup using Automator

I have recently purchased a MacBook Air, I have always had a MacOS system as my personal computer ever since the first Macbook Air came out. However I have always used a Windows Thinkpad for development at work and over the years windows has made some excellent editions to development community. Pow...

Easiest way to Run a Python Script in the Background

The easiest way of running a python script to run in the background is to use cronjob feature (in macOS and Linux). In windows, we can use Windows Task Scheduler. In Mac or Linux, open the terminal using the following command to check what jobs are running in the background crontab -l ...

Installing Amazon Web Service’s Cloud Development Kit (CDK) on MacOS and Creating your first Python Application

In this article, you will learn how to install AWS Cloud Development Kit (AWS CDK) onto a MacOS machine. After installing AWS CDK, you will then create your first app, deploy it, and destroy it. Background As I stand on the threshold of my impending graduation, I find myself drawn to the v...

Python OS Library Fundamentals

You can use the OS module to interact with your computer’s operating system in a number of ways. Command-line prompts are available for you to use. You will see various uses for the OS library in Python in this article. If you are familiar with command-line prompts, I will provide the equiv...

Run Python Scripts On Windows Startup

Have you ever made a Python script that needs to run each time a computer is started? Or a script that needs to be running all the time, like a directory watcher or a good habit reminder? Then wouldn’t it be nice if those scripts would start automatically right when you start...

Python Installation: Instructions to Install and Run Python

Introduction to Python Python, a versatile and popular programming language, has gained widespread acclaim for its simplicity, readability, and extensive libraries. Whether you’re a beginner taking your first steps into the world of coding or an experienced developer exploring Pytho...

Creating an Audio-Visual Berlin Tour with Python

Remember when I decided to embark on a pet project of creating my own audio tour guide? Well, I’ve taken it a step further and added a video to the mix, making the audio narration even more visually captivating. The best part? I accomplished it all using Python, with just a few line...

I built the T with Python (and revamped it)

This fall, I took a Network Models class (1.022) at MIT. The class covered a lot of cool concepts of networks/graphs, such as node centralities and shortest paths, as well as important applications, like the behaviors of epidemics and social networks. Another application of this theory — the o...

Mapping COVID-19 Infections with Python: an Introduction to GeoPandas

I. What is GeoPandas? GeoPandas is an open source python project aimed at making geospatial data easier to work with. It’s essentially an extension of the Pandas library for data analysis, and provides a user-friendly interface for manipulating and plotting geospatial data (source: htt...

Navigating Drought Patterns: Time Series Analysis and Heat-map Visualisation of PDSI with Python

The Palmer Drought Severity Index (PDSI) is a crucial meteorological scale for measuring drought severity, developed by Wayne Palmer in the 1960s. It calculates drought conditions using a balance of precipitation, temperature, and other climatic factors. Positive PDSI values indicate wet conditions,...

Legal and justice related python libraries

The legal and justice systems involve vast amounts of data that require analysis, interpretation, and visualization. Python, a popular programming language, offers a variety of libraries that enable legal professionals, researchers, and analysts to handle complex data and gain valuable insights...

Workforce planning optimization using Python and ErlangC

Finding the number of positions to use in a queue system has been a study case for a long time now; it has applications in several fields and industries, for example, finding the optimal number of call centers agents, deciding the number of bankers in a support station, network traffic analysis and ...

Transportation Optimization using Python “PuLP”

Assuming that Q Cells is in the process of optimizing its logistics operations, here are the key details about its current situation: 1) Q Cells operates three warehouses located in Atlanta, New Jersey, and Arizona, with inventory levels of 2075, 1500, and 1000 modules, respectively. 2) The so...

Procurement Process Optimization with Python

Procurement management is a strategic approach to acquiring goods or services from preferred vendors within your determined budget, either on or before a specific deadline. Analytics with Python can help you balance supply and demand to ensure a minimum lev...

Python + PuLP: A Simple Logistics Optimization Example

The logistics example (Beer Distribution Problem) provided by the developers is a great example, however, I wanted to approach it differently. I had already determined routes and an estimated margin impact for each of the ‘routes’ or lanes. We had other constraints that require...

Optimizing Port Rotation using Python and Searoute

The push is on to use information technology to streamline the supply chain in an effort to reduce consumption of fossil fuels (International Maritime Organization, 2023). This effort aligns with the goals of vessel owners who often search for ways to reduce cost. Searoute is a Python package bas...

Is Python a must-have skill in the supply chain? How much Python do I need?

Is Python a must-have skill in the supply chain? https://lnkd.in/dcEJuZJX. How much Python do I need? https://lnkd.in/e6Rmzpw. I had a SCM professional ask: “I don’t even know basic python yet . I want to get to the more advanced items but I am not ready yet . I’ve done r...

The hitchhiker’s guide to GTFS with python

GTFS feeds let public transit agencies publish their transit data and developers write applications that consume that data in an interoperable way. Many of these feeds are openly available at the Open Mobility Data website. But let’s face it, if you ever worked with a GTFS dataset you ...

Make your own self-driving RC car using Python and Raspberry Pi (Part 1 - Introduction)

This comprehensive article chronicles my personal journey of constructing a self-driving RC car from scratch, utilising Python and Raspberry Pi as the core components. Presented in a tutorial format, this guide is designed to support both beginners and advanced learners in the world of robotics and ...

Driving an RC Car using python and Arduino

The python program reads the joystick values and controls the car’s steering and throttle. Here I am using the 188$ Latte Panda Delta (LP-D) board (quad core Intel(R) Celeron(R) N4100 CPU and 4GB RAM). The board has a thin/quite fan. As shown in the block-diagram above Lat...

Data-Driven Urban Planning: Illuminating City Landscapes through Polar Histograms and OSMnx in Python

Urban planning, a multifaceted discipline at the intersection of design, policy, and development, relies heavily on data-driven insights to shape sustainable and efficient cities. As urban environments evolve, so too do the tools and methodologies employed by planners. One such tool is the polar his...

Visualization of Black Holes and Gravitational Lensing Using Python and Plotly

Prepare to be captivated as we explore the amazing world of black holes. This journey goes beyond theory, inviting you to observe the unseen forces at work: 1. Abyssal Journey: We embark on an adventure to better understand the complexities of black holes. Learn about concepts like the event hori...

The Python Planet Simulation

We will set up the view area We start by initializing pygame with init(). The Width and the Height can be as per your wish but It is recommended to stick with the SQUARE shape, i.e. Same Height and Width Set the caption for your wi...

Python in Space: A Beginner’s Guide to Decoding Planetary Orbits

Orbital mechanics is like figuring out how planets and moons play tag in space. Imagine you’re on a merry-go-round (a revolving machine with model horses or other animals on which people ride for amusement); when it spins, you feel like you’re being pushed outwards, right? But at the sam...

Automate Biological Laboratory Workflows Using a Liquid Handling Robot (with Opentrons Python API)

Liquid handling robots are highly efficient laboratory automation tools that can perform various sample preparation tasks that are repetitive and time-consuming. They provide numerous benefits such as cost savings, increased accuracy, and improved efficiency. Additionally, they are highly advantageo...

PYTHON — Analyzing Time And Space In Python

When it comes to analyzing the performance of an algorithm, we often talk about its time and space complexity. Time complexity refers to how long an algorithm takes to run, while space complexity is the amount of computer memory it needs to work. In computer science, we typically use Big O notati...

Professionally Visualize Data Distributions in Python

Exploratory data analysis and data visualization often includes inspecting a dataset’s distribution. Doing so provides important insights into the data, such as identifying the range, outliers or unusual groupings, the data’s central tendency, and skew within the data. Comparing subsets ...

How to bootstrap sample in both Python and R

In statistics, bootstrapping is a method that estimates the population characteristics by using repeated sampling with replacement of a representative sample. Bootstrap sampling is a technique that enables researchers to estimate parameters like the mean for an entire population without explicitly c...

SSIM on Python

SSIM or Structural Similarity Index is metric that we could use to measure how similiar is two images. It measures images luminance, contrast and structure and compare those values on 2 images. Using skimage.metrics, we will count SSIM between 2 images. First, import numpy, cv2, skimage, panda...

PYTHON — Math and Statistics Functions in Python

In this tutorial, we will explore how to create a project related to math and statistics functions in Python from scratch. We will cover the practical applications, necessary Python libraries, and step-by-step instructions for setting up the project environment, implementing foundational steps, and ...

Speechat; an algorithm for real-time Spoken Language Assessment in python

This algorithm https://shahabks.github.io/Speechat/ was built for processing high-entropy speech (simultaneous free speech processing) using probabilistic machine learning and deep learning models to predict spoken English language proficiency. This algorithm can measure the “pronunc...