
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 10476 Articles for Python

635 Views
NumPy refers to ‘Numerical’ ‘Python’. It is a library that contains multidimensional array objects and multiple methods that help in processing the arrays. NumPy can be used to perform a wide variety of operations on arrays. It is used in conjunction with packages like SciPy, Matplotlib and so on. NumPy+Matplotlib can be understood as an alternative to MatLab. It is an open source package, which means it can be used by anyone.The most important object present in NumPy package is an n-dimensional array which is known as ‘ndarray’. It defines the collection of items of the same type. These values ... Read More

1K+ Views
Scikit-learn, commonly known as sklearn is a library in Python that is used for the purpose of implementing machine learning algorithms. It is an open-source library hence it can be used free of cost. This library is built on Numpy, SciPy and Matplotlib libraries.The method of ‘marching squares’ is used to find the contours in an image. The function ‘find_contours’ present in the ‘measure’ class of ‘skimage’ library is used. In this, the values present in the array are interpolated in a linear manner.This way, the precision of the contours in the output image would be much better. If the ... Read More

719 Views
Data pre-processing basically refers to the task of gathering all the data (which is collected from various resources or a single resource) into a common format or into uniform datasets (depending on the type of data).Since real-world data is never ideal, there is a possibility that the data would have missing cells, errors, outliers, discrepancies in columns, and much more.Sometimes, images may not be correctly aligned, or may not be clear or may have a very large size. The goal of pre-processing is to remove these discrepancies and errors.To get the pixels of an image, a built-in function named ‘flatten’ ... Read More

425 Views
Data pre-processing basically refers to the task of gathering all the data (which is collected from various resources or a single resource) into a common format or into uniform datasets (depending on the type of data). Since real-world data is never ideal, there is a possibility that the data would have missing cells, errors, outliers, discrepancies in columns, and much more. Sometimes, images may not be correctly aligned, or may not be clear or may have a very large size. The goal of pre-processing is to remove these discrepancies and errors.To get the resolution of an image, a built-in function ... Read More

1K+ Views
Sometimes, it may be required to get the mean values of a specific column or mean values of all columns that contains numerical values. This is where the mean() function can be used.The term ‘mean’ refers to finding the sum of all values and dividing it by the total number of values in the dataset.Let us see a demonstration of the same −Example Live Demoimport pandas as pd my_data = {'Name':pd.Series(['Tom', 'Jane', 'Vin', 'Eve', 'Will']), 'Age':pd.Series([45, 67, 89, 12, 23]), 'value':pd.Series([8.79, 23.24, 31.98, 78.56, 90.20]) } print("The dataframe is :") my_df = pd.DataFrame(my_data) print(my_df) print("The mean is :") print(my_df.mean())OutputThe dataframe is ... Read More

1K+ Views
Sometimes, it may be required to get the sum of a specific column. This is where the ‘sum’ function can be used.The column whose sum needs to be computed can be passed as a value to the sum function. The index of the column can also be passed to find the sum.Let us see a demonstration of the same −Example Live Demoimport pandas as pd my_data = {'Name':pd.Series(['Tom', 'Jane', 'Vin', 'Eve', 'Will']), 'Age':pd.Series([45, 67, 89, 12, 23]), 'value':pd.Series([8.79, 23.24, 31.98, 78.56, 90.20]) } print("The dataframe is :") my_df = pd.DataFrame(my_data) print(my_df) print("The sum of 'age' column is :") print(my_df.sum(1))OutputThe dataframe is ... Read More

329 Views
Dataframe is a two dimensional data structure, where data is stored in a tabular format, in the form of rows and columns.It can be visualized as an SQL data table or an excel sheet representation. A column in a dataframe can be deleted using different methods.We will see the pop function that takes the name of the column that needs to be deleted as a parameter, and deletes it.Example Live Demoimport pandas as pd my_data = {'ab' : pd.Series([1, 8, 7], index=['a', 'b', 'c']), 'cd' : pd.Series([1, 2, 0, 9], index=['a', 'b', 'c', 'd']), 'ef' : pd.Series([56, 78, 32], index=['a', 'b', ... Read More

128 Views
Dataframe is a two dimensional data structure, where data is stored in a tabular format, in the form of rows and columns.It can be visualized as an SQL data table or an excel sheet representation. A column in a dataframe can be deleted using different methods.We will see the ‘del’ operator that takes the name of the column that needs to be deleted as a parameter, and deletes it −Example Live Demoimport pandas as pd my_data = {'ab' : pd.Series([1, 8, 7], index=['a', 'b', 'c']), 'cd' : pd.Series([1, 2, 0, 9], index=['a', 'b', 'c', 'd']), 'ef' : pd.Series([56, 78, 32], index=['a', ... Read More

3K+ Views
Dataframe is a two dimensional data structure, where data is stored in a tabular format, in the form of rows and columns.It can be visualized as an SQL data table or an excel sheet representation. It can be created using the following constructor −pd.Dataframe(data, index, columns, dtype, copy)Let us understand how a dataframe can be created using a dictionary of Series.Series is a one dimensional data structure present in the ‘Pandas’ library.The axis label is collectively known as index.Series structure can store any type of data such as integer, float, string, python objects, and so on.Let us see an example ... Read More

281 Views
Dataframe is a two dimensional data structure, where data is stored in a tabular format, in the form of rows and columns.It can be visualized as an SQL data table or an excel sheet representation. It can be created using the following constructor −pd.Dataframe(data, index, columns, dtype, copy)A new column can be added to a dataframe in different ways.Let us see one of the ways, in which a new column is created by first forming a series data structure and passing this as an additional column to the existing dataframe.Let us see the code in action −Example Live Demoimport pandas as ... Read More