Posts

Showing posts from April, 2022

Pandas - Python library.

Image
 Pandas Pandas is open source python library .  Used for data analysis . Also helpful in data mungling . Data Mungling -  Combination of data cleaning, data manipulation, and data understanding we call it as data munging. How to install pandas. Type pip install pandas in your cmd. If you are using anaconda (it is a python distribution) in this the pandas is already installed. To check the pandas version We import pandas as import pandas as pd. Type - pd.__version__ Basic pandas function you should know. pd.read_csv - To read csv file. pd.head() - to print top 5 line. pd.tail() - to print last 5 line. pd.describe() - to describe the dataset. pd.info() - to check the complete info about the dataset. pd.shape - It's a attribute, help to know shape of dataset pd.shape[0] - print  number of rows. pd.shape[1] - print number of columns. pd.columns - It will print all the columns name. pd.column_name - The column_name that you want will be selected. pd['column_name'] - Sa...

Numpy - Slicing

Image
 Slicing in Numpy Arrays. As we all know that the slicing is about to print subpart of something.  Like when our parents bring cake we get the slice of that not the whole cake, it's something similar to this. Now slicing in numpy array is like printing or getting the value from first index till last index. I am going to discuss slicing in advance. Numpy array with two dimensions. Basic information regarding slicing. Index is always start from 0. Negative indexing is also possible. We always try to figure our solution in [ row, column] format. If it's a single element the column number will be the exact one (see question 1 and 2). If it's more than one element then the previous rule will gonna apply like column - 1 (see question 3 and 4). We can access the particular element by giving rows and column index separated by comma. For accessing the group of elements you should pass the rows and columns by using the : symbol. Question - 1 print 10. Answer - As we all know that the...