![]() ![]() You can do that with the Pandas read_csv() function: Once your data is saved in a CSV file, you’ll likely want to load and use it from time to time. If you don’t want to keep them, then you can pass the argument index=False to. In some cases, you’ll find them irrelevant. The first column contains the row labels. This text file contains the data separated with commas. Now you have your DataFrame object populated with the data about each country. You can use this data to create an instance of a Pandas DataFrame. The corresponding keys for data are the three-letter country codes. These dictionaries are then collected as the values in the outer data dictionary. You can organize this data in Python using a nested dictionary:ĭata = columns = ( 'COUNTRY', 'POP', 'AREA', 'GDP', 'CONT', 'IND_DAY' )Įach row of the table is written as an inner dictionary whose keys are the column names and values are the corresponding data. There are also several missing independence days because the data source omits them. For example, the continent for Russia is not specified because it spreads across both Europe and Asia. You may notice that some of the data is missing. The column label for the dataset is IND_DAY. The first four digits represent the year, the next two numbers are the month, and the last two are for the day of the month. The data comes from the list of national independence days on Wikipedia. Independence day is a date that commemorates a nation’s independence. The column label for the dataset is CONT. You can find this information on Wikipedia as well. The column label for the dataset is GDP.Ĭontinent is either Africa, Asia, Oceania, Europe, North America, or South America. You can find this data in the list of countries by nominal GDP on Wikipedia. dollars, according to the United Nations data for 2017. Gross domestic product is expressed in millions of U.S. The column label for the dataset is AREA. The data comes from a list of countries and dependencies by area on Wikipedia. The column label for the dataset is POP.Īrea is expressed in thousands of kilometers squared. The data comes from a list of countries and dependencies by population on Wikipedia. The column label for the dataset is COUNTRY. The row labels for the dataset are the three-letter country codes defined in ISO 3166-1. ![]() Each country is in the top 10 list for either population, area, or gross domestic product (GDP). ![]() Here’s an overview of the data and sources you’ll be working with:Ĭountry is denoted by the country name. In this tutorial, you’ll use the data related to 20 countries. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |