How to fix your data returning Nan instead of float values in Python 3 for categorical data
Just a quick one. I am dealing with categorical data. 

After grouping by, I tried to see what the data looks like and this is what I get. what can I do?

    import pandas as pd
    import matplotlib.pyplot as plt
    import numpy as np

    pd.set_option('display.max_rows', 500)
    pd.set_option('display.max_columns', 500)
    pd.set_option('display.width', 1000)

    happiness_dataset= pd.read_csv('happiness-cantril-ladder.csv')

    ### Lets explore the dataset ####
    happiness_dataset.info()

    happiness_dataset.describe()

    happiness_dataset.columns = ['Country','Country_code','Year','Happiness_level']  ### rename the columns

    happiness_dataset['Happiness_level'] = pd.to_numeric(happiness_dataset['Happiness_level'],errors='coerce')

    happiness_dataset.info()


    groupby_country_v= pd.DataFrame(happiness_dataset.groupby('Country')['Happiness_level'].mean())

    print(groupby_country_v)

This is what I get when I print the groupby_country_v

                                  Happiness_level
    Country
    Afghanistan                               NaN
    Albania                                   NaN
    Algeria                                   NaN
    Angola                                    NaN
    Argentina                                 NaN
    Armenia                                   NaN
    Australia                                 NaN
    Austria                                   NaN
    Azerbaijan                                NaN
    Bahrain                                   NaN
    Bangladesh                                NaN
    Belarus                                   NaN
    Belgium                                   NaN
    Belize                                    NaN
    Benin                                     NaN
    Bhutan                                    NaN
    Bolivia                                   NaN
    Bosnia and Herzegovina                    NaN
    Botswana                                  NaN
    Brazil                                    NaN
    Bulgaria                                  NaN
    Burkina Faso                              NaN
    Burundi                                   NaN
