Python tutorials

How to Iterate over Rows in a Pandas DataFrame

Introduction Pandas is an immensely popular data manipulation framework for Python. In a lot of cases, you might want to iterate over data – either to print it out, or perform some operations on it. In this tutorial, we’ll take a look at how to iterate over rows in a Pandas DataFrame. If you’re new to Pandas, you can read our beginner’s tutorial. Once you’re familiar, let’s look at the three main ways to iterate over DataFrame: items() iterrows() itertuples() […]

Read more

Matplotlib Scatter 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 scatter plot in Matplotlib. Import Data We’ll be using the Ames Housing dataset and visualizing correlations between features from it. Let’s import Pandas and load in the dataset: import pandas as pd df = pd.read_csv(‘AmesHousing.csv’) Plot a Scatter Plot in Matplotlib Now, with […]

Read more

Python: Slice Notation on String

Introduction The term slicing in programming usually refers to obtaining a substring, sub-tuple, or sublist from a string, tuple, or list respectively. Python offers an array of straightforward ways to slice not only these three but any iterable. An iterable is, as the name suggests, any object that can be iterated over. In this article, we’ll go over everything you need to know about Slicing Strings in Python. Slicing a String in Python There are a couple of ways to […]

Read more

Python: Slice Notation on List

Introduction The term slicing in programming usually refers to obtaining a substring, sub-tuple, or sublist from a string, tuple, or list respectively. Python offers an array of straightforward ways to slice not only these three but any iterable. An iterable is, as the name suggests, any object that can be iterated over. In this article, we’ll go over everything you need to know about Slicing Lists in Python. Slicing a List in Python There are a couple of ways to […]

Read more

Change Font Size in Matplotlib

Introduction Matplotlib is one of the most widely used data visualization libraries in Python. Much of Matplotlib’s popularity comes from its customization options – you can tweak just about any element from its hierarchy of objects. In this tutorial, we’ll take a look at how to change the font size in Matplotlib. Change Font Size in Matplotlib There are a few ways you can go about changing the size of fonts in Matplotlib. You can set the fontsize argument, change […]

Read more

FlashText – A library faster than Regular Expressions for NLP tasks

People like me working in the field of Natural Language Processing almost always come across the task of replacing words in a text. The reasons behind replacing the words may be different. Some of them are. “would’ve” and “would have” represent the same thing. So changing all the occurrences of “would’ve” to “would have” is one such task. Changing all Case Variations to a single form i.e Python, pytHon, pYthon, pythoN etc. to python Changing all the synonyms of a word to […]

Read more

Text Mining 101: A Stepwise Introduction to Topic Modeling using Latent Semantic Analysis (using Python)

Introduction Have you ever been inside a well-maintained library? I’m always incredibly impressed with the way the librarians keep everything organized, by name, content, and other topics. But if you gave these librarians thousands of books and asked them to arrange each book on the basis of their genre, they will struggle to accomplish this task in a day, let alone an hour! However, this won’t happen to you if these books came in a digital format, right? All the […]

Read more

Learn how to Build and Deploy a Chatbot in Minutes using Rasa (IPL Case Study!)

Introduction Have you ever been stuck at work while a pulsating cricket match was going on? You need to meet a deadline but you just can’t concentrate because your favorite team is locked in a fierce battle for a playoff spot. Sounds familiar? I’ve been in this situation a lot in my professional career and checking my phone every 5 minutes was not really an option! Being a data scientist, I looked at this challenge from the lens of an […]

Read more

Knowledge Graph – A Powerful Data Science Technique to Mine Information from Text (with Python code)

Overview Knowledge graphs are one of the most fascinating concepts in data science Learn how to build a knowledge graph to mine information from Wikipedia pages You will be working hands-on in Python to build a knowledge graph using the popular spaCy library   Introduction Lionel Messi needs no introduction. Even folks who don’t follow football have heard about the brilliance of one of the greatest players to have graced the sport. Here’s his Wikipedia page: Quite a lot of […]

Read more

Transfer Learning for NLP: Fine-Tuning BERT for Text Classification

Introduction With the advancement in deep learning, neural network architectures like recurrent neural networks (RNN and LSTM) and convolutional neural networks (CNN) have shown a decent improvement in performance in solving several Natural Language Processing (NLP) tasks like text classification, language modeling, machine translation, etc. However, this performance of deep learning models in NLP pales in comparison to the performance of deep learning in Computer Vision. One of the main reasons for this slow progress could be the lack of […]

Read more
1 145 146 147 148 149 182