Everything you need to know about parameters, arguments, and their types in Python

Hands typing on a laptop computer.
Hands typing on a laptop computer.
Source: Unsplash

What are parameters and arguments? Most of the time we use the terms interchangeably — and that’s fine. However, it’s important that you understand the difference between the two. In this article, we’ll explore them in detail. Along the way, you’ll learn all you need to know about parameters and arguments in Python.

Note: If any of the features discussed below give syntax errors, please ensure you’re using a recent version of Python — 3.8 or 3.9.

Parameters and Arguments

Parameters are the names that appear in the function definition. …


Machine Learning, Data Science

Using MongoDB’s GridFS feature for storing and retrieving machine learning models

Image for post
Image for post
Source: mongoDB.com

If you are looking for a database for storing your machine learning models then this article is for you. You can use MongoDB to store and retrieve your machine learning models. Without further adieu let’s jump to the main topic.

MongoDB

MongoDB is a very popular NoSQL database. In MongoDB, the data is stored in the form of JSON-like documents. More specifically, documents are stored in the form of a BSON object which is nothing but binary data represented in JSON format.

The documents and collections in MongoDB are analogous to records and tables in relational database (RDBMS) respectively.

If you…


Data Science, Machine Learning

Understand how to use ONNX for converting ML model from any framework to ONNX format and make faster inference

Image for post
Image for post
Source: ONNX

The chances are high that you might have heard about ONNX but not sure what it does and how to use it. Don’t worry, you are in right place. In this beginner-friendly article, you will understand about ONNX. Let’s dive-in.

Assume that you built a deep learning model using the TensorFlow framework for face detection. But unfortunately, you might have to deploy this model in an environment that uses Pytorch. How can you handle this scenario? Well, we can think of two ways to handle this:

a) convert the existing model to a standard format that can work in any…


Get a deeper understanding of bool type beyond True and False

Actors silhouetted on a stage.
Actors silhouetted on a stage.
Photo by Kyle Head on Unsplash

In this article, you will get a thorough understanding of Python bool type, how it works, and how to effectively use it in your Python application. Let’s get started.

1. Bool Type

In Python, bool datatype is used to represent boolean values — True and False.

As you know, everything is an object in Python. That means integers, floats, strings, lists, tuples, etc. are all objects of their respective class. For example, integers are objects of the class int, floats are the object of the class float, lists are objects of the class list.

Similarly, boolean values True and False are also the…


Programming, Python

Decimal module for fixed-point and floating-point arithmetic

Image for post
Image for post
Source: Unsplash

We are all familiar with the float data type. Do you know there exists another data type called decimal that can be used to represent real-valued (floating-point) numbers? As we saw in the previous article, some of the float numbers don’t have an exact representation in binary. This inexactness causes rounding errors. The decimal data type tries to solve this problem by providing a way to represent floating-point numbers using fixed precision.

I strongly suggest you go through the below article to understand about fixed (finite) vs. approximate (infinite) representation of floating-point numbers and their implications.

Why should you understand decimal?

Why should you understand…


Data Science, Machine Learning

Summarization ML app using Streamlit making use of transformer model

Image for post
Image for post
Source: Unsplash

If you are reading this article it’s obvious that you are interested in text summarization. At the same time, you also want to go a step further and build a text summarization app. But you don’t know how to do it as you don’t have front-end experience. Say hello to Streamlit. With Streamlit, you can build beautiful apps in hours without the knowledge of front-end technologies.

Trust me when I say you can actually build beautiful apps in 30 mins using Streamlit as the title of this article say. It only takes 10–15 minutes to figure out the features you…


Programming, Python

Image for post
Image for post
Source: Unsplash

In the previous article, we have gone through the features of Python int data type that you are less familiar. Let’s go through the float data type in this article.

Float Data-type

Any real value number is represented as float data type such as 0.1, 0.2, 1.234, 56e-4, etc.

The basic arithmetic operations such as addition, subtraction, multiplication, division, floored division, etc. yield the result in float type.


Programming, Python

Interesting details about Python int data type

Image for post
Image for post
Image by the author (generated from Canva)

You might be thinking why I am writing about numeric types as there is not much to be explained in detail. Most of us are familiar with basic arithmetic operations such as addition, subtraction, multiplication, and division. But actually, there is more Python offers that we need to understand. So, the goal of this article is to present you with interesting features of Python Int data type.

Integer

Any number that can be written without any fractional part is considered as an integer number. For example, 0, 1 , 100, -1001, 4578 etc. are integers.

We all know about addition (+)…


Programming, Python

Recommended resources to learn the most popular programming language

Image for post
Image for post
Photo by Hitesh Choudhary on Unsplash

Python is an interpreted, high-level, general-purpose programming language. It is continuously gaining popularity over the last many years making it the most popular programming language.

There are hundreds of reasons why people love Python. The most common reasons seem to be — readability, simplicity, ease of use, vast community (growing rapidly), 3rd party libraries (such as Pandas, Numpy, Scikit-learn, etc.). You can do system programming, GUI, Numerical & Scientific programming. It can be used for Natural language analysis, visualization, image processing, machine learning. Sigh! The list is endless.

  • You may be learning Python for Machine Learning or Web Development or…


PROGRAMMING, PYTHON

Basics of memory management in Python

Image for post
Image for post
Source: Unsplash

In this article, we will go through one of the memory management techniques in Python called Reference Counting.

In Python, all objects and data structures are stored in the private heap and are managed by Python Memory Manager internally. The goal of the memory manager is to ensure that enough space is available in the private heap for memory allocation. This is done by deallocating the objects that are not currently being referenced (used). As developers, we don’t have to worry about it as it will be handled automatically by Python.

Reference Counting

Reference counting is one of the memory management technique…

Chetan Ambi

Data Science | Machine Learning | Python. Visit https://pythonsimplified.com/ for interesting articles on Python and Machine Learning

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store