Skip to main content

Python Tutorial

NumPy Array Reshaping

In this tutorial you will learn: NumPy Array Shape Reshape 1D Array to 2D Array Reshape 2D Array to 3D Array NumPy Array Shape After necessary slicing or concatenation of the array we sometimes have to confirm the size and dimensions of the array in order to make sure that the data format and size meets the desired requirements of specific API, for example some of the algorithms in Keras only

NumPy View and Copy

In this tutorial you will learn: NumPy inbuilt copy function NumPy inbuilt view function NumPy View vs NumPy Copy NumPy Copy As the name indicates, the copy function copies the content of one array into another array. Hence, any changes in the copied array will not affect the original array (array from where the values have been copied). Copy function is a built in function and it can be used for

NumPy DataType Conversion

In this tutorial you will learn How to check DataType? How to convert one DataType to another? Unconvertible DataTypes Check Data Type As discussed in previous tutorial, NumPy provides multiple inbuilt DataTypes, so inorder to manipulate the data structure with a particular data type we first have to ensure that we are dealing with the right Data/ DataType. There are two options, either we can

How to Calculate Salary of Employee with Taxable Amount in Python

This is a simple program to calculate salary of employee with taxable amount in Python. The program requires the name of the employee, name of the company, salary of the employee. It will then calculate based on 20% tax rate. If the employee’s salary falls below 10,000, then the employee is not taxed. Else the employee is taxed with 20% deduction. emp_name = input("Enter the name of the Employee: