Python tutorials

A Python Guide to the Fibonacci Sequence

With stacks, you’ll effectively see how each call in a recursive function is handled. The way each call is pushed onto the stack and popped off is exactly how the program is run, and it’ll clearly demonstrate how calculating large numbers will take a long time, if not optimized. Illustrating Visualization Using a Call Stack In a call stack, whenever a function call returns a result, a stack frame representing the function call is popped off the stack. Whenever you […]

Read more

Graph Your Data With Python and ggplot

In this course, you’ll learn how to use ggplot in Python to create data visualizations using a grammar of graphics. A grammar of graphics is a high-level tool that allows you to create data plots in an efficient and consistent way. It abstracts most low-level details, letting you focus on creating meaningful and beautiful visualizations for your data. There are several Python packages that provide a grammar of graphics. This course focuses on plotnine since it’s one of the most […]

Read more

How Long Does It Take to Learn Python?

You’ve probably found at least one blog post where the author reveals that they learned Python in a handful of days and quickly transitioned into a high-paying job. Some of these stories may be true, but they don’t help you prepare for a steady learning marathon. So, how long does it really take to learn Python, and is it worth your time investment? In this article, you’ll learn: What “learning Python” means and how you can measure your progress What […]

Read more

The best Docker base image for your Python application (August 2021)

When you’re building a Docker image for your Python application, you’re building on top of an existing image—and there are many possible choices. There are OS images like Ubuntu, and there are the many different variants of the python base image. Which one should you use? Which one is better? There are many choices, and it may not be obvious which is the best for your situation. So to help you make a choice that fits your needs, in this […]

Read more

Splitting Datasets With scikit-learn and train_test_split()

One of the key aspects of supervised machine learning is model evaluation and validation. When you evaluate the predictive performance of your model, it’s essential that the process be unbiased. Using train_test_split() from the data science library scikit-learn, you can split your dataset into subsets that minimize the potential for bias in your evaluation and validation process. In this course, you’ll learn: Why you need to split your dataset in supervised machine learning Which subsets of the dataset you need […]

Read more

Using Python Optional Arguments When Defining Functions

In this section, you’ll learn how to define a function that takes an optional argument. Functions with optional arguments offer more flexibility in how you can use them. You can call the function with or without the argument, and if there is no argument in the function call, then a default value is used. Default Values Assigned to Input Parameters You can modify the function add_item() so that the parameter quantity has a default value: # optional_params.py shopping_list = {} […]

Read more

Exploring the Python math Module

In this course, you’ll learn all about Python’s math module. Mathematical calculations are an essential part of most Python development. Whether you’re working on a scientific project, a financial application, or any other type of programming endeavor, you just can’t escape the need for math. For straightforward mathematical calculations in Python, you can use the built-in mathematical operators, such as addition (+), subtraction (-), division (/), and multiplication (*). But more advanced operations, such as exponential, logarithmic, trigonometric, or power […]

Read more

Python’s deque: Implement Efficient Queues and Stacks

If you often work with lists in Python, then you probably know that they don’t perform fast enough when you need to pop and append items on their left end. Python’s collections module provides a class called deque that’s specially designed to provide fast and memory-efficient ways to append and pop item from both ends of the underlying data structure. Python’s deque is a low-level and highly optimized double-ended queue that’s useful for implementing elegant, efficient, and Pythonic queues and […]

Read more

Beginner’s Guide To Text Classification Using PyCaret

Introduction Have you ever solved a Machine Learning problem in just one go? Solving a problem using machine learning isn’t straightforward. It involves various steps to come up with an accurate solution. The process/steps to be followed for solving an ml problem is known as ML Pipeline/ML Cycle. ML Pipeline/ ML Cycle (Credits: https://medium.com/analytics-vidhya/machine-learning-development-life-cycle-dfe88c44222e) As shown in the figure, the Machine Learning pipeline consists of different steps like: Understand Problem Statement, Hypothesis Generation, Exploratory Data Analysis, Data Preprocessing, Feature Engineering, […]

Read more

A friendly guide to NLP: Bag-of-Words with Python example

1. A Quick Example Let’s look at an easy example to understand the concepts previously explained. We could be interested in analyzing the reviews about Game of Thrones: Review 1: Game of Thrones is an amazing tv series! Review 2: Game of Thrones is the best tv series! Review 3: Game of Thrones is so great In the table, I show all the calculations to obtain the Bag-Of-Words approach: Each row corresponds to a different review, while the rows are […]

Read more
1 118 119 120 121 122 193