Descriptive Analytics Code Snippets

Read Excel file and change the filename

import pandas as pd
df = pd.read_csv (r’C:\Users\Acer\datasheet_virtusa.csv’)
df.head()

df_SAM = df.copy()

Display all column names in the dataset

list(df_SAM.columns.values)

Check number of records

df_SAM.shape

Check frequency of a value appearing within a specific column

df_SAM[“Value”].value_counts()

Check the frequency of occurring in percentages within a Column

df_SAM.Track.value_counts(normalize=True)

Checking columns datatypes and missing values

df_SAM.info()

Basic descriptive statistics queries

df_SAM.describe()

Leave a Reply

Your email address will not be published. Required fields are marked *