def zb(zb):
    """Transform the zb dataset according to what was found in the explaratory
    analyses, available on sp_np.ipynb

    1. Remove duplicates based on 'journal' and 'bibref_details' columns
    2. Rename some high-ranked journals
    3. Remove rows that contains higher ranked non-jounals, such as "nov",
    "n", etc.
    4. Remove years out of the 2010-2020 range
    5. Select only 'journal' and 'year' columns
    6. Rename these two columns to 'Journal' and 'Year', with capitalization
    7. Add a column named 'Source', with all rows = 'Zoobank'

    Args:
        zb (pandas.DataFrame): Unchanged dataframe from Zoobank scraper

    Returns:
        pandas.DataFrame: Transformed zb dataframe
    """
    # Removing duplicates
    zb.drop_duplicates(subset=['journal', 'bibref_details'], keep=False,
        inplace=True)

    # Renaming some high-ranked journals
    values_and_replacement = [
    ('Insecta mundi', 'Insecta Mundi'),
    ('Peckhamia\(', 'Peckhamia'),
    ('ZooKeys\(', 'ZooKeys'),
    ('European Journal of Taxonomy\(', 'European Journal of Taxonomy'),
    ('Far Eastern Entomologist\(', 'Far Eastern Entomologist'),
    ('Insecta Mundi\(', 'Insecta Mundi'),
    ('Cesa News\(', 'Cesa News'),
    ('Zootaxa\,', 'Zootaxa'),
    ('Zootaxa\(', 'Zootaxa'),
    ('Centre for Entomological Studies, Miscellaneous Papers\(', 'Centre for Entomological Studies, Miscellaneous Papers'),
    ('European journal of taxonomy\(', 'European Journal of Taxonomy'),
    ('Ichthyological exploration of freshwaters\(IEF\-', 'Ichthyological Exploration of Freshwaters'),
    ('Journal of Melittology\(', 'Journal of Melittology'),
    ('Bulletin of the Mizunami Fossil Museum\(', 'Bulletin of the Mizunami Fossil Museum'),
    ('Revue suisse de zoologie', 'Revue suisse de Zoologie')
    ]

    for v1, v2 in values_and_replacement:
        zb['journal'] = zb['journal'].str.replace(v1, v2)

    # Removing higher ranked non-journals indexes
    zb = zb[zb['journal'] != ',']
    zb = zb[zb['journal'] != '']

    # Removing years out of the 2010-2020 range
    years_out = ['1847', '1877', '1878', '1880', '1881', '1883', '1887', '1888',
        '1889', '1894', '1896', '1898', '1902', '1905', '1917', '1919', '1923',
        '1927', '1932', '1933', '1936', '1937', '1951', '1952', '1960', '1962',
        '1967', '1969', '1972', '1986', '1989', '1996', '1999', '2001', '2002',
        '2003', '2004', '2008', '2009']

    for yr in years_out:
        zb = zb[zb['year'] != yr]

    # Selecting only the columns 'journal' and 'year'
    zb = zb[['journal', 'year']]

    # Renaming columns
    zb.rename(columns={'journal': 'Journal', 'year': 'Year'}, inplace=True)

    # Adding column 'Source', filling all rows = 'Zoobank'
    zb['Source'] = 'Zoobank'

    return zb