Python tutorials

Comparing Datetimes in Python – With and Without Timezones

Introduction When working with dates, oftentimes, you’d like to know if a given date comes before or after another date. We can get these answers by comparing dates. In this article, we will learn how to use the Python datetime module to create and compare both naive (without timezone info) and aware (with timezone info) dates. To compare the dates, we will use the comparison operators in Python: , ==, =, !=. Note: The datetime module has two methods for […]

Read more

Analysis of Brazilian E-commerce Text Review Dataset Using NLP and Google Translate

This article was published as a part of the Data Science Blogathon. Introduction Comprehending the reviews of customers is very crucial for a business to be successful. Analyzing the reviews helps to properly discern the customer different preferences, likes, dislikes, etc. These extracted insights can then be used to improve customer service and experience.  In this article, we would be working on a Brazilian E-commerce reviews dataset where we would perform some exploratory data analysis (EDA) on reviews text, derive […]

Read more

Python: Safely Create Nested Directory

Introduction File manipulation is one of the most important skills to master in any programming language, and doing it correctly is of utmost importance. Making a mistake could cause an issue in your program, other programs running on the same system, and even the system itself. Possible errors can occur due to the parent directory not existing, or by other programs changing files in the file system at the same time, creating something that is called a race condition. A […]

Read more

How to Merge DataFrames in Pandas – merge(), join(), append(), concat() and update()

Introduction Pandas provides a huge range of methods and functions to manipulate data, including merging DataFrames. Merging DataFrames allows you to both create a new DataFrame without modifying the original data source or alter the original data source. If you are familiar with the SQL or a similar type of tabular data, you probably are familiar with the term join, which means combining DataFrames to form a new DataFrame. If you are a beginner it can be hard to fully […]

Read more

How to Use Global and Nonlocal Variables in Python

Introduction In this article we’ll be taking a look at Global and Non-Local Variables in Python and how you to use them to avoid issues when writing code. We’ll be starting off with a brief primer on variable scopes before we launch into the how and why of using global and non-local variables in your own functions. Scopes in Python Before we can get started, we first have to touch on scopes. For those of you who are less familiar, […]

Read more

Fake news classifier on US Election News📰 | LSTM 🈚

Introduction News media has become a channel to pass on the information of what’s happening in the world to the people living. Often people perceive whatever conveyed in the news to be true. There were circumstances where even the news channels acknowledged that their news is not true as they wrote. But some news has a significant impact not only on the people or    

Read more

Ultimate Guide to Heatmaps in Seaborn with Python

Introduction A heatmap is a data visualization technique that uses color to show how a value of interest changes depending on the values of two other variables. For example, you could use a heatmap to understand how air pollution varies according to the time of day across a set of cities. Another, perhaps more rare case of using heatmaps is to observe human behavior – you can create visualizations of how people use social media, how their answers on surveys […]

Read more

Reading and Writing HTML Tables with Pandas

Introduction Hypertext Markup Language (HTML) is the standard markup language for building web pages. We can render tabular data using HTML’s element. The Pandas data analysis library provides functions like read_html() and to_html() so we can import and export data to DataFrames. In this article, we will learn how to read tabular data from an HTML file and load it into a Pandas DataFrame. We’ll also learn how to write data from a Pandas DataFrame and to an HTML file. […]

Read more

Matplotlib Line Plot – Tutorial and Examples

Introduction Matplotlib is one of the most widely used data visualization libraries in Python. From simple to complex visualizations, it’s the go-to library for most. In this tutorial, we’ll take a look at how to plot a line plot in Matplotlib – one of the most basic types of plots. Line Plots display numerical values one one axis, and categorical values on the other. They can typically be used in much the same way Bar Plots can be used, though, […]

Read more

Matplotlib Violin Plot – Tutorial and Examples

Introduction There are many data visualization libraries in Python, yet Matplotlib is the most popular library out of all of them. Matplotlib’s popularity is due to its reliability and utility – it’s able to create both simple and complex plots with little code. You can also customize the plots in a variety of ways. In this tutorial, we’ll cover how to plot Violin Plots in Matplotlib. Violin plots are used to visualize data distributions, displaying the range, median, and distribution […]

Read more
1 132 133 134 135 136 181