Create a frequency table (one-way table) for the variable “cut” from the dataset “diamond.csv”. What is the frequency for the cut type “Ideal”? For data science using Python in Anaconda - Jupyter
#import the library Pandas
import pandas as pd
#Put the diamond.csv dataset on Root Directory
#Read the dataset
data1 = pd.read_csv('diamond.csv')
#Create a frequency table (one-way table) for the variable “cut” from the dataset “diamond.csv”.
#What is the frequency for the cut type “Ideal”?
#=====================================
# Cross Tables: One Way Table
#=====================================
pd.crosstab(index=data1['cut'],columns='count')
Output:-