Fungsi untuk mendapatkan statistik dasar dari DataFrame kami dalam sekali jalan

#Creating a function that does all of the above tasks in one go:

def get_basic_stats(dfname):
    print("Shape of dataframe is " + str(dfname.shape))
    print("Below are datatypes of columns in DF")
    print(dfname.dtypes.sort_values())
    print("Below are missing values in each column")
    print(dfname.isna().sum().sort_values())
    print("Below are the number of unique values taken by a column")
    print(dfname.nunique().sort_values())
    print("Below are some records in DF")
    print("Below is distribution of numeric variables")
    print(dfname.describe())
    print(dfname.head())
    
    
    
 get_basic_stats(df) #df here is the dataframe we wants to get it's statistic 
DON-PECH