import pandas as pd

def generate_countryDB(country_name:str):
    ''' Generates a csv database with all cities of a defined country.

    Args:
        country_name (str): Country name in english, not abbreviated.

    Returns:
        df_col (pandas.DataFrame): 

    Writes: A csv file with the cities of the specified country with the name 'country_name.csv'.
    '''
    df = pd.read_csv('../db/worldcities.csv')
    df_country = df[df['country'] == country_name].reset_index(drop = True)
    df_col = df_country[['city', 'lat', 'lng', 'admin_name', 'population']]

    df_col.to_csv('../db/{}.csv'.format(country_name.lower()))

    return df_col


def filter_cities_by_population(df, pop_filter:int):
    ''' Filter cities above a population threshold (in thousands).

    Arguments:
        df (pandas.DataFrame): Country DF generated by the function generate_countryDB
        pop_filters (int): Number of inhabitants in thousands that will serve as a threshold to select only the biger cities.
    
    Returns:
        filtered_cities (pandas.DataFrame): A df with the cities with the population bigger than the declared threshold
    '''    
    ### I don't want to see all of the cities in NL
    print(df.head())
    filtered_cities = df[df['population'] >= pop_filter*(1e3)].reset_index(drop = True)

    return filtered_cities

import pandas as pd

def generate_countryDB(country_name:str):
    ''' Generates a csv database with all cities of a defined country.

    Args:
        country_name (str): Country name in english, not abbreviated.

    Returns:
        df_col (pandas.DataFrame): 

    Writes: A csv file with the cities of the specified country with the name 'country_name.csv'.
    '''
    df = pd.read_csv('../db/worldcities.csv')
    df_country = df[df['country'] == country_name].reset_index(drop = True)
    df_col = df_country[['city', 'lat', 'lng', 'admin_name', 'population']]

    df_col.to_csv('../db/{}.csv'.format(country_name.lower()))

    return df_col


def filter_cities_by_population(df, pop_filter:int):
    ''' Filter cities above a population threshold (in thousands).

    Arguments:
        df (pandas.DataFrame): Country DF generated by the function generate_countryDB
        pop_filters (int): Number of inhabitants in thousands that will serve as a threshold to select only the biger cities.
    
    Returns:
        filtered_cities (pandas.DataFrame): A df with the cities with the population bigger than the declared threshold
    '''    
    ### I don't want to see all of the cities in NL
    print(df.head())
    filtered_cities = df[df['population'] >= pop_filter*(1e3)].reset_index(drop = True)

    return filtered_cities

Generates a csv database with all cities of a defined country.      Args:         country_name (str): Country name in english, not abbreviated.      Returns:         df_col (pandas.DataFrame):       Writes: A csv file with the cities of the specified country with the name 'country_name.csv'. Filter cities above a population threshold (in thousands).      Arguments:         df (pandas.DataFrame): Country DF generated by the function generate_countryDB         pop_filters (int): Number of inhabitants in thousands that will serve as a threshold to select only the biger cities.          Returns:         filtered_cities (pandas.DataFrame): A df with the cities with the population bigger than the declared threshold ### I don't want to see all of the cities in NL