Difference between Pandas .iloc and .loc function

The optimized data access methods are accessed by indexing off of the .loc and .iloc attributes. These two attributes allow label-based and position-based indexing respectively. When we perform an index operation on the .iloc attribute, it does lookup based on index position (in this case pandas behaves similar to a Python list). DataFrame operation: .loc…

Read More

Default argument and Ternary operators in Python

The objects like list, dict are mutable. A mutable object can change its state or contents, so whenever we use these types of mutable objects as default argument in Python functions, and execute or call the function multiple times it gives unnecessary output for each function call. The example shown below is to return the…

Read More

Difference between List and Tuple in Python

Lists and Tuple store one or more objects or values in a specific order. The objects stored in a list or tuple can be of any type including the nothing type defined by the None Keyword. Syntax Differences Syntax of list and tuple is slightly different. List are surrounded by square brackets [] and Tuples…

Read More

Python List Methods

The Python List is a general data structure widely used in Python programs. They are both mutable and can be indexed and sliced. List methods 1 – append(value) Append a new element to the end of the list. 2 – extend(value) Extends the list by appending elements from another enumerable. 3 – index(value) Gets the…

Read More

Arrays Functions and Functional Programming in Python

This post is dedicated to some of the commonly used numpy function to do with arrays in python. 1 – Remove Duplicate from arrays using numpy 2 – Concatenate two arrays using numpy 3 – Get product of one/two arrays using numpy 4 – Basic maths function of Numpy Functional Programming Functional programming is a…

Read More

Array Methods in Python

Arrays are used to store multiple values in one single variable. Array can be handled in Python by a module named array. Type codes for different data types: These codes are used while creating an array. 1 – Creating an Array Array(data_type, value_list) 2 – Adding Element to Array Insert() is used to insert one…

Read More

End to End Project Laptop Price Prediction using Machine Learning

Machine learning relies on AI to predict the future based on past data. If you’re a data science enthusiast or practitioner, this article will help you build your own end-to-end machine learning project from scratch. In order for a machine-learning project to be successful, there are several steps that should be followed. These steps vary…

Read More

Uber Data Analysis Project using Python

Uber is a company based in San Francisco that handles over 118 million users and 5 million drivers, making it the perfect app for you to hire a ride. Additionally, they process an average of 17.4 million trips with over 6 billion rides completed every day. You can download the dataset used in this project…

Read More

Date-Time Module in Python

The data-time is a built-in module supplies classes for manipulating dates and times. datetime.now use the now() method to access the current date and time. Date class in datetime module We can represent the data object using the data class Syntax to create a data object datetime.date(year, month, day) date.today() it will return the current…

Read More

Sales Analysis Project using Python

In this post, I use Python, Pandas & Matplotlib to analyze and answer business questions about 12 months worth of sales data. The data contains hundreds of thousands of electronics store purchases broken down by month, product type, cost, purchase address, etc. The dataset can be downloaded here. In this analysis, I’m using jupyter notebook. First,…

Read More