From e0266106b5d4f918dca0641cae78f3b858f6e63c Mon Sep 17 00:00:00 2001 From: andren967 Date: Fri, 20 Oct 2023 16:31:13 +0200 Subject: [PATCH 1/5] Exercices for Class 3 --- .../EN/Basic/03_Lists_and_For_Loops_NA.ipynb | 1274 +++++++++++++ .../Basic/04_Conditional_Statements_NA.ipynb | 1595 +++++++++++++++++ Exercises/EN/Basic/05_Control_Flow_NA.ipynb | 1259 +++++++++++++ 3 files changed, 4128 insertions(+) create mode 100644 Exercises/EN/Basic/03_Lists_and_For_Loops_NA.ipynb create mode 100644 Exercises/EN/Basic/04_Conditional_Statements_NA.ipynb create mode 100644 Exercises/EN/Basic/05_Control_Flow_NA.ipynb diff --git a/Exercises/EN/Basic/03_Lists_and_For_Loops_NA.ipynb b/Exercises/EN/Basic/03_Lists_and_For_Loops_NA.ipynb new file mode 100644 index 00000000..21a12d84 --- /dev/null +++ b/Exercises/EN/Basic/03_Lists_and_For_Loops_NA.ipynb @@ -0,0 +1,1274 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## About This Notebook\n", + "\n", + "In the previous notebook we understood what variables are and how these can store various values (strings, integers...). \n", + "\n", + "- In this notebook, we will expand our toolset with a more complex type of variable - **list**. As you will see, a list can store many elements (not just one like in the variables in previous lecture). \n", + "- We will learn later on how to manipulate these lists, such as how do we navigate through them and how do we retrieve elements we would like. \n", + "- In the final part of the notebook we will hop on to a different concept - **loops**. These are closely connected to the topic of lists (and for example retrieval from lists). If the list is *very* long it might become unfeasible to retrieve elements from it manually. We will need loops for this.\n", + "\n", + "Please note that in this notebook you will already see data being imported. To understand what these imports of libraries are (with all the functions and commands) is not yet a required knowledge. Try to follow only the examples which are shown.\n", + "***" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 1. Lists\n", + "\n", + "From last chapter we have worked with the table below:\n", + "\n", + "\n", + "| Track_name | Price | Currency | Rating_count_total | User_rating|\n", + "|------------|:------:|----------:|---------------------:|-----------:|\n", + "| Facebook | 0.0 | USD | 2974676 | 3.5|\n", + "| Instagram | 0.0 | USD |2161558 |4.5|\n", + "| Clash of Clans | 0.0| USD | 2130805 |4.5|\n", + "| Temple Run | 0.0 | USD |1724546 |4.5|\n", + "| Pandora - Music & Radio | 0.0| USD | 1126879 |4.5|\n", + "\n", + "Data Source: [Mobile App Store Data Set (Ramanathan Perumal)](https://www.kaggle.com/ramamet4/app-store-apple-data-set-10k-apps)

" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "There are 5 rows and 5 columns in this table. Each value in this table is called a **data point**. For example in the first row, we have five data points and they are:\n", + "\n", + "- Facebook\n", + "- 0.0\n", + "- USA\n", + "- 2974676\n", + "- 3.5" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "When we have a collection of data points it is called a **data set**. We can understand the table above as a collection of data points, so we can call it the entire table a data set as well. We see that the data set has five rows and five columns. \n", + "\n", + "When we want to work with data sets in the computer, we need to store them properly in the computer memory, so we can retrieve and manipulate the data points according to our needs. To store each data point in the computer, we can for instance take what we have learned so far and do it this way:" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "track_name_row1 = 'Facebook'\n", + "price_row1 = 0.0\n", + "currrency_row1 = 'USD'\n", + "rating_count_total_row1 = 2974676\n", + "user_rating_row1 = 3.5" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**To enter each data point manually in the data set like we did above would involve a lot of labor and nearly impossible for a big data set. Fortunately, we can store data in another more efficient way by using lists.** See example below:" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['Facebook', 0.0, 'USD', 2974676, 3.5]\n" + ] + }, + { + "data": { + "text/plain": [ + "list" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "row_one = ['Facebook', 0.0, 'USD', 2974676, 3.5]\n", + "print(row_one)\n", + "type(row_one)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "How did we create the list above? \n", + "\n", + "1. Enter a sequence of data points that we want to include in our data set and **separated each with a comma**: 'Facebook', 0.0, 'USD', 2974676, 3.5\n", + "2. Use **brackets for surrounding** the sequence of data points\n", + "\n", + "After we created the list, the list is stored in the computer's memory by assignment to the variable name row_one. " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 1.3.1\n", + "1. Store the second row as a list in a variable named `row_two`.\n", + "2. Store the third row as a list in a variable named `row_three`.\n", + "3. Print out `row_two` and `row_three`." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "| Track_name | Price | Currency | Rating_count_total | User_rating|\n", + "|------------|:------:|----------:|---------------------:|-----------:|\n", + "| Facebook | 0.0 | USD | 2974676 | 3.5|\n", + "| Instagram | 0.0 | USD |2161558 |4.5|\n", + "| Clash of Clans | 0.0| USD | 2130805 |4.5|\n", + "| Temple Run | 0.0 | USD |1724546 |4.5|\n", + "| Pandora - Music & Radio | 0.0| USD | 1126879 |4.5|" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['Instagram', 0.0, 'USD', 2161558, 4.5]\n", + "['Clash of Clans', 0.0, 'USD', 2130805, 4.5]\n" + ] + } + ], + "source": [ + "# Start your code below:\n", + "row_two = [\"Instagram\", 0.0, \"USD\",2161558, 4.5]\n", + "row_three = [\"Clash of Clans\", 0.0, \"USD\", 2130805, 4.5]\n", + "print(row_two)\n", + "print(row_three)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "A list can contain both - mixed and identical data types.\n", + "\n", + "For example, a list that contains only integers look like this: [ 1, 2, 3]. And a mixed data type list looks like the one we created above: ['Facebbok', 0.0, 'USD', 2974676, 3.5]. In this list, we have:\n", + "- Two strings ('Facebook', 'USD')\n", + "- Two floats (0.0, 3.5)\n", + "- One integer (2974676)\n", + "\n", + "In order to find out the **length of a list, we can use the `len()` command**. \n", + "The row_one list for example, has five data points." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "5\n", + "3\n", + "0\n" + ] + } + ], + "source": [ + "row_one = ['Facebook', 0.0, 'USD', 2974676, 3.5]\n", + "print(len(row_one))\n", + "\n", + "list_a = [1,2,3]\n", + "print(len(list_a))\n", + "\n", + "list_b=[]\n", + "print(len(list_b))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 2. Indexing a List\n", + "\n", + "**Each data point or element in the list has a specific index number (position) associated with it**. In Python, the indexing always starts with 0. For example, the first element always has the index number 0, and the second element always has the index number 1, and so on.\n", + "\n", + "To find the index of an element in the list, simply count the position of the index and then minus one. For example, the user rating is the 5th element in the list and it has an index number of 4 (5 - 1 = 4).\n", + "\n", + "*Note: Please really write this down - the indexing in Python starts at 0.*" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "3.5\n" + ] + } + ], + "source": [ + "row_one = ['Facebook', 0.0, 'USD', 2974676, 3.5]\n", + "print(row_one[4])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now we see, the index number can help us retrieve individual elements from a list. So how do we retrieve the first element? We can enter the list name and then wrap around the index number in a bracket. The general formula follows the model: **list_name[index_number]** . To retrieve each element from the list is useful when we want to perform operations between the elements. For example, we can find out the average and difference between Facebook and Instagram' ratings by doing this: " + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "1.0\n", + "4.0\n" + ] + } + ], + "source": [ + "row_one = ['Facebook', 0.0, 'USD', 2974676, 3.5]\n", + "row_two = ['Instagram',0.0, 'USD', 2161558, 4.5]\n", + "\n", + "difference_in_rating = row_two[4] - row_one[4]\n", + "average_rating = (row_one[4] + row_two[4])/2\n", + "\n", + "print(difference_in_rating)\n", + "print(average_rating)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 1.3.2\n", + "\n", + "In the code editor below, you can see the lists for the first three rows from the table. Retrieve the fourth element from each list, which represents the rating each app has received, and find the average value of the retrieved numbers.\n", + "\n", + "1. Assign the fourth element from the list ``row_one`` to a variable named ``ratings_one``. Don't forget that the indexing starts at 0.
\n", + "2. Repeat the same step for the fourth element from the list ``row_two``, to a variable named ``ratings_two``.
\n", + "3. Repeat the same step for for the fourth element from the list ``row_three``, to a variable named ``ratings_three``.
\n", + "4. Add the three numbers from above steps together and save the value to a variable named ``total_rating``.\n", + "5. Divide the ``total_rating`` by 3 to get the average number of ratings for the first three rows. Assign the final result to a variable named ``average_rating``.\n" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "12.5\n", + "4.166666666666667\n" + ] + } + ], + "source": [ + "row_one = ['Facebook', 0.0, 'USD', 2974676, 3.5]\n", + "row_two = ['Instagram', 0.0, 'USD', 2161558, 4.5]\n", + "row_three = ['Clash of Clans', 0.0, 'USD', 2130805, 4.5]\n", + "\n", + "# Start your code below:\n", + "rating_one = row_one[4]\n", + "rating_two = row_two[4]\n", + "rating_three = row_three[4]\n", + "total_rating = rating_one + rating_two + rating_three\n", + "average_rating = total_rating/3\n", + "\n", + "print(total_rating)\n", + "print(average_rating)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 3. Negative Indexing\n", + "\n", + "There are two indexing systems for lists in Python.\n", + "- Positive indexing: the one we have encountered so far starting with the first element having the index number 0 and the second element having the index number 1, and so on.\n", + "- Negative indexing: starting with the **last element** having the index number -1, the second to last element having the index number -2, and so on.\n", + "\n", + "Positive indexing is often put into practice in the day to day programming. However, negative indexing can also come in handy when we want to select the last element of a list, especially when this list is long and we have no idea how many elements are in this list." + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "3.5\n", + "3.5\n" + ] + } + ], + "source": [ + "row_one = ['Facebook', 0.0, 'USD', 2974676, 3.5]\n", + "\n", + "print(row_one[-1])\n", + "print(row_one[4])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "See that the code above, indexing number -1 and 4 retrieve the same result. \n", + "Pay attention: if we try to use an index number that is outside the range of the two indexing systems that are mentioned above, we'll get the following error:" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 1.3.3\n", + "\n", + "The last element in each list represents the rating of each app.\n", + "\n", + "1. Retrieve the ratings for the first three rows (like what you have done in task 2), and then find the average of all the ratings retrieved and print it to the screen.\n", + "\n", + "Try to use the negative indexing system." + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "4.166666666666667\n" + ] + } + ], + "source": [ + "row_1 = ['Facebook', 0.0, 'USD', 2974676, 3.5]\n", + "row_2 = ['Instagram', 0.0, 'USD', 2161558, 4.5]\n", + "row_3 = ['Clash of Clans', 0.0, 'USD', 2130805, 4.5]\n", + "\n", + "##Your task starts here:\n", + "rating_one = row_1[-1]\n", + "rating_two = row_2[-1]\n", + "rating_three = row_3[-1]\n", + "average_rating = (rating_one+rating_two+rating_three)/3\n", + "print(average_rating)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 4. Retrieving Multiple List Elements\n", + "There are occasions where we are asked to retrieve more than just one element from a list. \n", + "Take the list we have already worked with before: ['Facebook', 0.0, 'USD', 2974676, 3.5], and we're interested in knowing only the name of the app and the data about ratings (the number of ratings and the rating). Take what we have learned so far, we can do it as the following:" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [], + "source": [ + "row_one = ['Facebook', 0.0, 'USD', 2974676, 3.5]\n", + "app_name = row_one[0]\n", + "rating_count_total = row_one[3]\n", + "rating = row_one[-1] # or rating = row_one[4] \n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "It will be very inefficient if we try to do this for every app in the data table and make our code unnecessarily lengthy and hard to keep track of. \n", + "Alternatively we can store all the data we want to keep track of in a separate list like this:" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['Facebook', 2974676, 3.5]\n" + ] + } + ], + "source": [ + "row_one = ['Facebook', 0.0, 'USD', 2974676, 3.5]\n", + "\n", + "fb_rating = [row_one[0], row_one[3], row_one[-1]]\n", + "print(fb_rating)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In the code above we have successfully abstracted all the information we needed from the list into a separate list." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 1.3.4\n", + "\n", + "1. Abstract the rating data for Facebook, Instagram, Pandora - Music & Radio into separate lists. Each list should contain information like: the name of the app, the total rating count, and the user rating. Don't forget the positive index system begins with indexing number 0.\n", + " - For Facebook, assign the list to a variable called `fb_rating_data`\n", + " - For Instagram, assign the list to a variable called `insta_rating_data`\n", + " - For Pandora - Music & Radio, assign the list to a variable called `pan_rating_data`\n", + "\n", + "\n", + "2. Compute the average user rating for Instagram, and Pandora — Music & Radio using the data you just created ``fb_rating_data``, ``insta_rating_data``, and ``pandora_rating_data``.\n", + " - Sum up all the ratings together and compute the average rating.\n", + " - Assign the result to a variable named `avg_rating`." + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "4.5\n" + ] + } + ], + "source": [ + "row_one = ['Facebook', 0.0, 'USD', 2974676, 3.5]\n", + "row_two = ['Instagram', 0.0, 'USD', 2161558, 4.5]\n", + "row_three = ['Clash of Clans', 0.0, 'USD', 2130805, 4.5]\n", + "row_four = ['Temple Run', 0.0, 'USD', 1724546, 4.5]\n", + "row_five = ['Pandora - Music & Radio', 0.0, 'USD', 1126879, 4.0]\n", + "\n", + "# Start your code below:\n", + "fb_rating_data = [row_one[0], row_one[-2], row_one[-1]]\n", + "insta_rating_data = [row_two[0], row_two[-2], row_two[-1]]\n", + "pan_rating_data = [row_three[0], row_three[-2], row_three[-1]]\n", + "\n", + "avg_rating = (insta_rating_data[1]*insta_rating_data[-1]+pan_rating_data[1]*pan_rating_data[-1])/(insta_rating_data[1]+pan_rating_data[1])\n", + "print(avg_rating)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 5. List Slicing (IMPORTANT)\n", + "\n", + "In the previous exercise, we retrieved the first, fourth, and the last element and made them into a separate list.\n", + "We can also retrieve the first three elements from the list and create a separate pricing data list.\n", + "\n", + "For example:" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['Clash of Clans', 0.0, 'USD']\n" + ] + } + ], + "source": [ + "row_three = ['Clash of Clans', 0.0, 'USD', 2130805, 4.5]\n", + "\n", + "clash_pricing_data = [row_three[0], row_three[1], row_three[2]]\n", + "print(clash_pricing_data)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "However, there is a shortcut in selecting the first three elements like this:" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['Clash of Clans', 0.0, 'USD']\n" + ] + } + ], + "source": [ + "row_three = ['Clash of Clans', 0.0, 'USD', 2130805, 4.5]\n", + "\n", + "clash_pricing_data = row_three[0:3] #This is also known as the syntax shortcut\n", + "print(clash_pricing_data)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "As shown in the code, if we want to select the first n elements from a list called list_one, we can use the syntax shortcut list_one[0:n]. \n", + "In the example above, we have selected the first three elements from the list called row_three, so we have used:row_3[0:3] .\n", + "The process of selecting a particular part of a list is known as list slicing.\n", + "\n", + "In order to retrieve any list slice we want, we need to:\n", + "1. Identify the first and last element of the slice.\n", + "2. Identify the index numbers of the first and last element of the slice.\n", + "3. We can then retrieve the list slice we want by using the syntax we just mentioned above like: list_one[m:n], where:\n", + " - m is the index number of the first element of the slice\n", + " - n is the index number of the last element of the slice plus one . (That means if the last element has the index number 5, then n will be 6, and if the last element has the index number 10, then n will be 11, and so on)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "There is an even simpler syntax shortcuts when we want to select the first or last n elements (n stands for a number):\n", + "- list_one[:n]: when we want to select the first n elements\n", + "- list_one[-n:]: when we want to select the last n elements" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['Clash of Clans', 0.0, 'USD']\n", + "['USD', 2130805, 4.5]\n" + ] + } + ], + "source": [ + "row_three = ['Clash of Clans', 0.0, 'USD', 2130805, 4.5]\n", + "\n", + "first_3 = row_three[:3] #select the first 3 elements\n", + "last_3 = row_three[-3:] #select the last 3 elements\n", + "\n", + "print(first_3)\n", + "print(last_3)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 1.3.5\n", + "\n", + "1. Select the first four elements from row_one using the list slicing syntax shortcut and assign the result to a variable named first_four_elem_fb.\n", + "2. Select the last two elements from row_one using the list slicing syntax shortcut and assign the result to a variable named last_two_elem_fb.\n", + "3. For row_5, select the list slice [ 0.0, 'USD', 1126879] using the list slicing syntax shortcut and assign the result to a variable named pan_2_3_4" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['Facebook', 0.0, 'USD', 2974676]\n", + "[2974676, 3.5]\n", + "[0.0, 'USD', 1126879]\n" + ] + } + ], + "source": [ + "row_one = ['Facebook', 0.0, 'USD', 2974676, 3.5]\n", + "row_two = ['Instagram', 0.0, 'USD', 2161558, 4.5]\n", + "row_three = ['Clash of Clans', 0.0, 'USD', 2130805, 4.5]\n", + "row_four = ['Temple Run', 0.0, 'USD', 1724546, 4.5]\n", + "row_five = ['Pandora - Music & Radio', 0.0, 'USD', 1126879, 4.0]\n", + "\n", + "\n", + "# Start your code below:\n", + "first_four_elem_fb = row_one[:4]\n", + "last_two_elem_fb = row_one[-2:]\n", + "pan_2_3_4 = row_five[1:4]\n", + "\n", + "print(first_four_elem_fb)\n", + "print(last_two_elem_fb)\n", + "print(pan_2_3_4)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 6. List of Lists\n", + "So far we have only worked with a data set with a small scale (only five rows!) and we have stored each row as a list in a seprate variable like row_one, row_two, row_three, row_four, row_five. However, if we had a data set with more than 10,000 rows, then we'd have ended up with 10,000 more variables which is unrealistic and redundant.\n", + "\n", + "To solve this problem, we can store all five lists in one single variable like this:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "row_one = ['Facebook', 0.0, 'USD', 2974676, 3.5]\n", + "row_two = ['Instagram', 0.0, 'USD', 2161558, 4.5]\n", + "row_three = ['Clash of Clans', 0.0, 'USD', 2130805, 4.5]\n", + "row_four = ['Temple Run', 0.0, 'USD', 1724546, 4.5]\n", + "row_five = ['Pandora - Music & Radio', 0.0, 'USD', 1126879, 4.0]\n", + "\n", + "data_set = [row_one, row_two, row_three, row_four, row_five]\n", + "data_set" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can see that now the variable data_set contains all five lists (row_one, row_two, row_three, row_four, row_five). Such list that contains other lists is called a list of lists .\n", + "\n", + "The data_set is declared as a list, so we can retrieve the individual list elements and perform list slicing with what we have learned in the previous chapter." + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['Facebook', 0.0, 'USD', 2974676, 3.5]\n", + "['Pandora - Music & Radio', 0.0, 'USD', 1126879, 4.0]\n", + "[['Facebook', 0.0, 'USD', 2974676, 3.5], ['Instagram', 0.0, 'USD', 2161558, 4.5]]\n" + ] + } + ], + "source": [ + "data_set = [row_one, row_two, row_three, row_four, row_five]\n", + "\n", + "#To retrieve the first element\n", + "print(data_set[0])\n", + "\n", + "#To retrieve the last element\n", + "print(data_set[-1])\n", + "\n", + "#To retrieve the first two list elements \n", + "print(data_set[:2])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "There are also cases where we need to retrieve individual elements from a list that's part of a list of lists — for instance, we may want to retrieve the value 'Facebook' from ['Facebook', 0.0, 'USD', 2974676, 3.5], which is now part of the data_set list of lists." + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['Facebook', 0.0, 'USD', 2974676, 3.5]\n", + "Facebook\n" + ] + } + ], + "source": [ + "data_set = [row_one, row_two, row_three, row_four, row_five]\n", + "\n", + "#We can retrieve row_one and assign it to a variable like this:\n", + "fb_list = data_set[0]\n", + "\n", + "#To print out the facebook list data\n", + "print(fb_list)\n", + "\n", + "#To retrieve the first element from fb_list\n", + "app_name = fb_list[0]\n", + "\n", + "#Print the result of app_name\n", + "print(app_name)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In the code above, we have retrieved the first element in two steps: we first retrieved data_set[0], and then we retrieved fb_row[0].\n", + "There is a much simpler way to retrieve the value 'Facebook' by chaining the two indices ([0] and [0])\n", + "Try for example data_set[0][0] will give you the same output." + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Facebook\n" + ] + } + ], + "source": [ + "data_set = [row_one, row_two, row_three, row_four, row_five]\n", + "\n", + "print(data_set[0] [0])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 1.3.6\n", + "\n", + "\n", + "1. In the code editor below please group together the five lists into a ``list of lists`` named ``app_data_set``.\n", + "2. Compute the average rating of the apps by retrieving the right data points from the ``app_data_set`` list of lists.\n", + " - The user rating is always the last element of each row. Sum up the ratings and then divide by the number of ratings to get the average.\n", + " - Assign the result to a variable named ``average_rating``.\n" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "4.2\n" + ] + } + ], + "source": [ + "row_1 = ['Facebook', 0.0, 'USD', 2974676, 3.5]\n", + "row_2 = ['Instagram', 0.0, 'USD', 2161558, 4.5]\n", + "row_3 = ['Clash of Clans', 0.0, 'USD', 2130805, 4.5]\n", + "row_4 = ['Temple Run', 0.0, 'USD', 1724546, 4.5]\n", + "row_5 = ['Pandora - Music & Radio', 0.0, 'USD', 1126879, 4.0]\n", + "\n", + "\n", + "# Start your code below:\n", + "iCount = 0\n", + "sum_rating = 0\n", + "app_data_set = [row_1,row_2,row_3,row_4,row_5]\n", + "for row in app_data_set:\n", + " sum_rating += row[-1]\n", + " iCount +=1\n", + "\n", + "avarage_rating = sum_rating/iCount\n", + "print(avarage_rating)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 7. Opening a File (OPTIONAL)\n", + "\n", + "The data set we've been working with so far is an small snippet from a much larger data set from Kaggle. See data source: [Mobile App Store Data Set (Ramanathan Perumal)](https://www.kaggle.com/ramamet4/app-store-apple-data-set-10k-apps). \n", + "The data set contains 7,197 rows and 16 columns, which amounts to 115,152 (7,197 16) data points, it would be impossible to type all the data points manually into our computer and have them saved in the computer memory. However, we can always download a file and open it in our computer by using the `open()` command. For example if we have a file saved in the computer called \"AppleStore.csv\", we could open it like this:\n", + "\n", + "*my_file = open('AppleStore.csv')*\n", + "\n", + "Once we've opened the file we can read it in using a command called `reader()`.We need to import the `reader()` command from the csv module using the code: from csv import reader (a **module is a collection of commands and variables**). Then we can transform the file into a list of lists using the `list()` command like. The entire process looks like this:" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[['', 'id', 'track_name', 'size_bytes', 'currency', 'price', 'rating_count_tot', 'rating_count_ver', 'user_rating', 'user_rating_ver', 'ver', 'cont_rating', 'prime_genre', 'sup_devices.num', 'ipadSc_urls.num', 'lang.num', 'vpp_lic'], ['1', '281656475', 'PAC-MAN Premium', '100788224', 'USD', '3.99', '21292', '26', '4', '4.5', '6.3.5', '4+', 'Games', '38', '5', '10', '1'], ['2', '281796108', 'Evernote - stay organized', '158578688', 'USD', '0', '161065', '26', '4', '3.5', '8.2.2', '4+', 'Productivity', '37', '5', '23', '1'], ['3', '281940292', 'WeatherBug - Local Weather, Radar, Maps, Alerts', '100524032', 'USD', '0', '188583', '2822', '3.5', '4.5', '5.0.0', '4+', 'Weather', '37', '5', '3', '1'], ['4', '282614216', 'eBay: Best App to Buy, Sell, Save! Online Shopping', '128512000', 'USD', '0', '262241', '649', '4', '4.5', '5.10.0', '12+', 'Shopping', '37', '5', '9', '1']]\n" + ] + }, + { + "data": { + "text/plain": [ + "7198" + ] + }, + "execution_count": 34, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import os\n", + "os.chdir(\"C:/Users/andre/Documents/UNI/Master_Digital_Humanities/S1_WS2023/UE_Introduction_to_DH_Tools_and_Methods/\")\n", + "my_file = open('AppleStore.csv', encoding='utf8')\n", + "\n", + "from csv import reader\n", + "read_file = reader(my_file)\n", + "apps_data = list(read_file)\n", + "\n", + "#To print out the first five rows of apps_data\n", + "print(apps_data[:5])\n", + "\n", + "#To find out the length of our data set\n", + "len(apps_data)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 7.1. Dealing with files with the context manager\n", + "We started to open CSV files. We did so using a very simplified snippet of code, which would not be the case in professional code. Normally we work with a context manager with \n", + "The Python with statement creates a runtime context that allows you to run a group of statements under the control of a context manager. In case of opening files, the with closes them automatically for us at the end of the block.\n", + "\n", + "Each file should be closed once we finished the work - that will release resources back to OS. It is not necessary in case of few files (such as in these training notebooks), but the best practices is to do so everytime. It will prevent many possible problems in your future career as Data Scientist. We can use two following ways:" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[['', 'id', 'track_name', 'size_bytes', 'currency', 'price', 'rating_count_tot', 'rating_count_ver', 'user_rating', 'user_rating_ver', 'ver', 'cont_rating', 'prime_genre', 'sup_devices.num', 'ipadSc_urls.num', 'lang.num', 'vpp_lic'], ['1', '281656475', 'PAC-MAN Premium', '100788224', 'USD', '3.99', '21292', '26', '4', '4.5', '6.3.5', '4+', 'Games', '38', '5', '10', '1'], ['2', '281796108', 'Evernote - stay organized', '158578688', 'USD', '0', '161065', '26', '4', '3.5', '8.2.2', '4+', 'Productivity', '37', '5', '23', '1'], ['3', '281940292', 'WeatherBug - Local Weather, Radar, Maps, Alerts', '100524032', 'USD', '0', '188583', '2822', '3.5', '4.5', '5.0.0', '4+', 'Weather', '37', '5', '3', '1'], ['4', '282614216', 'eBay: Best App to Buy, Sell, Save! Online Shopping', '128512000', 'USD', '0', '262241', '649', '4', '4.5', '5.10.0', '12+', 'Shopping', '37', '5', '9', '1']]\n", + "*** Second way to do it ***\n", + "[['', 'id', 'track_name', 'size_bytes', 'currency', 'price', 'rating_count_tot', 'rating_count_ver', 'user_rating', 'user_rating_ver', 'ver', 'cont_rating', 'prime_genre', 'sup_devices.num', 'ipadSc_urls.num', 'lang.num', 'vpp_lic'], ['1', '281656475', 'PAC-MAN Premium', '100788224', 'USD', '3.99', '21292', '26', '4', '4.5', '6.3.5', '4+', 'Games', '38', '5', '10', '1'], ['2', '281796108', 'Evernote - stay organized', '158578688', 'USD', '0', '161065', '26', '4', '3.5', '8.2.2', '4+', 'Productivity', '37', '5', '23', '1'], ['3', '281940292', 'WeatherBug - Local Weather, Radar, Maps, Alerts', '100524032', 'USD', '0', '188583', '2822', '3.5', '4.5', '5.0.0', '4+', 'Weather', '37', '5', '3', '1'], ['4', '282614216', 'eBay: Best App to Buy, Sell, Save! Online Shopping', '128512000', 'USD', '0', '262241', '649', '4', '4.5', '5.10.0', '12+', 'Shopping', '37', '5', '9', '1']]\n" + ] + } + ], + "source": [ + "# context manager\n", + "with open('AppleStore.csv', encoding='utf8') as my_file: \n", + " from csv import reader\n", + " read_file = reader(my_file)\n", + " apps_data = list(read_file)\n", + "\n", + " #To print out the first five rows of apps_data\n", + " print(apps_data[:5])\n", + "\n", + " #To find out the length of our data set\n", + " len(apps_data)\n", + "\n", + " \n", + "# or a more classical approach \n", + "print(\"*** Second way to do it ***\")\n", + "my_file_2 = open('AppleStore.csv', encoding='utf8')\n", + "read_file = reader(my_file_2)\n", + "apps_data = list(read_file)\n", + "print(apps_data[:5])\n", + "len(apps_data)\n", + "\n", + "# closing resources\n", + "my_file_2.close() " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 8. Repetitive Processes\n", + "\n", + "In the previous task, we have retrieved ratings manually. However, try to retrieve 7,197 ratings manually is literally impractical because it takes a lot of time. How can we find a way that retrieve all 7,197 ratings in just a couple seconds? Luckily, Python offers us an easy way to repeat a process. Let's look at the following example:" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "3\n", + "10\n", + "2\n", + "6\n", + "8\n", + "1\n" + ] + } + ], + "source": [ + "ratings = [3, 10, 2, 6, 8, 1]\n", + "\n", + "for element in ratings:\n", + " print(element)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Do you remember the first example we had above? Where we wanted to retrieve the last element for each list in app_data_set. We can translate this process using the for loop in Python, like this:" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "3.5\n", + "4.5\n", + "4.5\n", + "4.5\n", + "4.0\n" + ] + } + ], + "source": [ + "app_data_set = [row_one, row_two, row_three, row_four, row_five]\n", + "\n", + "for each_list in app_data_set:\n", + " rating = each_list[-1]\n", + " print(rating)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The code above takes each list element from app_data_set, or isolates, and assigns it to ``each_list`` (which basically becomes a variable that stores a list). See example below, how each element in the ``app_data_set`` is taken out (or isolated) and got printed onto the screen:" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['Facebook', 0.0, 'USD', 2974676, 3.5]\n", + "['Instagram', 0.0, 'USD', 2161558, 4.5]\n", + "['Clash of Clans', 0.0, 'USD', 2130805, 4.5]\n", + "['Temple Run', 0.0, 'USD', 1724546, 4.5]\n", + "['Pandora - Music & Radio', 0.0, 'USD', 1126879, 4.0]\n" + ] + } + ], + "source": [ + "app_data_set = [row_one, row_two, row_three, row_four, row_five]\n", + "\n", + "for each_list in app_data_set:\n", + " print(each_list)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To make it more understandable, it basically does the following:" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['Facebook', 0.0, 'USD', 2974676, 3.5]\n", + "['Instagram', 0.0, 'USD', 2161558, 4.5]\n", + "['Clash of Clans', 0.0, 'USD', 2130805, 4.5]\n", + "['Temple Run', 0.0, 'USD', 1724546, 4.5]\n", + "['Pandora - Music & Radio', 0.0, 'USD', 1126879, 4.0]\n" + ] + } + ], + "source": [ + "app_data_set = [row_one, row_two, row_three, row_four, row_five]\n", + "\n", + "print(app_data_set[0])\n", + "print(app_data_set[1])\n", + "print(app_data_set[2])\n", + "print(app_data_set[3])\n", + "print(app_data_set[4])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "With the for loop technique, it requires us to write only two lines of code regardless of the number of rows in the data set, even if the data set has couple millions rows :)\n", + "\n", + "One thing to pay attention, do not forget to **indent** the code after the for line. To indent means to use for example TAB at the beginning of next line if your editor does not do it automatically for you." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 1.3.8: \n", + "Use the new technique we've learned to print all the rows in the app_data_set list of lists." + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['Facebook', 0.0, 'USD', 2974676, 3.5]\n", + "['Instagram', 0.0, 'USD', 2161558, 4.5]\n", + "['Clash of Clans', 0.0, 'USD', 2130805, 4.5]\n", + "['Temple Run', 0.0, 'USD', 1724546, 4.5]\n", + "['Pandora - Music & Radio', 0.0, 'USD', 1126879, 4.0]\n" + ] + } + ], + "source": [ + "row_1 = ['Facebook', 0.0, 'USD', 2974676, 3.5]\n", + "row_2 = ['Instagram', 0.0, 'USD', 2161558, 4.5]\n", + "row_3 = ['Clash of Clans', 0.0, 'USD', 2130805, 4.5]\n", + "row_4 = ['Temple Run', 0.0, 'USD', 1724546, 4.5]\n", + "row_5 = ['Pandora - Music & Radio', 0.0, 'USD', 1126879, 4.0]\n", + "\n", + "app_data_set = [row_1, row_2, row_3, row_4, row_5]\n", + "\n", + "# Start your code below:\n", + "for row in app_data_set:\n", + " print(row)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 9. For Loops\n", + "\n", + "What we just learned above is called for loop as we have already mentioned.\n", + "\n", + "There are three structural parts in a for loop :\n", + "1. iteration variable\n", + "2. iterable variable\n", + "3. the body of the for loop" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "1\n", + "0\n", + "2\n", + "1\n", + "3\n", + "2\n" + ] + } + ], + "source": [ + "a_list = [1, 2, 3]\n", + "\n", + "for value in a_list:\n", + " print(value)\n", + " print(value - 1)\n", + "\n", + "# value - is the iteration variable\n", + "# a_list - is the iterable variable\n", + "# print(value) & print(value - 1) - belong to the body of the loop\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The indented code in the body gets executed the same number of times as elements in the iterable variable. If the iterable variable is a list that has three elements, the indented code in the body gets executed three times. We call each code execution an iteration, so there'll be three iterations for a list that has three elements. For each iteration, the iteration variable will take a different value, following this pattern:\n", + "\n", + "- In the first iteration, the value is the first element of the iterable (we have the list [1, 2, 3] as the iterable, then the value will be 1).\n", + "- In the second iteration, the value is the second element of the iterable (we have the list [1, 2, 3] as the iterable, then the value will be 2).\n", + "- In the third iteration, the value is the third element of the iterable (we have the list [1, 2, 3] as the iterable, then the value will be 3).\n", + "\n", + "Do you know that the code outside the loop body can also interact with the code inside the loop body? Look at the following example:" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "1\n", + "3\n", + "6\n" + ] + } + ], + "source": [ + "a_list = [1, 2, 3]\n", + "\n", + "a_sum = 0 # a variable outside the loop body\n", + "\n", + "for value in a_list: # for every iteration of the loop\n", + " ######################Everything below is inside the loop body###################\n", + " \n", + " a_sum = a_sum + value # perform an addition between the current value \n", + " # of the iteration variable and the current value stored in a_sum, \n", + " # and assign the result of the addition back to a_sum\n", + " print(a_sum) # print the value of the a_sum variable\n", + " \n", + " ######################Everything above is inside the loop body###################\n", + " " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 1.3.9:\n", + "Compute the average app rating for the apps stored in the app_data_set variable.\n", + "\n", + "1. Initialize a variable named `rating_sum` with a value of zero outside the loop body.\n", + "2. Loop (iterate) over the app_data_set list of lists. For each of the five iterations of the loop (for each row in app_data_set):\n", + "3. Extract the rating of the app and store it to a variable named `rating`. The rating is the last element of each row.\n", + "4. Add the value stored in rating to the current value of the rating_sum.\n", + "5. Outside the loop body, divide the rating sum (stored in rating_sum) by the number of ratings to get an average value. Store the result in a variable named `avg_rating`.\n" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "4.2\n" + ] + } + ], + "source": [ + "row_1 = ['Facebook', 0.0, 'USD', 2974676, 3.5]\n", + "row_2 = ['Instagram', 0.0, 'USD', 2161558, 4.5]\n", + "row_3 = ['Clash of Clans', 0.0, 'USD', 2130805, 4.5]\n", + "row_4 = ['Temple Run', 0.0, 'USD', 1724546, 4.5]\n", + "row_5 = ['Pandora - Music & Radio', 0.0, 'USD', 1126879, 4.0]\n", + "\n", + "app_data_set = [row_1, row_2, row_3, row_4, row_5]\n", + "\n", + "rating_sum = 0\n", + "\n", + "for row in app_data_set:\n", + " rating = row[-1]\n", + " rating_sum += rating\n", + "\n", + "avg_rating = rating_sum/len(app_data_set)\n", + "\n", + "print(avg_rating)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.1" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/Exercises/EN/Basic/04_Conditional_Statements_NA.ipynb b/Exercises/EN/Basic/04_Conditional_Statements_NA.ipynb new file mode 100644 index 00000000..d5cf40be --- /dev/null +++ b/Exercises/EN/Basic/04_Conditional_Statements_NA.ipynb @@ -0,0 +1,1595 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## About This Notebook\n", + "\n", + "In this notebook we are going to dig into new topics. We will dig into logic and logical operators. In essence, when we code, we often want to control the *flow* of our code. For example, **IF** it is sunny, **THEN** go outside, **ELSE** stay inside. We are controlling the flow of what is happening with operators such as ``IF``, ``OR``, ``ELSE``. We are going to discuss these three operators in this notebook.\n", + "***" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 1. If Statements" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [], + "source": [ + "opened_file = open('AppleStore.csv', encoding='utf8')\n", + "\n", + "from csv import reader\n", + "read_file = reader(opened_file)\n", + "apps_data = list(read_file)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We have previously computed the average rating for all 7197 mobile apps. But there are more information for us to dig through. We might want to answer more granular questions like:\n", + "- What's the average rating of non-free apps?\n", + "- What's the average rating of free apps?\n", + "\n", + "In order to answer the two questions above, **we need to first separate free apps from non-free apps** and compute the average ratings just like we did in the previous chapter.\n", + "\n", + "Before we do the isolation of ratings for the free vs. non-free apps, let's quickly refresh your memory and see how we performed the `list_name.append()` command in the previous session.\n", + "See the code below:" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[3.5, 4.5, 4.5, 4.5, 4.0]\n" + ] + } + ], + "source": [ + "opened_file = open('AppleStore.csv', encoding='utf8')\n", + "from csv import reader\n", + "read_file = reader(opened_file)\n", + "apps_data = list(read_file)\n", + "\n", + "ratings = []\n", + "for row in apps_data[1:]:\n", + " rating = float(row[7])\n", + " ratings.append(rating)\n", + " \n", + "print(ratings[:5])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In the code above, there is a problem with the ratings list. It includes all the ratings for both free and non-free apps. How do we only extract the ratings of the free apps? We can therefore add a condition to our code above. \n", + "To differentiate free apps from non-free apps, free apps always have a price which is equal to 0.0. \n", + "\n", + "So if we implement a conditional statement where the price is equal to 0.0, then we will add this app to our ratings list. \n", + "\n", + "We can achieve this by using an if statement like below:" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "ratings = []\n", + "for row in apps_data[1:]: #we iterated over the apps_data[1:]\n", + " rating = float(row[7]) #Assign the rating as a float to a variable named rating.\n", + " price = float(row[4]) #Assign the price as a float to a variable named price.\n", + " \n", + " if price == 0.0: #If the price is equal to 0.0, that means this is a free app\n", + " ratings.append(rating)# we append the rating to the ratings list" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In the code above, we have learned about the basics of if statement.\n", + "- If statement starts with an if , and it ends with : (just like the for loop)\n", + "- We use the == operator to check whether the price is equal to 0.0. Pay attention that == is not the same with =. (= is a variable assignment operator)\n", + "- ratings.append(rating) will only be executed if the if statement is true." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 1.4.1:\n", + "Complete the code in the editor to find the average rating for free apps.\n", + "\n", + "1. Inside the for loop:\n", + "2. Assign the price of an app as a float to a variable named ``price``. The price is the fifth element in each row (don't forget that the index starts at 0).\n", + "3. If price == 0.0, append the value stored in rating to the free_apps_ratings list using the `list_name.append()` command (note the free_apps_ratings is already defined in the code editor). Be careful with indentation.\n", + "4. Outside the for loop body, compute the average rating of free apps. Assign the result to a variable named ``avg_rating_free``. The ratings are stored in the free_apps_ratings list. Hint: sum(...) / len(...)" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": {}, + "outputs": [], + "source": [ + "## Start your code below:\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 2. Booleans\n", + "\n", + "In the previous function, we have used if price == 0.0 to check whether price is equal to 0.0.\n", + "When we use the == operator to determine if two values are equal or not, the output returned will always be True or False." + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "True\n", + "False\n" + ] + } + ], + "source": [ + "print(10 == 10) #It's true that 10 is equal to 10\n", + "print(10 == 2) #It's false that 10 is equal to 2" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Do you know the type of True and False?\n", + "They are **booleans**." + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "bool" + ] + }, + "execution_count": 45, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "type(True)" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "bool" + ] + }, + "execution_count": 46, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "type(False)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Boolean values, which are True and False, are very important to any if statement.\n", + "An if statement must always be followed by one of the following:\n", + "\n", + "1. A Boolean value.\n", + "2. An expression that evaluates to a Boolean value.\n", + "\n", + "So it always has something to do with the Boolean value." + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "10\n" + ] + } + ], + "source": [ + "#1. A Boolean value.\n", + "\n", + "if True:\n", + " print(10)" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "10\n" + ] + } + ], + "source": [ + "#2. An expression that evaluates to a Boolean value.\n", + "if 10 == 10:\n", + " print(10)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Pay attention, if you evaluate the expression with just one ``=``, you will get an error like this:" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "metadata": {}, + "outputs": [ + { + "ename": "SyntaxError", + "evalue": "invalid syntax (, line 2)", + "output_type": "error", + "traceback": [ + "\u001b[0;36m File \u001b[0;32m\"\"\u001b[0;36m, line \u001b[0;32m2\u001b[0m\n\u001b[0;31m if 10 = 10:\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n" + ] + } + ], + "source": [ + "# = is not the same as ==, a SyntaxError will be thrown\n", + "if 10 = 10:\n", + " print(10)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The indented code is only executed when if is followed by True. The code body will no be executed if the if is followed by False. See the example below:" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "This boolean is true\n", + "The code above was not executed because \"if\" is followed by False\n" + ] + } + ], + "source": [ + "if True:\n", + " print('This boolean is true')\n", + "\n", + "if False:\n", + " print('This code will not be executed')\n", + "\n", + "if True:\n", + " print('The code above was not executed because \"if\" is followed by False')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Note that we can write as much code as we want after the if statement like this:" + ] + }, + { + "cell_type": "code", + "execution_count": 51, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "10\n", + "100\n", + "1000\n" + ] + } + ], + "source": [ + "if True:\n", + " print(10)\n", + " print(100)\n", + " print(1000)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 1.4.2:\n", + "\n", + "In the code editor, we've already initialized the variable price with a value of 0.\n", + "Write the code so it matches the following:\n", + "1. If price is equal to 0, the print the string 'This is free'\n", + "2. If price is equal to 1, the print the string 'This is not free'" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "metadata": {}, + "outputs": [], + "source": [ + "price = 0\n", + "\n", + "#start your code here:\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 3. The Average Rating of Non-free Apps\n", + "\n", + "In the diagram below, we created a list of lists named app_and_price, and we want to extract the names of the free apps in a separate list. To do that, we:" + ] + }, + { + "cell_type": "code", + "execution_count": 53, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['Facebook', 'Instagram', 'Temple Run']\n" + ] + } + ], + "source": [ + "app_and_price = [['Facebook', 0], ['Instagram', 0], ['Plants vs. Zombies', 0.99], \n", + " ['Minecraft: Pocket Edition', 6.99], ['Temple Run', 0],\n", + " ['Plague Inc', 0.99]]\n", + "\n", + "#create an empty list named free_apps\n", + "free_apps = []\n", + "\n", + "#iterate over app_and_price\n", + "for app in app_and_price: #for each iteration, we:\n", + " name = app[0] #extract the name of the app and assign it to name\n", + " price = app[1] # extract the price of the app and assign it to price \n", + " \n", + " if price == 0: #if the price of the app is equal to 0\n", + " free_apps.append(name) #append the name of the app to free_apps\n", + " \n", + "print(free_apps)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Do you remember a very similar example that we did at the beginning of this chapter?" + ] + }, + { + "cell_type": "code", + "execution_count": 54, + "metadata": {}, + "outputs": [], + "source": [ + "#Import data set\n", + "opened_file = open('AppleStore.csv', encoding='utf8')\n", + "from csv import reader\n", + "read_file = reader(opened_file)\n", + "apps_data = list(read_file)\n", + "\n", + "ratings = []\n", + "for row in apps_data[1:]: #we looped through a list of lists named apps_data\n", + " rating = float(row[7]) #extract the rating of the app and assign the rating as a float to a variable named rating.\n", + " price = float(row[4]) #extract the price of the app and assign the price as a float to a variable named price.\n", + " \n", + " if price == 0.0: #If the price is equal to 0.0, that means this is a free app\n", + " ratings.append(rating)# we append the rating to the ratings list" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "These two functions basically do the same task. To extract free apps from a mixed list of free and non-free apps.\n", + "\n", + "When we want to extract the free apps from the list, we used the condition \"if the price is equal to 0.0\" (if price == 0.0).\n", + "How do we extract the non-free apps then? The \"is not equal to\" operator comes in the place. What we have done so far is by using the \"is equal to\" operator which is just the same as \"==\". And if we want to extract the non-free apps, we can use the \"is not equal to\" operator which is just like this: !=.\n", + "Please example below:\n" + ] + }, + { + "cell_type": "code", + "execution_count": 55, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "True\n", + "False\n" + ] + } + ], + "source": [ + "print(10 != 0)\n", + "print(10 != 10)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "How can we use the \"!=\" operator for our price variable then? Please see the mini example mini:" + ] + }, + { + "cell_type": "code", + "execution_count": 56, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "True\n", + "False\n", + "Not free\n" + ] + } + ], + "source": [ + "price = 10\n", + "\n", + "print(price != 0)\n", + "print(price != 10)\n", + "\n", + "if price != 0:\n", + " print('Not free')\n", + " \n", + "if price != 10:\n", + " print('Price is not equal to 10')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 1.4.3 (OPTIONAL): \n", + "\n", + "Can you modify the code in the editor below to computer ``the average rating of non-free apps``?\n", + "\n", + "1. Change the name of the empty list from free_apps_ratings to non_free_apps_raings.\n", + "2. Change the conditional statement if price == 0.0 to extract the ratings of non-free apps.\n", + "3. Change free_apps_ratings.append(rating) and append to the new list non_free_apps_ratings.\n", + "4. Compute the average value by summing up the values in non_free_apps_ratings and dividing by the length of this list. Assign the result to ``avg_rating_non_free``.\n" + ] + }, + { + "cell_type": "code", + "execution_count": 58, + "metadata": {}, + "outputs": [], + "source": [ + "# INITIAL CODE\n", + "opened_file = open('AppleStore.csv', encoding='utf8')\n", + "from csv import reader\n", + "read_file = reader(opened_file)\n", + "apps_data = list(read_file)\n", + "\n", + "free_apps_ratings = []\n", + "for row in apps_data[1:]:\n", + " rating = float(row[7])\n", + " price = float(row[4]) \n", + " if price == 0.0:\n", + " free_apps_ratings.append(rating)\n", + " \n", + "avg_rating_free = sum(free_apps_ratings) / len(free_apps_ratings)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 4. The Average Rating of Gaming Apps\n", + "We have learned about the ``==`` and ``!=`` operators, and have only worked with integers and floats. Do you know we can use these two operators with other data types as well? " + ] + }, + { + "cell_type": "code", + "execution_count": 59, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "False\n", + "True\n" + ] + } + ], + "source": [ + "#operators with strings\n", + "print('Games' == 'Music')\n", + "print('Games' != 'Music')" + ] + }, + { + "cell_type": "code", + "execution_count": 60, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "True\n", + "False\n" + ] + } + ], + "source": [ + "#operators with lists\n", + "print([1,2,3] == [1,2,3])\n", + "print([1,2,3] == [1,2,3,4])\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "With such functionalities, we can answer more detailed questions about our data set like what's the average rating of gaming and non-gaming apps?\n", + "\n", + "We can see that from the data set that ``prime_genre`` column describes the app genre. If the app is a gaming app, the genre of the app will be encoded as 'Games'.\n", + "\n", + "To compute the average rating of gaming apps, we can use the same approach as we took in the previous screen when we computed the average rating of free and non-free apps." + ] + }, + { + "cell_type": "code", + "execution_count": 62, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "3.6850077679958573\n" + ] + } + ], + "source": [ + "games_ratings = [] #initialize an empty list named games_ratings\n", + "\n", + "for row in apps_data[1:]: \n", + " rating = float(row[7]) #extract the rating information and assign the rating to the variable rating\n", + " genre = row[11] #extract the genre information and assign the genre to the variable named genre\n", + " \n", + " if genre == 'Games': #if the genre is 'Games'\n", + " games_ratings.append(rating) # append the rating value stored in rating to the list games_ratings\n", + "\n", + "avg_ratings_games = sum(games_ratings) / len(games_ratings) #compute the average rating of gaming apps\n", + "print(avg_ratings_games)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 1.4.4:\n", + "With the code above, can you use the same techniques to compute the average rating of ``non-gaming apps``?" + ] + }, + { + "cell_type": "code", + "execution_count": 63, + "metadata": {}, + "outputs": [], + "source": [ + "#reading the dataset\n", + "opened_file = open('AppleStore.csv', encoding='utf8')\n", + "from csv import reader\n", + "read_file = reader(opened_file)\n", + "apps_data = list(read_file)\n", + "\n", + "#start your code here:\n", + "#Initialize an empty list named non_games_ratings.\n", + "\n", + "#Loop through the apps_data\n", + "\n", + "\n", + "#Compute the average rating of non-gaming apps\n", + "#and assign the result to a variable named avg_rating_non_games\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 5. Multiple Conditions\n", + "\n", + "So far, we've only worked with single conditions, like:\n", + "\n", + "- If price equals 0.0 (if price == 0)\n", + "- If genre equals \"Games\" (if genre == 'Games')\n", + "\n", + "However, single conditions won't help us answering some more complicated questions, like:\n", + "\n", + "- What's the average rating of free gaming apps?\n", + "- What's the average rating of non-free gaming apps?\n", + "- What's the average rating of free non-gaming apps?\n", + "- What's the average rating of non-free non-gaming apps?\n", + "\n", + "To solve this, do you know that we can combine two or more conditions together into a single ``if`` statement using the ``and `` keyword just like the English language." + ] + }, + { + "cell_type": "code", + "execution_count": 64, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "This is a free game!\n", + "True\n" + ] + } + ], + "source": [ + "app1_price = 0\n", + "app1_genre = 'Games'\n", + "\n", + "if app1_price == 0 and app1_genre == 'Games':\n", + " print('This is a free game!')\n", + " \n", + "print(app1_price == 0 and app1_genre == 'Games')" + ] + }, + { + "cell_type": "code", + "execution_count": 65, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "False\n" + ] + } + ], + "source": [ + "app1_price = 19\n", + "app1_genre = 'Games'\n", + "\n", + "if app1_price == 0 and app1_genre == 'Games':\n", + " print('This is a free game!')\n", + " \n", + "print(app1_price == 0 and app1_genre == 'Games')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Do you see that the code app1_price == 0 and app1_genre == 'Games' outputs a single Boolean value.\n", + "Python evaluate any combination of Booleans to a single boolean value.´:" + ] + }, + { + "cell_type": "code", + "execution_count": 66, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "True\n", + "False\n", + "False\n", + "False\n" + ] + } + ], + "source": [ + "print(True and True)\n", + "print(True and False)\n", + "print(False and True)\n", + "print(False and False)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "So the rule is, when we combine Booleans using ``and``, the end output ``True`` can only take place if expression within are all ``True``. If there is any ``False`` within, then the end output can only be ``False``. \n", + "\n", + "You might recall the ``truth table`` from your university class, exactly how the ``and`` operator functions in Python. It looks something like this:\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 6. The or Operator\n", + "\n", + "When we look at the prime_genre column we can see that there is the genre \"Social Networking\", and there is the genre \"Games\".\n", + "\n", + "As a data scientist, sometimes we might want to figure out the average rating of both categories. That means we need to isolate the ratings of all the apps whose genre is either \"Social Networking\" or \"Games\" into a separate list. And then calculate the average value in the way as have always done it.\n", + "\n", + "How do we isolate the ratings of these apps? This time, we can't use the and operator, so this time, we need an or operator. \n", + "Because it doesn't make any sense to use the and operator like this:\n", + "if genre == 'Social Networking' and genre == 'Games'\n", + "Each app has only one genre in the prime_genre column, **you won't have any apps with both social networking and games as its genre**.\n", + "This is where the ``or`` operator comes into place. Look at the code below:" + ] + }, + { + "cell_type": "code", + "execution_count": 71, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[0.0, 0.0, 0.0, 0.0, 0.0]\n" + ] + }, + { + "data": { + "text/plain": [ + "4029" + ] + }, + "execution_count": 71, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "games_social_ratings = []\n", + "\n", + "for row in apps_data[1:]:\n", + " ratings = float(row[7])\n", + " genre = row[11]\n", + " \n", + " if genre == 'Social Networking' or genre == 'Games':\n", + " games_social_ratings.append(rating)\n", + "\n", + "print(games_social_ratings[:5])\n", + "len(games_social_ratings)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Do know then know how or operator behaves in Python? See below:" + ] + }, + { + "cell_type": "code", + "execution_count": 72, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "True\n", + "True\n", + "True\n", + "False\n" + ] + } + ], + "source": [ + "#The OR operator\n", + "print(True or True)\n", + "print(True or False)\n", + "print(False or True)\n", + "print(False or False)" + ] + }, + { + "cell_type": "code", + "execution_count": 73, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "True\n", + "False\n", + "False\n", + "False\n" + ] + } + ], + "source": [ + "#The AND operator\n", + "print(True and True)\n", + "print(True and False)\n", + "print(False and True)\n", + "print(False and False)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You see that the ``AND`` and the ``OR`` operator behaves different. The OR operator will evaluate the statement to ``TRUE`` if any of the Booleans are ``True`` like this:" + ] + }, + { + "cell_type": "code", + "execution_count": 74, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "False\n", + "True\n" + ] + } + ], + "source": [ + "print(False or False or False)\n", + "print(False or False or False or True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Returning to our apps example, the condition if genre == 'Social Networking' or genre == 'Games' will only resolve to False when an app's genre is neither \"Social Networking\" nor \"Games.\" Otherwise, it will resolve to True." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 7. Combining Logical Operators\n", + "\n", + "In the previous exercise, the average rating of the apps whose genre is either \"Social Networking\" or \"Games.\" is computed. Now we can ask even more specific questions, like:\n", + "\n", + "What is the average rating of free apps whose genre is either \"Social Networking\" or \"Games\"?\n", + "What is the average rating of non-free apps whose genre is either \"Social Networking\" or \"Games\"?\n", + "\n", + "To answer the first question, we need to isolate the apps that:\n", + "\n", + "- Are in either the \"Social Networking\" or \"Games\" genre\n", + "- And have a price of 0.0\n", + "\n", + "To isolate these apps, we can combine or with and in a single if statement:\n" + ] + }, + { + "cell_type": "code", + "execution_count": 76, + "metadata": {}, + "outputs": [], + "source": [ + "free_games_social_ratings = []\n", + "\n", + "for row in apps_data[1:]:\n", + " rating = float(row[7])\n", + " genre = row[11]\n", + " price = float(row[4])\n", + " \n", + " if(genre == 'Social Networking' or genre == 'Games') and price == 0:\n", + " free_games_social_ratings.append(rating)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Notice that we enclosed the genre == 'Social Networking' or genre == 'Games' part within parentheses. This helps Python understand the specific logic we want for our if statement.\n", + "If the parentheses are not applied correctly, Python will lead us to unwanted results." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Pay attention that:\n", + "\n", + "````python\n", + "if(genre == 'Social Networking' or genre == 'Games') and price == 0:\n", + "\n", + "````\n", + "is not the same as\n", + "\n", + "````python\n", + "\n", + "if genre == 'Social Networking' or (genre == 'Games' and price == 0):\n", + "````" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now please observe the code below:" + ] + }, + { + "cell_type": "code", + "execution_count": 77, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "True\n", + "This gaming or social networking app is free!!\n" + ] + } + ], + "source": [ + "app_genre = 'Social Networking'\n", + "app_price = 100 #This is a non-free app\n", + "\n", + "print(True or False and False)\n", + "\n", + "if app_genre == 'Social Networking' or app_genre == 'Games' and app_price == 0:\n", + " print('This gaming or social networking app is free!!')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You see above that the code above has a logical error . We have printed 'This gaming or social networking app is free!!' for a non-free app. \n", + "\n", + "However, if we place the parentheses corretly, it would make a huge difference:" + ] + }, + { + "cell_type": "code", + "execution_count": 78, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "False\n" + ] + } + ], + "source": [ + "app_genre = 'Social Networking'\n", + "app_price = 100 #This is a non-free app\n", + "\n", + "print((True or False) and False)\n", + "\n", + "if (app_genre == 'Social Networking' or app_genre == 'Games') and app_price == 0:\n", + " print('This gaming or social networking app is free!!')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We see that now this expression is evaluated correctly. Now see the importance of using parentheses correctly. So make sure you place your parentheses correctly!" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 1.4.7:\n", + "\n", + "Compute the average rating of non-free apps whose genre is either ``Social Networking`` or ``Games``. Assign the result to a variable named ``avg_non_free``." + ] + }, + { + "cell_type": "code", + "execution_count": 79, + "metadata": {}, + "outputs": [], + "source": [ + "opened_file = open('AppleStore.csv', encoding='utf8')\n", + "from csv import reader\n", + "read_file = reader(opened_file)\n", + "apps_data = list(read_file)\n", + "\n", + "free_games_social_ratings = []\n", + "for row in apps_data[1:]:\n", + " rating = float(row[7])\n", + " genre = row[11]\n", + " price = float(row[4])\n", + " \n", + " if (genre == 'Social Networking' or genre == 'Games') and price == 0:\n", + " free_games_social_ratings.append(rating)\n", + " \n", + "avg_free = sum(free_games_social_ratings) / len(free_games_social_ratings)\n", + "\n", + "# Non-free apps (average)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 8. Comparison Operators\n", + "\n", + "Did you remember the equal to and non-equal to operators that we learned before? We used the == and != operators to check whether two values are equal or not. These two operators are called comparison operators.\n", + "\n", + "Please see the comparison operator table below:\n", + "\n", + "| Comparison (text) | Comparison operator | Comparison (code)| \n", + "|------------|:------:|----------:| \n", + "| A is equal to B| == | A==B |\n", + "| A is not equal to B | != | A !=B |\n", + "| A is greater than B | >| A > B |\n", + "| A is greater than or equal to B | >= | A >= B |\n", + "|A is less than B|<| A < B| \n", + "|A is less than or equal to B| < =| A <= B|\n", + "\n", + "How does it look when we put comparison operators into actual code?\n" + ] + }, + { + "cell_type": "code", + "execution_count": 80, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "True\n", + "False\n", + "True\n", + "False\n" + ] + } + ], + "source": [ + "print(10 > 2)\n", + "print( 10 < 2)\n", + "print (50 >=50)\n", + "print( 30 <=15)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Because the comparison operator will evaluate the expression and give us a single Boolean value as the final output, we can therefore also use such comparison operators inside the ``if`` statement. \n", + "Like this:" + ] + }, + { + "cell_type": "code", + "execution_count": 81, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "This app is expensive!\n", + "True\n" + ] + } + ], + "source": [ + "app_name = 'Ulysses'\n", + "app_price = 24.99\n", + "\n", + "if app_price > 20:\n", + " print('This app is expensive!')\n", + " \n", + "print(app_price > 20)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "These new comparison operators open up new possibilities for us to answer more granular questions about our data set like:\n", + "\n", + "- How many apps have a rating of 4 or greater?\n", + "- What is the average rating of the apps that have a price greater than 9 Dollars?\n", + "- How many apps have a price greater than 9 Dollars?\n", + "- How many apps have a price smaller than or equal to 9 Dollars?" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To answer the first question, we can write the code like this:\n" + ] + }, + { + "cell_type": "code", + "execution_count": 82, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "4781" + ] + }, + "execution_count": 82, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "apps_4_or_greater = [] #initialized an empty list named apps_4_or_greater\n", + "\n", + "for row in apps_data[1:]:\n", + " rating = float(row[7]) #Stored the rating value as a float to a variable named rating\n", + " if rating >= 4.0:\n", + " apps_4_or_greater.append(rating)\n", + " \n", + "len(apps_4_or_greater)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Alternatively, we do not have to use the ``append``." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "4781\n" + ] + } + ], + "source": [ + "n_of_apps = 0 #Initialized a variable n_of_apps with a value of 0\n", + "\n", + "for row in apps_data[1:]:\n", + " rating = float(row[7]) #Stored the rating value as a float to a variable named rating\n", + " if rating >= 4.0:\n", + " n_of_apps = n_of_apps + 1 #Incremented the value of n_of_apps by 1 \n", + " #if the value stored in rating was greater than or equal to 4.0\n", + " \n", + "print(n_of_apps)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 9. The else Clause\n", + "\n", + "Let's say we need to use information from the price column to label each app as ``free`` or ``non-free``. If the price is equal to ``0.0``, we want to label the app ``free``. Otherwise, we want to label it ``non-free``. To summarize this is Python language it's like this:" + ] + }, + { + "cell_type": "code", + "execution_count": 85, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[['GoodNotes', 19.99, 'non-free'], ['Amazon', 0.0, 'free'], ['Chrome', 0.0, 'free'], ['Snapchat', 0.0, 'free']]\n" + ] + } + ], + "source": [ + "apps_data = [['GoodNotes', 19.99], ['Amazon', 0.0], ['Chrome', 0.0], ['Snapchat', 0.0]]\n", + "\n", + "for app in apps_data:\n", + " price = app[1] #We saved the price value to a variable named price.\n", + " \n", + " if price == 0.0: #If price == 0.0\n", + " app.append('free') #we appended the string 'free' to the list app \n", + " if price != 0.0: #If price != 0.0\n", + " app.append('non-free') #we appended the string 'non-free' to the list \n", + " \n", + "print(apps_data)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "For each iteration, the computer evaluate two expressons: ``price == 0.0`` and ``price != 0.0``. But once we know that ``price == 0.0`` for an app, it's redundant to also check price != 0.0 for the same app — if we know that the price is ``0``, it doesn't make logical sense to also check whether the price is different than 0.\n", + "\n", + "In our small data set above, we have three free apps. The computer evaluated ``price == 0.0`` as ``True`` three times, and then checked whether ``price != 0.0`` for the same number of times. There are three **redundant** operations performed in this small dataset. \n", + "\n", + "However, if we have a data set with 5,000 free apps, we wouldn't want our computer to perform 5,000 redundant operations. This can be avoided using the if statement with an ``else`` clause:" + ] + }, + { + "cell_type": "code", + "execution_count": 86, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[['GoodNotes', 19.99, 'non-free'], ['Amazon', 0.0, 'free'], ['Chrome', 0.0, 'free'], ['Snapchat', 0.0, 'free']]\n" + ] + } + ], + "source": [ + "apps_data = [['GoodNotes', 19.99], ['Amazon', 0.0], ['Chrome', 0.0], ['Snapchat', 0.0]]\n", + "\n", + "for app in apps_data:\n", + " price = app[1] #We saved the price value to a variable named price.\n", + " \n", + " if price == 0.0: #If price == 0.0\n", + " app.append('free') #we appended the string 'free' to the list app \n", + " else: #If price is not 0.0,\n", + " app.append('non-free') #we appended the string 'non-free' to the list \n", + " \n", + "print(apps_data)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You see that the two chunks of code above give out eventually the same result, but the latter ist much more *sufficient* and *sophisticated*.\n", + "\n", + "Pay attention that the code within the body of an else clause is executed only if the if statement that precedes it resolves to False." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "~~~python\n", + "if False:\n", + " print(10)\n", + "else:\n", + " print(100)\n", + "~~~\n", + "\n", + "Just like in our apps example:\n", + "````python\n", + "price = 5\n", + "\n", + "if price == 0:\n", + " print('free')\n", + "else: \n", + " print('not free')\n", + "````\n", + "---" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "````python\n", + "price = 0\n", + "\n", + "if price == 0:\n", + " print('free')\n", + "else: \n", + " print('not free')\n", + "````" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In the apps example above, the code within the body of the ``else`` clause is executed only if ``price == 0.0`` evaluates to False. \n", + "\n", + "If price == 0.0 is True, then the line\n", + "\n", + "````python\n", + "app.append('free') \n", + "````\n", + "is executed, and computer moves forward *without* executing the else clause.\n", + "\n", + "Note that an else clause must be combined with a preceding if statement. We can have an if statement without an else clause, but we can't have an else clause without a preceding if statement. In the example below, the else clause alone throws out a ``SyntaxError``." + ] + }, + { + "cell_type": "code", + "execution_count": 89, + "metadata": {}, + "outputs": [ + { + "ename": "SyntaxError", + "evalue": "invalid syntax (, line 1)", + "output_type": "error", + "traceback": [ + "\u001b[0;36m File \u001b[0;32m\"\"\u001b[0;36m, line \u001b[0;32m1\u001b[0m\n\u001b[0;31m else:\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n" + ] + } + ], + "source": [ + "else:\n", + " print('This will not be printed, becausewe cannot have an else clause without a preceding if statement.' )" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "When we combine a statement with a clause, we create a compound statement — combining an if statement with an else clause makes up a compound statement." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 10. The elif Clause\n", + "\n", + "What happens when we have a more granular label rather than just using \"free\" and \"non-free\" like below:\n", + "\n", + "| price | label | \n", + "|------------|:------:|\n", + "| 0 | free|\n", + "| < 20 | affordable |\n", + "| 20 - 50 | expensive |\n", + "|> 50| very expensive |" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Using what we learned from the previous section, our code will like below:" + ] + }, + { + "cell_type": "code", + "execution_count": 91, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[['GoodNotes', 19.99, 'afforable'], ['Call of Duty Zombies', 5.0, 'afforable'], ['Notability', 29.99, 'expensive'], ['Snapchat', 0.0, 'free']]\n" + ] + } + ], + "source": [ + "apps_data = [['GoodNotes', 19.99], ['Call of Duty Zombies', 5.0], ['Notability', 29.99], ['Snapchat', 0.0]]\n", + "\n", + "for app in apps_data:\n", + " price = app[1] \n", + " \n", + " if price == 0.0: \n", + " app.append('free') \n", + " if price > 0.0 and price < 20:\n", + " app.append('affordable')\n", + " if price >= 20 and price < 50:\n", + " app.append('expensive')\n", + " if price >= 50:\n", + " app.append('very expensive')\n", + " \n", + "print(apps_data)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "When an app is free, ``price == 0.0`` evaluates to ``True`` and ``app.append('free')`` is executed. But then the computer continues to do redundant operations — it checks whether:\n", + "\n", + "- [ ] price > 0 and price < 20\n", + "- [ ] price >= 20 and price < 50\n", + "- [ ] price >= 50\n", + "\n", + "We already know the three conditions above will evaluate to False once we find out that price == 0.0 is True. To stop the computer from doing redundant operations, we can use elif clauses:" + ] + }, + { + "cell_type": "code", + "execution_count": 92, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[['GoodNotes', 19.99, 'afforable'], ['Call of Duty Zombies', 5.0, 'afforable'], ['Notability', 29.99, 'expensive'], ['Snapchat', 0.0, 'free']]\n" + ] + } + ], + "source": [ + "apps_data = [['GoodNotes', 19.99], ['Call of Duty Zombies', 5.0], ['Notability', 29.99], ['Snapchat', 0.0]]\n", + "\n", + "for app in apps_data:\n", + " price = app[1] \n", + " \n", + " if price == 0.0: \n", + " app.append('free') \n", + " elif price > 0.0 and price < 20:\n", + " app.append('affordable')\n", + " elif price >= 20 and price < 50:\n", + " app.append('expensive')\n", + " elif price >= 50:\n", + " app.append('very expensive')\n", + " \n", + "print(apps_data)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The code within the body of an elif clause is executed only if:\n", + "\n", + "- The preceding if statement (or the other preceding elif clauses) resolves to False; and\n", + "- The condition specified after the elif keyword evaluates to True.\n", + "\n", + "For example, if price == 0.0 is evaluated to be True, the computer will executes app.append('free') and jump out of the this section of code (the rest of the elif clauses).\n", + "\n", + "Notice that if we replace the last elif with else instead, the statement app.append('very expensive') will be executed even if the price has a value of -5 or -100 like this:" + ] + }, + { + "cell_type": "code", + "execution_count": 93, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[['GoodNotes', -19.99, 'very expensive'], ['Call of Duty Zombies', -5.0, 'very expensive'], ['Notability', 29.99, 'expensive'], ['Snapchat', 0.0, 'free']]\n" + ] + } + ], + "source": [ + "apps_data = [['GoodNotes', -19.99], ['Call of Duty Zombies', -5.0], ['Notability', 29.99], ['Snapchat', 0.0]]\n", + "\n", + "for app in apps_data:\n", + " price = app[1] \n", + " \n", + " if price == 0.0: \n", + " app.append('free') \n", + " elif price > 0.0 and price < 20:\n", + " app.append('affordable')\n", + " elif price >= 20 and price < 50:\n", + " app.append('expensive')\n", + " else:\n", + " app.append('very expensive')\n", + " \n", + "print(apps_data)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now let's have some practice with the else and elif statements.\n", + "### Task 1.4.10 (OPTIONAL):\n", + "\n", + "1. Complete the code in the editor to label each app as ``free``, ``affordable``, ``expensive``, or ``very expensive``. Inside the loop:\n", + " - If the price of the app is 0, label the app as ``free`` by appending the string ``free`` to the current iteration variable.\n", + " - If the price of the app is greater than 0 and less than 20, label the app as ``affordable``. For efficiency purposes, use an elif clause.\n", + " - If the price of the app is greater or equal to 20 and less than 50, label the app as ``expensive``. For efficiency purposes, use an elif clause.\n", + " - If the price of the app is greater or equal to 50, label the app as ``very expensive``. For efficiency purposes, use an elif clause.\n", + "2. Name the newly created column ``price_label`` by appending the string ``price_label`` to the first row of the ``apps_data`` data set.\n", + "3. Inspect the header row and the first five rows to see some of the changes you made." + ] + }, + { + "cell_type": "code", + "execution_count": 94, + "metadata": {}, + "outputs": [], + "source": [ + "# INITIAL CODE\n", + "opened_file = open('AppleStore.csv', encoding='utf8')\n", + "from csv import reader\n", + "read_file = reader(opened_file)\n", + "apps_data = list(read_file)\n", + "\n", + "for app in apps_data[1:]:\n", + " price = float(app[4])\n", + " # Complete code from here" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/Exercises/EN/Basic/05_Control_Flow_NA.ipynb b/Exercises/EN/Basic/05_Control_Flow_NA.ipynb new file mode 100644 index 00000000..a842943c --- /dev/null +++ b/Exercises/EN/Basic/05_Control_Flow_NA.ipynb @@ -0,0 +1,1259 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Introduction to Python \n", + "\n", + "### Control Flow" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import time\n", + "import random" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "A brief note about measuring time to run a cell " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "51.17707003576188\n" + ] + } + ], + "source": [ + "print(time.time()/((3600*24*365)+13)) # The Unix time started in 1970..." + ] + }, + { + "cell_type": "raw", + "metadata": {}, + "source": [ + "t0 = time.time()\n", + "\n", + "print(time.time() - t0)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 1- Create a script that prints the numbers from 1 to 100, following these rules: \n", + "\n", + "1. in those that are multiples of 3, print \"Fizz\" instead of the number. \n", + "2. in those that are multiples of 5 print \"Buzz\" instead of the number. \n", + "3. For numbers that are multiples of both 3 and 5, print \"FizzBuzz\". " + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "1\n", + "2\n", + "Fizz\n", + "4\n", + "Buzz\n", + "Fizz\n", + "7\n", + "8\n", + "Fizz\n", + "Buzz\n", + "11\n", + "Fizz\n", + "13\n", + "14\n", + "FizzBuzz\n", + "16\n", + "17\n", + "Fizz\n", + "19\n", + "Buzz\n", + "Fizz\n", + "22\n", + "23\n", + "Fizz\n", + "Buzz\n", + "26\n", + "Fizz\n", + "28\n", + "29\n", + "FizzBuzz\n", + "31\n", + "32\n", + "Fizz\n", + "34\n", + "Buzz\n", + "Fizz\n", + "37\n", + "38\n", + "Fizz\n", + "Buzz\n", + "41\n", + "Fizz\n", + "43\n", + "44\n", + "FizzBuzz\n", + "46\n", + "47\n", + "Fizz\n", + "49\n", + "Buzz\n", + "Fizz\n", + "52\n", + "53\n", + "Fizz\n", + "Buzz\n", + "56\n", + "Fizz\n", + "58\n", + "59\n", + "FizzBuzz\n", + "61\n", + "62\n", + "Fizz\n", + "64\n", + "Buzz\n", + "Fizz\n", + "67\n", + "68\n", + "Fizz\n", + "Buzz\n", + "71\n", + "Fizz\n", + "73\n", + "74\n", + "FizzBuzz\n", + "76\n", + "77\n", + "Fizz\n", + "79\n", + "Buzz\n", + "Fizz\n", + "82\n", + "83\n", + "Fizz\n", + "Buzz\n", + "86\n", + "Fizz\n", + "88\n", + "89\n", + "FizzBuzz\n", + "91\n", + "92\n", + "Fizz\n", + "94\n", + "Buzz\n", + "Fizz\n", + "97\n", + "98\n", + "Fizz\n", + "Buzz\n", + "101\n", + "Fizz\n", + "103\n", + "104\n", + "FizzBuzz\n", + "106\n", + "107\n", + "Fizz\n", + "109\n", + "Buzz\n", + "Fizz\n", + "112\n", + "113\n", + "Fizz\n", + "Buzz\n", + "116\n", + "Fizz\n", + "118\n", + "119\n", + "FizzBuzz\n", + "121\n", + "122\n", + "Fizz\n", + "124\n", + "Buzz\n", + "Fizz\n", + "127\n", + "128\n", + "Fizz\n", + "Buzz\n", + "131\n", + "Fizz\n", + "133\n", + "134\n", + "FizzBuzz\n", + "136\n", + "137\n", + "Fizz\n", + "139\n", + "Buzz\n", + "Fizz\n", + "142\n", + "143\n", + "Fizz\n", + "Buzz\n", + "146\n", + "Fizz\n", + "148\n", + "149\n", + "FizzBuzz\n", + "151\n", + "152\n", + "Fizz\n", + "154\n", + "Buzz\n", + "Fizz\n", + "157\n", + "158\n", + "Fizz\n", + "Buzz\n", + "161\n", + "Fizz\n", + "163\n", + "164\n", + "FizzBuzz\n", + "166\n", + "167\n", + "Fizz\n", + "169\n", + "Buzz\n", + "Fizz\n", + "172\n", + "173\n", + "Fizz\n", + "Buzz\n", + "176\n", + "Fizz\n", + "178\n", + "179\n", + "FizzBuzz\n", + "181\n", + "182\n", + "Fizz\n", + "184\n", + "Buzz\n", + "Fizz\n", + "187\n", + "188\n", + "Fizz\n", + "Buzz\n", + "191\n", + "Fizz\n", + "193\n", + "194\n", + "FizzBuzz\n", + "196\n", + "197\n", + "Fizz\n", + "199\n", + "Buzz\n", + "Fizz\n", + "202\n", + "203\n", + "Fizz\n", + "Buzz\n", + "206\n", + "Fizz\n", + "208\n", + "209\n", + "FizzBuzz\n", + "211\n", + "212\n", + "Fizz\n", + "214\n", + "Buzz\n", + "Fizz\n", + "217\n", + "218\n", + "Fizz\n", + "Buzz\n", + "221\n", + "Fizz\n", + "223\n", + "224\n", + "FizzBuzz\n", + "226\n", + "227\n", + "Fizz\n", + "229\n", + "Buzz\n", + "Fizz\n", + "232\n", + "233\n", + "Fizz\n", + "Buzz\n", + "236\n", + "Fizz\n", + "238\n", + "239\n", + "FizzBuzz\n", + "241\n", + "242\n", + "Fizz\n", + "244\n", + "Buzz\n", + "Fizz\n", + "247\n", + "248\n", + "Fizz\n", + "Buzz\n", + "251\n", + "Fizz\n", + "253\n", + "254\n", + "FizzBuzz\n", + "256\n", + "257\n", + "Fizz\n", + "259\n", + "Buzz\n", + "Fizz\n", + "262\n", + "263\n", + "Fizz\n", + "Buzz\n", + "266\n", + "Fizz\n", + "268\n", + "269\n", + "FizzBuzz\n", + "271\n", + "272\n", + "Fizz\n", + "274\n", + "Buzz\n", + "Fizz\n", + "277\n", + "278\n", + "Fizz\n", + "Buzz\n", + "281\n", + "Fizz\n", + "283\n", + "284\n", + "FizzBuzz\n", + "286\n", + "287\n", + "Fizz\n", + "289\n", + "Buzz\n", + "Fizz\n", + "292\n", + "293\n", + "Fizz\n", + "Buzz\n", + "296\n", + "Fizz\n", + "298\n", + "299\n", + "FizzBuzz\n", + "301\n", + "302\n", + "Fizz\n", + "304\n", + "Buzz\n", + "Fizz\n", + "307\n", + "308\n", + "Fizz\n", + "Buzz\n", + "311\n", + "Fizz\n", + "313\n", + "314\n", + "FizzBuzz\n", + "316\n", + "317\n", + "Fizz\n", + "319\n", + "Buzz\n", + "Fizz\n", + "322\n", + "323\n", + "Fizz\n", + "Buzz\n", + "326\n", + "Fizz\n", + "328\n", + "329\n", + "FizzBuzz\n", + "331\n", + "332\n", + "Fizz\n", + "334\n", + "Buzz\n", + "Fizz\n", + "337\n", + "338\n", + "Fizz\n", + "Buzz\n", + "341\n", + "Fizz\n", + "343\n", + "344\n", + "FizzBuzz\n", + "346\n", + "347\n", + "Fizz\n", + "349\n", + "Buzz\n", + "Fizz\n", + "352\n", + "353\n", + "Fizz\n", + "Buzz\n", + "356\n", + "Fizz\n", + "358\n", + "359\n", + "FizzBuzz\n", + "361\n", + "362\n", + "Fizz\n", + "364\n", + "Buzz\n", + "Fizz\n", + "367\n", + "368\n", + "Fizz\n", + "Buzz\n", + "371\n", + "Fizz\n", + "373\n", + "374\n", + "FizzBuzz\n", + "376\n", + "377\n", + "Fizz\n", + "379\n", + "Buzz\n", + "Fizz\n", + "382\n", + "383\n", + "Fizz\n", + "Buzz\n", + "386\n", + "Fizz\n", + "388\n", + "389\n", + "FizzBuzz\n", + "391\n", + "392\n", + "Fizz\n", + "394\n", + "Buzz\n", + "Fizz\n", + "397\n", + "398\n", + "Fizz\n", + "Buzz\n", + "401\n", + "Fizz\n", + "403\n", + "404\n", + "FizzBuzz\n", + "406\n", + "407\n", + "Fizz\n", + "409\n", + "Buzz\n", + "Fizz\n", + "412\n", + "413\n", + "Fizz\n", + "Buzz\n", + "416\n", + "Fizz\n", + "418\n", + "419\n", + "FizzBuzz\n", + "421\n", + "422\n", + "Fizz\n", + "424\n", + "Buzz\n", + "Fizz\n", + "427\n", + "428\n", + "Fizz\n", + "Buzz\n", + "431\n", + "Fizz\n", + "433\n", + "434\n", + "FizzBuzz\n", + "436\n", + "437\n", + "Fizz\n", + "439\n", + "Buzz\n", + "Fizz\n", + "442\n", + "443\n", + "Fizz\n", + "Buzz\n", + "446\n", + "Fizz\n", + "448\n", + "449\n", + "FizzBuzz\n", + "451\n", + "452\n", + "Fizz\n", + "454\n", + "Buzz\n", + "Fizz\n", + "457\n", + "458\n", + "Fizz\n", + "Buzz\n", + "461\n", + "Fizz\n", + "463\n", + "464\n", + "FizzBuzz\n", + "466\n", + "467\n", + "Fizz\n", + "469\n", + "Buzz\n", + "Fizz\n", + "472\n", + "473\n", + "Fizz\n", + "Buzz\n", + "476\n", + "Fizz\n", + "478\n", + "479\n", + "FizzBuzz\n", + "481\n", + "482\n", + "Fizz\n", + "484\n", + "Buzz\n", + "Fizz\n", + "487\n", + "488\n", + "Fizz\n", + "Buzz\n", + "491\n", + "Fizz\n", + "493\n", + "494\n", + "FizzBuzz\n", + "496\n", + "497\n", + "Fizz\n", + "499\n", + "Buzz\n", + "Fizz\n", + "502\n", + "503\n", + "Fizz\n", + "Buzz\n", + "506\n", + "Fizz\n", + "508\n", + "509\n", + "FizzBuzz\n", + "511\n", + "512\n", + "Fizz\n", + "514\n", + "Buzz\n", + "Fizz\n", + "517\n", + "518\n", + "Fizz\n", + "Buzz\n", + "521\n", + "Fizz\n", + "523\n", + "524\n", + "FizzBuzz\n", + "526\n", + "527\n", + "Fizz\n", + "529\n", + "Buzz\n", + "Fizz\n", + "532\n", + "533\n", + "Fizz\n", + "Buzz\n", + "536\n", + "Fizz\n", + "538\n", + "539\n", + "FizzBuzz\n", + "541\n", + "542\n", + "Fizz\n", + "544\n", + "Buzz\n", + "Fizz\n", + "547\n", + "548\n", + "Fizz\n", + "Buzz\n", + "551\n", + "Fizz\n", + "553\n", + "554\n", + "FizzBuzz\n", + "556\n", + "557\n", + "Fizz\n", + "559\n", + "Buzz\n", + "Fizz\n", + "562\n", + "563\n", + "Fizz\n", + "Buzz\n", + "566\n", + "Fizz\n", + "568\n", + "569\n", + "FizzBuzz\n", + "571\n", + "572\n", + "Fizz\n", + "574\n", + "Buzz\n", + "Fizz\n", + "577\n", + "578\n", + "Fizz\n", + "Buzz\n", + "581\n", + "Fizz\n", + "583\n", + "584\n", + "FizzBuzz\n", + "586\n", + "587\n", + "Fizz\n", + "589\n", + "Buzz\n", + "Fizz\n", + "592\n", + "593\n", + "Fizz\n", + "Buzz\n", + "596\n", + "Fizz\n", + "598\n", + "599\n", + "FizzBuzz\n", + "601\n", + "602\n", + "Fizz\n", + "604\n", + "Buzz\n", + "Fizz\n", + "607\n", + "608\n", + "Fizz\n", + "Buzz\n", + "611\n", + "Fizz\n", + "613\n", + "614\n", + "FizzBuzz\n", + "616\n", + "617\n", + "Fizz\n", + "619\n", + "Buzz\n", + "Fizz\n", + "622\n", + "623\n", + "Fizz\n", + "Buzz\n", + "626\n", + "Fizz\n", + "628\n", + "629\n", + "FizzBuzz\n", + "631\n", + "632\n", + "Fizz\n", + "634\n", + "Buzz\n", + "Fizz\n", + "637\n", + "638\n", + "Fizz\n", + "Buzz\n", + "641\n", + "Fizz\n", + "643\n", + "644\n", + "FizzBuzz\n", + "646\n", + "647\n", + "Fizz\n", + "649\n", + "Buzz\n", + "Fizz\n", + "652\n", + "653\n", + "Fizz\n", + "Buzz\n", + "656\n", + "Fizz\n", + "658\n", + "659\n", + "FizzBuzz\n", + "661\n", + "662\n", + "Fizz\n", + "664\n", + "Buzz\n", + "Fizz\n", + "667\n", + "668\n", + "Fizz\n", + "Buzz\n", + "671\n", + "Fizz\n", + "673\n", + "674\n", + "FizzBuzz\n", + "676\n", + "677\n", + "Fizz\n", + "679\n", + "Buzz\n", + "Fizz\n", + "682\n", + "683\n", + "Fizz\n", + "Buzz\n", + "686\n", + "Fizz\n", + "688\n", + "689\n", + "FizzBuzz\n", + "691\n", + "692\n", + "Fizz\n", + "694\n", + "Buzz\n", + "Fizz\n", + "697\n", + "698\n", + "Fizz\n", + "Buzz\n", + "701\n", + "Fizz\n", + "703\n", + "704\n", + "FizzBuzz\n", + "706\n", + "707\n", + "Fizz\n", + "709\n", + "Buzz\n", + "Fizz\n", + "712\n", + "713\n", + "Fizz\n", + "Buzz\n", + "716\n", + "Fizz\n", + "718\n", + "719\n", + "FizzBuzz\n", + "721\n", + "722\n", + "Fizz\n", + "724\n", + "Buzz\n", + "Fizz\n", + "727\n", + "728\n", + "Fizz\n", + "Buzz\n", + "731\n", + "Fizz\n", + "733\n", + "734\n", + "FizzBuzz\n", + "736\n", + "737\n", + "Fizz\n", + "739\n", + "Buzz\n", + "Fizz\n", + "742\n", + "743\n", + "Fizz\n", + "Buzz\n", + "746\n", + "Fizz\n", + "748\n", + "749\n", + "FizzBuzz\n", + "751\n", + "752\n", + "Fizz\n", + "754\n", + "Buzz\n", + "Fizz\n", + "757\n", + "758\n", + "Fizz\n", + "Buzz\n", + "761\n", + "Fizz\n", + "763\n", + "764\n", + "FizzBuzz\n", + "766\n", + "767\n", + "Fizz\n", + "769\n", + "Buzz\n", + "Fizz\n", + "772\n", + "773\n", + "Fizz\n", + "Buzz\n", + "776\n", + "Fizz\n", + "778\n", + "779\n", + "FizzBuzz\n", + "781\n", + "782\n", + "Fizz\n", + "784\n", + "Buzz\n", + "Fizz\n", + "787\n", + "788\n", + "Fizz\n", + "Buzz\n", + "791\n", + "Fizz\n", + "793\n", + "794\n", + "FizzBuzz\n", + "796\n", + "797\n", + "Fizz\n", + "799\n", + "Buzz\n", + "Fizz\n", + "802\n", + "803\n", + "Fizz\n", + "Buzz\n", + "806\n", + "Fizz\n", + "808\n", + "809\n", + "FizzBuzz\n", + "811\n", + "812\n", + "Fizz\n", + "814\n", + "Buzz\n", + "Fizz\n", + "817\n", + "818\n", + "Fizz\n", + "Buzz\n", + "821\n", + "Fizz\n", + "823\n", + "824\n", + "FizzBuzz\n", + "826\n", + "827\n", + "Fizz\n", + "829\n", + "Buzz\n", + "Fizz\n", + "832\n", + "833\n", + "Fizz\n", + "Buzz\n", + "836\n", + "Fizz\n", + "838\n", + "839\n", + "FizzBuzz\n", + "841\n", + "842\n", + "Fizz\n", + "844\n", + "Buzz\n", + "Fizz\n", + "847\n", + "848\n", + "Fizz\n", + "Buzz\n", + "851\n", + "Fizz\n", + "853\n", + "854\n", + "FizzBuzz\n", + "856\n", + "857\n", + "Fizz\n", + "859\n", + "Buzz\n", + "Fizz\n", + "862\n", + "863\n", + "Fizz\n", + "Buzz\n", + "866\n", + "Fizz\n", + "868\n", + "869\n", + "FizzBuzz\n", + "871\n", + "872\n", + "Fizz\n", + "874\n", + "Buzz\n", + "Fizz\n", + "877\n", + "878\n", + "Fizz\n", + "Buzz\n", + "881\n", + "Fizz\n", + "883\n", + "884\n", + "FizzBuzz\n", + "886\n", + "887\n", + "Fizz\n", + "889\n", + "Buzz\n", + "Fizz\n", + "892\n", + "893\n", + "Fizz\n", + "Buzz\n", + "896\n", + "Fizz\n", + "898\n", + "899\n", + "FizzBuzz\n", + "901\n", + "902\n", + "Fizz\n", + "904\n", + "Buzz\n", + "Fizz\n", + "907\n", + "908\n", + "Fizz\n", + "Buzz\n", + "911\n", + "Fizz\n", + "913\n", + "914\n", + "FizzBuzz\n", + "916\n", + "917\n", + "Fizz\n", + "919\n", + "Buzz\n", + "Fizz\n", + "922\n", + "923\n", + "Fizz\n", + "Buzz\n", + "926\n", + "Fizz\n", + "928\n", + "929\n", + "FizzBuzz\n", + "931\n", + "932\n", + "Fizz\n", + "934\n", + "Buzz\n", + "Fizz\n", + "937\n", + "938\n", + "Fizz\n", + "Buzz\n", + "941\n", + "Fizz\n", + "943\n", + "944\n", + "FizzBuzz\n", + "946\n", + "947\n", + "Fizz\n", + "949\n", + "Buzz\n", + "Fizz\n", + "952\n", + "953\n", + "Fizz\n", + "Buzz\n", + "956\n", + "Fizz\n", + "958\n", + "959\n", + "FizzBuzz\n", + "961\n", + "962\n", + "Fizz\n", + "964\n", + "Buzz\n", + "Fizz\n", + "967\n", + "968\n", + "Fizz\n", + "Buzz\n", + "971\n", + "Fizz\n", + "973\n", + "974\n", + "FizzBuzz\n", + "976\n", + "977\n", + "Fizz\n", + "979\n", + "Buzz\n", + "Fizz\n", + "982\n", + "983\n", + "Fizz\n", + "Buzz\n", + "986\n", + "Fizz\n", + "988\n", + "989\n", + "FizzBuzz\n", + "991\n", + "992\n", + "Fizz\n", + "994\n", + "Buzz\n", + "Fizz\n", + "997\n", + "998\n", + "Fizz\n", + "Buzz\n" + ] + } + ], + "source": [ + "for num in range(1,1001):\n", + " if (num % 3 == 0) and (num % 5 == 0):\n", + " print(\"FizzBuzz\")\n", + " elif num % 3 == 0:\n", + " print(\"Fizz\")\n", + " elif num % 5 == 0:\n", + " print(\"Buzz\")\n", + " else:\n", + " print(num)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 2 - Given the list:" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "list1 = [1,2,3,'4',5,6.3,7.4 + 2j,\"123\",[1,2,3], 93, \"98\"]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Create a script or function to print each element of a list, along with its predecessor and its successor. Follow these rules:\n", + "\n", + "1. If this element is numeric or a string, print its representational value; and\n", + "2. If the element is a container but not a string (tuple, list, dict, set, frozenset), print each element of the sequence." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 3- Using the \"random\" library, create a script to average the sum of two 6-sided dice (D6) in 10,000 releases." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 4 - [Project Euler - Problem 3](https://projecteuler.net/problem=3) \n", + " \n", + "The prime factors of 13195 are 5, 7, 13 and 29. \n", + "What is the largest prime factor of the number 600851475143 ?" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 5 - [Project Euler - Problem 4](https://projecteuler.net/problem=4) \n", + "\n", + "#### Largest palindrome product\n", + "\n", + "\"A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.\" \n", + "\n", + "**Find the largest palindrome made from the product of two 3-digit numbers.**" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "###### Hint: How to reverse a string?" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } + }, + "outputs": [ + { + "data": { + "text/plain": [ + "'gnirts modnar A'" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "'A random string'[-1::-1]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 6 - [Project Euler - Problem 14](https://projecteuler.net/problem=14) \n", + "\n", + "#### Longest Collatz sequence\n", + "\n", + "\n", + "The following iterative sequence is defined for the set of positive integers:\n", + "\n", + "n → n/2 (n is even)\n", + "n → 3n + 1 (n is odd)\n", + "\n", + "Using the rule above and starting with 13, we generate the following sequence:\n", + "\n", + "13 → 40 → 20 → 10 → 5 → 16 → 8 → 4 → 2 → 1\n", + "It can be seen that this sequence (starting at 13 and finishing at 1) contains 10 terms. Although it has not been proved yet (Collatz Problem), it is thought that all starting numbers finish at 1.\n", + "\n", + "**Which starting number, under one million, produces the longest chain?**\n", + "\n", + "NOTE: Once the chain starts the terms are allowed to go above one million." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.1" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} From e0a65d839fcb5abed18a39f16e2ef2aaaada2250 Mon Sep 17 00:00:00 2001 From: andren967 Date: Fri, 20 Oct 2023 16:36:40 +0200 Subject: [PATCH 2/5] Exercices for Class 2 --- Exercises/EN/Basic/01_Python_Sintax_NA.ipynb | 527 ++++++++++ .../02_Variables_and_Data_Types_NA.ipynb | 932 ++++++++++++++++++ 2 files changed, 1459 insertions(+) create mode 100644 Exercises/EN/Basic/01_Python_Sintax_NA.ipynb create mode 100644 Exercises/EN/Basic/02_Variables_and_Data_Types_NA.ipynb diff --git a/Exercises/EN/Basic/01_Python_Sintax_NA.ipynb b/Exercises/EN/Basic/01_Python_Sintax_NA.ipynb new file mode 100644 index 00000000..5cae5a44 --- /dev/null +++ b/Exercises/EN/Basic/01_Python_Sintax_NA.ipynb @@ -0,0 +1,527 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## About This Notebook\n", + "\n", + "Within this notebook, we are going to make our very first steps into the vast world of Python. \n", + "\n", + "- How does one line of *code* looks like?\n", + "- What is *syntax*?\n", + "- What are *comments*?\n", + "- How do we perform *arithmetic operations*?\n", + "***" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 1. First Lines of Code" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Python is one of the most popular programming langugage these days. It designed for readability, and it shares some similarities with the English Language as well as having influence from mathematics. It is one of the most straight-forward and easily understandable programming languages.\n", + "\n", + "\n", + "### Task 1.1.1:\n", + "1. How does Python compute 25+5? Try type in 25 + 5 in the following cell, just below where the text indicates it:" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "30" + ] + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Start your code below:\n", + "25+5\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "2. In the line above, a single calculation is instructed: 25 + 5. However, the computer is capable to perform more than just one calculation. Try to instruct the computer to perform multiple calculations like:\n", + "\n", + "25 + 5
\n", + "20 - 7
\n", + "30 + 2
\n", + "67 - 22
\n" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "45" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Start your code below:\n", + "20 - 7 \n", + "25 + 5 \n", + "30 + 2 \n", + "67 - 22\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The output is 45 and it seems like the computer only performed the last subtraction, 67 - 22. Hmm strange...\n", + "## 2. The print() Command\n", + "\n", + "What really happens is that the computer performed all the calculations above, but it only displays the last one as the output result. To display all calculation results, what we need is to use the `print()` command(function), like this:" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "30\n", + "4\n", + "32\n", + "50\n" + ] + } + ], + "source": [ + "print(25 + 5)\n", + "print(10 - 6)\n", + "print(30 + 2)\n", + "print(12 + 38)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Don't worry for now what *command* (or function) exactly is. You will get to learn that later. It is for you, for now, only important to understand that if we learn what a command does, we can use it to our advantage.Now let's have some practice with the `print()` command." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 1.1.2:\n", + "1. Using the `print()` command and display the result for:\n", + "- 55 + 5\n", + "- 300 - 8\n", + "- 21 + 67\n", + "\n", + "2. Click the Run button when you're ready to see your results." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "60\n", + "292\n", + "88\n" + ] + } + ], + "source": [ + "# Start your code below:\n", + "print(55+5)\n", + "print(300-8)\n", + "print(21+67)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Have you ever wondered what happens if we put all print commands one the same line? \n", + "Try to type in the following code this: print(55 + 5) print(300 - 8) print(21 + 67)" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "ename": "SyntaxError", + "evalue": "invalid syntax (1598850674.py, line 1)", + "output_type": "error", + "traceback": [ + "\u001b[1;36m Cell \u001b[1;32mIn[5], line 1\u001b[1;36m\u001b[0m\n\u001b[1;33m print(55 + 5) print(300 - 8) print(21 + 67)''\u001b[0m\n\u001b[1;37m ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n" + ] + } + ], + "source": [ + "print(55 + 5) print(300 - 8) print(21 + 67)''" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "It would work, however, if we have separated the commands with a semicolon (although this is not usual in Python)" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "60\n", + "292\n", + "88\n" + ] + } + ], + "source": [ + "print(55 + 5); print(300 - 8); print(21 + 67)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 3. Python Syntax\n", + "Yes, indeed. We'd get an **error**. And in fact it is described as a syntax error. This is because all programming languages like Python, Java, C++ all have its own **syntax rules**. Each line of instructions must comply with these rules. \n", + "\n", + "You can compare these syntax rules with grammar in human languages. If we want to convey a message, we must respect and follow the syntax rules in order to deliver our message in a meaningful way. For example, people will understand \"Data Science is super cool\", but not \"science super cool data is\". Likewise, the computer didn't understand print(55 + 5) print(300 - 8) print(21 + 67) because the syntax was wrong.\n", + "\n", + "**Running into errors while programming is more common than you would think!** Forget those action scenes from blockbuster movies where hackers code faster than the speed of light! Real life of a programmer often times is about examining (calmly and with patience) why a certain error occurred." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "After learning about some syntax rules, let's dive into the next task.\n", + "\n", + "### Task 1.1.3:\n", + "1. Try to run the instructions in the line below and see what does computer output as result. Remember that each command must be on a separate line.\n", + "\n", + "- print(30 + 20 + 50)\n", + "- print(5)\n", + "- print(-2)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "100\n", + "5\n", + "-2\n" + ] + } + ], + "source": [ + "# Start your code below:\n", + "print(30+20+50)\n", + "print(5)\n", + "print(-2)\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In the line above, three instructions were given to the computer:\n", + "\n", + "- print(30 + 20 + 50)\n", + "- print(5)\n", + "- print(-2)\n", + "\n", + "All these instructions are collectively known as **code**. Each line of command is known as a **line of code**. When we program or when we write code, we instruct or program the computer to do some tasks. Therefore, we can also call the code we write a computer program, or just simply a program.\n", + "\n", + "The program we wrote in *Task 2.1* had three lines of code, but a program can be as small as one line." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 1.1.3.2:\n", + "1. Try to use the `print()` command and write a program that consists of three lines of code:\n", + "- displays the result of 58 + 6\n", + "- displays the number 21\n", + "- displays the number -21\n", + "2. Hit the Run button after you have finished and compare your output with our task requirement." + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "64\n", + "21\n", + "-21\n" + ] + } + ], + "source": [ + "# Start your code below:\n", + "print(58+6)\n", + "print(21)\n", + "print(-21)\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 4. Code Comments\n", + "Before we get down to real programming, we want to introduce you the # symbol, also known as the **comment symbol**. \n", + "Any code or characters that follows the # symbol is called a code comment. Programmers use this symbol to add information or comments about our code." + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "4\n", + "1\n" + ] + } + ], + "source": [ + "print(3 + 1)\n", + "print(10 - 9) #This is the line that outputs 1" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can also use code comments to add a general description at the beginning of our program.\n", + "Now let's have some practice with the ``#`` symbol.\n", + "Please type the following code in the editor below:\n", + "- #print(5 + 21)
\n", + "- #print(5)
\n", + "- #print(-5)
" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [], + "source": [ + "# Start your code below:\n", + "#print(5+21)\n", + "#print(5)\n", + "#print(5)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Uncomment these three lines of code by removing the ``#`` symbol and then click the Run button." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 5. Arithmetical Operations\n", + "In the previous section, we have performed additions and subtractions. To perform multiplication, we can use the ``*`` operator. To multiply 5 * 2 we can type:" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "10" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "5 * 2 " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To perform division, we can use the ``/`` operator. To divide 10 / 5:" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2.0" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "10 / 5" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To raise a number to a power, we can use ``**``. For example, to raise 2 to th power of 3:" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "27" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "3**3 " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The arithmetical operations in Python follow the usual order of operations from mathematics. Just like from mathematics, calculations in parentheses are calculated first, then follows by exponentiation, division, multiplication, and at last, addition and subtraction.\n", + "\n", + "### Task 1.1.5: \n", + "1. Perform the following calculations in Python.\n", + "- 5 multiplied by 30\n", + "- 56 divided by 2\n", + "- 5 to power of 2 (pay attention that the operator ``^`` is not the operator to raise a number to a power, but instead it is a bitwise operator for ``XOR``)" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "150\n", + "28.0\n", + "7\n" + ] + } + ], + "source": [ + "# Start your code below:\n", + "print(5*30)\n", + "print(56/2)\n", + "print(5^2)\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.5" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/Exercises/EN/Basic/02_Variables_and_Data_Types_NA.ipynb b/Exercises/EN/Basic/02_Variables_and_Data_Types_NA.ipynb new file mode 100644 index 00000000..11f935c5 --- /dev/null +++ b/Exercises/EN/Basic/02_Variables_and_Data_Types_NA.ipynb @@ -0,0 +1,932 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## About This Notebook\n", + "\n", + "Probably the most useful concept within programming is understanding of **variables**. We will therefore focus on those within this notebook. We will begin by exploring why do we need those and how are they created. Later on, we will move onto **data types**. These mean that variables can be of different type depending on what they store.\n", + "\n", + "Alongside, we will learn some useful tricks, such as *conversion* betweeen data types.\n", + "***" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 1. Saving Values\n", + "We have learned the basics of Python programming and performed a couple of arithmetical operations in Python. However, how do we actually save values and work with numerical and text data. Take for example, if we want to save the result of an arithmetical operation for other execution. Let's say (20-10)*2 = 20, and we want to save 20 as our result. We can therefore write:" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "result = 20" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "If we print the result, the output is: 20" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "20\n" + ] + } + ], + "source": [ + "result = 20\n", + "print(result)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can also directly save (20-10)*2 instead of saving 20" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "20\n" + ] + } + ], + "source": [ + "result = (20-10)*2\n", + "print(result)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Pay attention that, when we print(result), the output is the value of calculation and not (20-10) * 2. **The computer first calculates (20-10) * 2 and then saves the result 20 to variable name \"result\".**" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 1.2.1:\n", + "1. Save the result of (50 + 6)*32 to variable name `result`.\n", + "2. Print result." + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "1792\n" + ] + } + ], + "source": [ + "# Start your code below:\n", + "result = (50+6)*32\n", + "print(result)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 2. Variables\n", + "When we run the code result = 20, the value 20 is saved in the computer memory. The computer memory has many storage locations, and the value 20 is saved to one particular location.\n", + "\n", + "The value we just saved, which is 20, has a unique identifier in the storage location which we can use it to access 20. We can use the identifier *result* to access 20 in our program. For example:" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "20\n", + "40\n", + "21\n" + ] + } + ], + "source": [ + "result = 20\n", + "print(result)\n", + "print(result * 2)\n", + "print(result + 1)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This unique identifier is commonly known as a **variable**. \n", + "*result = 20* is ran after we hit the Run button, the computer stored 20 in a variable or a storage location named *result* based on our command --- therefore \"result\" is a **variable name**.\n", + "Notice that the order of the variable naming is very important. The variable name is to the left of the = sign and the value we want to store to this variable name is located to the right.\n", + "Therefore if we want to store the value 20 to a variable named result, result = 20 must be written and not 20 = result." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now let's do some practice declaring some variable names.\n", + "\n", + "### Task 1.2.2:\n", + "1. Store the value 10 in a variable named some_value.\n", + "2. Store the result of (38+6-2)*23 to a variable named some_result.\n", + "3. Using the `print()` command to display the following:\n", + " * The value stored in the some_value variable.\n", + " * The result of adding 8 to the variable some_result.\n", + " * The result of adding some_value to some_result." + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "10\n", + "974\n", + "976\n" + ] + } + ], + "source": [ + "# Start your code below:\n", + "some_value = 10\n", + "some_result = (38+6-2)*23\n", + "\n", + "print (some_value)\n", + "print(some_result+8)\n", + "print (some_value+some_result)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 3. Variable Names\n", + "In the previous task, we have declared some variable names. We also learned that we can choose names for our variables. However, the names we choose must comply with a number of syntax rules. For example, if we try to name a variable a result, a syntax error will occur because we're not allowed to use space in variable names." + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "ename": "SyntaxError", + "evalue": "invalid syntax (, line 1)", + "output_type": "error", + "traceback": [ + "\u001b[0;36m File \u001b[0;32m\"\"\u001b[0;36m, line \u001b[0;32m1\u001b[0m\n\u001b[0;31m a result = 20\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n" + ] + } + ], + "source": [ + "a result = 20" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "There are two syntax rules we must follow when we declare our variables:
\n", + "1). Only letters, numbers, or underscores (we can't use apostrophes, hyphens, whitespace characters, etc.) can be used.
\n", + "2). Variable names cannot start with a number.
\n", + "\n", + "For example, errors will occur if we name our variables like:" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "ename": "SyntaxError", + "evalue": "invalid token (, line 1)", + "output_type": "error", + "traceback": [ + "\u001b[0;36m File \u001b[0;32m\"\"\u001b[0;36m, line \u001b[0;32m1\u001b[0m\n\u001b[0;31m 1_result = 2\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid token\n" + ] + } + ], + "source": [ + "1_result = 2\n", + "new result = 3\n", + "sister's_vacation_day = 23\n", + "old-result = 20\n", + "price_in_$ = 20\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "All variable names are case sensitive, notice that result is different from a variable named Result:" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "20\n", + "30\n" + ] + } + ], + "source": [ + "result = 20\n", + "Result = 30\n", + "print(result)\n", + "print(Result)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 4. Updating Variables\n", + "\n", + "The value saved in a variable can be changed or updated.\n", + "For example, in the code below we have first stored 2 in the variable result and then we update result to store 20 instead." + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2\n", + "3\n", + "20\n", + "30\n" + ] + } + ], + "source": [ + "result = 2\n", + "print(result)\n", + "print(result + 1)\n", + "\n", + "result = 20\n", + "print(result)\n", + "\n", + "result = result + 10\n", + "print(result)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Pay attention to the code above:\n", + "- The variable result initially only stores a value of 2\n", + "- result + 1 equals to 3 because result restores a value of 2 --- so result + 1 becomes 2 + 1\n", + "- when we run result = result + 10, result is updated to store of value of result + 10, which is 30. It is the same as running result = 20 + 10 because result has a value of 20.\n", + "print(result) outputs 30 after we executed result = result + 10.\n", + "Now let's have a little practice with variables.\n", + "income = 2000\n", + "\n", + "### Task 1.2.4:\n", + "1. Update the variable income by adding 5000 to its current value.\n", + "2. Print income" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "7000\n" + ] + } + ], + "source": [ + "income = 2000\n", + "\n", + "# Start your code below:\n", + "income += 5000\n", + "\n", + "print(income)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Pay attention to how we updated the variable, for example, by using x = x + 1. It is different than what we normally follows in mathematics. x = x +1 would be a false statement because x can never be equal to x + 1.** This means that the = operator sign in python or in any programming language in general doesn't have the same meaning as it does in mathematics.\n", + "\n", + "**In Python, the = operator means assignment**: the value on the right is assigned to the variable on the left, just like how we name our variable. It doesn't mean equality. We call = an assignment operator, and we read code like x = 2 as \"two is assigned to x\" or \"x is assigned two,\" but not \"x equals two.\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "By the way, Python offers a shortcut for inplace operations +=, -=, /= and *=" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "10\n", + "11\n" + ] + } + ], + "source": [ + "x = 10\n", + "print(x)\n", + "\n", + "x += 1 # is equivalent to x = x + 1\n", + "print(x)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 5. Types of Values\n", + "We have only worked with integers so far, of course we can also work with decimal numbers in Python. To understand what type of numbers or even values you are working with in Python, we can simply use the `type()` command to see the type of a value. For example:\n" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "\n", + "\n", + "\n" + ] + } + ], + "source": [ + "print(type(10))\n", + "print(type(10.))\n", + "print(type(10.0))\n", + "print(type(2.5))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We see that Python makes distinguishment between integers and decimal numbers. Take for example that the integer 10 has the int type and the decimal number 10., 10.0, and 2.5 has the float type. All integers have the int type, and numbers that has a decimal point have the float type. \n", + "\n", + "Even though these numbers are classified into different types or have different data types , we can still peform arithmetical operations with them. For example, we can still add an int data type to a float data type.\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "20.0\n", + "12.5\n" + ] + } + ], + "source": [ + "print(10 + 10.0)\n", + "print(2.5 * 5)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 1.2.5:\n", + "1. Assign a value of 10 to a variable named value_1
\n", + "2. Assign a value of 20.5 to a variable named value_2
\n", + "3. Update the value of value_1 by adding 2.5 to its current value. Try to use the syntax shortcut like += operator.
\n", + "4. Update the value of value_2 by multiplying its current value by 5 Try to use the syntax shorcut like *= operator.
\n", + "5. Print the result of value_1 and value_2 by using `print()` command.
\n" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "12.5\n", + "102.5\n" + ] + } + ], + "source": [ + "#Start your code below:\n", + "value_1 = 10\n", + "value_2 = 20.5\n", + "value_1 += 2.5\n", + "value_2 *= 5\n", + "print(value_1)\n", + "print(value_2)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 6. Conversion\n", + "\n", + "Is it possible to convert one type of value to another type of value? Totally! For example, float() command is used to convert an integer to a float and int() command is to convert a float to an integer." + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "10.0" + ] + }, + "execution_count": 22, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "float(10)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2" + ] + }, + "execution_count": 23, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "int(2.3)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Pay attention to the int() command and notice that 2.6 is rounded down to a 2. int() command will always round a float value down, even if the number after the decimal point is greater than five.\n", + "\n", + "However, we can also use `round() `command to properly round off a number, which follows the normal rounding rule." + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2" + ] + }, + "execution_count": 24, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "round(2.3)" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2" + ] + }, + "execution_count": 20, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "round(2.5)" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "3" + ] + }, + "execution_count": 26, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "round(2.99)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Do you know it is possible and often encouraged to combine commands. For example, we can use `round()` inside a `print()` command. Notice the different output printed on the screen between a simple round() command and print(round())." + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2\n", + "2\n", + "3\n" + ] + } + ], + "source": [ + "print(round(2.3))\n", + "print(round(2.5))\n", + "print(round(2.99))" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "3" + ] + }, + "execution_count": 28, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "round(2.3)\n", + "round(2.5)\n", + "round(2.99)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Another detail to pay attention to is that round() command doesn't change the value stored by a variable." + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2\n" + ] + }, + { + "data": { + "text/plain": [ + "2" + ] + }, + "execution_count": 29, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "variable_1 = 2.5\n", + "print(round(2.5))\n", + "round(2.5)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "However, if we assign the rounded value back to the variable, we are able to change the value stored in the variable." + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2\n" + ] + } + ], + "source": [ + "variable_1 =round(2.5)\n", + "print(variable_1)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 1.2.6:\n", + "1. Assign a value of 11.2 to a variable named value_1
\n", + "2. Assign a value of 2.5 to a variable named value_2
\n", + "3. Round the value of value_1 by using the `round()` command and try to assign the rounded value back to value_1
\n", + "4.Convert the value of value_2 from a float to an integer value using the `int()` command and assign the value back to value_2
\n", + "5. Print the result of value_1 and value_2 by using `print()` command.
\n" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "11\n", + "2\n" + ] + } + ], + "source": [ + "# Start your code below:\n", + "value_1 = 11.2\n", + "value_2 = 2.5\n", + "value_1 = round(value_1)\n", + "value_2 = int(value_2)\n", + "print(value_1)\n", + "print(value_2)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 7. Strings\n", + "\n", + "Up till now, we have only worked with int and float values. But in computer programming, there are many more types of values. \n", + "Take a look at the table down below:\n", + "\n", + "\n", + "| Track_name | Price | Currency | Rating_count_total | User_rating|\n", + "|------------|:------:|----------:|---------------------:|-----------:|\n", + "| Facebook | 0.0 | USD | 2974676 | 3.5|\n", + "| Instagram | 0.0 | USD |2161558 |4.5|\n", + "| Clash of Clans | 0.0| USD | 2130805 |4.5|\n", + "| Temple Run | 0.0 | USD |1724546 |4.5|\n", + "| Pandora - Music & Radio | 0.0| USD | 1126879 |4.5|\n", + "\n", + "Data Source: [Mobile App Store Data Set (Ramanathan Perumal)](https://www.kaggle.com/ramamet4/app-store-apple-data-set-10k-apps)

\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "As we can see in the columns track_name and currency for example, are consists of texts and not numbers. In Python, we can create text by using the quotation marks (\" \"):" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Instagram\n", + "USD\n" + ] + } + ], + "source": [ + "app_name = \"Instagram\"\n", + "currency = \"USD\"\n", + "\n", + "print(app_name)\n", + "print(currency)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Both double quotation marks (\" \") and single quotation mark (' ') are allowed in the Python syntax.\n", + "To create the word \"Instagram\", we can use either \"Instagram\", or 'Instagram'. The values surrounded by quotation marks are called strings and in Python it is presented as the str type." + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "str" + ] + }, + "execution_count": 33, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "type('Instagram')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "However, strings are not only limited to letters. It is also possible to use numbers, space, or other characters. See example below:" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "My Bank\n", + "number is 123456789\n" + ] + } + ], + "source": [ + "bank = 'My Bank'\n", + "number = 'number is 123456789'\n", + "\n", + "print(bank)\n", + "print(number)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 1.2.7:\n", + "1. Assign the string Instagram to a variable named app_name .
\n", + "2. Assign the string 4.5 to a variable named average_rating .
\n", + "3. Assign the string 2161158 to a variable named total_ratings .
\n", + "4. Assign the string data to a variable named value .
\n", + "5. Display the app_name variable using print() command.
\n" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Instagram\n" + ] + } + ], + "source": [ + "# Start your code below:\n", + "app_name = \"Instagram\"\n", + "average_rating = 4.5\n", + "total_ratings = 2161158\n", + "value = \"data\"\n", + "print(app_name)\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.5" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} From fa1a7ea8271227eef0ef5f5507b0c885e926e8fe Mon Sep 17 00:00:00 2001 From: andren967 Date: Fri, 27 Oct 2023 14:43:19 +0200 Subject: [PATCH 3/5] Exercise 4 finished --- .../Basic/04_Conditional_Statements_NA.ipynb | 17295 +++++++++++++++- 1 file changed, 17210 insertions(+), 85 deletions(-) diff --git a/Exercises/EN/Basic/04_Conditional_Statements_NA.ipynb b/Exercises/EN/Basic/04_Conditional_Statements_NA.ipynb index d5cf40be..1ae04c65 100644 --- a/Exercises/EN/Basic/04_Conditional_Statements_NA.ipynb +++ b/Exercises/EN/Basic/04_Conditional_Statements_NA.ipynb @@ -19,10 +19,14 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ + "import os\n", + "os.chdir(\"C:/Users/andre/Documents/UNI/Master_Digital_Humanities/S1_WS2023/UE_Introduction_to_DH_Tools_and_Methods/\")\n", + "my_file = open('AppleStore.csv', encoding='utf8')\n", + "\n", "opened_file = open('AppleStore.csv', encoding='utf8')\n", "\n", "from csv import reader\n", @@ -46,14 +50,14 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "[3.5, 4.5, 4.5, 4.5, 4.0]\n" + "[26.0, 26.0, 2822.0, 649.0, 5320.0]\n" ] } ], @@ -85,14 +89,17034 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[['',\n", + " 'id',\n", + " 'track_name',\n", + " 'size_bytes',\n", + " 'currency',\n", + " 'price',\n", + " 'rating_count_tot',\n", + " 'rating_count_ver',\n", + " 'user_rating',\n", + " 'user_rating_ver',\n", + " 'ver',\n", + " 'cont_rating',\n", + " 'prime_genre',\n", + " 'sup_devices.num',\n", + " 'ipadSc_urls.num',\n", + " 'lang.num',\n", + " 'vpp_lic'],\n", + " ['1',\n", + " '281656475',\n", + " 'PAC-MAN Premium',\n", + " '100788224',\n", + " 'USD',\n", + " '3.99',\n", + " '21292',\n", + " '26',\n", + " '4',\n", + " '4.5',\n", + " '6.3.5',\n", + " '4+',\n", + " 'Games',\n", + " '38',\n", + " '5',\n", + " '10',\n", + " '1'],\n", + " ['2',\n", + " '281796108',\n", + " 'Evernote - stay organized',\n", + " '158578688',\n", + " 'USD',\n", + " '0',\n", + " '161065',\n", + " '26',\n", + " '4',\n", + " '3.5',\n", + " '8.2.2',\n", + " '4+',\n", + " 'Productivity',\n", + " '37',\n", + " '5',\n", + " '23',\n", + " '1'],\n", + " ['3',\n", + " '281940292',\n", + " 'WeatherBug - Local Weather, Radar, Maps, Alerts',\n", + " '100524032',\n", + " 'USD',\n", + " '0',\n", + " '188583',\n", + " '2822',\n", + " '3.5',\n", + " '4.5',\n", + " '5.0.0',\n", + " '4+',\n", + " 'Weather',\n", + " '37',\n", + " '5',\n", + " '3',\n", + " '1'],\n", + " ['4',\n", + " '282614216',\n", + " 'eBay: Best App to Buy, Sell, Save! Online Shopping',\n", + " '128512000',\n", + " 'USD',\n", + " '0',\n", + " '262241',\n", + " '649',\n", + " '4',\n", + " '4.5',\n", + " '5.10.0',\n", + " '12+',\n", + " 'Shopping',\n", + " '37',\n", + " '5',\n", + " '9',\n", + " '1'],\n", + " ['5',\n", + " '282935706',\n", + " 'Bible',\n", + " '92774400',\n", + " 'USD',\n", + " '0',\n", + " '985920',\n", + " '5320',\n", + " '4.5',\n", + " '5',\n", + " '7.5.1',\n", + " '4+',\n", + " 'Reference',\n", + " '37',\n", + " '5',\n", + " '45',\n", + " '1'],\n", + " ['6',\n", + " '283619399',\n", + " 'Shanghai Mahjong',\n", + " '10485713',\n", + " 'USD',\n", + " '0.99',\n", + " '8253',\n", + " '5516',\n", + " '4',\n", + " '4',\n", + " '1.8',\n", + " '4+',\n", + " 'Games',\n", + " '47',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['7',\n", + " '283646709',\n", + " 'PayPal - Send and request money safely',\n", + " '227795968',\n", + " 'USD',\n", + " '0',\n", + " '119487',\n", + " '879',\n", + " '4',\n", + " '4.5',\n", + " '6.12.0',\n", + " '4+',\n", + " 'Finance',\n", + " '37',\n", + " '0',\n", + " '19',\n", + " '1'],\n", + " ['8',\n", + " '284035177',\n", + " 'Pandora - Music & Radio',\n", + " '130242560',\n", + " 'USD',\n", + " '0',\n", + " '1126879',\n", + " '3594',\n", + " '4',\n", + " '4.5',\n", + " '8.4.1',\n", + " '12+',\n", + " 'Music',\n", + " '37',\n", + " '4',\n", + " '1',\n", + " '1'],\n", + " ['9',\n", + " '284666222',\n", + " 'PCalc - The Best Calculator',\n", + " '49250304',\n", + " 'USD',\n", + " '9.99',\n", + " '1117',\n", + " '4',\n", + " '4.5',\n", + " '5',\n", + " '3.6.6',\n", + " '4+',\n", + " 'Utilities',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['10',\n", + " '284736660',\n", + " 'Ms. PAC-MAN',\n", + " '70023168',\n", + " 'USD',\n", + " '3.99',\n", + " '7885',\n", + " '40',\n", + " '4',\n", + " '4',\n", + " '4.0.4',\n", + " '4+',\n", + " 'Games',\n", + " '38',\n", + " '0',\n", + " '10',\n", + " '1'],\n", + " ['11',\n", + " '284791396',\n", + " 'Solitaire by MobilityWare',\n", + " '49618944',\n", + " 'USD',\n", + " '4.99',\n", + " '76720',\n", + " '4017',\n", + " '4.5',\n", + " '4.5',\n", + " '4.10.1',\n", + " '4+',\n", + " 'Games',\n", + " '38',\n", + " '4',\n", + " '11',\n", + " '1'],\n", + " ['12',\n", + " '284815117',\n", + " 'SCRABBLE Premium',\n", + " '227547136',\n", + " 'USD',\n", + " '7.99',\n", + " '105776',\n", + " '166',\n", + " '3.5',\n", + " '2.5',\n", + " '5.19.0',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '0',\n", + " '6',\n", + " '1'],\n", + " ['13',\n", + " '284815942',\n", + " 'Google – Search made just for mobile',\n", + " '179979264',\n", + " 'USD',\n", + " '0',\n", + " '479440',\n", + " '203',\n", + " '3.5',\n", + " '4',\n", + " '27.0',\n", + " '17+',\n", + " 'Utilities',\n", + " '37',\n", + " '4',\n", + " '33',\n", + " '1'],\n", + " ['14',\n", + " '284847138',\n", + " 'Bank of America - Mobile Banking',\n", + " '160925696',\n", + " 'USD',\n", + " '0',\n", + " '119773',\n", + " '2336',\n", + " '3.5',\n", + " '4.5',\n", + " '7.3.8',\n", + " '4+',\n", + " 'Finance',\n", + " '37',\n", + " '0',\n", + " '2',\n", + " '1'],\n", + " ['15',\n", + " '284862767',\n", + " 'FreeCell',\n", + " '55153664',\n", + " 'USD',\n", + " '4.99',\n", + " '6340',\n", + " '668',\n", + " '4.5',\n", + " '4.5',\n", + " '4.0.3',\n", + " '4+',\n", + " 'Games',\n", + " '38',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['16',\n", + " '284876795',\n", + " 'TripAdvisor Hotels Flights Restaurants',\n", + " '207907840',\n", + " 'USD',\n", + " '0',\n", + " '56194',\n", + " '87',\n", + " '4',\n", + " '3.5',\n", + " '21.1',\n", + " '4+',\n", + " 'Travel',\n", + " '37',\n", + " '1',\n", + " '26',\n", + " '1'],\n", + " ['17',\n", + " '284882215',\n", + " 'Facebook',\n", + " '389879808',\n", + " 'USD',\n", + " '0',\n", + " '2974676',\n", + " '212',\n", + " '3.5',\n", + " '3.5',\n", + " '95.0',\n", + " '4+',\n", + " 'Social Networking',\n", + " '37',\n", + " '1',\n", + " '29',\n", + " '1'],\n", + " ['18',\n", + " '284910350',\n", + " 'Yelp - Nearby Restaurants, Shopping & Services',\n", + " '167407616',\n", + " 'USD',\n", + " '0',\n", + " '223885',\n", + " '3726',\n", + " '4',\n", + " '4.5',\n", + " '11.15.0',\n", + " '12+',\n", + " 'Travel',\n", + " '37',\n", + " '5',\n", + " '18',\n", + " '1'],\n", + " ['20',\n", + " '284993459',\n", + " 'Shazam - Discover music, artists, videos & lyrics',\n", + " '147093504',\n", + " 'USD',\n", + " '0',\n", + " '402925',\n", + " '136',\n", + " '4',\n", + " '4.5',\n", + " '11.0.3',\n", + " '12+',\n", + " 'Music',\n", + " '37',\n", + " '3',\n", + " '16',\n", + " '1'],\n", + " ['21',\n", + " '285005463',\n", + " 'Crash Bandicoot Nitro Kart 3D',\n", + " '10735026',\n", + " 'USD',\n", + " '2.99',\n", + " '31456',\n", + " '4178',\n", + " '4',\n", + " '3.5',\n", + " '1.0.0',\n", + " '4+',\n", + " 'Games',\n", + " '47',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['22',\n", + " '285946052',\n", + " 'iQuran',\n", + " '70707916',\n", + " 'USD',\n", + " '1.99',\n", + " '2929',\n", + " '966',\n", + " '4.5',\n", + " '4.5',\n", + " '3.3',\n", + " '4+',\n", + " 'Reference',\n", + " '43',\n", + " '0',\n", + " '2',\n", + " '1'],\n", + " ['23',\n", + " '285994151',\n", + " ':) Sudoku +',\n", + " '6169600',\n", + " 'USD',\n", + " '2.99',\n", + " '11447',\n", + " '781',\n", + " '5',\n", + " '5',\n", + " '5.2.6',\n", + " '4+',\n", + " 'Games',\n", + " '40',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['24',\n", + " '286058814',\n", + " 'Yahoo Sports - Teams, Scores, News & Highlights',\n", + " '130583552',\n", + " 'USD',\n", + " '0',\n", + " '137951',\n", + " '131',\n", + " '4',\n", + " '4.5',\n", + " '6.9',\n", + " '4+',\n", + " 'Sports',\n", + " '37',\n", + " '2',\n", + " '6',\n", + " '1'],\n", + " ['25',\n", + " '286070473',\n", + " 'Mileage Log | Fahrtenbuch',\n", + " '71203840',\n", + " 'USD',\n", + " '5.99',\n", + " '8',\n", + " '0',\n", + " '4.5',\n", + " '0',\n", + " '9.0.5',\n", + " '4+',\n", + " 'Business',\n", + " '37',\n", + " '5',\n", + " '3',\n", + " '1'],\n", + " ['27',\n", + " '286799607',\n", + " 'Cleartune - Chromatic Tuner',\n", + " '11423008',\n", + " 'USD',\n", + " '3.99',\n", + " '3241',\n", + " '297',\n", + " '4',\n", + " '4',\n", + " '2.1.3',\n", + " '4+',\n", + " 'Music',\n", + " '43',\n", + " '2',\n", + " '10',\n", + " '1'],\n", + " ['28',\n", + " '286906691',\n", + " 'Lifesum – Inspiring healthy lifestyle app',\n", + " '188017664',\n", + " 'USD',\n", + " '0',\n", + " '5795',\n", + " '12',\n", + " '3.5',\n", + " '4',\n", + " '8.4.1',\n", + " '4+',\n", + " 'Health & Fitness',\n", + " '37',\n", + " '5',\n", + " '11',\n", + " '1'],\n", + " ['29',\n", + " '286911400',\n", + " 'Hangman.',\n", + " '4765696',\n", + " 'USD',\n", + " '0',\n", + " '42316',\n", + " '248',\n", + " '3',\n", + " '3.5',\n", + " '2.0.6',\n", + " '9+',\n", + " 'Games',\n", + " '38',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['31',\n", + " '288113403',\n", + " 'iTranslate - Language Translator & Dictionary',\n", + " '287933440',\n", + " 'USD',\n", + " '0',\n", + " '123215',\n", + " '25',\n", + " '3.5',\n", + " '5',\n", + " '10.5.4',\n", + " '4+',\n", + " 'Productivity',\n", + " '37',\n", + " '5',\n", + " '23',\n", + " '1'],\n", + " ['32',\n", + " '288120394',\n", + " 'TouchOSC',\n", + " '4263936',\n", + " 'USD',\n", + " '4.99',\n", + " '782',\n", + " '7',\n", + " '4',\n", + " '3.5',\n", + " '1.9.8',\n", + " '4+',\n", + " 'Music',\n", + " '43',\n", + " '1',\n", + " '1',\n", + " '1'],\n", + " ['33',\n", + " '288419283',\n", + " 'RadarScope',\n", + " '172772352',\n", + " 'USD',\n", + " '9.99',\n", + " '3449',\n", + " '23',\n", + " '4',\n", + " '4.5',\n", + " '3.4.1',\n", + " '4+',\n", + " 'Weather',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['34',\n", + " '288429040',\n", + " 'LinkedIn',\n", + " '273844224',\n", + " 'USD',\n", + " '0',\n", + " '71856',\n", + " '62',\n", + " '3.5',\n", + " '4.5',\n", + " '9.1.32',\n", + " '4+',\n", + " 'Social Networking',\n", + " '37',\n", + " '2',\n", + " '23',\n", + " '1'],\n", + " ['35',\n", + " '289084315',\n", + " 'Period Tracker Deluxe',\n", + " '40216576',\n", + " 'USD',\n", + " '1.99',\n", + " '13350',\n", + " '489',\n", + " '4.5',\n", + " '5',\n", + " '9.6',\n", + " '12+',\n", + " 'Health & Fitness',\n", + " '38',\n", + " '0',\n", + " '15',\n", + " '1'],\n", + " ['36',\n", + " '289446241',\n", + " 'Election 2016 Map',\n", + " '2386944',\n", + " 'USD',\n", + " '0.99',\n", + " '137',\n", + " '0',\n", + " '3',\n", + " '0',\n", + " '5.0',\n", + " '4+',\n", + " 'Entertainment',\n", + " '37',\n", + " '1',\n", + " '1',\n", + " '1'],\n", + " ['37',\n", + " '289523017',\n", + " 'Blackjack by MobilityWare',\n", + " '105431040',\n", + " 'USD',\n", + " '0',\n", + " '180087',\n", + " '1101',\n", + " '3.5',\n", + " '4.5',\n", + " '5.5.3',\n", + " '12+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '5',\n", + " '1'],\n", + " ['39',\n", + " '289894882',\n", + " 'White Noise',\n", + " '44129280',\n", + " 'USD',\n", + " '0.99',\n", + " '33426',\n", + " '299',\n", + " '4',\n", + " '5',\n", + " '7.2',\n", + " '4+',\n", + " 'Health & Fitness',\n", + " '37',\n", + " '5',\n", + " '3',\n", + " '1'],\n", + " ['40',\n", + " '290638154',\n", + " 'iHeartRadio – Free Music & Radio Stations',\n", + " '116443136',\n", + " 'USD',\n", + " '0',\n", + " '293228',\n", + " '110',\n", + " '4',\n", + " '3',\n", + " '8.0.0',\n", + " '12+',\n", + " 'Music',\n", + " '37',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['41',\n", + " '290807369',\n", + " 'Line Rider iRide™',\n", + " '1646592',\n", + " 'USD',\n", + " '1.99',\n", + " '21609',\n", + " '69',\n", + " '3.5',\n", + " '2.5',\n", + " '2.4',\n", + " '9+',\n", + " 'Entertainment',\n", + " '40',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['42',\n", + " '290986013',\n", + " 'Deliveries: a package tracker',\n", + " '30016512',\n", + " 'USD',\n", + " '4.99',\n", + " '4684',\n", + " '10',\n", + " '4',\n", + " '4',\n", + " '8.0.3',\n", + " '4+',\n", + " 'Utilities',\n", + " '37',\n", + " '4',\n", + " '9',\n", + " '1'],\n", + " ['43',\n", + " '291430598',\n", + " 'Hurricane Pro',\n", + " '29518848',\n", + " 'USD',\n", + " '2.99',\n", + " '2104',\n", + " '0',\n", + " '4.5',\n", + " '0',\n", + " '5.2',\n", + " '17+',\n", + " 'Weather',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['47',\n", + " '292421271',\n", + " 'Fieldrunners',\n", + " '66872320',\n", + " 'USD',\n", + " '2.99',\n", + " '41633',\n", + " '6',\n", + " '4',\n", + " '3',\n", + " '1.7.177604',\n", + " '9+',\n", + " 'Games',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['48',\n", + " '292628469',\n", + " 'Juxtaposer',\n", + " '45229056',\n", + " 'USD',\n", + " '2.99',\n", + " '3610',\n", + " '7',\n", + " '4.5',\n", + " '5',\n", + " '3.8.2',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['49',\n", + " '292738169',\n", + " 'Deezer - Listen to your Favorite Music & Playlists',\n", + " '127470592',\n", + " 'USD',\n", + " '0',\n", + " '4677',\n", + " '12',\n", + " '3',\n", + " '4',\n", + " '6.19.0',\n", + " '12+',\n", + " 'Music',\n", + " '37',\n", + " '5',\n", + " '21',\n", + " '1'],\n", + " ['50',\n", + " '293118835',\n", + " 'iStellar',\n", + " '44241920',\n", + " 'USD',\n", + " '3.99',\n", + " '30',\n", + " '0',\n", + " '3.5',\n", + " '0',\n", + " '2.9.0',\n", + " '4+',\n", + " 'Navigation',\n", + " '37',\n", + " '0',\n", + " '2',\n", + " '0'],\n", + " ['51',\n", + " '293523031',\n", + " 'Sonos Controller',\n", + " '107983872',\n", + " 'USD',\n", + " '0',\n", + " '48905',\n", + " '2691',\n", + " '4.5',\n", + " '4.5',\n", + " '7.2',\n", + " '4+',\n", + " 'Music',\n", + " '37',\n", + " '4',\n", + " '12',\n", + " '1'],\n", + " ['52',\n", + " '293573778',\n", + " 'Avertinoo',\n", + " '8044544',\n", + " 'USD',\n", + " '4.99',\n", + " '32',\n", + " '0',\n", + " '3',\n", + " '0',\n", + " '3.9.2',\n", + " '4+',\n", + " 'Navigation',\n", + " '38',\n", + " '5',\n", + " '7',\n", + " '1'],\n", + " ['53',\n", + " '293622097',\n", + " 'Google Earth',\n", + " '37214208',\n", + " 'USD',\n", + " '0',\n", + " '446185',\n", + " '1359',\n", + " '3.5',\n", + " '3.5',\n", + " '7.1.6',\n", + " '4+',\n", + " 'Travel',\n", + " '43',\n", + " '5',\n", + " '30',\n", + " '1'],\n", + " ['54',\n", + " '293760823',\n", + " 'iFart - The Original Fart Sounds App',\n", + " '60320768',\n", + " 'USD',\n", + " '1.99',\n", + " '21825',\n", + " '10',\n", + " '3',\n", + " '4',\n", + " '4.0.8',\n", + " '9+',\n", + " 'Entertainment',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['55',\n", + " '293778748',\n", + " 'PAC-MAN',\n", + " '100849664',\n", + " 'USD',\n", + " '0',\n", + " '508808',\n", + " '99',\n", + " '3',\n", + " '4.5',\n", + " '6.3.5',\n", + " '4+',\n", + " 'Games',\n", + " '38',\n", + " '5',\n", + " '10',\n", + " '1'],\n", + " ['57',\n", + " '294056623',\n", + " 'FOX Sports Mobile',\n", + " '72748032',\n", + " 'USD',\n", + " '0',\n", + " '57500',\n", + " '103',\n", + " '3',\n", + " '4',\n", + " '3.5.13',\n", + " '4+',\n", + " 'Sports',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '0'],\n", + " ['58',\n", + " '294536447',\n", + " 'First Words Animals',\n", + " '32164864',\n", + " 'USD',\n", + " '1.99',\n", + " '2576',\n", + " '4',\n", + " '4',\n", + " '5',\n", + " '7.0',\n", + " '4+',\n", + " 'Games',\n", + " '38',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['59',\n", + " '294631159',\n", + " 'WeatherPro',\n", + " '69079040',\n", + " 'USD',\n", + " '1.99',\n", + " '1572',\n", + " '34',\n", + " '4',\n", + " '4.5',\n", + " '4.8.2',\n", + " '4+',\n", + " 'Weather',\n", + " '37',\n", + " '0',\n", + " '13',\n", + " '1'],\n", + " ['60',\n", + " '294934058',\n", + " 'HotSchedules',\n", + " '82037760',\n", + " 'USD',\n", + " '2.99',\n", + " '3292',\n", + " '2',\n", + " '3',\n", + " '5',\n", + " '4.56.1',\n", + " '4+',\n", + " 'Business',\n", + " '37',\n", + " '2',\n", + " '2',\n", + " '1'],\n", + " ['61',\n", + " '295430577',\n", + " 'Star Walk - Find Stars And Planets in Sky Above',\n", + " '150195200',\n", + " 'USD',\n", + " '4.99',\n", + " '8932',\n", + " '55',\n", + " '4.5',\n", + " '5',\n", + " '7.2.3',\n", + " '4+',\n", + " 'Education',\n", + " '37',\n", + " '0',\n", + " '12',\n", + " '1'],\n", + " ['62',\n", + " '295646461',\n", + " 'The Weather Channel: Forecast, Radar & Alerts',\n", + " '199734272',\n", + " 'USD',\n", + " '0',\n", + " '495626',\n", + " '5893',\n", + " '3.5',\n", + " '4.5',\n", + " '8.11',\n", + " '4+',\n", + " 'Weather',\n", + " '37',\n", + " '0',\n", + " '33',\n", + " '1'],\n", + " ['63',\n", + " '295759189',\n", + " 'Big Day - Event Countdown',\n", + " '13156352',\n", + " 'USD',\n", + " '0.99',\n", + " '812',\n", + " '14',\n", + " '3',\n", + " '4',\n", + " '8.2.0',\n", + " '4+',\n", + " 'Lifestyle',\n", + " '38',\n", + " '0',\n", + " '7',\n", + " '1'],\n", + " ['64',\n", + " '295775656',\n", + " '12 Steps AA Companion - Alcoholics Anonymous',\n", + " '30367744',\n", + " 'USD',\n", + " '2.99',\n", + " '1583',\n", + " '2',\n", + " '3.5',\n", + " '4.5',\n", + " '2.5.9.2',\n", + " '12+',\n", + " 'Lifestyle',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['65',\n", + " '296581815',\n", + " 'OpenTable - Restaurant Reservations',\n", + " '93420544',\n", + " 'USD',\n", + " '0',\n", + " '113936',\n", + " '150',\n", + " '4.5',\n", + " '5',\n", + " '10.18.0',\n", + " '4+',\n", + " 'Food & Drink',\n", + " '37',\n", + " '1',\n", + " '6',\n", + " '1'],\n", + " ['66',\n", + " '297244048',\n", + " 'VLC Remote',\n", + " '31505408',\n", + " 'USD',\n", + " '4.99',\n", + " '2027',\n", + " '2',\n", + " '4',\n", + " '5',\n", + " '9.30',\n", + " '4+',\n", + " 'Entertainment',\n", + " '37',\n", + " '5',\n", + " '33',\n", + " '1'],\n", + " ['67',\n", + " '297332787',\n", + " 'gFlashPro - Flashcards & Tests',\n", + " '25997312',\n", + " 'USD',\n", + " '3.99',\n", + " '768',\n", + " '4',\n", + " '4',\n", + " '4',\n", + " '7.1',\n", + " '4+',\n", + " 'Education',\n", + " '37',\n", + " '3',\n", + " '3',\n", + " '1'],\n", + " ['68',\n", + " '297368629',\n", + " 'Lose It! – Weight Loss Program and Calorie Counter',\n", + " '182054912',\n", + " 'USD',\n", + " '0',\n", + " '373835',\n", + " '402',\n", + " '4',\n", + " '4.5',\n", + " '8.0.2',\n", + " '4+',\n", + " 'Health & Fitness',\n", + " '37',\n", + " '3',\n", + " '1',\n", + " '1'],\n", + " ['69',\n", + " '297430070',\n", + " 'Target',\n", + " '138754048',\n", + " 'USD',\n", + " '0',\n", + " '108131',\n", + " '13',\n", + " '3',\n", + " '2',\n", + " '8.21.0',\n", + " '4+',\n", + " 'Shopping',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['70',\n", + " '297606726',\n", + " 'Fish Tycoon',\n", + " '13564835',\n", + " 'USD',\n", + " '0.99',\n", + " '18943',\n", + " '1787',\n", + " '3.5',\n", + " '4.5',\n", + " '1.1.0',\n", + " '4+',\n", + " 'Games',\n", + " '47',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['71',\n", + " '297606951',\n", + " 'Amazon App: shop, scan, compare, and read reviews',\n", + " '133688320',\n", + " 'USD',\n", + " '0',\n", + " '126312',\n", + " '22',\n", + " '3.5',\n", + " '3',\n", + " '9.10.0',\n", + " '4+',\n", + " 'Shopping',\n", + " '37',\n", + " '5',\n", + " '8',\n", + " '1'],\n", + " ['72',\n", + " '297694601',\n", + " 'Touchgrind',\n", + " '55205888',\n", + " 'USD',\n", + " '4.99',\n", + " '35735',\n", + " '378',\n", + " '4',\n", + " '4.5',\n", + " '1.5.1',\n", + " '4+',\n", + " 'Games',\n", + " '40',\n", + " '0',\n", + " '0',\n", + " '1'],\n", + " ['73',\n", + " '298127110',\n", + " 'ProPresenter Remote',\n", + " '46922752',\n", + " 'USD',\n", + " '4.99',\n", + " '410',\n", + " '7',\n", + " '3',\n", + " '2.5',\n", + " '4.8.1',\n", + " '4+',\n", + " 'Utilities',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['74',\n", + " '298206806',\n", + " 'iReal Pro - Music Book & Play Along',\n", + " '63283200',\n", + " 'USD',\n", + " '12.99',\n", + " '1390',\n", + " '143',\n", + " '4.5',\n", + " '5',\n", + " '7.0.1',\n", + " '4+',\n", + " 'Music',\n", + " '37',\n", + " '5',\n", + " '33',\n", + " '1'],\n", + " ['75',\n", + " '298596830',\n", + " 'NRJ Radio',\n", + " '53426176',\n", + " 'USD',\n", + " '0',\n", + " '38',\n", + " '2',\n", + " '3.5',\n", + " '5',\n", + " '5.2.6',\n", + " '4+',\n", + " 'Music',\n", + " '37',\n", + " '5',\n", + " '4',\n", + " '1'],\n", + " ['76',\n", + " '298867247',\n", + " 'Chase Mobile℠',\n", + " '39505920',\n", + " 'USD',\n", + " '0',\n", + " '233270',\n", + " '14625',\n", + " '4.5',\n", + " '4.5',\n", + " '2.610',\n", + " '4+',\n", + " 'Finance',\n", + " '37',\n", + " '0',\n", + " '2',\n", + " '1'],\n", + " ['77',\n", + " '299029654',\n", + " '大辞林',\n", + " '210088960',\n", + " 'USD',\n", + " '21.99',\n", + " '64',\n", + " '0',\n", + " '4.5',\n", + " '0',\n", + " '4.1.1',\n", + " '4+',\n", + " 'Reference',\n", + " '37',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['79',\n", + " '299515267',\n", + " 'Allrecipes Dinner Spinner',\n", + " '36399104',\n", + " 'USD',\n", + " '0',\n", + " '109349',\n", + " '1540',\n", + " '3.5',\n", + " '5',\n", + " '6.3',\n", + " '12+',\n", + " 'Food & Drink',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['80',\n", + " '299853944',\n", + " '新浪新闻-阅读最新时事热门头条资讯视频',\n", + " '115143680',\n", + " 'USD',\n", + " '0',\n", + " '2229',\n", + " '4',\n", + " '3.5',\n", + " '1',\n", + " '6.2.1',\n", + " '17+',\n", + " 'News',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['81',\n", + " '299949744',\n", + " 'MotionX GPS',\n", + " '56481792',\n", + " 'USD',\n", + " '1.99',\n", + " '14970',\n", + " '24',\n", + " '3.5',\n", + " '4.5',\n", + " '24.2',\n", + " '4+',\n", + " 'Navigation',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['82',\n", + " '300048137',\n", + " 'AccuWeather - Weather for Life',\n", + " '181941248',\n", + " 'USD',\n", + " '0',\n", + " '144214',\n", + " '2162',\n", + " '3.5',\n", + " '4',\n", + " '10.4.1',\n", + " '4+',\n", + " 'Weather',\n", + " '37',\n", + " '1',\n", + " '43',\n", + " '1'],\n", + " ['83',\n", + " '300238550',\n", + " 'Mint: Personal Finance, Budget, Bills & Money',\n", + " '162891776',\n", + " 'USD',\n", + " '0',\n", + " '232940',\n", + " '683',\n", + " '4',\n", + " '4.5',\n", + " '5.9.0',\n", + " '4+',\n", + " 'Finance',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['84',\n", + " '300255638',\n", + " 'ABC News - US & World News + Live Video',\n", + " '98108416',\n", + " 'USD',\n", + " '0',\n", + " '48407',\n", + " '20',\n", + " '3',\n", + " '3.5',\n", + " '5.16',\n", + " '12+',\n", + " 'News',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '0'],\n", + " ['85',\n", + " '300265786',\n", + " 'Rowmote: Remote Control for Mac',\n", + " '54088704',\n", + " 'USD',\n", + " '0.99',\n", + " '5531',\n", + " '37',\n", + " '3.5',\n", + " '2.5',\n", + " '4.3',\n", + " '4+',\n", + " 'Utilities',\n", + " '40',\n", + " '3',\n", + " '13',\n", + " '1'],\n", + " ['86',\n", + " '300590611',\n", + " 'Peekaboo Barn',\n", + " '50155520',\n", + " 'USD',\n", + " '1.99',\n", + " '3393',\n", + " '77',\n", + " '4',\n", + " '4',\n", + " '5.1.0',\n", + " '4+',\n", + " 'Education',\n", + " '43',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['87',\n", + " '300704847',\n", + " 'Speedtest by Ookla',\n", + " '23936000',\n", + " 'USD',\n", + " '0',\n", + " '65016',\n", + " '274',\n", + " '3.5',\n", + " '5',\n", + " '3.8.2',\n", + " '4+',\n", + " 'Utilities',\n", + " '38',\n", + " '4',\n", + " '17',\n", + " '1'],\n", + " ['89',\n", + " '301387274',\n", + " 'Pocket God',\n", + " '145293312',\n", + " 'USD',\n", + " '0.99',\n", + " '187529',\n", + " '1071',\n", + " '4',\n", + " '4',\n", + " '1.48.2',\n", + " '9+',\n", + " 'Entertainment',\n", + " '43',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['90',\n", + " '301521403',\n", + " 'Nike+ Training Club - Workouts & Fitness Plans',\n", + " '140367872',\n", + " 'USD',\n", + " '0',\n", + " '33969',\n", + " '466',\n", + " '3.5',\n", + " '5',\n", + " '5.4.1',\n", + " '4+',\n", + " 'Health & Fitness',\n", + " '37',\n", + " '0',\n", + " '17',\n", + " '1'],\n", + " ['91',\n", + " '301724680',\n", + " 'Citi Mobile®',\n", + " '281244672',\n", + " 'USD',\n", + " '0',\n", + " '48822',\n", + " '193',\n", + " '3.5',\n", + " '4',\n", + " '8.5.0',\n", + " '4+',\n", + " 'Finance',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['92',\n", + " '302049354',\n", + " 'Phase 10 Pro - Play Your Friends!',\n", + " '66695168',\n", + " 'USD',\n", + " '1.99',\n", + " '59155',\n", + " '101',\n", + " '4.5',\n", + " '2.5',\n", + " '3.2.0',\n", + " '4+',\n", + " 'Games',\n", + " '40',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['93',\n", + " '302584613',\n", + " 'Kindle – Read eBooks, Magazines & Textbooks',\n", + " '169747456',\n", + " 'USD',\n", + " '0',\n", + " '252076',\n", + " '80',\n", + " '3.5',\n", + " '4.5',\n", + " '5.11',\n", + " '4+',\n", + " 'Book',\n", + " '37',\n", + " '5',\n", + " '9',\n", + " '1'],\n", + " ['95',\n", + " '303058767',\n", + " 'MASH',\n", + " '41691136',\n", + " 'USD',\n", + " '1.99',\n", + " '4913',\n", + " '1',\n", + " '4',\n", + " '4',\n", + " '3.3.2',\n", + " '9+',\n", + " 'Games',\n", + " '37',\n", + " '3',\n", + " '15',\n", + " '1'],\n", + " ['96',\n", + " '303191318',\n", + " '同花顺-炒股、股票',\n", + " '122886144',\n", + " 'USD',\n", + " '0',\n", + " '1744',\n", + " '0',\n", + " '3.5',\n", + " '0',\n", + " '10.10.46',\n", + " '4+',\n", + " 'Finance',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['97',\n", + " '303337299',\n", + " 'Wedding Dash Deluxe',\n", + " '55803904',\n", + " 'USD',\n", + " '0.99',\n", + " '16567',\n", + " '1155',\n", + " '4.5',\n", + " '4.5',\n", + " '2.29.13',\n", + " '4+',\n", + " 'Games',\n", + " '43',\n", + " '4',\n", + " '1',\n", + " '1'],\n", + " ['99',\n", + " '303849934',\n", + " 'Beer Pong Game',\n", + " '188956672',\n", + " 'USD',\n", + " '0',\n", + " '187315',\n", + " '9',\n", + " '2',\n", + " '4',\n", + " '17.05.15',\n", + " '17+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '9',\n", + " '1'],\n", + " ['100',\n", + " '304731501',\n", + " 'Tempo - Metronome with Setlists',\n", + " '22185984',\n", + " 'USD',\n", + " '2.99',\n", + " '4781',\n", + " '1',\n", + " '4.5',\n", + " '5',\n", + " '3.9.2',\n", + " '4+',\n", + " 'Music',\n", + " '37',\n", + " '5',\n", + " '10',\n", + " '1'],\n", + " ['101',\n", + " '304770340',\n", + " 'Skat',\n", + " '66160640',\n", + " 'USD',\n", + " '3.99',\n", + " '94',\n", + " '4',\n", + " '4.5',\n", + " '4.5',\n", + " '11.0.10',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['102',\n", + " '304871603',\n", + " 'Color Splash',\n", + " '28135424',\n", + " 'USD',\n", + " '0.99',\n", + " '29554',\n", + " '55',\n", + " '4',\n", + " '5',\n", + " '3.6.1',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '37',\n", + " '0',\n", + " '3',\n", + " '1'],\n", + " ['103',\n", + " '304871622',\n", + " 'Zombieville USA',\n", + " '27962441',\n", + " 'USD',\n", + " '0.99',\n", + " '32988',\n", + " '2489',\n", + " '4',\n", + " '4',\n", + " '1.7',\n", + " '12+',\n", + " 'Games',\n", + " '47',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['104',\n", + " '304878510',\n", + " 'Skype for iPhone',\n", + " '133238784',\n", + " 'USD',\n", + " '0',\n", + " '373519',\n", + " '127',\n", + " '3.5',\n", + " '4',\n", + " '6.35.1',\n", + " '4+',\n", + " 'Social Networking',\n", + " '37',\n", + " '0',\n", + " '32',\n", + " '1'],\n", + " ['105',\n", + " '305343404',\n", + " 'Tumblr',\n", + " '151573504',\n", + " 'USD',\n", + " '0',\n", + " '334293',\n", + " '919',\n", + " '4',\n", + " '4',\n", + " '8.6',\n", + " '17+',\n", + " 'Social Networking',\n", + " '37',\n", + " '5',\n", + " '16',\n", + " '1'],\n", + " ['106',\n", + " '305557780',\n", + " 'iSwap Faces',\n", + " '27069440',\n", + " 'USD',\n", + " '1.99',\n", + " '2302',\n", + " '3',\n", + " '3.5',\n", + " '5',\n", + " '5.1',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['107',\n", + " '305939712',\n", + " 'Match™ - #1 Dating App.',\n", + " '101259264',\n", + " 'USD',\n", + " '0',\n", + " '60659',\n", + " '57',\n", + " '3',\n", + " '2.5',\n", + " '17.05.01',\n", + " '17+',\n", + " 'Social Networking',\n", + " '37',\n", + " '5',\n", + " '10',\n", + " '1'],\n", + " ['108',\n", + " '306169895',\n", + " \"Tozzle - Toddler's favorite puzzle\",\n", + " '168192000',\n", + " 'USD',\n", + " '2.99',\n", + " '2562',\n", + " '10',\n", + " '4',\n", + " '4.5',\n", + " '5.1',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '4',\n", + " '1'],\n", + " ['109',\n", + " '306257910',\n", + " 'HomeBudget with Sync',\n", + " '17485824',\n", + " 'USD',\n", + " '4.99',\n", + " '3042',\n", + " '6',\n", + " '3.5',\n", + " '4',\n", + " '3.3.0',\n", + " '4+',\n", + " 'Finance',\n", + " '37',\n", + " '5',\n", + " '11',\n", + " '1'],\n", + " ['110',\n", + " '306375551',\n", + " 'Wind Meter',\n", + " '5234688',\n", + " 'USD',\n", + " '0.99',\n", + " '338',\n", + " '12',\n", + " '2.5',\n", + " '2',\n", + " '5.0',\n", + " '4+',\n", + " 'Weather',\n", + " '43',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['111',\n", + " '306468004',\n", + " 'Map My Run+ - GPS Running & Workout Tracker',\n", + " '237913088',\n", + " 'USD',\n", + " '2.99',\n", + " '16434',\n", + " '3',\n", + " '4.5',\n", + " '4.5',\n", + " '17.5.5',\n", + " '4+',\n", + " 'Health & Fitness',\n", + " '37',\n", + " '0',\n", + " '9',\n", + " '1'],\n", + " ['112',\n", + " '306561234',\n", + " 'Map My Ride+ - GPS Cycling & Route Tracker',\n", + " '233513984',\n", + " 'USD',\n", + " '2.99',\n", + " '10046',\n", + " '7',\n", + " '4.5',\n", + " '5',\n", + " '17.5.5',\n", + " '4+',\n", + " 'Health & Fitness',\n", + " '37',\n", + " '0',\n", + " '9',\n", + " '1'],\n", + " ['113',\n", + " '306621789',\n", + " 'HuffPost - News, Politics & Entertainment',\n", + " '110420992',\n", + " 'USD',\n", + " '0',\n", + " '29107',\n", + " '85',\n", + " '3',\n", + " '4',\n", + " '11.2',\n", + " '12+',\n", + " 'News',\n", + " '37',\n", + " '5',\n", + " '10',\n", + " '1'],\n", + " ['114',\n", + " '306628397',\n", + " 'Phrase Party!',\n", + " '47774720',\n", + " 'USD',\n", + " '1.99',\n", + " '878',\n", + " '48',\n", + " '4',\n", + " '4.5',\n", + " '8.7.5',\n", + " '17+',\n", + " 'Games',\n", + " '38',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['115',\n", + " '306937053',\n", + " 'Minesweeper Classic',\n", + " '22259712',\n", + " 'USD',\n", + " '0.99',\n", + " '1140',\n", + " '20',\n", + " '3.5',\n", + " '3.5',\n", + " '3.6',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '4',\n", + " '1',\n", + " '1'],\n", + " ['116',\n", + " '307132353',\n", + " \"Sally's Spa\",\n", + " '431771648',\n", + " 'USD',\n", + " '2.99',\n", + " '35074',\n", + " '403',\n", + " '4.5',\n", + " '4',\n", + " '3.3.0',\n", + " '4+',\n", + " 'Games',\n", + " '43',\n", + " '0',\n", + " '6',\n", + " '1'],\n", + " ['117',\n", + " '307184892',\n", + " 'CBS Sports App - Sports Scores, News, Stats, Watch',\n", + " '120357888',\n", + " 'USD',\n", + " '0',\n", + " '59639',\n", + " '11',\n", + " '3',\n", + " '2.5',\n", + " '10.2.2',\n", + " '17+',\n", + " 'Sports',\n", + " '37',\n", + " '4',\n", + " '1',\n", + " '1'],\n", + " ['118',\n", + " '307219387',\n", + " 'Brain Wave ™ - 32 Advanced Binaural Brainwave Entrainment Programs with iTunes Music and Relaxing Ambience',\n", + " '90828800',\n", + " 'USD',\n", + " '4.99',\n", + " '2913',\n", + " '357',\n", + " '4',\n", + " '5',\n", + " '7.4',\n", + " '4+',\n", + " 'Health & Fitness',\n", + " '43',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['119',\n", + " '307354030',\n", + " 'iSwap Faces LITE',\n", + " '30796800',\n", + " 'USD',\n", + " '0',\n", + " '39722',\n", + " '0',\n", + " '3',\n", + " '0',\n", + " '5.1',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['120',\n", + " '307386350',\n", + " 'DIRECTV',\n", + " '151397376',\n", + " 'USD',\n", + " '0',\n", + " '81006',\n", + " '25',\n", + " '3.5',\n", + " '3',\n", + " '4.9.705',\n", + " '4+',\n", + " 'Entertainment',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['121',\n", + " '307569751',\n", + " 'NYTimes Crossword - Daily Word Puzzle Game',\n", + " '46880768',\n", + " 'USD',\n", + " '0',\n", + " '53465',\n", + " '204',\n", + " '3.5',\n", + " '4',\n", + " '2.8.1',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['122',\n", + " '307727765',\n", + " 'Doodle Jump',\n", + " '48741376',\n", + " 'USD',\n", + " '0.99',\n", + " '395261',\n", + " '88',\n", + " '4.5',\n", + " '4.5',\n", + " '3.17.6',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['123',\n", + " '307741537',\n", + " 'LEDit – The LED Banner App',\n", + " '17145856',\n", + " 'USD',\n", + " '1.99',\n", + " '2021',\n", + " '147',\n", + " '4.5',\n", + " '4.5',\n", + " '3.5.1',\n", + " '4+',\n", + " 'Utilities',\n", + " '37',\n", + " '4',\n", + " '12',\n", + " '1'],\n", + " ['124',\n", + " '307764057',\n", + " 'niconico',\n", + " '25808896',\n", + " 'USD',\n", + " '0',\n", + " '182',\n", + " '0',\n", + " '3',\n", + " '0',\n", + " '6.52',\n", + " '17+',\n", + " 'Entertainment',\n", + " '37',\n", + " '5',\n", + " '3',\n", + " '1'],\n", + " ['125',\n", + " '307906541',\n", + " 'Fandango Movies - Times + Tickets',\n", + " '81924096',\n", + " 'USD',\n", + " '0',\n", + " '291787',\n", + " '589',\n", + " '4',\n", + " '5',\n", + " '8.6',\n", + " '4+',\n", + " 'Entertainment',\n", + " '37',\n", + " '4',\n", + " '1',\n", + " '1'],\n", + " ['126',\n", + " '308111628',\n", + " 'iCab Mobile (Web Browser)',\n", + " '19451904',\n", + " 'USD',\n", + " '1.99',\n", + " '2441',\n", + " '4',\n", + " '4',\n", + " '5',\n", + " '9.9',\n", + " '17+',\n", + " 'Utilities',\n", + " '38',\n", + " '4',\n", + " '12',\n", + " '1'],\n", + " ['128',\n", + " '308339980',\n", + " 'iRagdoll - Ragdoll Physics',\n", + " '118683648',\n", + " 'USD',\n", + " '0.99',\n", + " '1372',\n", + " '25',\n", + " '4',\n", + " '4',\n", + " '1.8.3',\n", + " '12+',\n", + " 'Games',\n", + " '37',\n", + " '2',\n", + " '1',\n", + " '1'],\n", + " ['129',\n", + " '308368164',\n", + " 'Proloquo2Go - Symbol-based AAC',\n", + " '723764224',\n", + " 'USD',\n", + " '249.99',\n", + " '773',\n", + " '10',\n", + " '4',\n", + " '3.5',\n", + " '5.0.1',\n", + " '4+',\n", + " 'Education',\n", + " '37',\n", + " '5',\n", + " '3',\n", + " '1'],\n", + " ['130',\n", + " '308750436',\n", + " 'Dictionary.com Dictionary & Thesaurus',\n", + " '111275008',\n", + " 'USD',\n", + " '0',\n", + " '200047',\n", + " '177',\n", + " '4',\n", + " '4',\n", + " '7.1.3',\n", + " '4+',\n", + " 'Reference',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['132',\n", + " '308834491',\n", + " \"20 Minutes.fr - l'actualité en continu\",\n", + " '109616128',\n", + " 'USD',\n", + " '0',\n", + " '112',\n", + " '0',\n", + " '3.5',\n", + " '0',\n", + " '5.0.11',\n", + " '12+',\n", + " 'News',\n", + " '37',\n", + " '5',\n", + " '17',\n", + " '1'],\n", + " ['133',\n", + " '309025938',\n", + " 'The Masters Tournament',\n", + " '120725504',\n", + " 'USD',\n", + " '0',\n", + " '148160',\n", + " '63',\n", + " '4.5',\n", + " '3.5',\n", + " '9.0.701',\n", + " '4+',\n", + " 'Sports',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['134',\n", + " '309172177',\n", + " 'myAT&T',\n", + " '68491264',\n", + " 'USD',\n", + " '0',\n", + " '108507',\n", + " '628',\n", + " '3',\n", + " '3',\n", + " '5.3',\n", + " '4+',\n", + " 'Utilities',\n", + " '37',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['135',\n", + " '309187846',\n", + " 'SFR TV',\n", + " '122153984',\n", + " 'USD',\n", + " '0',\n", + " '46',\n", + " '0',\n", + " '3',\n", + " '0',\n", + " '7.3.0',\n", + " '4+',\n", + " 'Entertainment',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['136',\n", + " '309465525',\n", + " 'Shutterfly: Prints, Photo Books, Cards Made Easy',\n", + " '122315776',\n", + " 'USD',\n", + " '0',\n", + " '51427',\n", + " '874',\n", + " '4',\n", + " '5',\n", + " '7.7.0',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['137',\n", + " '309527804',\n", + " 'StickWars',\n", + " '17010688',\n", + " 'USD',\n", + " '0.99',\n", + " '53821',\n", + " '165',\n", + " '3.5',\n", + " '4',\n", + " '1.8.9',\n", + " '12+',\n", + " 'Games',\n", + " '43',\n", + " '1',\n", + " '1',\n", + " '0'],\n", + " ['138',\n", + " '309735670',\n", + " 'Indeed Job Search',\n", + " '3691520',\n", + " 'USD',\n", + " '0',\n", + " '38681',\n", + " '563',\n", + " '4',\n", + " '4.5',\n", + " '4.3',\n", + " '4+',\n", + " 'Business',\n", + " '37',\n", + " '3',\n", + " '28',\n", + " '1'],\n", + " ['139',\n", + " '310303959',\n", + " 'World Cup Table Tennis™',\n", + " '31387648',\n", + " 'USD',\n", + " '0.99',\n", + " '17776',\n", + " '6',\n", + " '4',\n", + " '5',\n", + " '4.6.1',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '0',\n", + " '11',\n", + " '1'],\n", + " ['140',\n", + " '310633997',\n", + " 'WhatsApp Messenger',\n", + " '135044096',\n", + " 'USD',\n", + " '0',\n", + " '287589',\n", + " '73088',\n", + " '4.5',\n", + " '4.5',\n", + " '2.17.22',\n", + " '4+',\n", + " 'Social Networking',\n", + " '12',\n", + " '0',\n", + " '35',\n", + " '1'],\n", + " ['141',\n", + " '310636441',\n", + " 'iStudiez Pro – Homework, Schedule, Grades',\n", + " '55815168',\n", + " 'USD',\n", + " '2.99',\n", + " '7308',\n", + " '15',\n", + " '4',\n", + " '4.5',\n", + " '1.9.1',\n", + " '4+',\n", + " 'Productivity',\n", + " '37',\n", + " '5',\n", + " '30',\n", + " '1'],\n", + " ['142',\n", + " '310738695',\n", + " 'Zillow Real Estate - Homes for Sale & for Rent',\n", + " '132632576',\n", + " 'USD',\n", + " '0',\n", + " '342969',\n", + " '88478',\n", + " '4.5',\n", + " '4.5',\n", + " '10.4.5',\n", + " '4+',\n", + " 'Lifestyle',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['144',\n", + " '310951782',\n", + " '2XL Supercross',\n", + " '270729216',\n", + " 'USD',\n", + " '4.99',\n", + " '6093',\n", + " '3',\n", + " '4',\n", + " '5',\n", + " '1.2.1',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '7',\n", + " '1'],\n", + " ['146',\n", + " '311466554',\n", + " 'Pocket Tanks Deluxe',\n", + " '39827456',\n", + " 'USD',\n", + " '4.99',\n", + " '5452',\n", + " '39',\n", + " '4.5',\n", + " '4.5',\n", + " '2.3.1',\n", + " '9+',\n", + " 'Games',\n", + " '38',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['148',\n", + " '311548709',\n", + " 'Wells Fargo Mobile',\n", + " '57328640',\n", + " 'USD',\n", + " '0',\n", + " '43064',\n", + " '216',\n", + " '3',\n", + " '2.5',\n", + " '3.55',\n", + " '4+',\n", + " 'Finance',\n", + " '37',\n", + " '0',\n", + " '2',\n", + " '1'],\n", + " ['150',\n", + " '311762416',\n", + " 'radio.de - Der Radioplayer',\n", + " '40717312',\n", + " 'USD',\n", + " '0',\n", + " '64',\n", + " '9',\n", + " '4.5',\n", + " '5',\n", + " '4.0.5',\n", + " '4+',\n", + " 'Music',\n", + " '37',\n", + " '5',\n", + " '14',\n", + " '1'],\n", + " ['151',\n", + " '311785642',\n", + " 'AutoScout24 - mobile used & new car market',\n", + " '141136896',\n", + " 'USD',\n", + " '0',\n", + " '220',\n", + " '2',\n", + " '4.5',\n", + " '5',\n", + " '9.1.10',\n", + " '4+',\n", + " 'Productivity',\n", + " '37',\n", + " '5',\n", + " '13',\n", + " '1'],\n", + " ['152',\n", + " '311972587',\n", + " 'Sky Burger - Build & Match Food Free',\n", + " '146228224',\n", + " 'USD',\n", + " '0',\n", + " '114096',\n", + " '2157',\n", + " '4.5',\n", + " '4',\n", + " '3.0.3',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '3',\n", + " '1'],\n", + " ['153',\n", + " '312220102',\n", + " 'MindNode – Delightful Mind Mapping',\n", + " '52294656',\n", + " 'USD',\n", + " '9.99',\n", + " '1296',\n", + " '4',\n", + " '4',\n", + " '5',\n", + " '4.5.3',\n", + " '4+',\n", + " 'Productivity',\n", + " '37',\n", + " '4',\n", + " '13',\n", + " '1'],\n", + " ['154',\n", + " '312266675',\n", + " 'Packing Pro',\n", + " '16332800',\n", + " 'USD',\n", + " '2.99',\n", + " '1293',\n", + " '31',\n", + " '4',\n", + " '5',\n", + " '12.2',\n", + " '4+',\n", + " 'Travel',\n", + " '37',\n", + " '5',\n", + " '11',\n", + " '1'],\n", + " ['155',\n", + " '312325565',\n", + " 'USAA Mobile',\n", + " '164382720',\n", + " 'USD',\n", + " '0',\n", + " '19946',\n", + " '13',\n", + " '4',\n", + " '2.5',\n", + " '7.32.3',\n", + " '4+',\n", + " 'Finance',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['156',\n", + " '312343159',\n", + " 'The Moron Test',\n", + " '45712384',\n", + " 'USD',\n", + " '0',\n", + " '88613',\n", + " '392',\n", + " '4',\n", + " '4.5',\n", + " '6.3.1',\n", + " '4+',\n", + " 'Entertainment',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['157',\n", + " '313199385',\n", + " 'Sunday Lawn',\n", + " '16086016',\n", + " 'USD',\n", + " '0.99',\n", + " '107727',\n", + " '55',\n", + " '3.5',\n", + " '4.5',\n", + " '1.41.1',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '3',\n", + " '1',\n", + " '1'],\n", + " ['158',\n", + " '314303518',\n", + " 'Peggle Classic',\n", + " '223805440',\n", + " 'USD',\n", + " '0.99',\n", + " '21416',\n", + " '974',\n", + " '4.5',\n", + " '4.5',\n", + " '1.7.2',\n", + " '4+',\n", + " 'Games',\n", + " '43',\n", + " '0',\n", + " '5',\n", + " '1'],\n", + " ['159',\n", + " '314506629',\n", + " 'SmartGo Player',\n", + " '22159360',\n", + " 'USD',\n", + " '2.99',\n", + " '533',\n", + " '27',\n", + " '4',\n", + " '4',\n", + " '2.5.1',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '3',\n", + " '9',\n", + " '1'],\n", + " ['160',\n", + " '314652382',\n", + " 'I Am T-Pain 2.0',\n", + " '20542280',\n", + " 'USD',\n", + " '2.99',\n", + " '32650',\n", + " '754',\n", + " '3.5',\n", + " '3.5',\n", + " '2.0.4',\n", + " '12+',\n", + " 'Music',\n", + " '43',\n", + " '1',\n", + " '1',\n", + " '1'],\n", + " ['161',\n", + " '314716233',\n", + " 'TextNow - Unlimited Text + Calls',\n", + " '130637824',\n", + " 'USD',\n", + " '0',\n", + " '164963',\n", + " '69',\n", + " '3.5',\n", + " '4',\n", + " '8.5.1',\n", + " '4+',\n", + " 'Social Networking',\n", + " '37',\n", + " '5',\n", + " '3',\n", + " '1'],\n", + " ['162',\n", + " '314819528',\n", + " 'Boating Weather',\n", + " '8900608',\n", + " 'USD',\n", + " '1.99',\n", + " '141',\n", + " '15',\n", + " '3',\n", + " '3',\n", + " '4.5',\n", + " '4+',\n", + " 'Weather',\n", + " '40',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['163',\n", + " '314855255',\n", + " 'Best Buy',\n", + " '180500480',\n", + " 'USD',\n", + " '0',\n", + " '80424',\n", + " '46',\n", + " '4',\n", + " '4.5',\n", + " '10.11.0',\n", + " '4+',\n", + " 'Shopping',\n", + " '37',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['164',\n", + " '314864297',\n", + " 'I Dig It',\n", + " '19853312',\n", + " 'USD',\n", + " '0.99',\n", + " '17190',\n", + " '180',\n", + " '4',\n", + " '4.5',\n", + " '1.12',\n", + " '4+',\n", + " 'Games',\n", + " '40',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['165',\n", + " '315021242',\n", + " 'Unblock Me',\n", + " '42926080',\n", + " 'USD',\n", + " '0.99',\n", + " '7973',\n", + " '127',\n", + " '4',\n", + " '5',\n", + " '1.5.95',\n", + " '4+',\n", + " 'Games',\n", + " '40',\n", + " '5',\n", + " '15',\n", + " '1'],\n", + " ['166',\n", + " '316025912',\n", + " 'Sonic The Hedgehog',\n", + " '36692992',\n", + " 'USD',\n", + " '2.99',\n", + " '19621',\n", + " '1191',\n", + " '4',\n", + " '4.5',\n", + " '2.1.2',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['168',\n", + " '316227296',\n", + " '10 Pin Shuffle Pro Bowling',\n", + " '36647936',\n", + " 'USD',\n", + " '3.99',\n", + " '7315',\n", + " '138',\n", + " '4',\n", + " '4.5',\n", + " '2.01',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '6',\n", + " '1'],\n", + " ['169',\n", + " '316391924',\n", + " 'Sky News',\n", + " '91697152',\n", + " 'USD',\n", + " '0',\n", + " '118',\n", + " '0',\n", + " '3',\n", + " '0',\n", + " '4.6',\n", + " '12+',\n", + " 'News',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['171',\n", + " '317469184',\n", + " 'ESPN: Get scores, news, alerts & watch live sports',\n", + " '51538944',\n", + " 'USD',\n", + " '0',\n", + " '290996',\n", + " '150',\n", + " '3.5',\n", + " '3.5',\n", + " '5.7.1',\n", + " '4+',\n", + " 'Sports',\n", + " '37',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['172',\n", + " '317809458',\n", + " 'LiveATC Air Radio',\n", + " '8302592',\n", + " 'USD',\n", + " '3.99',\n", + " '2785',\n", + " '90',\n", + " '4',\n", + " '4',\n", + " '1.9.0',\n", + " '4+',\n", + " 'Travel',\n", + " '37',\n", + " '5',\n", + " '26',\n", + " '1'],\n", + " ['173',\n", + " '317904170',\n", + " 'The Sims 3',\n", + " '430128128',\n", + " 'USD',\n", + " '6.99',\n", + " '54408',\n", + " '65',\n", + " '3.5',\n", + " '2',\n", + " '1.4.10',\n", + " '12+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '8',\n", + " '1'],\n", + " ['175',\n", + " '318304532',\n", + " 'Chess Pro with Coach - Learn,Play & Online Friends',\n", + " '69960704',\n", + " 'USD',\n", + " '9.99',\n", + " '8138',\n", + " '107',\n", + " '4',\n", + " '4.5',\n", + " '2.89',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '13',\n", + " '1'],\n", + " ['176',\n", + " '318592730',\n", + " 'Guess My Age \\ue020 Math Magic',\n", + " '767126',\n", + " 'USD',\n", + " '0',\n", + " '123190',\n", + " '68841',\n", + " '3',\n", + " '3',\n", + " '1.1',\n", + " '4+',\n", + " 'Education',\n", + " '47',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['177',\n", + " '318639200',\n", + " 'Crush the Castle',\n", + " '12996628',\n", + " 'USD',\n", + " '0.99',\n", + " '23810',\n", + " '582',\n", + " '3.5',\n", + " '4',\n", + " '1.5',\n", + " '12+',\n", + " 'Games',\n", + " '45',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['178',\n", + " '319204550',\n", + " '2016 U.S. Open Golf Championship',\n", + " '139545600',\n", + " 'USD',\n", + " '0',\n", + " '54192',\n", + " '32',\n", + " '4',\n", + " '2',\n", + " '8.0.263',\n", + " '4+',\n", + " 'Sports',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['179',\n", + " '319284643',\n", + " 'The Championships, Wimbledon 2016 - Tennis Grand Slam',\n", + " '130394112',\n", + " 'USD',\n", + " '0',\n", + " '20953',\n", + " '481',\n", + " '4',\n", + " '4',\n", + " '8.1',\n", + " '4+',\n", + " 'Sports',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['180',\n", + " '319295332',\n", + " 'TuneIn Radio Pro - MLB Audiobooks Podcasts Music',\n", + " '101925888',\n", + " 'USD',\n", + " '9.99',\n", + " '71609',\n", + " '99',\n", + " '4.5',\n", + " '4',\n", + " '11.9',\n", + " '12+',\n", + " 'Music',\n", + " '37',\n", + " '4',\n", + " '14',\n", + " '1'],\n", + " ['181',\n", + " '319740707',\n", + " 'NBC News',\n", + " '52951040',\n", + " 'USD',\n", + " '0',\n", + " '32881',\n", + " '7',\n", + " '3.5',\n", + " '2',\n", + " '5.11.0',\n", + " '12+',\n", + " 'News',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['182',\n", + " '319881193',\n", + " 'Grindr - Gay and same sex guys chat, meet and date',\n", + " '80409600',\n", + " 'USD',\n", + " '0',\n", + " '23201',\n", + " '14',\n", + " '2.5',\n", + " '2',\n", + " '3.9.1',\n", + " '17+',\n", + " 'Social Networking',\n", + " '37',\n", + " '5',\n", + " '5',\n", + " '1'],\n", + " ['183',\n", + " '320029256',\n", + " 'Whole Foods Market',\n", + " '137312256',\n", + " 'USD',\n", + " '0',\n", + " '17906',\n", + " '4',\n", + " '3',\n", + " '3',\n", + " '8.3.17',\n", + " '4+',\n", + " 'Shopping',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['184',\n", + " '320279293',\n", + " 'NAVIGON Europe',\n", + " '144412672',\n", + " 'USD',\n", + " '74.99',\n", + " '927',\n", + " '3',\n", + " '3.5',\n", + " '2.5',\n", + " '2.17',\n", + " '4+',\n", + " 'Navigation',\n", + " '37',\n", + " '2',\n", + " '21',\n", + " '1'],\n", + " ['185',\n", + " '320300350',\n", + " 'Virtual Families',\n", + " '27746273',\n", + " 'USD',\n", + " '1.99',\n", + " '18920',\n", + " '3014',\n", + " '3.5',\n", + " '4.5',\n", + " '1.1.2',\n", + " '9+',\n", + " 'Games',\n", + " '47',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['186',\n", + " '320596872',\n", + " 'Sparkasse+',\n", + " '119648256',\n", + " 'USD',\n", + " '0.99',\n", + " '30',\n", + " '0',\n", + " '3',\n", + " '0',\n", + " '3.1.3',\n", + " '4+',\n", + " 'Finance',\n", + " '37',\n", + " '0',\n", + " '3',\n", + " '1'],\n", + " ['187',\n", + " '320599923',\n", + " 'Sparkasse - Your mobile branch',\n", + " '119574528',\n", + " 'USD',\n", + " '0',\n", + " '77',\n", + " '1',\n", + " '3',\n", + " '4',\n", + " '3.1.3',\n", + " '4+',\n", + " 'Finance',\n", + " '37',\n", + " '0',\n", + " '3',\n", + " '1'],\n", + " ['188',\n", + " '320606217',\n", + " 'Sleep Cycle alarm clock',\n", + " '79315968',\n", + " 'USD',\n", + " '0',\n", + " '104539',\n", + " '11',\n", + " '4.5',\n", + " '4.5',\n", + " '5.4.1',\n", + " '4+',\n", + " 'Health & Fitness',\n", + " '37',\n", + " '5',\n", + " '13',\n", + " '1'],\n", + " ['189',\n", + " '320636131',\n", + " 'FACEinHOLE®',\n", + " '12818432',\n", + " 'USD',\n", + " '0.99',\n", + " '4016',\n", + " '1',\n", + " '4',\n", + " '5',\n", + " '5.7',\n", + " '12+',\n", + " 'Photo & Video',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['190',\n", + " '320650307',\n", + " 'Harvest - Select the Best Produce',\n", + " '18165760',\n", + " 'USD',\n", + " '1.99',\n", + " '299',\n", + " '28',\n", + " '4',\n", + " '4.5',\n", + " '3.1',\n", + " '4+',\n", + " 'Food & Drink',\n", + " '38',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['191',\n", + " '321369231',\n", + " 'WORMS',\n", + " '253834240',\n", + " 'USD',\n", + " '1.99',\n", + " '5758',\n", + " '9',\n", + " '4',\n", + " '3',\n", + " '2.6',\n", + " '12+',\n", + " 'Games',\n", + " '40',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['192',\n", + " '321756558',\n", + " 'Pixel Starships™ : 8Bit MMORPG',\n", + " '69083136',\n", + " 'USD',\n", + " '0',\n", + " '5565',\n", + " '140',\n", + " '4.5',\n", + " '4.5',\n", + " '0.39',\n", + " '9+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '17',\n", + " '1'],\n", + " ['193',\n", + " '322423174',\n", + " 'Traffic Rush',\n", + " '8573952',\n", + " 'USD',\n", + " '0.99',\n", + " '213092',\n", + " '51',\n", + " '3.5',\n", + " '4.5',\n", + " '1.45.1',\n", + " '9+',\n", + " 'Games',\n", + " '37',\n", + " '3',\n", + " '1',\n", + " '1'],\n", + " ['194',\n", + " '322439990',\n", + " 'MyRadar NOAA Weather Radar Forecast',\n", + " '127284224',\n", + " 'USD',\n", + " '0',\n", + " '150158',\n", + " '3392',\n", + " '4.5',\n", + " '5',\n", + " '5.1.4',\n", + " '4+',\n", + " 'Weather',\n", + " '37',\n", + " '2',\n", + " '8',\n", + " '1'],\n", + " ['196',\n", + " '322523436',\n", + " 'Resident Evil 4: PLATINUM',\n", + " '81374398',\n", + " 'USD',\n", + " '4.99',\n", + " '6046',\n", + " '446',\n", + " '4',\n", + " '4',\n", + " '1.04.10',\n", + " '12+',\n", + " 'Games',\n", + " '47',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['197',\n", + " '323229106',\n", + " 'Waze - GPS Navigation, Maps & Real-time Traffic',\n", + " '94139392',\n", + " 'USD',\n", + " '0',\n", + " '345046',\n", + " '3040',\n", + " '4.5',\n", + " '4.5',\n", + " '4.24',\n", + " '4+',\n", + " 'Navigation',\n", + " '37',\n", + " '5',\n", + " '36',\n", + " '1'],\n", + " ['198',\n", + " '323242790',\n", + " 'Cartoon Wars',\n", + " '13216994',\n", + " 'USD',\n", + " '0.99',\n", + " '35930',\n", + " '262',\n", + " '3.5',\n", + " '4',\n", + " '114',\n", + " '12+',\n", + " 'Games',\n", + " '43',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['199',\n", + " '323438913',\n", + " 'Moto X Mayhem',\n", + " '21010210',\n", + " 'USD',\n", + " '0.99',\n", + " '22557',\n", + " '526',\n", + " '4',\n", + " '4',\n", + " '1.8.7',\n", + " '4+',\n", + " 'Games',\n", + " '47',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['200',\n", + " '324266640',\n", + " 'Fantasy Football Manager - FFM for FPL',\n", + " '35998720',\n", + " 'USD',\n", + " '0.99',\n", + " '292',\n", + " '1',\n", + " '3',\n", + " '5',\n", + " '9.3',\n", + " '17+',\n", + " 'Sports',\n", + " '37',\n", + " '1',\n", + " '1',\n", + " '1'],\n", + " ['202',\n", + " '324684580',\n", + " 'Spotify Music',\n", + " '132510720',\n", + " 'USD',\n", + " '0',\n", + " '878563',\n", + " '8253',\n", + " '4.5',\n", + " '4.5',\n", + " '8.4.3',\n", + " '12+',\n", + " 'Music',\n", + " '37',\n", + " '5',\n", + " '18',\n", + " '1'],\n", + " ['203',\n", + " '324887734',\n", + " 'McDo France',\n", + " '37001216',\n", + " 'USD',\n", + " '0',\n", + " '22',\n", + " '0',\n", + " '3.5',\n", + " '0',\n", + " '4.0.16',\n", + " '4+',\n", + " 'Food & Drink',\n", + " '37',\n", + " '0',\n", + " '30',\n", + " '1'],\n", + " ['204',\n", + " '325462190',\n", + " 'PGA Championship 2016 – Baltusrol Golf Club',\n", + " '64147456',\n", + " 'USD',\n", + " '0',\n", + " '10472',\n", + " '58',\n", + " '3.5',\n", + " '2',\n", + " '8.1',\n", + " '17+',\n", + " 'Sports',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '0'],\n", + " ['206',\n", + " '325658560',\n", + " \"BFMTV : l'info en continu\",\n", + " '100779008',\n", + " 'USD',\n", + " '0',\n", + " '115',\n", + " '70',\n", + " '4',\n", + " '5',\n", + " '5.0.3',\n", + " '17+',\n", + " 'News',\n", + " '37',\n", + " '4',\n", + " '1',\n", + " '0'],\n", + " ['207',\n", + " '325683306',\n", + " 'MyRadar Pro NOAA Weather Radar, Forecasts & Storms',\n", + " '123718656',\n", + " 'USD',\n", + " '1.99',\n", + " '13915',\n", + " '205',\n", + " '4.5',\n", + " '5',\n", + " '5.1.4',\n", + " '4+',\n", + " 'Weather',\n", + " '37',\n", + " '2',\n", + " '8',\n", + " '1'],\n", + " ['208',\n", + " '325954996',\n", + " 'Spider: The Secret of Bryce Manor',\n", + " '126312448',\n", + " 'USD',\n", + " '1.99',\n", + " '6780',\n", + " '68',\n", + " '4',\n", + " '4.5',\n", + " '1.5',\n", + " '9+',\n", + " 'Games',\n", + " '38',\n", + " '0',\n", + " '5',\n", + " '1'],\n", + " ['209',\n", + " '325962257',\n", + " 'My Measures PRO',\n", + " '79882240',\n", + " 'USD',\n", + " '7.99',\n", + " '1701',\n", + " '35',\n", + " '4',\n", + " '4.5',\n", + " '6.06',\n", + " '4+',\n", + " 'Productivity',\n", + " '37',\n", + " '5',\n", + " '21',\n", + " '1'],\n", + " ['210',\n", + " '326082487',\n", + " 'Food Additives Checker (E Numbers)',\n", + " '6418432',\n", + " 'USD',\n", + " '1.99',\n", + " '6',\n", + " '0',\n", + " '3.5',\n", + " '0',\n", + " '4.1.2',\n", + " '4+',\n", + " 'Health & Fitness',\n", + " '37',\n", + " '0',\n", + " '8',\n", + " '1'],\n", + " ['212',\n", + " '326161564',\n", + " 'SFR Mon Compte',\n", + " '74093568',\n", + " 'USD',\n", + " '0',\n", + " '19',\n", + " '0',\n", + " '3',\n", + " '0',\n", + " '6.4.0',\n", + " '4+',\n", + " 'Utilities',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['213',\n", + " '326574411',\n", + " 'Baby Connect (Activity Log)',\n", + " '12937216',\n", + " 'USD',\n", + " '4.99',\n", + " '3483',\n", + " '79',\n", + " '4.5',\n", + " '5',\n", + " '5.4.3',\n", + " '4+',\n", + " 'Medical',\n", + " '37',\n", + " '0',\n", + " '14',\n", + " '1'],\n", + " ['214',\n", + " '326876192',\n", + " 'Epson iPrint',\n", + " '53388288',\n", + " 'USD',\n", + " '0',\n", + " '2838',\n", + " '26',\n", + " '3',\n", + " '2.5',\n", + " '6.3.1',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '37',\n", + " '5',\n", + " '12',\n", + " '1'],\n", + " ['215',\n", + " '326885152',\n", + " 'Mad Libs',\n", + " '118498304',\n", + " 'USD',\n", + " '0',\n", + " '117889',\n", + " '725',\n", + " '3',\n", + " '4.5',\n", + " '3.3.3',\n", + " '4+',\n", + " 'Entertainment',\n", + " '38',\n", + " '1',\n", + " '1',\n", + " '1'],\n", + " ['217',\n", + " '326979430',\n", + " 'BATTLE BEARS: Zombies!',\n", + " '103197675',\n", + " 'USD',\n", + " '0.99',\n", + " '50710',\n", + " '309',\n", + " '3.5',\n", + " '4',\n", + " '1.6.7',\n", + " '9+',\n", + " 'Games',\n", + " '45',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['219',\n", + " '327193945',\n", + " 'Hurricane Tracker',\n", + " '24574976',\n", + " 'USD',\n", + " '2.99',\n", + " '3960',\n", + " '0',\n", + " '4.5',\n", + " '0',\n", + " '5.0',\n", + " '4+',\n", + " 'Weather',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['220',\n", + " '327243363',\n", + " 'NFL Sunday Ticket',\n", + " '96093184',\n", + " 'USD',\n", + " '0',\n", + " '24258',\n", + " '305',\n", + " '3',\n", + " '2.5',\n", + " '2.6.042',\n", + " '4+',\n", + " 'Entertainment',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['221',\n", + " '327455869',\n", + " '2016 US Open Tennis Championships',\n", + " '77700096',\n", + " 'USD',\n", + " '0',\n", + " '37522',\n", + " '39',\n", + " '4',\n", + " '3',\n", + " '8.0.353',\n", + " '4+',\n", + " 'Sports',\n", + " '37',\n", + " '4',\n", + " '1',\n", + " '1'],\n", + " ['222',\n", + " '327630330',\n", + " 'Dropbox',\n", + " '180804608',\n", + " 'USD',\n", + " '0',\n", + " '49578',\n", + " '16',\n", + " '3.5',\n", + " '3',\n", + " '50.2',\n", + " '4+',\n", + " 'Productivity',\n", + " '37',\n", + " '5',\n", + " '20',\n", + " '1'],\n", + " ['223',\n", + " '328011357',\n", + " 'Wa Kingyo - Goldfish Pond',\n", + " '56397824',\n", + " 'USD',\n", + " '0.99',\n", + " '626',\n", + " '44',\n", + " '4',\n", + " '5',\n", + " '2.0.3',\n", + " '4+',\n", + " 'Entertainment',\n", + " '38',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['224',\n", + " '328205875',\n", + " 'Monkey Preschool Lunchbox',\n", + " '229272576',\n", + " 'USD',\n", + " '1.99',\n", + " '9286',\n", + " '49',\n", + " '4',\n", + " '3.5',\n", + " '4.02',\n", + " '4+',\n", + " 'Games',\n", + " '38',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['225',\n", + " '328415391',\n", + " 'Yahoo Fantasy Sports',\n", + " '131000320',\n", + " 'USD',\n", + " '0',\n", + " '190670',\n", + " '19',\n", + " '3.5',\n", + " '2.5',\n", + " '9.1.0',\n", + " '17+',\n", + " 'Sports',\n", + " '37',\n", + " '3',\n", + " '45',\n", + " '1'],\n", + " ['226',\n", + " '329127297',\n", + " 'Gaia GPS Classic',\n", + " '53097472',\n", + " 'USD',\n", + " '19.99',\n", + " '2429',\n", + " '8',\n", + " '4.5',\n", + " '3.5',\n", + " '10.9.13',\n", + " '4+',\n", + " 'Navigation',\n", + " '37',\n", + " '5',\n", + " '16',\n", + " '1'],\n", + " ['227',\n", + " '329174056',\n", + " 'iLoan Calc (Loan calculator)',\n", + " '3375104',\n", + " 'USD',\n", + " '3.99',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '5.1.0',\n", + " '4+',\n", + " 'Finance',\n", + " '37',\n", + " '5',\n", + " '3',\n", + " '1'],\n", + " ['228',\n", + " '329541503',\n", + " 'Geocaching®',\n", + " '108166144',\n", + " 'USD',\n", + " '0',\n", + " '12811',\n", + " '134',\n", + " '3.5',\n", + " '1.5',\n", + " '5.3',\n", + " '4+',\n", + " 'Navigation',\n", + " '37',\n", + " '0',\n", + " '22',\n", + " '1'],\n", + " ['229',\n", + " '329670577',\n", + " 'Camera+',\n", + " '89187328',\n", + " 'USD',\n", + " '1.99',\n", + " '32338',\n", + " '261',\n", + " '4',\n", + " '4.5',\n", + " '9.1',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '37',\n", + " '0',\n", + " '10',\n", + " '1'],\n", + " ['230',\n", + " '329703516',\n", + " 'Alter Ego',\n", + " '13647872',\n", + " 'USD',\n", + " '4.99',\n", + " '262',\n", + " '43',\n", + " '4',\n", + " '4',\n", + " '1.3.0',\n", + " '12+',\n", + " 'Games',\n", + " '40',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['231',\n", + " '329887910',\n", + " 'Parking Mania',\n", + " '123544576',\n", + " 'USD',\n", + " '0.99',\n", + " '9657',\n", + " '47',\n", + " '4.5',\n", + " '4.5',\n", + " '2.5.0',\n", + " '4+',\n", + " 'Games',\n", + " '38',\n", + " '0',\n", + " '12',\n", + " '1'],\n", + " ['232',\n", + " '329981776',\n", + " 'Sudoku⁺',\n", + " '1608704',\n", + " 'USD',\n", + " '2.99',\n", + " '18332',\n", + " '1007',\n", + " '4.5',\n", + " '5',\n", + " '3.4',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['234',\n", + " '330376830',\n", + " 'Period Tracker Lite',\n", + " '50169856',\n", + " 'USD',\n", + " '0',\n", + " '53620',\n", + " '2872',\n", + " '4',\n", + " '5',\n", + " '9.5.1',\n", + " '12+',\n", + " 'Health & Fitness',\n", + " '38',\n", + " '0',\n", + " '15',\n", + " '1'],\n", + " ['235',\n", + " '330803072',\n", + " 'Camera Plus: For Macro Photos & Remote Photography',\n", + " '101181440',\n", + " 'USD',\n", + " '0.99',\n", + " '38533',\n", + " '36',\n", + " '2.5',\n", + " '3.5',\n", + " '4.5.4',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '37',\n", + " '4',\n", + " '11',\n", + " '1'],\n", + " ['236',\n", + " '331004675',\n", + " 'The perfect Egg timer',\n", + " '15329280',\n", + " 'USD',\n", + " '0.99',\n", + " '40',\n", + " '0',\n", + " '3.5',\n", + " '0',\n", + " '1.8.9',\n", + " '4+',\n", + " 'Food & Drink',\n", + " '37',\n", + " '4',\n", + " '7',\n", + " '1'],\n", + " ['237',\n", + " '331177703',\n", + " 'Letter Quiz - alphabet tracing for kids',\n", + " '31845376',\n", + " 'USD',\n", + " '1.99',\n", + " '472',\n", + " '0',\n", + " '4',\n", + " '0',\n", + " '2.4',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['238',\n", + " '331177714',\n", + " 'Starbucks',\n", + " '135032832',\n", + " 'USD',\n", + " '0',\n", + " '303856',\n", + " '7027',\n", + " '4.5',\n", + " '4.5',\n", + " '4.3.5',\n", + " '4+',\n", + " 'Food & Drink',\n", + " '37',\n", + " '0',\n", + " '2',\n", + " '1'],\n", + " ['239',\n", + " '331259725',\n", + " '央视影音-海量央视内容高清直播',\n", + " '54648832',\n", + " 'USD',\n", + " '0',\n", + " '2070',\n", + " '0',\n", + " '2.5',\n", + " '0',\n", + " '6.2.0',\n", + " '4+',\n", + " 'Sports',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['240',\n", + " '331271904',\n", + " 'Bloons TD',\n", + " '8432232',\n", + " 'USD',\n", + " '2.99',\n", + " '7941',\n", + " '76',\n", + " '4',\n", + " '3.5',\n", + " '1.2.1',\n", + " '4+',\n", + " 'Games',\n", + " '47',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['241',\n", + " '331308914',\n", + " 'Weight Watchers',\n", + " '230720512',\n", + " 'USD',\n", + " '0',\n", + " '136833',\n", + " '64',\n", + " '3.5',\n", + " '4.5',\n", + " '5.9.0',\n", + " '12+',\n", + " 'Health & Fitness',\n", + " '37',\n", + " '5',\n", + " '6',\n", + " '1'],\n", + " ['242',\n", + " '331786748',\n", + " 'CNN: Breaking US & World News, Live Video',\n", + " '80211968',\n", + " 'USD',\n", + " '0',\n", + " '112886',\n", + " '298',\n", + " '3.5',\n", + " '1.5',\n", + " '5.3',\n", + " '12+',\n", + " 'News',\n", + " '37',\n", + " '1',\n", + " '1',\n", + " '1'],\n", + " ['243',\n", + " '331804452',\n", + " 'Gilt',\n", + " '148201472',\n", + " 'USD',\n", + " '0',\n", + " '26353',\n", + " '3',\n", + " '3.5',\n", + " '2.5',\n", + " '5.1.3',\n", + " '4+',\n", + " 'Shopping',\n", + " '37',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['245',\n", + " '332568551',\n", + " 'TRUTH or DARE!!! - FREE',\n", + " '20795392',\n", + " 'USD',\n", + " '0',\n", + " '171055',\n", + " '31',\n", + " '3',\n", + " '3.5',\n", + " '5',\n", + " '12+',\n", + " 'Entertainment',\n", + " '38',\n", + " '1',\n", + " '1',\n", + " '1'],\n", + " ['246',\n", + " '333180061',\n", + " 'Canabalt',\n", + " '27934720',\n", + " 'USD',\n", + " '2.99',\n", + " '4540',\n", + " '140',\n", + " '4',\n", + " '4.5',\n", + " '2.31',\n", + " '9+',\n", + " 'Games',\n", + " '43',\n", + " '5',\n", + " '15',\n", + " '1'],\n", + " ['247',\n", + " '333206289',\n", + " 'Alipay - Makes Life Easy',\n", + " '208309248',\n", + " 'USD',\n", + " '0',\n", + " '1926',\n", + " '2',\n", + " '3',\n", + " '3',\n", + " '10.0.15',\n", + " '4+',\n", + " 'Lifestyle',\n", + " '38',\n", + " '5',\n", + " '3',\n", + " '1'],\n", + " ['248',\n", + " '333246187',\n", + " 'Scanner911 Pro',\n", + " '33812480',\n", + " 'USD',\n", + " '3.99',\n", + " '14345',\n", + " '100',\n", + " '4',\n", + " '2.5',\n", + " '4.0',\n", + " '12+',\n", + " 'News',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['249',\n", + " '333263435',\n", + " 'Daily Teachings',\n", + " '20298752',\n", + " 'USD',\n", + " '4.99',\n", + " '1340',\n", + " '288',\n", + " '4.5',\n", + " '5',\n", + " '1.7.3',\n", + " '4+',\n", + " 'Lifestyle',\n", + " '38',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['250',\n", + " '333710667',\n", + " 'Scanner Pro - PDF document scanner app with OCR',\n", + " '101346304',\n", + " 'USD',\n", + " '3.99',\n", + " '31912',\n", + " '154',\n", + " '4.5',\n", + " '5',\n", + " '7.1.3',\n", + " '4+',\n", + " 'Business',\n", + " '37',\n", + " '5',\n", + " '9',\n", + " '1'],\n", + " ['251',\n", + " '333903271',\n", + " 'Twitter',\n", + " '210569216',\n", + " 'USD',\n", + " '0',\n", + " '354058',\n", + " '452',\n", + " '3.5',\n", + " '4',\n", + " '6.79.1',\n", + " '17+',\n", + " 'News',\n", + " '37',\n", + " '2',\n", + " '33',\n", + " '1'],\n", + " ['252',\n", + " '334235181',\n", + " 'Trainline UK: Live Train Times, Tickets & Planner',\n", + " '110198784',\n", + " 'USD',\n", + " '0',\n", + " '248',\n", + " '0',\n", + " '4',\n", + " '0',\n", + " '22',\n", + " '4+',\n", + " 'Travel',\n", + " '37',\n", + " '4',\n", + " '1',\n", + " '1'],\n", + " ['253',\n", + " '334256223',\n", + " 'CBS News - Watch Free Live Breaking News',\n", + " '78047232',\n", + " 'USD',\n", + " '0',\n", + " '11691',\n", + " '44',\n", + " '3.5',\n", + " '4.5',\n", + " '3.5.1',\n", + " '12+',\n", + " 'News',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['254',\n", + " '334264405',\n", + " 'iOvilus',\n", + " '9946112',\n", + " 'USD',\n", + " '1.99',\n", + " '381',\n", + " '6',\n", + " '3',\n", + " '2',\n", + " 'iOV 2.1.3',\n", + " '12+',\n", + " 'Entertainment',\n", + " '38',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['255',\n", + " '334503000',\n", + " 'The Impossible Quiz!',\n", + " '44652544',\n", + " 'USD',\n", + " '0',\n", + " '18884',\n", + " '451',\n", + " '4',\n", + " '4.5',\n", + " '1.62',\n", + " '9+',\n", + " 'Entertainment',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['257',\n", + " '334989259',\n", + " 'WolframAlpha',\n", + " '30369792',\n", + " 'USD',\n", + " '2.99',\n", + " '7410',\n", + " '82',\n", + " '4',\n", + " '4.5',\n", + " '1.7.3',\n", + " '9+',\n", + " 'Reference',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['258',\n", + " '335029050',\n", + " 'Catan',\n", + " '376171520',\n", + " 'USD',\n", + " '1.99',\n", + " '15175',\n", + " '308',\n", + " '4',\n", + " '4',\n", + " '4.6.2',\n", + " '4+',\n", + " 'Games',\n", + " '38',\n", + " '0',\n", + " '6',\n", + " '1'],\n", + " ['259',\n", + " '335047649',\n", + " 'ScanBizCards Business Card Reader',\n", + " '96815104',\n", + " 'USD',\n", + " '0.99',\n", + " '3166',\n", + " '34',\n", + " '4',\n", + " '4.5',\n", + " '6.08',\n", + " '4+',\n", + " 'Business',\n", + " '37',\n", + " '5',\n", + " '5',\n", + " '1'],\n", + " ['261',\n", + " '335364882',\n", + " 'Walgreens – Pharmacy, Photo, Coupons and Shopping',\n", + " '169138176',\n", + " 'USD',\n", + " '0',\n", + " '88885',\n", + " '333',\n", + " '4.5',\n", + " '4',\n", + " '6.5',\n", + " '12+',\n", + " 'Shopping',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['262',\n", + " '335545504',\n", + " 'King of Dragon Pass',\n", + " '364490752',\n", + " 'USD',\n", + " '9.99',\n", + " '882',\n", + " '85',\n", + " '5',\n", + " '5',\n", + " '2.3.2',\n", + " '12+',\n", + " 'Games',\n", + " '43',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['263',\n", + " '335709058',\n", + " 'Stylebook',\n", + " '44135424',\n", + " 'USD',\n", + " '3.99',\n", + " '1729',\n", + " '599',\n", + " '4',\n", + " '4.5',\n", + " '7.0',\n", + " '17+',\n", + " 'Lifestyle',\n", + " '37',\n", + " '5',\n", + " '3',\n", + " '1'],\n", + " ['264',\n", + " '335744614',\n", + " 'NBA',\n", + " '112074752',\n", + " 'USD',\n", + " '0',\n", + " '43682',\n", + " '19',\n", + " '3.5',\n", + " '2.5',\n", + " '2013.4.3',\n", + " '4+',\n", + " 'Sports',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['265',\n", + " '335862325',\n", + " 'Blower',\n", + " '98942976',\n", + " 'USD',\n", + " '0.99',\n", + " '861',\n", + " '70',\n", + " '2',\n", + " '2.5',\n", + " '4.2',\n", + " '4+',\n", + " 'Entertainment',\n", + " '40',\n", + " '4',\n", + " '1',\n", + " '1'],\n", + " ['266',\n", + " '335875911',\n", + " 'My Cycles Period and Ovulation Tracker',\n", + " '77686784',\n", + " 'USD',\n", + " '0',\n", + " '7469',\n", + " '68',\n", + " '3.5',\n", + " '5',\n", + " '5.10.3',\n", + " '12+',\n", + " 'Health & Fitness',\n", + " '37',\n", + " '0',\n", + " '2',\n", + " '1'],\n", + " ['267',\n", + " '335989871',\n", + " 'Kmart – Download Now, Shop Online & Pick Up Today!',\n", + " '94496768',\n", + " 'USD',\n", + " '0',\n", + " '4186',\n", + " '6',\n", + " '3.5',\n", + " '4.5',\n", + " '17.0',\n", + " '4+',\n", + " 'Shopping',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['268',\n", + " '336141475',\n", + " '优酷视频',\n", + " '204959744',\n", + " 'USD',\n", + " '0',\n", + " '4885',\n", + " '0',\n", + " '3.5',\n", + " '0',\n", + " '6.7.0',\n", + " '12+',\n", + " 'Entertainment',\n", + " '38',\n", + " '0',\n", + " '2',\n", + " '1'],\n", + " ['269',\n", + " '336347946',\n", + " 'DOOM Classic',\n", + " '32796672',\n", + " 'USD',\n", + " '4.99',\n", + " '3970',\n", + " '509',\n", + " '4',\n", + " '4',\n", + " '2.7',\n", + " '17+',\n", + " 'Games',\n", + " '40',\n", + " '3',\n", + " '5',\n", + " '1'],\n", + " ['270',\n", + " '336353151',\n", + " 'SoundCloud - Music & Audio',\n", + " '105009152',\n", + " 'USD',\n", + " '0',\n", + " '135744',\n", + " '594',\n", + " '4',\n", + " '4.5',\n", + " '5.6.0',\n", + " '4+',\n", + " 'Music',\n", + " '37',\n", + " '4',\n", + " '7',\n", + " '1'],\n", + " ['271',\n", + " '336435697',\n", + " 'imo video calls and chat',\n", + " '22562816',\n", + " 'USD',\n", + " '0',\n", + " '18841',\n", + " '0',\n", + " '4',\n", + " '0',\n", + " '7.0.84',\n", + " '4+',\n", + " 'Social Networking',\n", + " '38',\n", + " '2',\n", + " '29',\n", + " '1'],\n", + " ['272',\n", + " '336477530',\n", + " 'Plane Finder - Flight Tracker',\n", + " '52632576',\n", + " 'USD',\n", + " '3.99',\n", + " '1438',\n", + " '171',\n", + " '4',\n", + " '4',\n", + " '9.4.1',\n", + " '4+',\n", + " 'Navigation',\n", + " '37',\n", + " '3',\n", + " '10',\n", + " '1'],\n", + " ['274',\n", + " '336599882',\n", + " 'Runtastic Running, Jogging and Walking Tracker',\n", + " '151388160',\n", + " 'USD',\n", + " '0',\n", + " '10298',\n", + " '7',\n", + " '4.5',\n", + " '3.5',\n", + " '7.3',\n", + " '4+',\n", + " 'Health & Fitness',\n", + " '37',\n", + " '0',\n", + " '15',\n", + " '1'],\n", + " ['275',\n", + " '336683524',\n", + " 'iFiles',\n", + " '47323136',\n", + " 'USD',\n", + " '0.99',\n", + " '1842',\n", + " '23',\n", + " '3.5',\n", + " '2.5',\n", + " '1.17.11',\n", + " '4+',\n", + " 'Productivity',\n", + " '38',\n", + " '1',\n", + " '1',\n", + " '1'],\n", + " ['276',\n", + " '336689375',\n", + " 'TeachMe: Kindergarten',\n", + " '59846656',\n", + " 'USD',\n", + " '1.99',\n", + " '2548',\n", + " '5',\n", + " '4',\n", + " '4',\n", + " '4.2.2',\n", + " '4+',\n", + " 'Education',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['277',\n", + " '336834650',\n", + " 'Moorhuhn Deluxe - Crazy Chicken',\n", + " '27807744',\n", + " 'USD',\n", + " '0.99',\n", + " '319',\n", + " '12',\n", + " '3',\n", + " '5',\n", + " '2.8.0',\n", + " '12+',\n", + " 'Games',\n", + " '38',\n", + " '5',\n", + " '5',\n", + " '1'],\n", + " ['278',\n", + " '336860594',\n", + " 'Victoria’s Secret – The Sexiest Bras & Lingerie',\n", + " '60976128',\n", + " 'USD',\n", + " '0',\n", + " '34507',\n", + " '38',\n", + " '3.5',\n", + " '5',\n", + " '5.2.1',\n", + " '12+',\n", + " 'Shopping',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['279',\n", + " '337021781',\n", + " 'MONOPOLY Game',\n", + " '194386944',\n", + " 'USD',\n", + " '0.99',\n", + " '26482',\n", + " '331',\n", + " '3.5',\n", + " '2.5',\n", + " '1.4.04',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '0',\n", + " '6',\n", + " '1'],\n", + " ['281',\n", + " '337056601',\n", + " 'n-tv Nachrichten',\n", + " '49470464',\n", + " 'USD',\n", + " '0',\n", + " '273',\n", + " '0',\n", + " '3',\n", + " '0',\n", + " '5.25',\n", + " '12+',\n", + " 'News',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['282',\n", + " '337288863',\n", + " 'Shazam Encore',\n", + " '147118080',\n", + " 'USD',\n", + " '2.99',\n", + " '8331',\n", + " '24',\n", + " '4',\n", + " '3.5',\n", + " '11.0.2',\n", + " '12+',\n", + " 'Music',\n", + " '37',\n", + " '3',\n", + " '15',\n", + " '1'],\n", + " ['283',\n", + " '337402021',\n", + " 'Harry Potter: Spells',\n", + " '125411328',\n", + " 'USD',\n", + " '0.99',\n", + " '17023',\n", + " '916',\n", + " '4',\n", + " '4.5',\n", + " '2.2',\n", + " '4+',\n", + " 'Games',\n", + " '40',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['284',\n", + " '337462979',\n", + " 'First Words Deluxe',\n", + " '63316992',\n", + " 'USD',\n", + " '4.99',\n", + " '1101',\n", + " '8',\n", + " '4',\n", + " '4',\n", + " '7.0',\n", + " '4+',\n", + " 'Games',\n", + " '38',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['285',\n", + " '337571576',\n", + " 'Clay Hunt',\n", + " '15313920',\n", + " 'USD',\n", + " '0.99',\n", + " '1193',\n", + " '1',\n", + " '4',\n", + " '2',\n", + " '3.5.3',\n", + " '17+',\n", + " 'Games',\n", + " '40',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['286',\n", + " '337710261',\n", + " 'Dream Team - be your own fantasy football manager',\n", + " '69816320',\n", + " 'USD',\n", + " '0',\n", + " '35',\n", + " '0',\n", + " '2.5',\n", + " '0',\n", + " '12.8.0',\n", + " '17+',\n", + " 'Sports',\n", + " '37',\n", + " '3',\n", + " '1',\n", + " '1'],\n", + " ['287',\n", + " '337866370',\n", + " 'Jet Car Stunts',\n", + " '32848910',\n", + " 'USD',\n", + " '1.99',\n", + " '4088',\n", + " '436',\n", + " '4',\n", + " '4.5',\n", + " '1.5.0',\n", + " '4+',\n", + " 'Games',\n", + " '47',\n", + " '4',\n", + " '1',\n", + " '1'],\n", + " ['288',\n", + " '338057689',\n", + " 'Call of Duty: Zombies',\n", + " '52821364',\n", + " 'USD',\n", + " '4.99',\n", + " '63943',\n", + " '31264',\n", + " '4',\n", + " '4',\n", + " '1.5.0',\n", + " '17+',\n", + " 'Games',\n", + " '47',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['289',\n", + " '338137227',\n", + " 'Walmart: Free 2-Day Shipping,* Easy Store Shopping',\n", + " '146507776',\n", + " 'USD',\n", + " '0',\n", + " '70286',\n", + " '51',\n", + " '3',\n", + " '4',\n", + " '17.8',\n", + " '4+',\n", + " 'Shopping',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['290',\n", + " '338761996',\n", + " 'AirWatch Agent',\n", + " '24747008',\n", + " 'USD',\n", + " '0',\n", + " '1150',\n", + " '0',\n", + " '2.5',\n", + " '0',\n", + " '5.5',\n", + " '4+',\n", + " 'Business',\n", + " '37',\n", + " '5',\n", + " '19',\n", + " '1'],\n", + " ['291',\n", + " '338828953',\n", + " 'Shop Savvy Barcode Scanner - Price Compare & Deals',\n", + " '89517056',\n", + " 'USD',\n", + " '0',\n", + " '54630',\n", + " '280',\n", + " '2.5',\n", + " '4.5',\n", + " '12.0',\n", + " '4+',\n", + " 'Shopping',\n", + " '37',\n", + " '4',\n", + " '1',\n", + " '1'],\n", + " ['292',\n", + " '339440515',\n", + " 'Voice Changer Plus',\n", + " '40722432',\n", + " 'USD',\n", + " '0',\n", + " '98777',\n", + " '233',\n", + " '3',\n", + " '4',\n", + " '5.01',\n", + " '4+',\n", + " 'Entertainment',\n", + " '37',\n", + " '2',\n", + " '12',\n", + " '1'],\n", + " ['293',\n", + " '339462921',\n", + " 'CatPaint',\n", + " '73332736',\n", + " 'USD',\n", + " '0.99',\n", + " '649',\n", + " '11',\n", + " '4',\n", + " '4',\n", + " '3.5.1',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['294',\n", + " '339532909',\n", + " 'Redbox',\n", + " '83906560',\n", + " 'USD',\n", + " '0',\n", + " '60236',\n", + " '58',\n", + " '3',\n", + " '4.5',\n", + " '5.24',\n", + " '12+',\n", + " 'Entertainment',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['295',\n", + " '340368403',\n", + " 'クックパッド - No.1料理レシピ検索アプリ',\n", + " '76644352',\n", + " 'USD',\n", + " '0',\n", + " '115',\n", + " '0',\n", + " '3.5',\n", + " '0',\n", + " '17.5.1.0',\n", + " '4+',\n", + " 'Food & Drink',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['296',\n", + " '340769953',\n", + " 'Trenches',\n", + " '37340259',\n", + " 'USD',\n", + " '0.99',\n", + " '26732',\n", + " '1428',\n", + " '4',\n", + " '4.5',\n", + " '1.9.3',\n", + " '17+',\n", + " 'Games',\n", + " '43',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['297',\n", + " '340779800',\n", + " 'The Christmas List',\n", + " '26137600',\n", + " 'USD',\n", + " '1.99',\n", + " '2722',\n", + " '1',\n", + " '4.5',\n", + " '5',\n", + " '2.1',\n", + " '4+',\n", + " 'Shopping',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['298',\n", + " '341036067',\n", + " \"Macy's\",\n", + " '107816960',\n", + " 'USD',\n", + " '0',\n", + " '11013',\n", + " '76',\n", + " '3.5',\n", + " '5',\n", + " '5.11.0',\n", + " '4+',\n", + " 'Shopping',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['299',\n", + " '341232718',\n", + " 'Calorie Counter & Diet Tracker by MyFitnessPal',\n", + " '152700928',\n", + " 'USD',\n", + " '0',\n", + " '507706',\n", + " '181',\n", + " '4.5',\n", + " '4.5',\n", + " '7.16',\n", + " '4+',\n", + " 'Health & Fitness',\n", + " '37',\n", + " '5',\n", + " '19',\n", + " '1'],\n", + " ['300',\n", + " '341329033',\n", + " 'BlaBlaCar - Trusted Carpooling',\n", + " '112024576',\n", + " 'USD',\n", + " '0',\n", + " '397',\n", + " '0',\n", + " '4.5',\n", + " '0',\n", + " '4.10.1',\n", + " '4+',\n", + " 'Travel',\n", + " '37',\n", + " '0',\n", + " '16',\n", + " '1'],\n", + " ['301',\n", + " '341691394',\n", + " 'Refills Calendar - Scheduler - Note',\n", + " '35864576',\n", + " 'USD',\n", + " '9.99',\n", + " '196',\n", + " '3',\n", + " '4',\n", + " '5',\n", + " '4.0.1',\n", + " '4+',\n", + " 'Productivity',\n", + " '38',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['302',\n", + " '341776037',\n", + " '5-0 Radio Pro Police Scanner (Extra Feeds)',\n", + " '49594368',\n", + " 'USD',\n", + " '3.99',\n", + " '24553',\n", + " '2620',\n", + " '4',\n", + " '4.5',\n", + " '39.1',\n", + " '9+',\n", + " 'News',\n", + " '38',\n", + " '5',\n", + " '26',\n", + " '1'],\n", + " ['303',\n", + " '342115564',\n", + " 'Hipstamatic',\n", + " '114081792',\n", + " 'USD',\n", + " '2.99',\n", + " '12557',\n", + " '6',\n", + " '3.5',\n", + " '5',\n", + " '337',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '37',\n", + " '5',\n", + " '15',\n", + " '1'],\n", + " ['304',\n", + " '342138881',\n", + " 'Sing Karaoke Songs Unlimited with StarMaker',\n", + " '91267072',\n", + " 'USD',\n", + " '0',\n", + " '26227',\n", + " '7',\n", + " '4',\n", + " '4.5',\n", + " '6.0.3',\n", + " '9+',\n", + " 'Music',\n", + " '37',\n", + " '4',\n", + " '14',\n", + " '1'],\n", + " ['305',\n", + " '342548956',\n", + " 'TurboScan™ Pro - document & receipt scanner: scan multiple pages and photos to PDF',\n", + " '8821760',\n", + " 'USD',\n", + " '4.99',\n", + " '28388',\n", + " '7009',\n", + " '5',\n", + " '5',\n", + " '2.8.2',\n", + " '4+',\n", + " 'Business',\n", + " '38',\n", + " '5',\n", + " '9',\n", + " '1'],\n", + " ['307',\n", + " '342602105',\n", + " 'Positivity with Andrew Johnson',\n", + " '69513216',\n", + " 'USD',\n", + " '2.99',\n", + " '282',\n", + " '1',\n", + " '4',\n", + " '5',\n", + " '3.38',\n", + " '4+',\n", + " 'Health & Fitness',\n", + " '38',\n", + " '4',\n", + " '1',\n", + " '1'],\n", + " ['308',\n", + " '342699962',\n", + " 'Rat On A Scooter XL',\n", + " '7767040',\n", + " 'USD',\n", + " '0.99',\n", + " '19296',\n", + " '7',\n", + " '4',\n", + " '4',\n", + " '1.24.1',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '3',\n", + " '1',\n", + " '1'],\n", + " ['309',\n", + " '342792525',\n", + " 'IMDb Movies & TV - Trailers and Showtimes',\n", + " '88702976',\n", + " 'USD',\n", + " '0',\n", + " '183425',\n", + " '4724',\n", + " '4.5',\n", + " '5',\n", + " '7.11',\n", + " '12+',\n", + " 'Entertainment',\n", + " '37',\n", + " '5',\n", + " '10',\n", + " '1'],\n", + " ['310',\n", + " '343200656',\n", + " 'Angry Birds',\n", + " '175966208',\n", + " 'USD',\n", + " '0',\n", + " '824451',\n", + " '107',\n", + " '4.5',\n", + " '3',\n", + " '7.4.0',\n", + " '4+',\n", + " 'Games',\n", + " '38',\n", + " '0',\n", + " '10',\n", + " '1'],\n", + " ['311',\n", + " '343555245',\n", + " 'DB Navigator',\n", + " '84791296',\n", + " 'USD',\n", + " '0',\n", + " '512',\n", + " '6',\n", + " '3.5',\n", + " '5',\n", + " '17.04.00',\n", + " '4+',\n", + " 'Travel',\n", + " '38',\n", + " '0',\n", + " '2',\n", + " '1'],\n", + " ['312',\n", + " '343638336',\n", + " 'Video Calls with Santa',\n", + " '27997184',\n", + " 'USD',\n", + " '2.99',\n", + " '315',\n", + " '0',\n", + " '3.5',\n", + " '0',\n", + " '5.1',\n", + " '4+',\n", + " 'Lifestyle',\n", + " '37',\n", + " '0',\n", + " '31',\n", + " '1'],\n", + " ['313',\n", + " '343889987',\n", + " 'Voyages-sncf.com : book train and bus tickets',\n", + " '131463168',\n", + " 'USD',\n", + " '0',\n", + " '268',\n", + " '0',\n", + " '3.5',\n", + " '0',\n", + " '38.0',\n", + " '4+',\n", + " 'Travel',\n", + " '37',\n", + " '5',\n", + " '6',\n", + " '1'],\n", + " ['314',\n", + " '344065205',\n", + " 'The Font Game',\n", + " '5415000',\n", + " 'USD',\n", + " '1.99',\n", + " '438',\n", + " '295',\n", + " '4.5',\n", + " '4.5',\n", + " '2.1',\n", + " '4+',\n", + " 'Games',\n", + " '45',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['316',\n", + " '344176018',\n", + " 'ImmobilienScout24: Real Estate Search in Germany',\n", + " '126867456',\n", + " 'USD',\n", + " '0',\n", + " '187',\n", + " '0',\n", + " '3.5',\n", + " '0',\n", + " '9.5',\n", + " '4+',\n", + " 'Navigation',\n", + " '37',\n", + " '5',\n", + " '3',\n", + " '1'],\n", + " ['317',\n", + " '344186162',\n", + " 'Grand Theft Auto: Chinatown Wars',\n", + " '878883840',\n", + " 'USD',\n", + " '4.99',\n", + " '15142',\n", + " '73',\n", + " '4',\n", + " '4',\n", + " '4.4',\n", + " '17+',\n", + " 'Games',\n", + " '38',\n", + " '5',\n", + " '6',\n", + " '1'],\n", + " ['318',\n", + " '344542975',\n", + " 'Southwest Airlines',\n", + " '88773632',\n", + " 'USD',\n", + " '0',\n", + " '30552',\n", + " '18',\n", + " '3',\n", + " '2.5',\n", + " '4.5.1',\n", + " '4+',\n", + " 'Travel',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['319',\n", + " '345445479',\n", + " 'The Sims 3 World Adventures',\n", + " '812758016',\n", + " 'USD',\n", + " '2.99',\n", + " '9744',\n", + " '42',\n", + " '3.5',\n", + " '3',\n", + " '1.2.21',\n", + " '12+',\n", + " 'Games',\n", + " '37',\n", + " '4',\n", + " '6',\n", + " '1'],\n", + " ['320',\n", + " '345542655',\n", + " 'Star Chart',\n", + " '28616704',\n", + " 'USD',\n", + " '0',\n", + " '13482',\n", + " '2517',\n", + " '4.5',\n", + " '4.5',\n", + " '3.98',\n", + " '4+',\n", + " 'Education',\n", + " '38',\n", + " '5',\n", + " '8',\n", + " '1'],\n", + " ['321',\n", + " '346184215',\n", + " 'TaxCaster – Free tax refund calculator',\n", + " '7111680',\n", + " 'USD',\n", + " '0',\n", + " '17516',\n", + " '125',\n", + " '3.5',\n", + " '5',\n", + " '7.2',\n", + " '4+',\n", + " 'Finance',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['322',\n", + " '346453382',\n", + " 'Glow Hockey 2 FREE',\n", + " '34056767',\n", + " 'USD',\n", + " '0',\n", + " '186653',\n", + " '226',\n", + " '3.5',\n", + " '3.5',\n", + " '2.2.9',\n", + " '4+',\n", + " 'Games',\n", + " '43',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['323',\n", + " '346513173',\n", + " 'Big Button Box - funny sounds, sound effects buttons, pro fx soundboard, fun games board, scary music, annoying fart noises, jokes, super cool dj effect, cat, dog & animal fx',\n", + " '21450752',\n", + " 'USD',\n", + " '0.99',\n", + " '10031',\n", + " '142',\n", + " '4',\n", + " '5',\n", + " '4.1',\n", + " '4+',\n", + " 'Entertainment',\n", + " '43',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['324',\n", + " '346997126',\n", + " 'TV SPIELFILM - TV Programm mit Live TV',\n", + " '97879040',\n", + " 'USD',\n", + " '0',\n", + " '81',\n", + " '0',\n", + " '3',\n", + " '0',\n", + " '5.2',\n", + " '4+',\n", + " 'Entertainment',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['325',\n", + " '347310316',\n", + " 'All-in-1 Logic GameBox',\n", + " '22299021',\n", + " 'USD',\n", + " '0.99',\n", + " '9854',\n", + " '823',\n", + " '4',\n", + " '4',\n", + " '1.19',\n", + " '4+',\n", + " 'Games',\n", + " '47',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['326',\n", + " '347393479',\n", + " 'Roadside America',\n", + " '10231808',\n", + " 'USD',\n", + " '2.99',\n", + " '1093',\n", + " '106',\n", + " '4',\n", + " '4.5',\n", + " '1.9.0',\n", + " '9+',\n", + " 'Travel',\n", + " '38',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['327',\n", + " '347400507',\n", + " 'Pocket Yoga',\n", + " '132480000',\n", + " 'USD',\n", + " '2.99',\n", + " '4475',\n", + " '95',\n", + " '4.5',\n", + " '4.5',\n", + " '5.3.2',\n", + " '4+',\n", + " 'Health & Fitness',\n", + " '37',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['328',\n", + " '347411942',\n", + " 'Sonic the Hedgehog 2',\n", + " '47182848',\n", + " 'USD',\n", + " '2.99',\n", + " '9405',\n", + " '1089',\n", + " '4',\n", + " '4.5',\n", + " '3.1.10',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['330',\n", + " '347418999',\n", + " 'Simply Being - Guided Meditation for Relaxation and Presence',\n", + " '100048896',\n", + " 'USD',\n", + " '1.99',\n", + " '2417',\n", + " '1366',\n", + " '4.5',\n", + " '4.5',\n", + " '6.0',\n", + " '4+',\n", + " 'Health & Fitness',\n", + " '38',\n", + " '2',\n", + " '1',\n", + " '1'],\n", + " ['331',\n", + " '347803339',\n", + " 'CamCard - Business card scanner & reader',\n", + " '174839808',\n", + " 'USD',\n", + " '0.99',\n", + " '2923',\n", + " '300',\n", + " '4.5',\n", + " '4.5',\n", + " '7.9.5',\n", + " '4+',\n", + " 'Business',\n", + " '37',\n", + " '0',\n", + " '7',\n", + " '1'],\n", + " ['332',\n", + " '348530331',\n", + " 'This American Life',\n", + " '13725696',\n", + " 'USD',\n", + " '2.99',\n", + " '8657',\n", + " '1468',\n", + " '3.5',\n", + " '4',\n", + " '3.0.8',\n", + " '9+',\n", + " 'Entertainment',\n", + " '38',\n", + " '4',\n", + " '1',\n", + " '1'],\n", + " ['333',\n", + " '348543978',\n", + " 'Timetracks - Slit-Scan Camera',\n", + " '11369472',\n", + " 'USD',\n", + " '0.99',\n", + " '70',\n", + " '1',\n", + " '2',\n", + " '1',\n", + " '2.2.0',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '37',\n", + " '4',\n", + " '5',\n", + " '1'],\n", + " ['335',\n", + " '348684697',\n", + " \"franceinfo - l'actualité & les élections en direct\",\n", + " '155857920',\n", + " 'USD',\n", + " '0',\n", + " '162',\n", + " '32',\n", + " '4',\n", + " '5',\n", + " '5.2.0',\n", + " '17+',\n", + " 'News',\n", + " '37',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['337',\n", + " '349079731',\n", + " 'DOUBUTSU URANAI®-Animal Fortune-',\n", + " '38718464',\n", + " 'USD',\n", + " '0.99',\n", + " '5',\n", + " '0',\n", + " '4',\n", + " '0',\n", + " '2.9.5',\n", + " '4+',\n", + " 'Lifestyle',\n", + " '40',\n", + " '0',\n", + " '2',\n", + " '1'],\n", + " ['338',\n", + " '349276209',\n", + " 'Doodle Army',\n", + " '17879270',\n", + " 'USD',\n", + " '0.99',\n", + " '12354',\n", + " '1428',\n", + " '4',\n", + " '4.5',\n", + " '3.1.0',\n", + " '12+',\n", + " 'Games',\n", + " '47',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['339',\n", + " '349442137',\n", + " 'Ameba',\n", + " '96635904',\n", + " 'USD',\n", + " '0',\n", + " '269',\n", + " '0',\n", + " '3',\n", + " '0',\n", + " '8.6.1',\n", + " '12+',\n", + " 'Social Networking',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['340',\n", + " '350480010',\n", + " 'eBook: War and Peace',\n", + " '8039424',\n", + " 'USD',\n", + " '3.99',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '7.1',\n", + " '9+',\n", + " 'Book',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['341',\n", + " '350642635',\n", + " 'Plants vs. Zombies',\n", + " '105379840',\n", + " 'USD',\n", + " '0.99',\n", + " '426463',\n", + " '680',\n", + " '5',\n", + " '4',\n", + " '1.9.13',\n", + " '9+',\n", + " 'Games',\n", + " '38',\n", + " '0',\n", + " '5',\n", + " '1'],\n", + " ['342',\n", + " '350962117',\n", + " 'Weibo',\n", + " '199585792',\n", + " 'USD',\n", + " '0',\n", + " '7265',\n", + " '11',\n", + " '3.5',\n", + " '4',\n", + " '7.5.2',\n", + " '17+',\n", + " 'Social Networking',\n", + " '37',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['343',\n", + " '351091731',\n", + " '大众点评-发现品质生活',\n", + " '244516864',\n", + " 'USD',\n", + " '0',\n", + " '844',\n", + " '1',\n", + " '4',\n", + " '1',\n", + " '9.2.4',\n", + " '17+',\n", + " 'Lifestyle',\n", + " '37',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['344',\n", + " '351184863',\n", + " 'AlloCiné : Cinéma et Séries',\n", + " '123450368',\n", + " 'USD',\n", + " '0',\n", + " '101',\n", + " '1',\n", + " '4',\n", + " '5',\n", + " '7.1.0',\n", + " '12+',\n", + " 'Entertainment',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['345',\n", + " '351331194',\n", + " 'Badoo - Meet New People, Chat, Socialize.',\n", + " '157625344',\n", + " 'USD',\n", + " '0',\n", + " '34428',\n", + " '23',\n", + " '4.5',\n", + " '4',\n", + " '5.8.0',\n", + " '17+',\n", + " 'Social Networking',\n", + " '37',\n", + " '4',\n", + " '30',\n", + " '1'],\n", + " ['346',\n", + " '351707231',\n", + " 'Flick Kick Field Goal',\n", + " '75612160',\n", + " 'USD',\n", + " '1.99',\n", + " '36946',\n", + " '152',\n", + " '4.5',\n", + " '4',\n", + " '1.11.0',\n", + " '4+',\n", + " 'Games',\n", + " '38',\n", + " '5',\n", + " '3',\n", + " '1'],\n", + " ['347',\n", + " '351727428',\n", + " 'Venmo',\n", + " '68153344',\n", + " 'USD',\n", + " '0',\n", + " '21090',\n", + " '1325',\n", + " '4.5',\n", + " '5',\n", + " '7.1.0',\n", + " '4+',\n", + " 'Finance',\n", + " '37',\n", + " '4',\n", + " '1',\n", + " '1'],\n", + " ['348',\n", + " '351939099',\n", + " 'Dungeons & Such Treasures,Collectibles and Dragons',\n", + " '84469760',\n", + " 'USD',\n", + " '2.99',\n", + " '653',\n", + " '8',\n", + " '4.5',\n", + " '4.5',\n", + " '3.4.2',\n", + " '12+',\n", + " 'Games',\n", + " '37',\n", + " '1',\n", + " '31',\n", + " '1'],\n", + " ['349',\n", + " '351986992',\n", + " 'StarMap 3D+: Night Sky, Astronomy, Star View Guide',\n", + " '100368384',\n", + " 'USD',\n", + " '3.99',\n", + " '1118',\n", + " '29',\n", + " '4.5',\n", + " '5',\n", + " '3.5.3',\n", + " '4+',\n", + " 'Education',\n", + " '37',\n", + " '5',\n", + " '29',\n", + " '1'],\n", + " ['350',\n", + " '352000376',\n", + " 'Shift Worker',\n", + " '7344128',\n", + " 'USD',\n", + " '1.99',\n", + " '348',\n", + " '33',\n", + " '4',\n", + " '4',\n", + " '1.5.4',\n", + " '4+',\n", + " 'Productivity',\n", + " '40',\n", + " '0',\n", + " '1',\n", + " '0'],\n", + " ['351',\n", + " '352041837',\n", + " 'Spy Calc - Hide pictures, videos, documents',\n", + " '25097281',\n", + " 'USD',\n", + " '1.99',\n", + " '207',\n", + " '50',\n", + " '3.5',\n", + " '3',\n", + " '3.0.3',\n", + " '9+',\n", + " 'Utilities',\n", + " '40',\n", + " '0',\n", + " '34',\n", + " '1'],\n", + " ['352',\n", + " '352199775',\n", + " 'Waterlogged - Daily Hydration Tracker',\n", + " '43439104',\n", + " 'USD',\n", + " '0',\n", + " '5000',\n", + " '23',\n", + " '4.5',\n", + " '4.5',\n", + " '2.5.11',\n", + " '12+',\n", + " 'Health & Fitness',\n", + " '37',\n", + " '5',\n", + " '10',\n", + " '1'],\n", + " ['353',\n", + " '352247139',\n", + " 'MyNetDiary PRO - Calorie Counter and Food Diary',\n", + " '83851264',\n", + " 'USD',\n", + " '3.99',\n", + " '15188',\n", + " '272',\n", + " '4.5',\n", + " '4',\n", + " '5.30',\n", + " '12+',\n", + " 'Health & Fitness',\n", + " '37',\n", + " '0',\n", + " '2',\n", + " '1'],\n", + " ['354',\n", + " '352509417',\n", + " 'The Washington Post Classic',\n", + " '118980608',\n", + " 'USD',\n", + " '0',\n", + " '18572',\n", + " '307',\n", + " '4.5',\n", + " '4.5',\n", + " '3.8.2',\n", + " '12+',\n", + " 'News',\n", + " '37',\n", + " '3',\n", + " '1',\n", + " '1'],\n", + " ['355',\n", + " '352670055',\n", + " 'F-Sim Space Shuttle',\n", + " '76394496',\n", + " 'USD',\n", + " '4.99',\n", + " '6403',\n", + " '491',\n", + " '4.5',\n", + " '4.5',\n", + " '2.10',\n", + " '4+',\n", + " 'Games',\n", + " '43',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['356',\n", + " '352683833',\n", + " 'Groupon - Deals, Coupons & Discount Shopping App',\n", + " '127382528',\n", + " 'USD',\n", + " '0',\n", + " '417779',\n", + " '914',\n", + " '4.5',\n", + " '4.5',\n", + " '17.7',\n", + " '12+',\n", + " 'Shopping',\n", + " '37',\n", + " '4',\n", + " '10',\n", + " '1'],\n", + " ['357',\n", + " '353372460',\n", + " 'Learn to Speak Spanish Fast With MosaLingua',\n", + " '48819200',\n", + " 'USD',\n", + " '4.99',\n", + " '9',\n", + " '1',\n", + " '5',\n", + " '5',\n", + " '9.2',\n", + " '12+',\n", + " 'Education',\n", + " '38',\n", + " '5',\n", + " '5',\n", + " '1'],\n", + " ['358',\n", + " '353573707',\n", + " 'Coaster VR, Extreme Endless 3D Stereograph',\n", + " '30977024',\n", + " 'USD',\n", + " '0.99',\n", + " '107',\n", + " '0',\n", + " '2.5',\n", + " '0',\n", + " '1.1.5',\n", + " '4+',\n", + " 'Entertainment',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['359',\n", + " '353603279',\n", + " 'Parents Calling Easter Bunny',\n", + " '8073209',\n", + " 'USD',\n", + " '1.99',\n", + " '72',\n", + " '72',\n", + " '2',\n", + " '2',\n", + " '1.0',\n", + " '4+',\n", + " 'Lifestyle',\n", + " '47',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['360',\n", + " '353642901',\n", + " 'Sporcle',\n", + " '15676416',\n", + " 'USD',\n", + " '2.99',\n", + " '2044',\n", + " '10',\n", + " '3.5',\n", + " '3',\n", + " '5.4',\n", + " '9+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['361',\n", + " '353665650',\n", + " 'Univision Deportes: Liga MX, MLS, Fútbol En Vivo',\n", + " '81876992',\n", + " 'USD',\n", + " '0',\n", + " '16683',\n", + " '21',\n", + " '3.5',\n", + " '2.5',\n", + " '5.5',\n", + " '4+',\n", + " 'Sports',\n", + " '37',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['362',\n", + " '354051766',\n", + " 'DOOM II RPG',\n", + " '48700821',\n", + " 'USD',\n", + " '0.99',\n", + " '1455',\n", + " '1450',\n", + " '3',\n", + " '3',\n", + " '1.0',\n", + " '12+',\n", + " 'Games',\n", + " '47',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['364',\n", + " '354655665',\n", + " 'STREET FIGHTER IV',\n", + " '581353472',\n", + " 'USD',\n", + " '4.99',\n", + " '15056',\n", + " '751',\n", + " '4',\n", + " '4',\n", + " '1.00.12',\n", + " '17+',\n", + " 'Games',\n", + " '40',\n", + " '0',\n", + " '3',\n", + " '1'],\n", + " ['365',\n", + " '354850853',\n", + " 'Dr. Seuss Camera - The Cat in the Hat Edition',\n", + " '9906176',\n", + " 'USD',\n", + " '0.99',\n", + " '249',\n", + " '5',\n", + " '4.5',\n", + " '4.5',\n", + " '1.5.5',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['366',\n", + " '354972939',\n", + " 'FINAL FANTASY',\n", + " '114843648',\n", + " 'USD',\n", + " '7.99',\n", + " '6091',\n", + " '75',\n", + " '4',\n", + " '3.5',\n", + " '1.1.2',\n", + " '9+',\n", + " 'Games',\n", + " '38',\n", + " '3',\n", + " '8',\n", + " '1'],\n", + " ['367',\n", + " '354974729',\n", + " 'FINAL FANTASY II',\n", + " '199450624',\n", + " 'USD',\n", + " '7.99',\n", + " '2754',\n", + " '55',\n", + " '4',\n", + " '2.5',\n", + " '1.1.1',\n", + " '9+',\n", + " 'Games',\n", + " '38',\n", + " '5',\n", + " '6',\n", + " '1'],\n", + " ['369',\n", + " '355524910',\n", + " 'Worms 2: Armageddon',\n", + " '529755136',\n", + " 'USD',\n", + " '4.99',\n", + " '9870',\n", + " '12',\n", + " '4.5',\n", + " '4.5',\n", + " '1.25',\n", + " '12+',\n", + " 'Games',\n", + " '40',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['370',\n", + " '355554941',\n", + " 'SoundHound Song Search & Music Player',\n", + " '70516736',\n", + " 'USD',\n", + " '0',\n", + " '82602',\n", + " '13',\n", + " '4',\n", + " '4.5',\n", + " '7.6',\n", + " '9+',\n", + " 'Music',\n", + " '37',\n", + " '5',\n", + " '23',\n", + " '1'],\n", + " ['371',\n", + " '355709084',\n", + " 'Jourist Weltübersetzer',\n", + " '147066880',\n", + " 'USD',\n", + " '7.99',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '2.8',\n", + " '4+',\n", + " 'Travel',\n", + " '40',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['372',\n", + " '355940964',\n", + " 'TeachMe: 1st Grade',\n", + " '90241024',\n", + " 'USD',\n", + " '1.99',\n", + " '762',\n", + " '5',\n", + " '4',\n", + " '5',\n", + " '4.0.2',\n", + " '4+',\n", + " 'Education',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['373',\n", + " '356618664',\n", + " 'TeachMe: 3rd Grade',\n", + " '174268416',\n", + " 'USD',\n", + " '1.99',\n", + " '160',\n", + " '2',\n", + " '4',\n", + " '3',\n", + " '2.0.2',\n", + " '4+',\n", + " 'Education',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['374',\n", + " '356968629',\n", + " 'ヤフオク! 利用者数NO.1のオークション、フリマアプリ',\n", + " '187040768',\n", + " 'USD',\n", + " '0',\n", + " '9',\n", + " '0',\n", + " '3',\n", + " '0',\n", + " '6.14.0',\n", + " '17+',\n", + " 'Shopping',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['375',\n", + " '357218860',\n", + " 'Kik',\n", + " '151864320',\n", + " 'USD',\n", + " '0',\n", + " '260965',\n", + " '228',\n", + " '4',\n", + " '3',\n", + " '11.21.0',\n", + " '12+',\n", + " 'Social Networking',\n", + " '37',\n", + " '0',\n", + " '14',\n", + " '0'],\n", + " ['376',\n", + " '357404131',\n", + " 'Slow Shutter Cam',\n", + " '4466688',\n", + " 'USD',\n", + " '1.99',\n", + " '2305',\n", + " '100',\n", + " '4',\n", + " '5',\n", + " '4.0',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '37',\n", + " '5',\n", + " '4',\n", + " '1'],\n", + " ['377',\n", + " '357421934',\n", + " 'PeakFinder Earth',\n", + " '35478528',\n", + " 'USD',\n", + " '4.99',\n", + " '137',\n", + " '21',\n", + " '4',\n", + " '5',\n", + " '3.0.7',\n", + " '4+',\n", + " 'Travel',\n", + " '37',\n", + " '3',\n", + " '10',\n", + " '1'],\n", + " ['379',\n", + " '357467791',\n", + " 'AgingBooth',\n", + " '31869952',\n", + " 'USD',\n", + " '0',\n", + " '11999',\n", + " '233',\n", + " '4',\n", + " '4.5',\n", + " '3.9.5',\n", + " '4+',\n", + " 'Entertainment',\n", + " '37',\n", + " '4',\n", + " '1',\n", + " '1'],\n", + " ['380',\n", + " '357577420',\n", + " 'iWatermark - Watermark 1 or Batch of Photos. Watermarking with Text, Logo, & Graphics Overlays.',\n", + " '21771264',\n", + " 'USD',\n", + " '1.99',\n", + " '1995',\n", + " '148',\n", + " '4.5',\n", + " '4.5',\n", + " '6.5',\n", + " '12+',\n", + " 'Photo & Video',\n", + " '38',\n", + " '5',\n", + " '14',\n", + " '1'],\n", + " ['381',\n", + " '357828853',\n", + " 'Tabs & Chords by Ultimate Guitar - learn and play',\n", + " '103049216',\n", + " 'USD',\n", + " '2.99',\n", + " '35045',\n", + " '250',\n", + " '4.5',\n", + " '4.5',\n", + " '3.1.2',\n", + " '4+',\n", + " 'Music',\n", + " '37',\n", + " '0',\n", + " '6',\n", + " '1'],\n", + " ['382',\n", + " '358055270',\n", + " 'Dude, your car!',\n", + " '40586240',\n", + " 'USD',\n", + " '0.99',\n", + " '343',\n", + " '15',\n", + " '4',\n", + " '4.5',\n", + " '2.5',\n", + " '4+',\n", + " 'Entertainment',\n", + " '38',\n", + " '0',\n", + " '30',\n", + " '1'],\n", + " ['383',\n", + " '358207332',\n", + " 'Drawing Pad',\n", + " '220397568',\n", + " 'USD',\n", + " '1.99',\n", + " '1824',\n", + " '113',\n", + " '4',\n", + " '4',\n", + " '2.5.1',\n", + " '4+',\n", + " 'Entertainment',\n", + " '24',\n", + " '5',\n", + " '22',\n", + " '1'],\n", + " ['385',\n", + " '359891723',\n", + " 'ESPN Tournament Challenge',\n", + " '69057536',\n", + " 'USD',\n", + " '0',\n", + " '39642',\n", + " '492',\n", + " '4',\n", + " '4',\n", + " '5.5.3',\n", + " '4+',\n", + " 'Sports',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['386',\n", + " '359917414',\n", + " 'Solitaire',\n", + " '101943296',\n", + " 'USD',\n", + " '0',\n", + " '679055',\n", + " '9673',\n", + " '4.5',\n", + " '4.5',\n", + " '4.11.2',\n", + " '4+',\n", + " 'Games',\n", + " '38',\n", + " '4',\n", + " '11',\n", + " '1'],\n", + " ['388',\n", + " '360593530',\n", + " 'Notability',\n", + " '122235904',\n", + " 'USD',\n", + " '9.99',\n", + " '17594',\n", + " '143',\n", + " '4',\n", + " '4',\n", + " '6.5.2',\n", + " '4+',\n", + " 'Productivity',\n", + " '37',\n", + " '5',\n", + " '14',\n", + " '1'],\n", + " ['390',\n", + " '361231506',\n", + " \"Rubik's® Cube\",\n", + " '151954432',\n", + " 'USD',\n", + " '1.99',\n", + " '3531',\n", + " '177',\n", + " '4',\n", + " '4.5',\n", + " '2.5',\n", + " '4+',\n", + " 'Games',\n", + " '38',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['391',\n", + " '362179828',\n", + " 'Super Why! Power to Read',\n", + " '138047488',\n", + " 'USD',\n", + " '3.99',\n", + " '1080',\n", + " '5',\n", + " '3.5',\n", + " '2.5',\n", + " '4.0',\n", + " '4+',\n", + " 'Education',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['392',\n", + " '362348516',\n", + " 'Amex Mobile',\n", + " '105982976',\n", + " 'USD',\n", + " '0',\n", + " '11421',\n", + " '57',\n", + " '4',\n", + " '2.5',\n", + " '5.21.1',\n", + " '4+',\n", + " 'Finance',\n", + " '37',\n", + " '4',\n", + " '1',\n", + " '1'],\n", + " ['393',\n", + " '362949845',\n", + " 'Fruit Ninja Classic',\n", + " '104590336',\n", + " 'USD',\n", + " '1.99',\n", + " '698516',\n", + " '132',\n", + " '4.5',\n", + " '4',\n", + " '2.3.9',\n", + " '4+',\n", + " 'Games',\n", + " '38',\n", + " '5',\n", + " '13',\n", + " '1'],\n", + " ['395',\n", + " '363201632',\n", + " 'Animation Creator HD',\n", + " '32051200',\n", + " 'USD',\n", + " '3.99',\n", + " '4497',\n", + " '448',\n", + " '4',\n", + " '4',\n", + " '1.14.3',\n", + " '12+',\n", + " 'Entertainment',\n", + " '24',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['396',\n", + " '363282253',\n", + " 'Plants vs. Zombies HD',\n", + " '225859584',\n", + " 'USD',\n", + " '0.99',\n", + " '163598',\n", + " '503',\n", + " '5',\n", + " '4',\n", + " '1.9.12',\n", + " '9+',\n", + " 'Games',\n", + " '24',\n", + " '5',\n", + " '5',\n", + " '1'],\n", + " ['397',\n", + " '363306776',\n", + " 'SCRABBLE Premium for iPad',\n", + " '229992448',\n", + " 'USD',\n", + " '9.99',\n", + " '39678',\n", + " '114',\n", + " '3.5',\n", + " '3.5',\n", + " '5.19.0',\n", + " '4+',\n", + " 'Games',\n", + " '24',\n", + " '5',\n", + " '6',\n", + " '1'],\n", + " ['398',\n", + " '363317633',\n", + " 'Graphic - illustration and design',\n", + " '32604160',\n", + " 'USD',\n", + " '8.99',\n", + " '1809',\n", + " '52',\n", + " '4.5',\n", + " '3.5',\n", + " '3.2.5',\n", + " '4+',\n", + " 'Productivity',\n", + " '24',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['399',\n", + " '363360636',\n", + " 'Ship Finder',\n", + " '22948864',\n", + " 'USD',\n", + " '4.99',\n", + " '624',\n", + " '20',\n", + " '3.5',\n", + " '3.5',\n", + " '9.0.1',\n", + " '4+',\n", + " 'Navigation',\n", + " '37',\n", + " '1',\n", + " '1',\n", + " '1'],\n", + " ['400',\n", + " '363448251',\n", + " 'Photogene ⁴',\n", + " '35422208',\n", + " 'USD',\n", + " '2.99',\n", + " '3761',\n", + " '596',\n", + " '4.5',\n", + " '4.5',\n", + " '4.3',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '40',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['401',\n", + " '363451838',\n", + " 'Hurricane HD',\n", + " '32083968',\n", + " 'USD',\n", + " '3.99',\n", + " '353',\n", + " '8',\n", + " '4',\n", + " '3.5',\n", + " '3.0',\n", + " '12+',\n", + " 'Weather',\n", + " '24',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['402',\n", + " '363486802',\n", + " 'Star Walk HD - Night Sky Map',\n", + " '150221824',\n", + " 'USD',\n", + " '4.99',\n", + " '6503',\n", + " '60',\n", + " '4.5',\n", + " '5',\n", + " '7.2.3',\n", + " '4+',\n", + " 'Education',\n", + " '24',\n", + " '5',\n", + " '12',\n", + " '1'],\n", + " ['403',\n", + " '363486833',\n", + " 'Space War HD',\n", + " '30270464',\n", + " 'USD',\n", + " '0.99',\n", + " '71',\n", + " '3',\n", + " '3',\n", + " '4.5',\n", + " '5.3',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '2',\n", + " '4',\n", + " '1'],\n", + " ['404',\n", + " '363590051',\n", + " 'Netflix',\n", + " '125016064',\n", + " 'USD',\n", + " '0',\n", + " '308844',\n", + " '139',\n", + " '3.5',\n", + " '3',\n", + " '9.21.3',\n", + " '4+',\n", + " 'Entertainment',\n", + " '37',\n", + " '5',\n", + " '20',\n", + " '1'],\n", + " ['405',\n", + " '363738376',\n", + " 'forScore',\n", + " '35717120',\n", + " 'USD',\n", + " '9.99',\n", + " '3909',\n", + " '36',\n", + " '4.5',\n", + " '5',\n", + " '10.2.5',\n", + " '4+',\n", + " 'Music',\n", + " '24',\n", + " '5',\n", + " '14',\n", + " '1'],\n", + " ['406',\n", + " '363992049',\n", + " 'ComicGlass [ComicReader]',\n", + " '31955968',\n", + " 'USD',\n", + " '2.99',\n", + " '308',\n", + " '0',\n", + " '4.5',\n", + " '0',\n", + " '9.11',\n", + " '12+',\n", + " 'Utilities',\n", + " '40',\n", + " '5',\n", + " '7',\n", + " '1'],\n", + " ['407',\n", + " '363998953',\n", + " 'iAnnotate PDF',\n", + " '44099584',\n", + " 'USD',\n", + " '9.99',\n", + " '11156',\n", + " '8',\n", + " '4.5',\n", + " '2.5',\n", + " '3.2.6',\n", + " '4+',\n", + " 'Productivity',\n", + " '24',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['408',\n", + " '364017607',\n", + " 'ArtStudio for iPad - Draw Sketch and Paint',\n", + " '34310144',\n", + " 'USD',\n", + " '4.99',\n", + " '8542',\n", + " '543',\n", + " '4.5',\n", + " '5',\n", + " '5.98',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '26',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['409',\n", + " '364159440',\n", + " 'Call of Duty: Zombies HD',\n", + " '35602607',\n", + " 'USD',\n", + " '4.99',\n", + " '5853',\n", + " '3860',\n", + " '3.5',\n", + " '4',\n", + " '1.3.3',\n", + " '17+',\n", + " 'Games',\n", + " '26',\n", + " '4',\n", + " '1',\n", + " '1'],\n", + " ['410',\n", + " '364165557',\n", + " 'Small World 2',\n", + " '234123264',\n", + " 'USD',\n", + " '1.99',\n", + " '1506',\n", + " '198',\n", + " '4',\n", + " '4.5',\n", + " '2.5.1',\n", + " '9+',\n", + " 'Games',\n", + " '26',\n", + " '5',\n", + " '6',\n", + " '1'],\n", + " ['411',\n", + " '364183992',\n", + " 'Qzone',\n", + " '133874688',\n", + " 'USD',\n", + " '0',\n", + " '1649',\n", + " '1',\n", + " '3.5',\n", + " '5',\n", + " '7.2.8',\n", + " '4+',\n", + " 'Social Networking',\n", + " '37',\n", + " '0',\n", + " '3',\n", + " '1'],\n", + " ['412',\n", + " '364191819',\n", + " 'ABC – Watch Live TV & Stream Full Episodes',\n", + " '85724160',\n", + " 'USD',\n", + " '0',\n", + " '78890',\n", + " '449',\n", + " '3',\n", + " '3.5',\n", + " '5.0.14',\n", + " '12+',\n", + " 'Entertainment',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '0'],\n", + " ['413',\n", + " '364204209',\n", + " 'Fieldrunners for iPad',\n", + " '219693056',\n", + " 'USD',\n", + " '3.99',\n", + " '2147',\n", + " '23',\n", + " '4',\n", + " '5',\n", + " '1.3.177598',\n", + " '9+',\n", + " 'Games',\n", + " '24',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['414',\n", + " '364234221',\n", + " 'Angry Birds HD',\n", + " '176164864',\n", + " 'USD',\n", + " '0',\n", + " '89110',\n", + " '114',\n", + " '4.5',\n", + " '4',\n", + " '7.4.0',\n", + " '4+',\n", + " 'Games',\n", + " '24',\n", + " '5',\n", + " '10',\n", + " '1'],\n", + " ['415',\n", + " '364252504',\n", + " 'The Weather Channel App for iPad – best local forecast, radar map, and storm tracking',\n", + " '59101184',\n", + " 'USD',\n", + " '0',\n", + " '208648',\n", + " '25664',\n", + " '4',\n", + " '4.5',\n", + " '4.5.1',\n", + " '4+',\n", + " 'Weather',\n", + " '24',\n", + " '4',\n", + " '1',\n", + " '1'],\n", + " ['416',\n", + " '364267763',\n", + " 'Do Not Press The Red Button HD',\n", + " '10907191',\n", + " 'USD',\n", + " '1.99',\n", + " '856',\n", + " '38',\n", + " '2.5',\n", + " '3.5',\n", + " '1.2',\n", + " '12+',\n", + " 'Entertainment',\n", + " '26',\n", + " '3',\n", + " '1',\n", + " '1'],\n", + " ['417',\n", + " '364500115',\n", + " 'Digits, the calculator for humans',\n", + " '4177920',\n", + " 'USD',\n", + " '3.99',\n", + " '7825',\n", + " '828',\n", + " '4.5',\n", + " '4.5',\n", + " '2.2.1',\n", + " '4+',\n", + " 'Productivity',\n", + " '43',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['418',\n", + " '364502063',\n", + " 'PDF Reader Pro Edition - Annotate,edit & sign PDFs',\n", + " '62978048',\n", + " 'USD',\n", + " '9.99',\n", + " '7033',\n", + " '119',\n", + " '4',\n", + " '4.5',\n", + " '8.3',\n", + " '4+',\n", + " 'Business',\n", + " '37',\n", + " '5',\n", + " '11',\n", + " '1'],\n", + " ['422',\n", + " '364733950',\n", + " 'National Geographic World Atlas',\n", + " '66138112',\n", + " 'USD',\n", + " '1.99',\n", + " '4255',\n", + " '209',\n", + " '4',\n", + " '2',\n", + " '4.1.1',\n", + " '4+',\n", + " 'Reference',\n", + " '38',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['423',\n", + " '364738545',\n", + " 'FileBrowser - Access files on remote computers',\n", + " '68073472',\n", + " 'USD',\n", + " '5.99',\n", + " '3230',\n", + " '5',\n", + " '4.5',\n", + " '4',\n", + " '9.7',\n", + " '4+',\n", + " 'Utilities',\n", + " '37',\n", + " '5',\n", + " '7',\n", + " '1'],\n", + " ['424',\n", + " '364740856',\n", + " 'Dictionary.com Dictionary & Thesaurus for iPad',\n", + " '165748736',\n", + " 'USD',\n", + " '0',\n", + " '54175',\n", + " '10176',\n", + " '4.5',\n", + " '4.5',\n", + " '4.0',\n", + " '4+',\n", + " 'Reference',\n", + " '24',\n", + " '5',\n", + " '9',\n", + " '1'],\n", + " ['425',\n", + " '364762290',\n", + " 'Animation & Drawing by Do Ink',\n", + " '33857536',\n", + " 'USD',\n", + " '4.99',\n", + " '308',\n", + " '8',\n", + " '4',\n", + " '4.5',\n", + " '4.5',\n", + " '4+',\n", + " 'Education',\n", + " '24',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['426',\n", + " '364899325',\n", + " 'AirCoaster - Roller Coaster Builder',\n", + " '22763520',\n", + " 'USD',\n", + " '0.99',\n", + " '2602',\n", + " '71',\n", + " '3',\n", + " '4.5',\n", + " '2.0',\n", + " '9+',\n", + " 'Games',\n", + " '37',\n", + " '4',\n", + " '1',\n", + " '1'],\n", + " ['427',\n", + " '364901807',\n", + " 'Documents 6 - File manager, PDF reader and browser',\n", + " '107259904',\n", + " 'USD',\n", + " '0',\n", + " '29110',\n", + " '324',\n", + " '4.5',\n", + " '4.5',\n", + " '6.0',\n", + " '17+',\n", + " 'Productivity',\n", + " '37',\n", + " '5',\n", + " '9',\n", + " '1'],\n", + " ['428',\n", + " '364904019',\n", + " 'The World Factbook for iPad',\n", + " '73224192',\n", + " 'USD',\n", + " '1.99',\n", + " '273',\n", + " '8',\n", + " '3.5',\n", + " '4.5',\n", + " '1.2.3',\n", + " '4+',\n", + " 'Reference',\n", + " '26',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['429',\n", + " '365152940',\n", + " 'Photo Transfer App - Easy backup of photos+videos',\n", + " '45182976',\n", + " 'USD',\n", + " '0',\n", + " '15654',\n", + " '24',\n", + " '4.5',\n", + " '4.5',\n", + " '6.2.1',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '37',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['431',\n", + " '365235835',\n", + " 'TwitCasting Viewer - Watch Live Video & Radio',\n", + " '16292864',\n", + " 'USD',\n", + " '0',\n", + " '189',\n", + " '0',\n", + " '2.5',\n", + " '0',\n", + " '4.169',\n", + " '12+',\n", + " 'Entertainment',\n", + " '37',\n", + " '1',\n", + " '9',\n", + " '1'],\n", + " ['432',\n", + " '365724094',\n", + " 'Ski Tracks',\n", + " '24851456',\n", + " 'USD',\n", + " '0.99',\n", + " '829',\n", + " '16',\n", + " '4.5',\n", + " '4.5',\n", + " '1.6.5',\n", + " '4+',\n", + " 'Navigation',\n", + " '24',\n", + " '0',\n", + " '7',\n", + " '1'],\n", + " ['433',\n", + " '366195670',\n", + " \"The Photographer's Ephemeris\",\n", + " '58463232',\n", + " 'USD',\n", + " '8.99',\n", + " '663',\n", + " '5',\n", + " '5',\n", + " '4',\n", + " '3.14.1',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['434',\n", + " '366247306',\n", + " '▻Sudoku',\n", + " '71002112',\n", + " 'USD',\n", + " '0',\n", + " '359832',\n", + " '17119',\n", + " '4.5',\n", + " '5',\n", + " '5.4',\n", + " '4+',\n", + " 'Games',\n", + " '40',\n", + " '5',\n", + " '7',\n", + " '1'],\n", + " ['436',\n", + " '366562751',\n", + " 'StubHub - Tickets to Sports, Concerts and Theatre',\n", + " '112609280',\n", + " 'USD',\n", + " '0',\n", + " '9011',\n", + " '49',\n", + " '3.5',\n", + " '4',\n", + " '6.5.2',\n", + " '4+',\n", + " 'Entertainment',\n", + " '37',\n", + " '5',\n", + " '6',\n", + " '1'],\n", + " ['437',\n", + " '366626332',\n", + " 'Runtastic PRO Running, Jogging and Fitness Tracker',\n", + " '149536768',\n", + " 'USD',\n", + " '4.99',\n", + " '17667',\n", + " '14',\n", + " '4.5',\n", + " '4',\n", + " '7.3',\n", + " '4+',\n", + " 'Health & Fitness',\n", + " '37',\n", + " '0',\n", + " '15',\n", + " '1'],\n", + " ['438',\n", + " '366869252',\n", + " 'OverDrive – Library eBooks and Audiobooks',\n", + " '39844864',\n", + " 'USD',\n", + " '0',\n", + " '65450',\n", + " '2721',\n", + " '4',\n", + " '4.5',\n", + " '3.6.4',\n", + " '4+',\n", + " 'Book',\n", + " '37',\n", + " '5',\n", + " '18',\n", + " '1'],\n", + " ['440',\n", + " '367003839',\n", + " 'Hotels & Vacation Rentals by Booking.com',\n", + " '105609216',\n", + " 'USD',\n", + " '0',\n", + " '31261',\n", + " '374',\n", + " '4.5',\n", + " '4.5',\n", + " '14.4',\n", + " '4+',\n", + " 'Travel',\n", + " '37',\n", + " '5',\n", + " '40',\n", + " '1'],\n", + " ['441',\n", + " '367242040',\n", + " 'The Impossible Game',\n", + " '14160896',\n", + " 'USD',\n", + " '0.99',\n", + " '9885',\n", + " '10',\n", + " '4',\n", + " '4',\n", + " '1.6.1',\n", + " '4+',\n", + " 'Games',\n", + " '40',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['442',\n", + " '367287593',\n", + " 'PrankDial - #1 Prank Call App',\n", + " '112515072',\n", + " 'USD',\n", + " '0',\n", + " '11091',\n", + " '415',\n", + " '3',\n", + " '4.5',\n", + " '4.1.11',\n", + " '4+',\n", + " 'Entertainment',\n", + " '37',\n", + " '0',\n", + " '6',\n", + " '1'],\n", + " ['443',\n", + " '367623543',\n", + " 'Fox News',\n", + " '64705536',\n", + " 'USD',\n", + " '0',\n", + " '132703',\n", + " '394',\n", + " '4',\n", + " '3',\n", + " '2.6',\n", + " '4+',\n", + " 'News',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '0'],\n", + " ['444',\n", + " '367706767',\n", + " 'Live Cams - HD',\n", + " '37161984',\n", + " 'USD',\n", + " '4.99',\n", + " '286',\n", + " '25',\n", + " '2.5',\n", + " '5',\n", + " '2.0.100',\n", + " '4+',\n", + " 'Travel',\n", + " '24',\n", + " '5',\n", + " '1',\n", + " '0'],\n", + " ['446',\n", + " '368494609',\n", + " 'QR Reader for iPhone',\n", + " '54776832',\n", + " 'USD',\n", + " '0',\n", + " '12683',\n", + " '108',\n", + " '4',\n", + " '4',\n", + " '5.9.2',\n", + " '12+',\n", + " 'Utilities',\n", + " '38',\n", + " '0',\n", + " '29',\n", + " '1'],\n", + " ['448',\n", + " '368677368',\n", + " 'Uber',\n", + " '283852800',\n", + " 'USD',\n", + " '0',\n", + " '49466',\n", + " '150',\n", + " '3',\n", + " '2',\n", + " '3.247.2',\n", + " '4+',\n", + " 'Travel',\n", + " '37',\n", + " '4',\n", + " '41',\n", + " '1'],\n", + " ['450',\n", + " '368948250',\n", + " 'WEB.DE Mail',\n", + " '101923840',\n", + " 'USD',\n", + " '0',\n", + " '168',\n", + " '0',\n", + " '4',\n", + " '0',\n", + " '6.2',\n", + " '4+',\n", + " 'Productivity',\n", + " '37',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['451',\n", + " '369111608',\n", + " 'iBunkoHD',\n", + " '40479744',\n", + " 'USD',\n", + " '6.99',\n", + " '114',\n", + " '0',\n", + " '4',\n", + " '0',\n", + " '3.4.4',\n", + " '17+',\n", + " 'Book',\n", + " '24',\n", + " '5',\n", + " '3',\n", + " '1'],\n", + " ['452',\n", + " '369266386',\n", + " 'Hurricane Tracker For iPad',\n", + " '10612736',\n", + " 'USD',\n", + " '2.99',\n", + " '2798',\n", + " '357',\n", + " '4.5',\n", + " '4.5',\n", + " '4.2',\n", + " '4+',\n", + " 'Weather',\n", + " '24',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['453',\n", + " '369692259',\n", + " '6play, TV en direct et en replay',\n", + " '94592000',\n", + " 'USD',\n", + " '0',\n", + " '62',\n", + " '0',\n", + " '3.5',\n", + " '0',\n", + " '4.3.7',\n", + " '4+',\n", + " 'Entertainment',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['455',\n", + " '369820957',\n", + " 'AudioNote - Notepad and Voice Recorder',\n", + " '33213440',\n", + " 'USD',\n", + " '9.99',\n", + " '1756',\n", + " '53',\n", + " '4',\n", + " '5',\n", + " '6.3',\n", + " '4+',\n", + " 'Business',\n", + " '37',\n", + " '4',\n", + " '5',\n", + " '1'],\n", + " ['456',\n", + " '369838631',\n", + " 'Breathing Zone: Guided Breathing for Mindfulness',\n", + " '37140480',\n", + " 'USD',\n", + " '3.99',\n", + " '511',\n", + " '57',\n", + " '4.5',\n", + " '4.5',\n", + " '3.1',\n", + " '4+',\n", + " 'Health & Fitness',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['457',\n", + " '369849199',\n", + " 'My Virtual Girlfriend - Deluxe Dating Sim',\n", + " '144180224',\n", + " 'USD',\n", + " '0.99',\n", + " '2609',\n", + " '9',\n", + " '3.5',\n", + " '4.5',\n", + " '3.62',\n", + " '17+',\n", + " 'Games',\n", + " '40',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['458',\n", + " '369970819',\n", + " 'Fake-A-Location Free ™',\n", + " '7689537',\n", + " 'USD',\n", + " '0',\n", + " '354',\n", + " '215',\n", + " '1.5',\n", + " '1',\n", + " '1.01',\n", + " '4+',\n", + " 'Social Networking',\n", + " '43',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['459',\n", + " '370139302',\n", + " 'QQ 浏览器-搜新闻、选小说漫画、看视频',\n", + " '119812096',\n", + " 'USD',\n", + " '0',\n", + " '1750',\n", + " '19',\n", + " '3.5',\n", + " '5',\n", + " '7.4.1',\n", + " '17+',\n", + " 'Utilities',\n", + " '38',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['460',\n", + " '370144476',\n", + " 'Math Ninja HD',\n", + " '25137152',\n", + " 'USD',\n", + " '1.99',\n", + " '1121',\n", + " '209',\n", + " '4.5',\n", + " '4.5',\n", + " '1.7',\n", + " '9+',\n", + " 'Games',\n", + " '43',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['462',\n", + " '370406465',\n", + " 'Résultats Foot en Direct',\n", + " '65074176',\n", + " 'USD',\n", + " '0',\n", + " '339',\n", + " '7',\n", + " '4.5',\n", + " '4.5',\n", + " '4.0.1',\n", + " '4+',\n", + " 'Sports',\n", + " '38',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['464',\n", + " '370697773',\n", + " 'Chase Mobile',\n", + " '34950144',\n", + " 'USD',\n", + " '0',\n", + " '34322',\n", + " '3167',\n", + " '4.5',\n", + " '4.5',\n", + " '3.620',\n", + " '4+',\n", + " 'Finance',\n", + " '24',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['465',\n", + " '370899391',\n", + " 'Captio - Email yourself with 1 tap',\n", + " '19054592',\n", + " 'USD',\n", + " '1.99',\n", + " '162',\n", + " '17',\n", + " '4.5',\n", + " '4.5',\n", + " '2.8.1',\n", + " '4+',\n", + " 'Productivity',\n", + " '38',\n", + " '3',\n", + " '3',\n", + " '1'],\n", + " ['466',\n", + " '370901726',\n", + " 'My Vodafone',\n", + " '83575808',\n", + " 'USD',\n", + " '0',\n", + " '8',\n", + " '1',\n", + " '3',\n", + " '1',\n", + " '6.5',\n", + " '4+',\n", + " 'Utilities',\n", + " '37',\n", + " '3',\n", + " '1',\n", + " '1'],\n", + " ['467',\n", + " '371338715',\n", + " 'Math Bingo',\n", + " '14602240',\n", + " 'USD',\n", + " '2.99',\n", + " '4386',\n", + " '444',\n", + " '4.5',\n", + " '4.5',\n", + " '1.7',\n", + " '4+',\n", + " 'Education',\n", + " '43',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['469',\n", + " '372283316',\n", + " '▻Sudoku +',\n", + " '61595648',\n", + " 'USD',\n", + " '4.99',\n", + " '5397',\n", + " '476',\n", + " '5',\n", + " '5',\n", + " '5.4',\n", + " '4+',\n", + " 'Games',\n", + " '40',\n", + " '5',\n", + " '7',\n", + " '1'],\n", + " ['470',\n", + " '372513032',\n", + " 'Tango - Free Video Call, Voice and Chat',\n", + " '134848512',\n", + " 'USD',\n", + " '0',\n", + " '75412',\n", + " '66',\n", + " '4.5',\n", + " '4.5',\n", + " '4.1.219400',\n", + " '17+',\n", + " 'Social Networking',\n", + " '37',\n", + " '5',\n", + " '18',\n", + " '1'],\n", + " ['471',\n", + " '372648912',\n", + " 'MeetMe - Chat and Meet New People',\n", + " '133956608',\n", + " 'USD',\n", + " '0',\n", + " '97072',\n", + " '143',\n", + " '4',\n", + " '3.5',\n", + " '12.1.1.0',\n", + " '17+',\n", + " 'Social Networking',\n", + " '37',\n", + " '0',\n", + " '18',\n", + " '1'],\n", + " ['472',\n", + " '373185673',\n", + " 'WebMD for iPad',\n", + " '17613824',\n", + " 'USD',\n", + " '0',\n", + " '9142',\n", + " '22',\n", + " '3.5',\n", + " '4',\n", + " '3.5',\n", + " '12+',\n", + " 'Health & Fitness',\n", + " '26',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['473',\n", + " '373203236',\n", + " 'GeoBee Challenge HD by National Geographic',\n", + " '35975168',\n", + " 'USD',\n", + " '1.99',\n", + " '1957',\n", + " '958',\n", + " '4.5',\n", + " '4.5',\n", + " '2.2',\n", + " '4+',\n", + " 'Games',\n", + " '40',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['474',\n", + " '373236724',\n", + " 'OPlayer HD - video player, classic media streaming',\n", + " '127020032',\n", + " 'USD',\n", + " '4.99',\n", + " '2944',\n", + " '40',\n", + " '4',\n", + " '4.5',\n", + " '3.3',\n", + " '17+',\n", + " 'Entertainment',\n", + " '24',\n", + " '5',\n", + " '29',\n", + " '1'],\n", + " ['475',\n", + " '373311252',\n", + " 'TouchRetouch',\n", + " '27962368',\n", + " 'USD',\n", + " '1.99',\n", + " '588',\n", + " '54',\n", + " '4',\n", + " '4',\n", + " '4.0.1',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '37',\n", + " '0',\n", + " '14',\n", + " '1'],\n", + " ['476',\n", + " '373342398',\n", + " 'Cat Physics',\n", + " '14824448',\n", + " 'USD',\n", + " '1.99',\n", + " '40552',\n", + " '238',\n", + " '4.5',\n", + " '4.5',\n", + " '1.26.1',\n", + " '4+',\n", + " 'Games',\n", + " '40',\n", + " '3',\n", + " '1',\n", + " '1'],\n", + " ['477',\n", + " '373454750',\n", + " '随手记(专业版)-好用的记账理财工具',\n", + " '83899392',\n", + " 'USD',\n", + " '0.99',\n", + " '1267',\n", + " '0',\n", + " '4.5',\n", + " '0',\n", + " '10.6.3',\n", + " '4+',\n", + " 'Finance',\n", + " '38',\n", + " '0',\n", + " '3',\n", + " '1'],\n", + " ['478',\n", + " '373493387',\n", + " 'AnkiMobile Flashcards',\n", + " '19371008',\n", + " 'USD',\n", + " '24.99',\n", + " '753',\n", + " '12',\n", + " '4',\n", + " '4.5',\n", + " '2.0.30',\n", + " '4+',\n", + " 'Education',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['479',\n", + " '373515261',\n", + " 'WeatherPro for iPad',\n", + " '59475968',\n", + " 'USD',\n", + " '2.99',\n", + " '725',\n", + " '26',\n", + " '4',\n", + " '4.5',\n", + " '4.4.2',\n", + " '4+',\n", + " 'Weather',\n", + " '24',\n", + " '5',\n", + " '13',\n", + " '1'],\n", + " ['480',\n", + " '373563219',\n", + " 'Real英会話',\n", + " '80203776',\n", + " 'USD',\n", + " '3.99',\n", + " '45',\n", + " '12',\n", + " '4.5',\n", + " '4.5',\n", + " '5.1',\n", + " '12+',\n", + " 'Education',\n", + " '38',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['481',\n", + " '373714084',\n", + " 'BATTLE BEARS -1',\n", + " '227403527',\n", + " 'USD',\n", + " '0.99',\n", + " '14910',\n", + " '1003',\n", + " '4',\n", + " '4.5',\n", + " '1.5.7',\n", + " '12+',\n", + " 'Games',\n", + " '45',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['482',\n", + " '373849969',\n", + " 'Crash Bandicoot Nitro Kart 2',\n", + " '75254654',\n", + " 'USD',\n", + " '2.99',\n", + " '3064',\n", + " '1428',\n", + " '3.5',\n", + " '3.5',\n", + " '1.0.5',\n", + " '9+',\n", + " 'Games',\n", + " '47',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['483',\n", + " '373903654',\n", + " 'WIRED Magazine',\n", + " '23879680',\n", + " 'USD',\n", + " '0',\n", + " '12074',\n", + " '43',\n", + " '2.5',\n", + " '1.5',\n", + " '4.6.7',\n", + " '17+',\n", + " 'News',\n", + " '24',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['485',\n", + " '374151636',\n", + " 'Popplet',\n", + " '4893696',\n", + " 'USD',\n", + " '4.99',\n", + " '336',\n", + " '2',\n", + " '4',\n", + " '3',\n", + " '2.3',\n", + " '4+',\n", + " 'Productivity',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['486',\n", + " '374211477',\n", + " 'Notes Plus',\n", + " '109620224',\n", + " 'USD',\n", + " '9.99',\n", + " '6257',\n", + " '15',\n", + " '4',\n", + " '4',\n", + " '5.0',\n", + " '4+',\n", + " 'Productivity',\n", + " '37',\n", + " '5',\n", + " '11',\n", + " '1'],\n", + " ['488',\n", + " '374308914',\n", + " 'Color Splash for iPad',\n", + " '18752512',\n", + " 'USD',\n", + " '1.99',\n", + " '2445',\n", + " '41',\n", + " '4.5',\n", + " '5',\n", + " '3.6.1',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '24',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['489',\n", + " '374791544',\n", + " 'Robot Unicorn Attack',\n", + " '52117504',\n", + " 'USD',\n", + " '0.99',\n", + " '22150',\n", + " '1141',\n", + " '4',\n", + " '4.5',\n", + " '3.4',\n", + " '9+',\n", + " 'Games',\n", + " '43',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['490',\n", + " '375239755',\n", + " 'SimSimi',\n", + " '31358976',\n", + " 'USD',\n", + " '0',\n", + " '23530',\n", + " '7',\n", + " '4',\n", + " '2.5',\n", + " '6.8.9',\n", + " '17+',\n", + " 'Social Networking',\n", + " '37',\n", + " '0',\n", + " '25',\n", + " '1'],\n", + " ['491',\n", + " '375295479',\n", + " 'Carcassonne',\n", + " '359192576',\n", + " 'USD',\n", + " '9.99',\n", + " '10846',\n", + " '91',\n", + " '4.5',\n", + " '4.5',\n", + " '4.28',\n", + " '4+',\n", + " 'Games',\n", + " '38',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['492',\n", + " '375380948',\n", + " 'Apple Store',\n", + " '70782976',\n", + " 'USD',\n", + " '0',\n", + " '55171',\n", + " '187',\n", + " '3.5',\n", + " '3.5',\n", + " '4.2',\n", + " '4+',\n", + " 'Shopping',\n", + " '37',\n", + " '5',\n", + " '21',\n", + " '1'],\n", + " ['493',\n", + " '376183339',\n", + " 'TED',\n", + " '84056064',\n", + " 'USD',\n", + " '0',\n", + " '5782',\n", + " '149',\n", + " '3.5',\n", + " '3.5',\n", + " '3.0.4',\n", + " '12+',\n", + " 'Education',\n", + " '37',\n", + " '5',\n", + " '22',\n", + " '1'],\n", + " ['494',\n", + " '376197239',\n", + " 'Météo-France',\n", + " '124090368',\n", + " 'USD',\n", + " '0',\n", + " '24',\n", + " '2',\n", + " '3.5',\n", + " '5',\n", + " '5.7.1150',\n", + " '4+',\n", + " 'Weather',\n", + " '37',\n", + " '4',\n", + " '3',\n", + " '1'],\n", + " ['495',\n", + " '376202925',\n", + " 'Ma Banque',\n", + " '137866240',\n", + " 'USD',\n", + " '0',\n", + " '17',\n", + " '0',\n", + " '3.5',\n", + " '0',\n", + " '11.0.1',\n", + " '4+',\n", + " 'Finance',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['496',\n", + " '376374689',\n", + " 'Doodle God™',\n", + " '121715712',\n", + " 'USD',\n", + " '1.99',\n", + " '35759',\n", + " '64',\n", + " '4.5',\n", + " '4',\n", + " '3.0.19',\n", + " '12+',\n", + " 'Games',\n", + " '40',\n", + " '0',\n", + " '13',\n", + " '1'],\n", + " ['497',\n", + " '376412660',\n", + " 'Carnivores: Dinosaur Hunter Pro',\n", + " '304654336',\n", + " 'USD',\n", + " '2.99',\n", + " '18306',\n", + " '186',\n", + " '4',\n", + " '4.5',\n", + " '1.7.0',\n", + " '12+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '4',\n", + " '1'],\n", + " ['498',\n", + " '376413870',\n", + " 'Blackboard Mobile Learn™',\n", + " '51179520',\n", + " 'USD',\n", + " '0',\n", + " '13567',\n", + " '2625',\n", + " '2',\n", + " '1.5',\n", + " '4.1.2',\n", + " '4+',\n", + " 'Education',\n", + " '40',\n", + " '5',\n", + " '14',\n", + " '1'],\n", + " ['499',\n", + " '376436174',\n", + " 'SEC Football Schedules, Scores & Radio',\n", + " '60380160',\n", + " 'USD',\n", + " '1.99',\n", + " '240',\n", + " '2',\n", + " '3',\n", + " '4.5',\n", + " '5.2.135',\n", + " '4+',\n", + " 'Sports',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['500',\n", + " '376510438',\n", + " 'Hulu: Watch TV Shows & Stream the Latest Movies',\n", + " '99568640',\n", + " 'USD',\n", + " '0',\n", + " '56170',\n", + " '1264',\n", + " '2',\n", + " '2',\n", + " '4.10.1',\n", + " '12+',\n", + " 'Entertainment',\n", + " '37',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['501',\n", + " '376561911',\n", + " 'かなもじ',\n", + " '61272064',\n", + " 'USD',\n", + " '3.99',\n", + " '19',\n", + " '0',\n", + " '4.5',\n", + " '0',\n", + " '1.9.3',\n", + " '4+',\n", + " 'Education',\n", + " '24',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['503',\n", + " '377321278',\n", + " '恵方コンパス.',\n", + " '41207059',\n", + " 'USD',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '2.1.0',\n", + " '4+',\n", + " 'Navigation',\n", + " '39',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['504',\n", + " '377342622',\n", + " '360 Panorama',\n", + " '7954432',\n", + " 'USD',\n", + " '1.99',\n", + " '10463',\n", + " '193',\n", + " '4.5',\n", + " '3.5',\n", + " '4.4.3',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '38',\n", + " '5',\n", + " '3',\n", + " '1'],\n", + " ['507',\n", + " '377677727',\n", + " 'Mega Millions & Powerball - lottery games in the US with winning number results, lotto jackpots and prize payouts',\n", + " '7876608',\n", + " 'USD',\n", + " '0',\n", + " '1255',\n", + " '432',\n", + " '4.5',\n", + " '4.5',\n", + " '3.2',\n", + " '12+',\n", + " 'Lifestyle',\n", + " '38',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['508',\n", + " '377704407',\n", + " 'Cake Doodle',\n", + " '99558400',\n", + " 'USD',\n", + " '0.99',\n", + " '5803',\n", + " '10',\n", + " '4',\n", + " '4',\n", + " '1.21',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['509',\n", + " '377831429',\n", + " 'The Impossible Quiz! for iPad',\n", + " '16857290',\n", + " 'USD',\n", + " '1.99',\n", + " '227',\n", + " '225',\n", + " '4',\n", + " '4',\n", + " '1.0',\n", + " '9+',\n", + " 'Games',\n", + " '26',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['510',\n", + " '377908737',\n", + " 'Boating USA',\n", + " '111196160',\n", + " 'USD',\n", + " '9.99',\n", + " '342',\n", + " '2',\n", + " '3.5',\n", + " '4',\n", + " '10.4.3',\n", + " '4+',\n", + " 'Navigation',\n", + " '37',\n", + " '0',\n", + " '5',\n", + " '1'],\n", + " ['511',\n", + " '377989827',\n", + " 'Diptic',\n", + " '36705280',\n", + " 'USD',\n", + " '2.99',\n", + " '7578',\n", + " '67',\n", + " '4.5',\n", + " '5',\n", + " '10',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['512',\n", + " '378326916',\n", + " 'Family Feud™ HD',\n", + " '79312792',\n", + " 'USD',\n", + " '6.99',\n", + " '1156',\n", + " '951',\n", + " '3.5',\n", + " '3.5',\n", + " '1.0.1',\n", + " '4+',\n", + " 'Games',\n", + " '26',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['513',\n", + " '378352300',\n", + " 'Edmodo',\n", + " '127939584',\n", + " 'USD',\n", + " '0',\n", + " '7197',\n", + " '0',\n", + " '3.5',\n", + " '0',\n", + " '5.9.2',\n", + " '4+',\n", + " 'Education',\n", + " '37',\n", + " '4',\n", + " '4',\n", + " '1'],\n", + " ['515',\n", + " '378781805',\n", + " 'Auto Palmistry Premium',\n", + " '44349440',\n", + " 'USD',\n", + " '2.99',\n", + " '5',\n", + " '0',\n", + " '3',\n", + " '0',\n", + " '4.0.3',\n", + " '4+',\n", + " 'Entertainment',\n", + " '37',\n", + " '4',\n", + " '3',\n", + " '1'],\n", + " ['516',\n", + " '378782714',\n", + " 'Drift Mania Championship',\n", + " '1178477568',\n", + " 'USD',\n", + " '0.99',\n", + " '3432',\n", + " '0',\n", + " '3',\n", + " '0',\n", + " '1.80',\n", + " '4+',\n", + " 'Games',\n", + " '38',\n", + " '5',\n", + " '10',\n", + " '1'],\n", + " ['517',\n", + " '379256460',\n", + " '「宅建士」過去問題《受験用》',\n", + " '24444928',\n", + " 'USD',\n", + " '3.99',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '5.1',\n", + " '4+',\n", + " 'Education',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['518',\n", + " '379323382',\n", + " 'Osmos for iPad',\n", + " '41772032',\n", + " 'USD',\n", + " '4.99',\n", + " '24306',\n", + " '6',\n", + " '4.5',\n", + " '5',\n", + " '2.4.1',\n", + " '4+',\n", + " 'Games',\n", + " '24',\n", + " '5',\n", + " '9',\n", + " '1'],\n", + " ['519',\n", + " '379395415',\n", + " '携程旅行-酒店、机票、火车票预订助手',\n", + " '144488448',\n", + " 'USD',\n", + " '0',\n", + " '312',\n", + " '0',\n", + " '3.5',\n", + " '0',\n", + " '7.4.1',\n", + " '17+',\n", + " 'Travel',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['520',\n", + " '379693831',\n", + " 'Audible – audio books, original series & podcasts',\n", + " '81558528',\n", + " 'USD',\n", + " '0',\n", + " '105274',\n", + " '1774',\n", + " '4.5',\n", + " '4.5',\n", + " '2.23',\n", + " '4+',\n", + " 'Book',\n", + " '37',\n", + " '5',\n", + " '5',\n", + " '1'],\n", + " ['521',\n", + " '379869627',\n", + " 'Living Earth - Clock & Weather',\n", + " '169009152',\n", + " 'USD',\n", + " '2.99',\n", + " '25475',\n", + " '71',\n", + " '4.5',\n", + " '4',\n", + " '3.82',\n", + " '4+',\n", + " 'Utilities',\n", + " '37',\n", + " '4',\n", + " '11',\n", + " '1'],\n", + " ['522',\n", + " '379937581',\n", + " 'Sushi Cat',\n", + " '62373888',\n", + " 'USD',\n", + " '0.99',\n", + " '8718',\n", + " '381',\n", + " '4',\n", + " '4.5',\n", + " '2.1.0',\n", + " '4+',\n", + " 'Games',\n", + " '43',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['523',\n", + " '379983299',\n", + " 'Talking Tom Cat for iPad',\n", + " '75417600',\n", + " 'USD',\n", + " '0',\n", + " '29492',\n", + " '51',\n", + " '3.5',\n", + " '4',\n", + " '3.3',\n", + " '4+',\n", + " 'Entertainment',\n", + " '24',\n", + " '5',\n", + " '13',\n", + " '1'],\n", + " ['524',\n", + " '380090605',\n", + " \"Let's create! Pottery HD\",\n", + " '175157248',\n", + " 'USD',\n", + " '4.99',\n", + " '12787',\n", + " '12',\n", + " '4.5',\n", + " '4.5',\n", + " '1.71',\n", + " '4+',\n", + " 'Entertainment',\n", + " '38',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['525',\n", + " '380641055',\n", + " 'Files HD Pro - File Manager & Web Browser',\n", + " '28118016',\n", + " 'USD',\n", + " '4.99',\n", + " '2237',\n", + " '41',\n", + " '4',\n", + " '3.5',\n", + " '6.1.1',\n", + " '17+',\n", + " 'Utilities',\n", + " '24',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['526',\n", + " '380834987',\n", + " 'Army Fitness APFT Calculator',\n", + " '15759360',\n", + " 'USD',\n", + " '0.99',\n", + " '108',\n", + " '74',\n", + " '4',\n", + " '4.5',\n", + " '2.4',\n", + " '4+',\n", + " 'Utilities',\n", + " '40',\n", + " '3',\n", + " '1',\n", + " '1'],\n", + " ['527',\n", + " '380908399',\n", + " 'Ringtones for iPhone & Ringtone Maker',\n", + " '109270016',\n", + " 'USD',\n", + " '0',\n", + " '25403',\n", + " '1598',\n", + " '4.5',\n", + " '4.5',\n", + " '8.9.6',\n", + " '12+',\n", + " 'Music',\n", + " '37',\n", + " '4',\n", + " '9',\n", + " '1'],\n", + " ['528',\n", + " '380932800',\n", + " 'Zoopla Property Search -UK Homes for Sale and Rent',\n", + " '59411456',\n", + " 'USD',\n", + " '0',\n", + " '210',\n", + " '4',\n", + " '3.5',\n", + " '4.5',\n", + " '3.3.4',\n", + " '4+',\n", + " 'Lifestyle',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['529',\n", + " '380974668',\n", + " 'Vestiaire Collective - Pre-Owned Luxury Fashion',\n", + " '138755072',\n", + " 'USD',\n", + " '0',\n", + " '169',\n", + " '16',\n", + " '4',\n", + " '4.5',\n", + " '4.2.7',\n", + " '4+',\n", + " 'Shopping',\n", + " '37',\n", + " '5',\n", + " '5',\n", + " '1'],\n", + " ['530',\n", + " '381059732',\n", + " 'Week Calendar',\n", + " '81845248',\n", + " 'USD',\n", + " '1.99',\n", + " '7447',\n", + " '18',\n", + " '4.5',\n", + " '4.5',\n", + " '10.2.1',\n", + " '4+',\n", + " 'Productivity',\n", + " '37',\n", + " '0',\n", + " '29',\n", + " '1'],\n", + " ['531',\n", + " '381342267',\n", + " 'Stack the States®',\n", + " '132377600',\n", + " 'USD',\n", + " '2.99',\n", + " '12833',\n", + " '282',\n", + " '4.5',\n", + " '4.5',\n", + " '2.7',\n", + " '4+',\n", + " 'Education',\n", + " '40',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['532',\n", + " '381471023',\n", + " 'Flashlight Ⓞ',\n", + " '42027008',\n", + " 'USD',\n", + " '0',\n", + " '130450',\n", + " '1010',\n", + " '5',\n", + " '4.5',\n", + " '2.1.2',\n", + " '4+',\n", + " 'Utilities',\n", + " '40',\n", + " '0',\n", + " '22',\n", + " '1'],\n", + " ['533',\n", + " '381477230',\n", + " 'ゲーム発展国++',\n", + " '191410176',\n", + " 'USD',\n", + " '4.99',\n", + " '6',\n", + " '0',\n", + " '4',\n", + " '0',\n", + " '2.09',\n", + " '4+',\n", + " 'Games',\n", + " '38',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['535',\n", + " '381722077',\n", + " 'Celebtwin: Celebrity Looks Like Lite',\n", + " '81773568',\n", + " 'USD',\n", + " '0',\n", + " '1111',\n", + " '0',\n", + " '1.5',\n", + " '0',\n", + " '6.1',\n", + " '4+',\n", + " 'Lifestyle',\n", + " '37',\n", + " '4',\n", + " '12',\n", + " '1'],\n", + " ['536',\n", + " '382002079',\n", + " 'Onefootball - Soccer Scores & Live News',\n", + " '113814528',\n", + " 'USD',\n", + " '0',\n", + " '3194',\n", + " '18',\n", + " '4.5',\n", + " '4.5',\n", + " '10.12',\n", + " '12+',\n", + " 'Sports',\n", + " '37',\n", + " '5',\n", + " '13',\n", + " '1'],\n", + " ['537',\n", + " '382013715',\n", + " 'SuperCam_Pro',\n", + " '27815936',\n", + " 'USD',\n", + " '1.99',\n", + " '1399',\n", + " '24',\n", + " '2.5',\n", + " '2.5',\n", + " '4.3',\n", + " '4+',\n", + " 'Business',\n", + " '43',\n", + " '0',\n", + " '7',\n", + " '1'],\n", + " ['538',\n", + " '382045106',\n", + " 'カロリー管理(痩せるアプリ)',\n", + " '44402688',\n", + " 'USD',\n", + " '3.99',\n", + " '10',\n", + " '0',\n", + " '4.5',\n", + " '0',\n", + " '5.4',\n", + " '17+',\n", + " 'Health & Fitness',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['540',\n", + " '382201985',\n", + " '手机百度 - 百度一下你就得到',\n", + " '226406400',\n", + " 'USD',\n", + " '0',\n", + " '1990',\n", + " '0',\n", + " '4.5',\n", + " '0',\n", + " '8.6.5',\n", + " '17+',\n", + " 'Utilities',\n", + " '38',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['541',\n", + " '382497397',\n", + " \"Sam's Club: Wholesale Shopping & Bulk Buy Deals\",\n", + " '113119232',\n", + " 'USD',\n", + " '0',\n", + " '8149',\n", + " '173',\n", + " '4',\n", + " '4.5',\n", + " '17.4',\n", + " '4+',\n", + " 'Shopping',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['542',\n", + " '382509315',\n", + " 'Splashtop Personal - Remote Desktop',\n", + " '55986176',\n", + " 'USD',\n", + " '4.99',\n", + " '29376',\n", + " '11',\n", + " '4.5',\n", + " '5',\n", + " '2.7.4.1',\n", + " '4+',\n", + " 'Business',\n", + " '24',\n", + " '5',\n", + " '11',\n", + " '1'],\n", + " ['543',\n", + " '382596778',\n", + " 'eBay Kleinanzeigen - Free. Easy. Local.',\n", + " '63022080',\n", + " 'USD',\n", + " '0',\n", + " '74',\n", + " '3',\n", + " '4.5',\n", + " '5',\n", + " '7.5.2',\n", + " '4+',\n", + " 'Shopping',\n", + " '37',\n", + " '4',\n", + " '1',\n", + " '1'],\n", + " ['544',\n", + " '382617920',\n", + " 'Viber Messenger – Text & Call',\n", + " '129657856',\n", + " 'USD',\n", + " '0',\n", + " '164249',\n", + " '206',\n", + " '4.5',\n", + " '4.5',\n", + " '6.9.0',\n", + " '4+',\n", + " 'Social Networking',\n", + " '37',\n", + " '5',\n", + " '32',\n", + " '1'],\n", + " ['546',\n", + " '382991304',\n", + " 'Osmos',\n", + " '33989632',\n", + " 'USD',\n", + " '2.99',\n", + " '14605',\n", + " '23',\n", + " '4.5',\n", + " '5',\n", + " '2.4.1',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '0',\n", + " '9',\n", + " '1'],\n", + " ['547',\n", + " '383298204',\n", + " 'shopkick - Shopping Rewards & Discounts',\n", + " '74822656',\n", + " 'USD',\n", + " '0',\n", + " '130823',\n", + " '29363',\n", + " '4.5',\n", + " '5',\n", + " '5.1.4',\n", + " '4+',\n", + " 'Shopping',\n", + " '37',\n", + " '4',\n", + " '2',\n", + " '1'],\n", + " ['548',\n", + " '383718755',\n", + " 'Decide Now!',\n", + " '3462144',\n", + " 'USD',\n", + " '0.99',\n", + " '486',\n", + " '25',\n", + " '4.5',\n", + " '4',\n", + " '2.0.1',\n", + " '4+',\n", + " 'Entertainment',\n", + " '37',\n", + " '5',\n", + " '9',\n", + " '1'],\n", + " ['549',\n", + " '383819300',\n", + " 'Ringtone Designer Pro - Create Unlimited Ringtones, Text Tones, Email Alerts, and More!',\n", + " '3462266',\n", + " 'USD',\n", + " '0.99',\n", + " '8946',\n", + " '1776',\n", + " '4.5',\n", + " '4.5',\n", + " '1.9',\n", + " '4+',\n", + " 'Music',\n", + " '43',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['551',\n", + " '384282298',\n", + " 'The Secret of Grisly Manor',\n", + " '51794944',\n", + " 'USD',\n", + " '0.99',\n", + " '1993',\n", + " '36',\n", + " '4',\n", + " '4',\n", + " '1.9.4',\n", + " '4+',\n", + " 'Games',\n", + " '40',\n", + " '5',\n", + " '7',\n", + " '1'],\n", + " ['552',\n", + " '384830320',\n", + " 'Find My Family, Friends & iPhone - Life360 Locator',\n", + " '154507264',\n", + " 'USD',\n", + " '0',\n", + " '43877',\n", + " '80',\n", + " '4.5',\n", + " '4.5',\n", + " '13.7.1',\n", + " '4+',\n", + " 'Social Networking',\n", + " '37',\n", + " '0',\n", + " '13',\n", + " '1'],\n", + " ['553',\n", + " '385145330',\n", + " 'Pocketbooth - the photo booth in your pocket',\n", + " '72586240',\n", + " 'USD',\n", + " '0.99',\n", + " '2377',\n", + " '5',\n", + " '4.5',\n", + " '5',\n", + " '3.5',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['554',\n", + " '385285922',\n", + " '乐视视频-白鹿原,欢乐颂,奔跑吧全网热播',\n", + " '184689664',\n", + " 'USD',\n", + " '0',\n", + " '1590',\n", + " '6',\n", + " '4.5',\n", + " '5',\n", + " '7.1',\n", + " '17+',\n", + " 'Entertainment',\n", + " '38',\n", + " '0',\n", + " '2',\n", + " '1'],\n", + " ['555',\n", + " '385533456',\n", + " 'The Incident',\n", + " '19534848',\n", + " 'USD',\n", + " '0.99',\n", + " '2070',\n", + " '16',\n", + " '4',\n", + " '4.5',\n", + " '1.7',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['556',\n", + " '385724144',\n", + " 'ホットペッパービューティー/サロン予約',\n", + " '65892352',\n", + " 'USD',\n", + " '0',\n", + " '9',\n", + " '0',\n", + " '4',\n", + " '0',\n", + " '4.14.1',\n", + " '4+',\n", + " 'Lifestyle',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['557',\n", + " '385756768',\n", + " 'Dictionary.com Dictionary & Thesaurus Premium',\n", + " '108836864',\n", + " 'USD',\n", + " '3.99',\n", + " '11530',\n", + " '81',\n", + " '4.5',\n", + " '4.5',\n", + " '7.1.3',\n", + " '4+',\n", + " 'Reference',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['558',\n", + " '385919493',\n", + " 'Autohome-Find new&Used Cars For Sale',\n", + " '89219072',\n", + " 'USD',\n", + " '0',\n", + " '194',\n", + " '0',\n", + " '4',\n", + " '0',\n", + " '8.0.6',\n", + " '17+',\n", + " 'Lifestyle',\n", + " '37',\n", + " '0',\n", + " '2',\n", + " '1'],\n", + " ['559',\n", + " '385957032',\n", + " 'OPEN Forum',\n", + " '83138560',\n", + " 'USD',\n", + " '0',\n", + " '200',\n", + " '0',\n", + " '3.5',\n", + " '0',\n", + " '6.3',\n", + " '4+',\n", + " 'Business',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['560',\n", + " '386098453',\n", + " 'Weibo HD',\n", + " '104387584',\n", + " 'USD',\n", + " '0',\n", + " '16772',\n", + " '293',\n", + " '4.5',\n", + " '3',\n", + " '4.0.0',\n", + " '4+',\n", + " 'Social Networking',\n", + " '24',\n", + " '4',\n", + " '3',\n", + " '1'],\n", + " ['561',\n", + " '386239683',\n", + " 'Reckless Racing HD',\n", + " '77139968',\n", + " 'USD',\n", + " '0.99',\n", + " '9',\n", + " '7',\n", + " '4',\n", + " '4.5',\n", + " '1.4.3',\n", + " '4+',\n", + " 'Games',\n", + " '43',\n", + " '5',\n", + " '5',\n", + " '1'],\n", + " ['562',\n", + " '386241770',\n", + " 'Bloons Super Monkey',\n", + " '28566528',\n", + " 'USD',\n", + " '0.99',\n", + " '2113',\n", + " '20',\n", + " '3.5',\n", + " '2.5',\n", + " '1.5.4',\n", + " '4+',\n", + " 'Games',\n", + " '40',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['563',\n", + " '386505750',\n", + " 'Lotto Results - Mega Millions Powerball Lottery',\n", + " '7990272',\n", + " 'USD',\n", + " '0',\n", + " '794',\n", + " '8',\n", + " '4',\n", + " '3.5',\n", + " '3.5.1',\n", + " '12+',\n", + " 'News',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['565',\n", + " '386592716',\n", + " 'IKEA Catalog',\n", + " '122979328',\n", + " 'USD',\n", + " '0',\n", + " '8939',\n", + " '15',\n", + " '4',\n", + " '1.5',\n", + " '17.10',\n", + " '4+',\n", + " 'Lifestyle',\n", + " '37',\n", + " '5',\n", + " '29',\n", + " '1'],\n", + " ['566',\n", + " '387109554',\n", + " 'QQ安全中心',\n", + " '32918528',\n", + " 'USD',\n", + " '0',\n", + " '308',\n", + " '0',\n", + " '3.5',\n", + " '0',\n", + " '6.9.8',\n", + " '17+',\n", + " 'Utilities',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['567',\n", + " '387310377',\n", + " 'Free IQ Test: Calculate your IQ',\n", + " '4034560',\n", + " 'USD',\n", + " '0',\n", + " '5',\n", + " '1',\n", + " '2',\n", + " '1',\n", + " '3.0.2',\n", + " '4+',\n", + " 'Education',\n", + " '38',\n", + " '0',\n", + " '2',\n", + " '1'],\n", + " ['568',\n", + " '387428400',\n", + " 'Infinity Blade',\n", + " '624107810',\n", + " 'USD',\n", + " '0.99',\n", + " '326482',\n", + " '177050',\n", + " '5',\n", + " '5',\n", + " '1.4.1',\n", + " '12+',\n", + " 'Games',\n", + " '43',\n", + " '5',\n", + " '13',\n", + " '1'],\n", + " ['569',\n", + " '387682726',\n", + " '淘宝 - 随时随地,想淘就淘',\n", + " '309673984',\n", + " 'USD',\n", + " '0',\n", + " '3801',\n", + " '6',\n", + " '4',\n", + " '4',\n", + " '6.7.2',\n", + " '4+',\n", + " 'Shopping',\n", + " '37',\n", + " '1',\n", + " '1',\n", + " '1'],\n", + " ['570',\n", + " '387893495',\n", + " 'Virtual Regatta Offshore',\n", + " '123541504',\n", + " 'USD',\n", + " '0',\n", + " '209',\n", + " '1',\n", + " '3.5',\n", + " '5',\n", + " '2.2.1',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['571',\n", + " '388130466',\n", + " 'iSlash',\n", + " '27619328',\n", + " 'USD',\n", + " '0.99',\n", + " '33868',\n", + " '463',\n", + " '4.5',\n", + " '4.5',\n", + " '1.5.4',\n", + " '4+',\n", + " 'Games',\n", + " '43',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['573',\n", + " '388336485',\n", + " 'Ugly Meter™',\n", + " '30441472',\n", + " 'USD',\n", + " '0.99',\n", + " '13741',\n", + " '58',\n", + " '3.5',\n", + " '2.5',\n", + " '4.6',\n", + " '9+',\n", + " 'Entertainment',\n", + " '43',\n", + " '4',\n", + " '1',\n", + " '1'],\n", + " ['574',\n", + " '388389451',\n", + " 'Muslim Pro: Ramadan 2017 Prayer Times, Azan, Quran',\n", + " '100551680',\n", + " 'USD',\n", + " '0',\n", + " '18418',\n", + " '706',\n", + " '4.5',\n", + " '5',\n", + " '9.2.1',\n", + " '4+',\n", + " 'Reference',\n", + " '37',\n", + " '5',\n", + " '16',\n", + " '1'],\n", + " ['575',\n", + " '388459613',\n", + " 'Carbs & Cals - Diet & Diabetes',\n", + " '209295360',\n", + " 'USD',\n", + " '4.99',\n", + " '21',\n", + " '0',\n", + " '1.5',\n", + " '0',\n", + " '4.0.5',\n", + " '4+',\n", + " 'Health & Fitness',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['576',\n", + " '388462078',\n", + " '2XL Supercross HD',\n", + " '270729216',\n", + " 'USD',\n", + " '4.99',\n", + " '1588',\n", + " '6',\n", + " '3.5',\n", + " '4.5',\n", + " '1.2.1',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '7',\n", + " '1'],\n", + " ['577',\n", + " '388491656',\n", + " 'Fly Delta',\n", + " '140803072',\n", + " 'USD',\n", + " '0',\n", + " '8094',\n", + " '191',\n", + " '3',\n", + " '2.5',\n", + " '4.2.2',\n", + " '4+',\n", + " 'Travel',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['578',\n", + " '388497605',\n", + " 'Google Authenticator',\n", + " '17235968',\n", + " 'USD',\n", + " '0',\n", + " '1652',\n", + " '202',\n", + " '3',\n", + " '2.5',\n", + " '3.0.0',\n", + " '4+',\n", + " 'Utilities',\n", + " '38',\n", + " '1',\n", + " '32',\n", + " '1'],\n", + " ['579',\n", + " '388624839',\n", + " 'CamScanner +| PDF Document Scanner and OCR',\n", + " '98450432',\n", + " 'USD',\n", + " '0.99',\n", + " '5482',\n", + " '25',\n", + " '4.5',\n", + " '4.5',\n", + " '4.4.2',\n", + " '4+',\n", + " 'Productivity',\n", + " '37',\n", + " '0',\n", + " '14',\n", + " '1'],\n", + " ['580',\n", + " '388633565',\n", + " 'Pocket Anatomy - Interactive 3D Human Anatomy and Physiology.',\n", + " '685733888',\n", + " 'USD',\n", + " '13.99',\n", + " '611',\n", + " '186',\n", + " '4.5',\n", + " '4.5',\n", + " '6.0',\n", + " '12+',\n", + " 'Medical',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['581',\n", + " '388838723',\n", + " 'Flashlight for iPhone , iPod and iPad',\n", + " '64041984',\n", + " 'USD',\n", + " '0',\n", + " '26697',\n", + " '3109',\n", + " '4.5',\n", + " '4.5',\n", + " '4.1.1',\n", + " '4+',\n", + " 'Utilities',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['582',\n", + " '388932995',\n", + " '赶集网-工作生活啥都有!',\n", + " '106115072',\n", + " 'USD',\n", + " '0',\n", + " '317',\n", + " '0',\n", + " '4',\n", + " '0',\n", + " '7.9.9',\n", + " '17+',\n", + " 'Lifestyle',\n", + " '38',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['583',\n", + " '389204861',\n", + " 'The Sims 3 Ambitions',\n", + " '444821504',\n", + " 'USD',\n", + " '4.99',\n", + " '14202',\n", + " '638',\n", + " '3.5',\n", + " '3.5',\n", + " '1.1.83',\n", + " '12+',\n", + " 'Games',\n", + " '40',\n", + " '5',\n", + " '10',\n", + " '1'],\n", + " ['585',\n", + " '389359495',\n", + " 'Bookshelf',\n", + " '106445824',\n", + " 'USD',\n", + " '0',\n", + " '2064',\n", + " '2',\n", + " '2.5',\n", + " '4',\n", + " '3.9.5',\n", + " '4+',\n", + " 'Education',\n", + " '37',\n", + " '5',\n", + " '32',\n", + " '1'],\n", + " ['586',\n", + " '389481236',\n", + " 'QQ同步助手-新机一键换机必备工具',\n", + " '72941568',\n", + " 'USD',\n", + " '0',\n", + " '746',\n", + " '1',\n", + " '4.5',\n", + " '5',\n", + " '6.7.8',\n", + " '4+',\n", + " 'Utilities',\n", + " '40',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['587',\n", + " '389543438',\n", + " 'Der Feueralarm',\n", + " '30711808',\n", + " 'USD',\n", + " '0.99',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '1.2',\n", + " '12+',\n", + " 'Entertainment',\n", + " '40',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['588',\n", + " '389638243',\n", + " 'POF - Best Dating App for Conversations',\n", + " '59248640',\n", + " 'USD',\n", + " '0',\n", + " '52642',\n", + " '16',\n", + " '3.5',\n", + " '3.5',\n", + " '5.90',\n", + " '17+',\n", + " 'Social Networking',\n", + " '37',\n", + " '5',\n", + " '31',\n", + " '1'],\n", + " ['589',\n", + " '389781154',\n", + " 'NFL',\n", + " '131428352',\n", + " 'USD',\n", + " '0',\n", + " '27317',\n", + " '2',\n", + " '2.5',\n", + " '5',\n", + " '14.1.4',\n", + " '4+',\n", + " 'Sports',\n", + " '37',\n", + " '1',\n", + " '1',\n", + " '1'],\n", + " ['590',\n", + " '389784247',\n", + " 'Vernier Video Physics',\n", + " '40472576',\n", + " 'USD',\n", + " '4.99',\n", + " '76',\n", + " '2',\n", + " '4',\n", + " '1',\n", + " '3.0.4',\n", + " '4+',\n", + " 'Education',\n", + " '37',\n", + " '5',\n", + " '5',\n", + " '1'],\n", + " ['591',\n", + " '389801252',\n", + " 'Instagram',\n", + " '113954816',\n", + " 'USD',\n", + " '0',\n", + " '2161558',\n", + " '1289',\n", + " '4.5',\n", + " '4',\n", + " '10.23',\n", + " '12+',\n", + " 'Photo & Video',\n", + " '37',\n", + " '0',\n", + " '29',\n", + " '1'],\n", + " ['592',\n", + " '390017969',\n", + " 'Due — Reminders, Countdown Timers',\n", + " '32130048',\n", + " 'USD',\n", + " '4.99',\n", + " '2554',\n", + " '93',\n", + " '4.5',\n", + " '3.5',\n", + " '2.4.2',\n", + " '4+',\n", + " 'Productivity',\n", + " '37',\n", + " '5',\n", + " '17',\n", + " '1'],\n", + " ['593',\n", + " '390109631',\n", + " 'UFO on Tape',\n", + " '35359744',\n", + " 'USD',\n", + " '0.99',\n", + " '1058',\n", + " '3',\n", + " '3.5',\n", + " '3.5',\n", + " '1.5',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '3',\n", + " '1',\n", + " '1'],\n", + " ['594',\n", + " '390422167',\n", + " 'Catan HD',\n", + " '812010496',\n", + " 'USD',\n", + " '1.99',\n", + " '10382',\n", + " '281',\n", + " '4',\n", + " '3.5',\n", + " '4.6.2',\n", + " '4+',\n", + " 'Games',\n", + " '24',\n", + " '5',\n", + " '6',\n", + " '1'],\n", + " ['595',\n", + " '390523040',\n", + " 'Polar Plunge ™',\n", + " '3700705',\n", + " 'USD',\n", + " '0.99',\n", + " '1428',\n", + " '1417',\n", + " '3.5',\n", + " '3.5',\n", + " '1.0.0',\n", + " '4+',\n", + " 'Games',\n", + " '47',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['597',\n", + " '390577714',\n", + " 'Sunday Ticket',\n", + " '92392448',\n", + " 'USD',\n", + " '0',\n", + " '3134',\n", + " '160',\n", + " '2.5',\n", + " '3',\n", + " '2.6.041',\n", + " '4+',\n", + " 'Entertainment',\n", + " '24',\n", + " '4',\n", + " '1',\n", + " '1'],\n", + " ['598',\n", + " '391071343',\n", + " '央视影音HD-海量央视内容高清直播',\n", + " '64325632',\n", + " 'USD',\n", + " '0',\n", + " '596',\n", + " '0',\n", + " '2.5',\n", + " '0',\n", + " '6.1.55',\n", + " '4+',\n", + " 'Entertainment',\n", + " '24',\n", + " '5',\n", + " '3',\n", + " '1'],\n", + " ['599',\n", + " '391297152',\n", + " 'Neuroshima Hex',\n", + " '511094784',\n", + " 'USD',\n", + " '4.99',\n", + " '4378',\n", + " '251',\n", + " '4.5',\n", + " '4.5',\n", + " '3.0',\n", + " '9+',\n", + " 'Games',\n", + " '43',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['600',\n", + " '391304000',\n", + " 'Maps 3D PRO - GPS for Bike, Hike, Ski & Outdoor',\n", + " '25960448',\n", + " 'USD',\n", + " '4.99',\n", + " '280',\n", + " '12',\n", + " '4',\n", + " '4',\n", + " '4.1.4',\n", + " '4+',\n", + " 'Navigation',\n", + " '37',\n", + " '0',\n", + " '6',\n", + " '1'],\n", + " ['601',\n", + " '391432693',\n", + " 'ArtRage',\n", + " '58826752',\n", + " 'USD',\n", + " '4.99',\n", + " '1045',\n", + " '2',\n", + " '4',\n", + " '2.5',\n", + " '2.1.11',\n", + " '4+',\n", + " 'Entertainment',\n", + " '24',\n", + " '5',\n", + " '7',\n", + " '1'],\n", + " ['602',\n", + " '391767653',\n", + " 'Sleep Talk Recorder',\n", + " '25309184',\n", + " 'USD',\n", + " '0',\n", + " '1110',\n", + " '31',\n", + " '4.5',\n", + " '3.5',\n", + " '5.4.4',\n", + " '17+',\n", + " 'Utilities',\n", + " '38',\n", + " '0',\n", + " '31',\n", + " '1'],\n", + " ['603',\n", + " '391855805',\n", + " 'Spider Solitaire by MobilityWare',\n", + " '39446528',\n", + " 'USD',\n", + " '4.99',\n", + " '11154',\n", + " '1862',\n", + " '4.5',\n", + " '5',\n", + " '3.2.1',\n", + " '4+',\n", + " 'Games',\n", + " '38',\n", + " '5',\n", + " '3',\n", + " '1'],\n", + " ['604',\n", + " '391947489',\n", + " 'iSleeping by iSommeil SARL',\n", + " '24419328',\n", + " 'USD',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '2.7.1',\n", + " '4+',\n", + " 'Medical',\n", + " '38',\n", + " '0',\n", + " '3',\n", + " '1'],\n", + " ['605',\n", + " '391965015',\n", + " '中国建设银行',\n", + " '209245184',\n", + " 'USD',\n", + " '0',\n", + " '258',\n", + " '0',\n", + " '2',\n", + " '0',\n", + " '4.0.3.005',\n", + " '17+',\n", + " 'Finance',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['606',\n", + " '392084834',\n", + " 'Lane Splitter',\n", + " '106458112',\n", + " 'USD',\n", + " '0.99',\n", + " '44567',\n", + " '202',\n", + " '4.5',\n", + " '4.5',\n", + " '5.2.1',\n", + " '4+',\n", + " 'Games',\n", + " '38',\n", + " '4',\n", + " '1',\n", + " '1'],\n", + " ['607',\n", + " '392186427',\n", + " 'Ryder Cup 2016 – Hazeltine National Golf Club',\n", + " '116247552',\n", + " 'USD',\n", + " '0',\n", + " '3818',\n", + " '69',\n", + " '2.5',\n", + " '1.5',\n", + " '4.1.2',\n", + " '4+',\n", + " 'Sports',\n", + " '37',\n", + " '1',\n", + " '1',\n", + " '0'],\n", + " ['608',\n", + " '392188745',\n", + " 'Noteshelf',\n", + " '117406720',\n", + " 'USD',\n", + " '9.99',\n", + " '7562',\n", + " '9',\n", + " '4.5',\n", + " '4',\n", + " '11.9.6',\n", + " '4+',\n", + " 'Productivity',\n", + " '24',\n", + " '5',\n", + " '7',\n", + " '1'],\n", + " ['609',\n", + " '392198579',\n", + " 'The Legend of Spookley the Square Pumpkin',\n", + " '36942848',\n", + " 'USD',\n", + " '2.99',\n", + " '120',\n", + " '12',\n", + " '4.5',\n", + " '4.5',\n", + " '2.6.1',\n", + " '4+',\n", + " 'Book',\n", + " '37',\n", + " '4',\n", + " '1',\n", + " '1'],\n", + " ['611',\n", + " '392252535',\n", + " 'BUBBLE BOBBLE DOUBLE',\n", + " '56954817',\n", + " 'USD',\n", + " '4.99',\n", + " '206',\n", + " '128',\n", + " '3',\n", + " '3.5',\n", + " '2.0.0',\n", + " '4+',\n", + " 'Games',\n", + " '47',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['612',\n", + " '392408028',\n", + " 'Paprika Recipe Manager',\n", + " '10432512',\n", + " 'USD',\n", + " '4.99',\n", + " '1755',\n", + " '83',\n", + " '4.5',\n", + " '4.5',\n", + " '2.2.2',\n", + " '17+',\n", + " 'Food & Drink',\n", + " '24',\n", + " '5',\n", + " '16',\n", + " '1'],\n", + " ['613',\n", + " '392538848',\n", + " 'ToonCamera',\n", + " '29494272',\n", + " 'USD',\n", + " '1.99',\n", + " '1037',\n", + " '95',\n", + " '4.5',\n", + " '4.5',\n", + " '4.0',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '37',\n", + " '5',\n", + " '13',\n", + " '1'],\n", + " ['614',\n", + " '392788790',\n", + " 'Sonic The Hedgehog 4™ Episode I',\n", + " '124710912',\n", + " 'USD',\n", + " '2.99',\n", + " '4755',\n", + " '132',\n", + " '4',\n", + " '3.5',\n", + " '1.5',\n", + " '9+',\n", + " 'Games',\n", + " '38',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['615',\n", + " '392790924',\n", + " 'Cisco AnyConnect',\n", + " '46872576',\n", + " 'USD',\n", + " '0',\n", + " '825',\n", + " '28',\n", + " '3.5',\n", + " '4',\n", + " '4.0.05066',\n", + " '4+',\n", + " 'Business',\n", + " '40',\n", + " '1',\n", + " '1',\n", + " '1'],\n", + " ['616',\n", + " '392796698',\n", + " 'GroupMe',\n", + " '66864128',\n", + " 'USD',\n", + " '0',\n", + " '28260',\n", + " '294',\n", + " '4.5',\n", + " '4.5',\n", + " '5.9.0',\n", + " '4+',\n", + " 'Social Networking',\n", + " '37',\n", + " '1',\n", + " '14',\n", + " '1'],\n", + " ['617',\n", + " '392899425',\n", + " '招商银行',\n", + " '154910720',\n", + " 'USD',\n", + " '0',\n", + " '306',\n", + " '1',\n", + " '3.5',\n", + " '1',\n", + " '5.3.0',\n", + " '12+',\n", + " 'Finance',\n", + " '37',\n", + " '0',\n", + " '2',\n", + " '1'],\n", + " ['618',\n", + " '392915994',\n", + " 'Jenga',\n", + " '97562624',\n", + " 'USD',\n", + " '0',\n", + " '32527',\n", + " '4411',\n", + " '4.5',\n", + " '4',\n", + " '1.7.6',\n", + " '4+',\n", + " 'Games',\n", + " '43',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['619',\n", + " '392988420',\n", + " 'Zappos: shop shoes & clothes, fast free shipping',\n", + " '70325248',\n", + " 'USD',\n", + " '0',\n", + " '103655',\n", + " '39452',\n", + " '5',\n", + " '5',\n", + " '3.9.0',\n", + " '4+',\n", + " 'Shopping',\n", + " '37',\n", + " '4',\n", + " '1',\n", + " '1'],\n", + " ['620',\n", + " '393313223',\n", + " 'Printer Pro - Print photos, pdf and emails',\n", + " '98820096',\n", + " 'USD',\n", + " '6.99',\n", + " '15981',\n", + " '440',\n", + " '4.5',\n", + " '4.5',\n", + " '5.4.11',\n", + " '4+',\n", + " 'Productivity',\n", + " '37',\n", + " '5',\n", + " '9',\n", + " '1'],\n", + " ['621',\n", + " '393328150',\n", + " 'Sephora Makeup & Beauty App – Insider Tips & Style',\n", + " '147001344',\n", + " 'USD',\n", + " '0',\n", + " '15593',\n", + " '301',\n", + " '4.5',\n", + " '5',\n", + " '17.3',\n", + " '4+',\n", + " 'Shopping',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['623',\n", + " '393670998',\n", + " '欧路英语词典 Eudic 增强版',\n", + " '152671232',\n", + " 'USD',\n", + " '2.99',\n", + " '206',\n", + " '2',\n", + " '4',\n", + " '3.5',\n", + " '8.2.1',\n", + " '17+',\n", + " 'Reference',\n", + " '37',\n", + " '5',\n", + " '3',\n", + " '1'],\n", + " ['624',\n", + " '393765873',\n", + " '爱奇艺 - 电视剧电影综艺娱乐视频播放器',\n", + " '235160576',\n", + " 'USD',\n", + " '0',\n", + " '786',\n", + " '0',\n", + " '3.5',\n", + " '0',\n", + " '8.5.0',\n", + " '17+',\n", + " 'Entertainment',\n", + " '38',\n", + " '0',\n", + " '2',\n", + " '1'],\n", + " ['626',\n", + " '393989284',\n", + " 'Mathmateer®',\n", + " '26029056',\n", + " 'USD',\n", + " '1.99',\n", + " '1207',\n", + " '2',\n", + " '4.5',\n", + " '4.5',\n", + " '2.3',\n", + " '4+',\n", + " 'Education',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['627',\n", + " '394057299',\n", + " 'Battleheart',\n", + " '275481600',\n", + " 'USD',\n", + " '2.99',\n", + " '6879',\n", + " '54',\n", + " '4.5',\n", + " '4.5',\n", + " '1.6',\n", + " '9+',\n", + " 'Games',\n", + " '38',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['628',\n", + " '394075284',\n", + " 'Youku HD',\n", + " '145140736',\n", + " 'USD',\n", + " '0',\n", + " '5683',\n", + " '7',\n", + " '4',\n", + " '4.5',\n", + " '5.0',\n", + " '12+',\n", + " 'Entertainment',\n", + " '24',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['629',\n", + " '394342281',\n", + " 'Bowitter for iPhone',\n", + " '3174400',\n", + " 'USD',\n", + " '0.99',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '1.5.0',\n", + " '4+',\n", + " 'Social Networking',\n", + " '43',\n", + " '0',\n", + " '2',\n", + " '1'],\n", + " ['630',\n", + " '394732447',\n", + " 'Need for Speed™ Hot Pursuit',\n", + " '1269152768',\n", + " 'USD',\n", + " '4.99',\n", + " '5059',\n", + " '20',\n", + " '4',\n", + " '3.5',\n", + " '1.3.10',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '8',\n", + " '1'],\n", + " ['631',\n", + " '395042892',\n", + " 'Instant Heart Rate+: Heart Rate & Pulse Monitor',\n", + " '189514752',\n", + " 'USD',\n", + " '4.99',\n", + " '10158',\n", + " '475',\n", + " '4.5',\n", + " '4.5',\n", + " '5.72',\n", + " '4+',\n", + " 'Health & Fitness',\n", + " '37',\n", + " '0',\n", + " '31',\n", + " '1'],\n", + " ['632',\n", + " '395096736',\n", + " '去哪儿旅行-预订机票酒店火车票特价旅游自由行',\n", + " '131723264',\n", + " 'USD',\n", + " '0',\n", + " '291',\n", + " '0',\n", + " '4',\n", + " '0',\n", + " '4.10.12',\n", + " '17+',\n", + " 'Travel',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['633',\n", + " '395148744',\n", + " 'NOAA Hurricane Center',\n", + " '8069120',\n", + " 'USD',\n", + " '1.99',\n", + " '31',\n", + " '15',\n", + " '3',\n", + " '3',\n", + " '3.5',\n", + " '4+',\n", + " 'Weather',\n", + " '43',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['634',\n", + " '395545555',\n", + " 'CVS Pharmacy',\n", + " '129167360',\n", + " 'USD',\n", + " '0',\n", + " '35981',\n", + " '237',\n", + " '4',\n", + " '4',\n", + " '3.4.1',\n", + " '12+',\n", + " 'Shopping',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['635',\n", + " '395627741',\n", + " 'Age of Zombies™',\n", + " '53805056',\n", + " 'USD',\n", + " '0.99',\n", + " '14493',\n", + " '384',\n", + " '4.5',\n", + " '4.5',\n", + " '1.2.81',\n", + " '12+',\n", + " 'Games',\n", + " '40',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['636',\n", + " '395680819',\n", + " 'AVPlayer',\n", + " '39790592',\n", + " 'USD',\n", + " '2.99',\n", + " '853',\n", + " '11',\n", + " '4',\n", + " '5',\n", + " '2.84',\n", + " '17+',\n", + " 'Entertainment',\n", + " '40',\n", + " '0',\n", + " '11',\n", + " '1'],\n", + " ['637',\n", + " '395893124',\n", + " '土豆视频HD—高清影视综艺视频播放器',\n", + " '68668416',\n", + " 'USD',\n", + " '0',\n", + " '990',\n", + " '4',\n", + " '3',\n", + " '2',\n", + " '5.5.2',\n", + " '12+',\n", + " 'Entertainment',\n", + " '24',\n", + " '4',\n", + " '1',\n", + " '1'],\n", + " ['638',\n", + " '395898626',\n", + " '土豆(短视频分享平台)',\n", + " '88601600',\n", + " 'USD',\n", + " '0',\n", + " '676',\n", + " '0',\n", + " '3',\n", + " '0',\n", + " '6.3.3',\n", + " '12+',\n", + " 'Entertainment',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['639',\n", + " '395979574',\n", + " 'Spider Solitaire Free by MobilityWare',\n", + " '91588608',\n", + " 'USD',\n", + " '0',\n", + " '128739',\n", + " '5515',\n", + " '4.5',\n", + " '4.5',\n", + " '3.4.0',\n", + " '4+',\n", + " 'Games',\n", + " '38',\n", + " '5',\n", + " '3',\n", + " '1'],\n", + " ['640',\n", + " '396082453',\n", + " 'The Calculator',\n", + " '71177216',\n", + " 'USD',\n", + " '2.99',\n", + " '1556',\n", + " '25',\n", + " '4.5',\n", + " '5',\n", + " '4.7.0',\n", + " '4+',\n", + " 'Utilities',\n", + " '38',\n", + " '5',\n", + " '11',\n", + " '1'],\n", + " ['641',\n", + " '396085661',\n", + " 'Game Dev Story',\n", + " '191455232',\n", + " 'USD',\n", + " '4.99',\n", + " '12331',\n", + " '11',\n", + " '4.5',\n", + " '4.5',\n", + " '2.09',\n", + " '4+',\n", + " 'Games',\n", + " '38',\n", + " '5',\n", + " '5',\n", + " '1'],\n", + " ['643',\n", + " '396224808',\n", + " 'French Words for Kids - Learn Letter Sounds',\n", + " '35518464',\n", + " 'USD',\n", + " '3.99',\n", + " '22',\n", + " '1',\n", + " '4.5',\n", + " '5',\n", + " '5.0.1',\n", + " '4+',\n", + " 'Education',\n", + " '37',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['644',\n", + " '396669943',\n", + " 'Death Worm',\n", + " '29303808',\n", + " 'USD',\n", + " '0.99',\n", + " '6527',\n", + " '15',\n", + " '4',\n", + " '4',\n", + " '1.65',\n", + " '12+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['646',\n", + " '396837225',\n", + " 'Cartoon Wars 2: Heroes',\n", + " '42482779',\n", + " 'USD',\n", + " '0.99',\n", + " '13049',\n", + " '1180',\n", + " '4.5',\n", + " '4.5',\n", + " '111',\n", + " '12+',\n", + " 'Games',\n", + " '43',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['647',\n", + " '396885309',\n", + " 'MSNBC',\n", + " '92997632',\n", + " 'USD',\n", + " '0',\n", + " '3692',\n", + " '27',\n", + " '3.5',\n", + " '2',\n", + " '6.0.5',\n", + " '12+',\n", + " 'News',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['648',\n", + " '397049430',\n", + " 'Super Stickman Golf',\n", + " '88879104',\n", + " 'USD',\n", + " '2.99',\n", + " '41446',\n", + " '566',\n", + " '4.5',\n", + " '4.5',\n", + " '2.0',\n", + " '4+',\n", + " 'Games',\n", + " '43',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['649',\n", + " '397533889',\n", + " 'Black Friday 2017 Ads App - BlackFriday.fm',\n", + " '23296000',\n", + " 'USD',\n", + " '0',\n", + " '8221',\n", + " '0',\n", + " '4.5',\n", + " '0',\n", + " '3.0.3',\n", + " '4+',\n", + " 'Shopping',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['650',\n", + " '397836467',\n", + " 'Hotel Dash Deluxe',\n", + " '50085888',\n", + " 'USD',\n", + " '0.99',\n", + " '36190',\n", + " '221',\n", + " '4.5',\n", + " '4',\n", + " '1.27.3',\n", + " '4+',\n", + " 'Games',\n", + " '43',\n", + " '4',\n", + " '1',\n", + " '1'],\n", + " ['651',\n", + " '397951063',\n", + " 'Backbreaker 2: Vengeance',\n", + " '83214336',\n", + " 'USD',\n", + " '0.99',\n", + " '14491',\n", + " '304',\n", + " '4.5',\n", + " '4.5',\n", + " '1.3.6',\n", + " '4+',\n", + " 'Games',\n", + " '40',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['653',\n", + " '398129933',\n", + " 'The Calculator - Free and Easy Calculating!',\n", + " '84945920',\n", + " 'USD',\n", + " '0',\n", + " '99244',\n", + " '1760',\n", + " '4.5',\n", + " '4.5',\n", + " '4.7.2',\n", + " '4+',\n", + " 'Utilities',\n", + " '38',\n", + " '5',\n", + " '11',\n", + " '1'],\n", + " ['654',\n", + " '398166286',\n", + " '出会い系アプリ i-Mail(アイメール)',\n", + " '3833856',\n", + " 'USD',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '2.1.2',\n", + " '17+',\n", + " 'Social Networking',\n", + " '43',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['656',\n", + " '398329664',\n", + " 'Angry Birds Seasons HD',\n", + " '710486016',\n", + " 'USD',\n", + " '0',\n", + " '75714',\n", + " '481',\n", + " '4',\n", + " '4.5',\n", + " '6.6.1',\n", + " '4+',\n", + " 'Games',\n", + " '24',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['657',\n", + " '398348506',\n", + " 'Gravity Guy',\n", + " '22577152',\n", + " 'USD',\n", + " '0.99',\n", + " '35161',\n", + " '1316',\n", + " '4.5',\n", + " '4',\n", + " '1.4.4',\n", + " '9+',\n", + " 'Games',\n", + " '43',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['659',\n", + " '398436747',\n", + " 'Fooducate - Lose Weight, Eat Healthy,Get Motivated',\n", + " '48590848',\n", + " 'USD',\n", + " '0',\n", + " '11875',\n", + " '73',\n", + " '4.5',\n", + " '4.5',\n", + " '4.981',\n", + " '4+',\n", + " 'Health & Fitness',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['660',\n", + " '398453262',\n", + " '招商银行信用卡掌上生活',\n", + " '160764928',\n", + " 'USD',\n", + " '0',\n", + " '122',\n", + " '0',\n", + " '2.5',\n", + " '0',\n", + " '5.5.9',\n", + " '17+',\n", + " 'Finance',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['661',\n", + " '398596699',\n", + " 'myChevrolet',\n", + " '85515264',\n", + " 'USD',\n", + " '0',\n", + " '1083',\n", + " '36',\n", + " '2',\n", + " '2.5',\n", + " '3.6.0',\n", + " '17+',\n", + " 'Lifestyle',\n", + " '37',\n", + " '0',\n", + " '4',\n", + " '1'],\n", + " ['662',\n", + " '398687544',\n", + " 'Puzzle Quest 2',\n", + " '1319796736',\n", + " 'USD',\n", + " '2.99',\n", + " '1575',\n", + " '104',\n", + " '3.5',\n", + " '4',\n", + " '1.3.4',\n", + " '12+',\n", + " 'Games',\n", + " '38',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['663',\n", + " '398860966',\n", + " 'Mountain Biker',\n", + " '165394432',\n", + " 'USD',\n", + " '1.99',\n", + " '24',\n", + " '7',\n", + " '3.5',\n", + " '4',\n", + " '1.0.3',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '8',\n", + " '1'],\n", + " ['665',\n", + " '398954883',\n", + " 'Yurekuru Call',\n", + " '56609792',\n", + " 'USD',\n", + " '0',\n", + " '53',\n", + " '0',\n", + " '4',\n", + " '0',\n", + " '3.4.7',\n", + " '4+',\n", + " 'Weather',\n", + " '37',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['666',\n", + " '398975927',\n", + " 'Stratego® Single Player',\n", + " '195406848',\n", + " 'USD',\n", + " '2.99',\n", + " '739',\n", + " '145',\n", + " '3.5',\n", + " '4',\n", + " '1.3.9',\n", + " '4+',\n", + " 'Games',\n", + " '40',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['667',\n", + " '399355755',\n", + " 'Text Free: Free Texting + Calling + MMS',\n", + " '136184832',\n", + " 'USD',\n", + " '0',\n", + " '100477',\n", + " '35',\n", + " '4',\n", + " '4.5',\n", + " '9.25',\n", + " '4+',\n", + " 'Lifestyle',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['668',\n", + " '399363156',\n", + " '腾讯新闻-头条新闻热点资讯掌上阅读软件',\n", + " '114878464',\n", + " 'USD',\n", + " '0',\n", + " '718',\n", + " '4',\n", + " '4',\n", + " '2.5',\n", + " '5.3.6',\n", + " '12+',\n", + " 'News',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['669',\n", + " '399452287',\n", + " 'Merriam-Webster Dictionary',\n", + " '155593728',\n", + " 'USD',\n", + " '0',\n", + " '16849',\n", + " '1125',\n", + " '4.5',\n", + " '4.5',\n", + " '4.1',\n", + " '4+',\n", + " 'Reference',\n", + " '38',\n", + " '1',\n", + " '12',\n", + " '1'],\n", + " ['670',\n", + " '399608199',\n", + " '中国银行手机银行',\n", + " '251711488',\n", + " 'USD',\n", + " '0',\n", + " '192',\n", + " '2',\n", + " '1.5',\n", + " '3',\n", + " '3.0.7',\n", + " '4+',\n", + " 'Finance',\n", + " '38',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['672',\n", + " '399804936',\n", + " 'Learn English quickly with MosaLingua',\n", + " '51665920',\n", + " 'USD',\n", + " '4.99',\n", + " '7',\n", + " '0',\n", + " '5',\n", + " '0',\n", + " '9.2',\n", + " '12+',\n", + " 'Education',\n", + " '38',\n", + " '5',\n", + " '5',\n", + " '1'],\n", + " ['673',\n", + " '400213892',\n", + " \"Reiner Knizia's Ra\",\n", + " '34992128',\n", + " 'USD',\n", + " '3.99',\n", + " '1114',\n", + " '110',\n", + " '4.5',\n", + " '4',\n", + " '1.5.1',\n", + " '4+',\n", + " 'Games',\n", + " '45',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['675',\n", + " '400666114',\n", + " 'Guitar Pro',\n", + " '34405376',\n", + " 'USD',\n", + " '6.99',\n", + " '1218',\n", + " '11',\n", + " '4',\n", + " '4.5',\n", + " '1.7.3',\n", + " '4+',\n", + " 'Music',\n", + " '38',\n", + " '5',\n", + " '12',\n", + " '1'],\n", + " ['678',\n", + " '400882072',\n", + " 'Flick Golf!',\n", + " '59663360',\n", + " 'USD',\n", + " '0.99',\n", + " '9948',\n", + " '211',\n", + " '4.5',\n", + " '4',\n", + " '1.8.1',\n", + " '4+',\n", + " 'Games',\n", + " '40',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['679',\n", + " '400971700',\n", + " 'DirectVR Remote for DirecTV',\n", + " '7497728',\n", + " 'USD',\n", + " '0.99',\n", + " '528',\n", + " '1',\n", + " '4',\n", + " '2',\n", + " '4.4.1',\n", + " '4+',\n", + " 'Utilities',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['680',\n", + " '401301276',\n", + " 'World of Goo',\n", + " '119131136',\n", + " 'USD',\n", + " '4.99',\n", + " '4675',\n", + " '15',\n", + " '4.5',\n", + " '5',\n", + " '1.6',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['681',\n", + " '401626263',\n", + " 'Airbnb',\n", + " '243776512',\n", + " 'USD',\n", + " '0',\n", + " '22302',\n", + " '0',\n", + " '4',\n", + " '0',\n", + " '17.22',\n", + " '4+',\n", + " 'Travel',\n", + " '37',\n", + " '5',\n", + " '29',\n", + " '1'],\n", + " ['682',\n", + " '401643317',\n", + " 'UPAD 3',\n", + " '34397184',\n", + " 'USD',\n", + " '5.99',\n", + " '3849',\n", + " '164',\n", + " '4',\n", + " '4.5',\n", + " '3.29',\n", + " '4+',\n", + " 'Productivity',\n", + " '24',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['683',\n", + " '401644893',\n", + " 'Tagesschau',\n", + " '83928064',\n", + " 'USD',\n", + " '0',\n", + " '233',\n", + " '56',\n", + " '4',\n", + " '5',\n", + " '2.1.1',\n", + " '12+',\n", + " 'News',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['684',\n", + " '401746066',\n", + " 'iExit Interstate Exit Guide',\n", + " '9784320',\n", + " 'USD',\n", + " '0',\n", + " '1798',\n", + " '8',\n", + " '4.5',\n", + " '4.5',\n", + " '9.2.2',\n", + " '4+',\n", + " 'Travel',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['685',\n", + " '401818935',\n", + " 'Genius Scan+ - PDF Scanner',\n", + " '43338752',\n", + " 'USD',\n", + " '7.99',\n", + " '916',\n", + " '39',\n", + " '4.5',\n", + " '4.5',\n", + " '4.1.6',\n", + " '4+',\n", + " 'Business',\n", + " '37',\n", + " '5',\n", + " '10',\n", + " '1'],\n", + " ['686',\n", + " '402012828',\n", + " 'iSafe Pro',\n", + " '95949824',\n", + " 'USD',\n", + " '0.99',\n", + " '2956',\n", + " '94',\n", + " '4.5',\n", + " '4',\n", + " '10.11',\n", + " '17+',\n", + " 'Utilities',\n", + " '37',\n", + " '0',\n", + " '32',\n", + " '1'],\n", + " ['687',\n", + " '402370879',\n", + " 'NBA JAM by EA SPORTS™',\n", + " '410202112',\n", + " 'USD',\n", + " '4.99',\n", + " '21648',\n", + " '460',\n", + " '4',\n", + " '3.5',\n", + " '1.1.35',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '0',\n", + " '8',\n", + " '1'],\n", + " ['688',\n", + " '402422247',\n", + " 'iHandy Translator Pro',\n", + " '30382080',\n", + " 'USD',\n", + " '2.99',\n", + " '5163',\n", + " '86',\n", + " '4.5',\n", + " '4.5',\n", + " '1.3.1',\n", + " '4+',\n", + " 'Reference',\n", + " '38',\n", + " '0',\n", + " '11',\n", + " '1'],\n", + " ['689',\n", + " '402614251',\n", + " 'AR Missile - Automatic Target Tracking',\n", + " '17178624',\n", + " 'USD',\n", + " '0.99',\n", + " '49',\n", + " '2',\n", + " '4.5',\n", + " '4.5',\n", + " '1.11',\n", + " '4+',\n", + " 'Entertainment',\n", + " '38',\n", + " '0',\n", + " '2',\n", + " '1'],\n", + " ['690',\n", + " '403037266',\n", + " 'QuakeFeed Earthquake Map, Alerts, and News',\n", + " '70262784',\n", + " 'USD',\n", + " '0',\n", + " '6081',\n", + " '15',\n", + " '4.5',\n", + " '4.5',\n", + " '4.1',\n", + " '4+',\n", + " 'Weather',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['691',\n", + " '403090531',\n", + " 'Dungeon Raid',\n", + " '11911065',\n", + " 'USD',\n", + " '0.99',\n", + " '4401',\n", + " '2927',\n", + " '5',\n", + " '5',\n", + " '1.3.4',\n", + " '9+',\n", + " 'Games',\n", + " '47',\n", + " '0',\n", + " '1',\n", + " '0'],\n", + " ['692',\n", + " '403684733',\n", + " 'Badoo Premium - Meet new people. Extra features.',\n", + " '157370368',\n", + " 'USD',\n", + " '2.99',\n", + " '2231',\n", + " '3',\n", + " '4.5',\n", + " '5',\n", + " '5.8.0',\n", + " '17+',\n", + " 'Social Networking',\n", + " '37',\n", + " '4',\n", + " '30',\n", + " '1'],\n", + " ['693',\n", + " '403858572',\n", + " 'Fruit Ninja®',\n", + " '163801088',\n", + " 'USD',\n", + " '0',\n", + " '327025',\n", + " '82',\n", + " '4.5',\n", + " '4',\n", + " '2.5.1',\n", + " '4+',\n", + " 'Games',\n", + " '38',\n", + " '5',\n", + " '13',\n", + " '1'],\n", + " ['694',\n", + " '404086528',\n", + " 'LEGO Harry Potter: Years 1-4',\n", + " '475697678',\n", + " 'USD',\n", + " '4.99',\n", + " '10463',\n", + " '5018',\n", + " '4',\n", + " '4',\n", + " '2.4',\n", + " '9+',\n", + " 'Games',\n", + " '43',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['695',\n", + " '404095058',\n", + " 'Rat On A Skateboard',\n", + " '9458688',\n", + " 'USD',\n", + " '1.99',\n", + " '28672',\n", + " '11',\n", + " '4.5',\n", + " '4.5',\n", + " '1.22.1',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '3',\n", + " '1',\n", + " '1'],\n", + " ['696',\n", + " '404299862',\n", + " 'iTrackBites Plus - Smart Weight Loss Tracker & Points Calculator for Diet Nutrition Watchers',\n", + " '67922944',\n", + " 'USD',\n", + " '3.99',\n", + " '4716',\n", + " '718',\n", + " '4.5',\n", + " '4.5',\n", + " '5.5',\n", + " '12+',\n", + " 'Health & Fitness',\n", + " '38',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['697',\n", + " '404405151',\n", + " 'Pocket God: Journey To Uranus',\n", + " '118435840',\n", + " 'USD',\n", + " '1.99',\n", + " '6278',\n", + " '98',\n", + " '3.5',\n", + " '3.5',\n", + " '1.05.05',\n", + " '9+',\n", + " 'Games',\n", + " '43',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['698',\n", + " '404529222',\n", + " 'ファッション通販 ZOZOTOWN',\n", + " '43611136',\n", + " 'USD',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '4.8.2',\n", + " '4+',\n", + " 'Shopping',\n", + " '37',\n", + " '0',\n", + " '2',\n", + " '1'],\n", + " ['699',\n", + " '404553553',\n", + " 'Bloons TD 4',\n", + " '23447492',\n", + " 'USD',\n", + " '2.99',\n", + " '8304',\n", + " '1401',\n", + " '4.5',\n", + " '4.5',\n", + " '3.6.1',\n", + " '4+',\n", + " 'Games',\n", + " '47',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['700',\n", + " '404593641',\n", + " 'Cartoon Network App – Teen Titans Go! And more!',\n", + " '101873664',\n", + " 'USD',\n", + " '0',\n", + " '15984',\n", + " '97',\n", + " '3',\n", + " '3.5',\n", + " '3.6',\n", + " '9+',\n", + " 'Entertainment',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['701',\n", + " '404990064',\n", + " 'SkyView® - Explore the Universe',\n", + " '93429760',\n", + " 'USD',\n", + " '1.99',\n", + " '5079',\n", + " '241',\n", + " '4.5',\n", + " '4.5',\n", + " '3.5.1',\n", + " '4+',\n", + " 'Education',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['702',\n", + " '405338085',\n", + " 'Coach Guitar - Lessons & Easy Tabs For Beginners',\n", + " '132141056',\n", + " 'USD',\n", + " '0',\n", + " '2416',\n", + " '45',\n", + " '4.5',\n", + " '4.5',\n", + " '4.8.1',\n", + " '4+',\n", + " 'Music',\n", + " '37',\n", + " '5',\n", + " '12',\n", + " '1'],\n", + " ['703',\n", + " '405548206',\n", + " 'Lobi',\n", + " '38540288',\n", + " 'USD',\n", + " '0',\n", + " '36',\n", + " '0',\n", + " '4',\n", + " '0',\n", + " '9.1.5',\n", + " '17+',\n", + " 'Social Networking',\n", + " '37',\n", + " '0',\n", + " '4',\n", + " '1'],\n", + " ['704',\n", + " '405622181',\n", + " 'MONOPOLY for iPad',\n", + " '979909632',\n", + " 'USD',\n", + " '4.99',\n", + " '8165',\n", + " '110',\n", + " '3.5',\n", + " '3.5',\n", + " '1.1.93',\n", + " '4+',\n", + " 'Games',\n", + " '24',\n", + " '5',\n", + " '8',\n", + " '1'],\n", + " ['706',\n", + " '405667771',\n", + " '聚力视频HD-人民的名义,跨界歌王全网热播',\n", + " '90725376',\n", + " 'USD',\n", + " '0',\n", + " '7446',\n", + " '8',\n", + " '4',\n", + " '4.5',\n", + " '5.0.8',\n", + " '12+',\n", + " 'Entertainment',\n", + " '24',\n", + " '4',\n", + " '1',\n", + " '1'],\n", + " ['707',\n", + " '405743220',\n", + " 'Eden - World Builder',\n", + " '122429440',\n", + " 'USD',\n", + " '0.99',\n", + " '26419',\n", + " '1157',\n", + " '4',\n", + " '4.5',\n", + " '2.1',\n", + " '9+',\n", + " 'Games',\n", + " '43',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['708',\n", + " '405891908',\n", + " 'Holiday Greetings - 3D Animations, Emoji, Emoticons, Sounds & Videos for Special Occasions',\n", + " '12783616',\n", + " 'USD',\n", + " '0.99',\n", + " '208',\n", + " '13',\n", + " '4',\n", + " '4',\n", + " '10.33',\n", + " '17+',\n", + " 'Entertainment',\n", + " '38',\n", + " '4',\n", + " '1',\n", + " '1'],\n", + " ['710',\n", + " '406239138',\n", + " 'Puffin Browser Pro',\n", + " '63474688',\n", + " 'USD',\n", + " '3.99',\n", + " '7565',\n", + " '80',\n", + " '3.5',\n", + " '3',\n", + " '5.2.0',\n", + " '17+',\n", + " 'Utilities',\n", + " '37',\n", + " '5',\n", + " '28',\n", + " '1'],\n", + " ['712',\n", + " '406541444',\n", + " '8mm Vintage Camera',\n", + " '22227968',\n", + " 'USD',\n", + " '1.99',\n", + " '3040',\n", + " '14',\n", + " '4.5',\n", + " '4',\n", + " '2.5.1',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '37',\n", + " '0',\n", + " '4',\n", + " '1'],\n", + " ['713',\n", + " '406719683',\n", + " 'GasBuddy',\n", + " '145240064',\n", + " 'USD',\n", + " '0',\n", + " '145549',\n", + " '330',\n", + " '4.5',\n", + " '4.5',\n", + " '4.4.6.1',\n", + " '17+',\n", + " 'Travel',\n", + " '37',\n", + " '4',\n", + " '1',\n", + " '1'],\n", + " ['714',\n", + " '406732590',\n", + " 'Paprika Recipe Manager for iPhone',\n", + " '10426368',\n", + " 'USD',\n", + " '4.99',\n", + " '835',\n", + " '84',\n", + " '4.5',\n", + " '4.5',\n", + " '2.2.1',\n", + " '17+',\n", + " 'Food & Drink',\n", + " '37',\n", + " '0',\n", + " '16',\n", + " '1'],\n", + " ['716',\n", + " '407262212',\n", + " 'BillMinder - Bill Reminder and Organizer',\n", + " '4278742',\n", + " 'USD',\n", + " '1.99',\n", + " '4262',\n", + " '668',\n", + " '4.5',\n", + " '4',\n", + " '3.7.6',\n", + " '4+',\n", + " 'Finance',\n", + " '43',\n", + " '0',\n", + " '6',\n", + " '1'],\n", + " ['717',\n", + " '407375789',\n", + " 'myCardLists Christmas Card Address Label Printing',\n", + " '21371904',\n", + " 'USD',\n", + " '1.99',\n", + " '219',\n", + " '1',\n", + " '4',\n", + " '5',\n", + " '4.40',\n", + " '4+',\n", + " 'Utilities',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['719',\n", + " '407558537',\n", + " 'Capital One Mobile',\n", + " '273259520',\n", + " 'USD',\n", + " '0',\n", + " '56110',\n", + " '57',\n", + " '4.5',\n", + " '4',\n", + " '5.19.1',\n", + " '4+',\n", + " 'Finance',\n", + " '37',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['720',\n", + " '407690035',\n", + " 'HotelTonight - Great Deals on Last Minute Hotels',\n", + " '79332352',\n", + " 'USD',\n", + " '0',\n", + " '32341',\n", + " '1707',\n", + " '4.5',\n", + " '5',\n", + " '10.15',\n", + " '12+',\n", + " 'Travel',\n", + " '37',\n", + " '5',\n", + " '6',\n", + " '1'],\n", + " ['721',\n", + " '407707744',\n", + " 'The 7th Guest',\n", + " '655987075',\n", + " 'USD',\n", + " '4.99',\n", + " '1419',\n", + " '216',\n", + " '4',\n", + " '3.5',\n", + " '7.5',\n", + " '12+',\n", + " 'Games',\n", + " '43',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['724',\n", + " '407838198',\n", + " 'Stack the Countries®',\n", + " '188030976',\n", + " 'USD',\n", + " '2.99',\n", + " '3303',\n", + " '37',\n", + " '4.5',\n", + " '4.5',\n", + " '2.7',\n", + " '4+',\n", + " 'Education',\n", + " '40',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['727',\n", + " '407925512',\n", + " '腾讯视频HD-楚乔传,明日之子6月全网首播',\n", + " '123563008',\n", + " 'USD',\n", + " '0',\n", + " '2058',\n", + " '4',\n", + " '4',\n", + " '4',\n", + " '5.1.5',\n", + " '17+',\n", + " 'Entertainment',\n", + " '24',\n", + " '5',\n", + " '3',\n", + " '1'],\n", + " ['728',\n", + " '407949800',\n", + " 'Secret of Mana',\n", + " '192136192',\n", + " 'USD',\n", + " '7.99',\n", + " '990',\n", + " '50',\n", + " '4',\n", + " '3.5',\n", + " '3.2.0',\n", + " '9+',\n", + " 'Games',\n", + " '37',\n", + " '0',\n", + " '6',\n", + " '1'],\n", + " ['729',\n", + " '407976815',\n", + " 'AVPlayerHD',\n", + " '39835648',\n", + " 'USD',\n", + " '2.99',\n", + " '1986',\n", + " '14',\n", + " '4',\n", + " '4.5',\n", + " '2.84',\n", + " '17+',\n", + " 'Entertainment',\n", + " '24',\n", + " '5',\n", + " '11',\n", + " '1'],\n", + " ['730',\n", + " '408233979',\n", + " 'SimplePhysics',\n", + " '8773632',\n", + " 'USD',\n", + " '1.99',\n", + " '8981',\n", + " '66',\n", + " '4.5',\n", + " '4',\n", + " '2.1.3',\n", + " '9+',\n", + " 'Games',\n", + " '43',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['731',\n", + " '408854559',\n", + " 'Hot Springs Story',\n", + " '183409664',\n", + " 'USD',\n", + " '4.99',\n", + " '554',\n", + " '1',\n", + " '4.5',\n", + " '1',\n", + " '2.02',\n", + " '4+',\n", + " 'Games',\n", + " '38',\n", + " '5',\n", + " '6',\n", + " '1'],\n", + " ['732',\n", + " '409128287',\n", + " 'The Guardian',\n", + " '92966912',\n", + " 'USD',\n", + " '0',\n", + " '8176',\n", + " '13',\n", + " '5',\n", + " '5',\n", + " '4.30',\n", + " '12+',\n", + " 'News',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['733',\n", + " '409157308',\n", + " \"Annabel Karmel's Baby & Toddler Recipe App\",\n", + " '104406016',\n", + " 'USD',\n", + " '4.99',\n", + " '53',\n", + " '5',\n", + " '2',\n", + " '1',\n", + " '1.29',\n", + " '4+',\n", + " 'Food & Drink',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['734',\n", + " '409299054',\n", + " 'SecurityCam for iPhone',\n", + " '10469376',\n", + " 'USD',\n", + " '0.99',\n", + " '6',\n", + " '1',\n", + " '1',\n", + " '1',\n", + " '1.131',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '39',\n", + " '0',\n", + " '2',\n", + " '1'],\n", + " ['735',\n", + " '409362880',\n", + " 'La Banque Postale',\n", + " '23792640',\n", + " 'USD',\n", + " '0',\n", + " '8',\n", + " '0',\n", + " '3',\n", + " '0',\n", + " '5.5.0',\n", + " '4+',\n", + " 'Finance',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['736',\n", + " '409395695',\n", + " 'My Score Plus Weight Loss, Food & Exercise Tracker',\n", + " '60144640',\n", + " 'USD',\n", + " '0',\n", + " '467',\n", + " '1',\n", + " '4',\n", + " '5',\n", + " '4.2.1',\n", + " '4+',\n", + " 'Health & Fitness',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['737',\n", + " '409563112',\n", + " '爱奇艺HD -《欢乐颂2》电视剧热播',\n", + " '154600448',\n", + " 'USD',\n", + " '0',\n", + " '2394',\n", + " '0',\n", + " '4',\n", + " '0',\n", + " '8.5.1',\n", + " '17+',\n", + " 'Entertainment',\n", + " '24',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['738',\n", + " '409605521',\n", + " 'Quit Pro',\n", + " '33914880',\n", + " 'USD',\n", + " '0.99',\n", + " '287',\n", + " '18',\n", + " '4.5',\n", + " '4.5',\n", + " '3.0',\n", + " '12+',\n", + " 'Health & Fitness',\n", + " '37',\n", + " '0',\n", + " '3',\n", + " '1'],\n", + " ['741',\n", + " '409838725',\n", + " 'Splice - Video Editor + Movie Maker by GoPro',\n", + " '123070464',\n", + " 'USD',\n", + " '0',\n", + " '28189',\n", + " '2723',\n", + " '4.5',\n", + " '5',\n", + " '3.5.3',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '37',\n", + " '5',\n", + " '22',\n", + " '1'],\n", + " ['742',\n", + " '409869453',\n", + " 'Localscope - Find places and people around you',\n", + " '13852672',\n", + " 'USD',\n", + " '2.99',\n", + " '868',\n", + " '8',\n", + " '4.5',\n", + " '4.5',\n", + " '4.5',\n", + " '12+',\n", + " 'Navigation',\n", + " '37',\n", + " '0',\n", + " '21',\n", + " '1'],\n", + " ['743',\n", + " '409890132',\n", + " 'Slingo Supreme HD',\n", + " '60013568',\n", + " 'USD',\n", + " '0.99',\n", + " '4094',\n", + " '15',\n", + " '4.5',\n", + " '3.5',\n", + " '2.1.46',\n", + " '4+',\n", + " 'Games',\n", + " '24',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['744',\n", + " '410031728',\n", + " 'VLC Streamer',\n", + " '82395136',\n", + " 'USD',\n", + " '2.99',\n", + " '3152',\n", + " '41',\n", + " '4.5',\n", + " '4.5',\n", + " '5.71',\n", + " '4+',\n", + " 'Entertainment',\n", + " '37',\n", + " '5',\n", + " '34',\n", + " '1'],\n", + " ['745',\n", + " '410089731',\n", + " 'Low Carb Diet Tracker PRO by Carb Manager',\n", + " '57810944',\n", + " 'USD',\n", + " '2.99',\n", + " '2950',\n", + " '1671',\n", + " '4.5',\n", + " '4.5',\n", + " '4.4.3',\n", + " '4+',\n", + " 'Health & Fitness',\n", + " '37',\n", + " '5',\n", + " '12',\n", + " '1'],\n", + " ['746',\n", + " '410148139',\n", + " 'NOAA Weather Radio',\n", + " '14232576',\n", + " 'USD',\n", + " '3.99',\n", + " '3245',\n", + " '53',\n", + " '4',\n", + " '4',\n", + " '9.4.5',\n", + " '4+',\n", + " 'Weather',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['747',\n", + " '410229362',\n", + " 'Mad Skills Motocross',\n", + " '16949248',\n", + " 'USD',\n", + " '0.99',\n", + " '9341',\n", + " '53',\n", + " '4.5',\n", + " '3.5',\n", + " '3.7.0',\n", + " '12+',\n", + " 'Games',\n", + " '43',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['748',\n", + " '410315894',\n", + " 'Pearson eText',\n", + " '21079040',\n", + " 'USD',\n", + " '0',\n", + " '981',\n", + " '4',\n", + " '2.5',\n", + " '2',\n", + " '1.11',\n", + " '4+',\n", + " 'Education',\n", + " '24',\n", + " '5',\n", + " '8',\n", + " '1'],\n", + " ['749',\n", + " '410319945',\n", + " 'QWOP for iOS',\n", + " '27227934',\n", + " 'USD',\n", + " '0.99',\n", + " '735',\n", + " '288',\n", + " '4',\n", + " '4.5',\n", + " '1.07',\n", + " '4+',\n", + " 'Games',\n", + " '43',\n", + " '4',\n", + " '1',\n", + " '1'],\n", + " ['750',\n", + " '410351918',\n", + " 'Sleep Pillow Sounds: white noise, rain, ocean, fan',\n", + " '124150784',\n", + " 'USD',\n", + " '2.99',\n", + " '15116',\n", + " '2692',\n", + " '4.5',\n", + " '5',\n", + " '7.4',\n", + " '4+',\n", + " 'Health & Fitness',\n", + " '37',\n", + " '5',\n", + " '31',\n", + " '1'],\n", + " ['751',\n", + " '410395246',\n", + " 'Microsoft OneNote',\n", + " '233533440',\n", + " 'USD',\n", + " '0',\n", + " '39638',\n", + " '1213',\n", + " '4.5',\n", + " '4.5',\n", + " '16.0',\n", + " '4+',\n", + " 'Productivity',\n", + " '37',\n", + " '5',\n", + " '33',\n", + " '1'],\n", + " ['752',\n", + " '410896080',\n", + " 'PlayStation®App',\n", + " '20168704',\n", + " 'USD',\n", + " '0',\n", + " '7256',\n", + " '491',\n", + " '3',\n", + " '2.5',\n", + " '4.20.9',\n", + " '12+',\n", + " 'Entertainment',\n", + " '37',\n", + " '4',\n", + " '19',\n", + " '1'],\n", + " ['753',\n", + " '411206394',\n", + " 'Scan - QR Code and Barcode Reader',\n", + " '10058752',\n", + " 'USD',\n", + " '1.99',\n", + " '12590',\n", + " '126',\n", + " '4.5',\n", + " '3.5',\n", + " '2.7',\n", + " '4+',\n", + " 'Utilities',\n", + " '38',\n", + " '4',\n", + " '14',\n", + " '1'],\n", + " ['754',\n", + " '411430426',\n", + " 'Carnivores: Ice Age Pro',\n", + " '198701056',\n", + " 'USD',\n", + " '2.99',\n", + " '13258',\n", + " '62',\n", + " '4.5',\n", + " '4',\n", + " '1.71',\n", + " '12+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '4',\n", + " '1'],\n", + " ['755',\n", + " '411608323',\n", + " '花しらべ 花認識/花検索',\n", + " '813500416',\n", + " 'USD',\n", + " '6.99',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '3.4.1',\n", + " '4+',\n", + " 'Reference',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['756',\n", + " '411711646',\n", + " 'Fighter Verses - memorize bible verses',\n", + " '13778944',\n", + " 'USD',\n", + " '2.99',\n", + " '331',\n", + " '1',\n", + " '4.5',\n", + " '1',\n", + " '4.0.8',\n", + " '4+',\n", + " 'Reference',\n", + " '37',\n", + " '4',\n", + " '3',\n", + " '1'],\n", + " ['757',\n", + " '411766326',\n", + " 'Schoology',\n", + " '120382464',\n", + " 'USD',\n", + " '0',\n", + " '1777',\n", + " '9',\n", + " '3',\n", + " '4',\n", + " '3.15.0',\n", + " '4+',\n", + " 'Education',\n", + " '37',\n", + " '5',\n", + " '4',\n", + " '1'],\n", + " ['758',\n", + " '411843682',\n", + " 'iDarkroom',\n", + " '29369344',\n", + " 'USD',\n", + " '0.99',\n", + " '554',\n", + " '1',\n", + " '4.5',\n", + " '4',\n", + " '2.6',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '37',\n", + " '0',\n", + " '31',\n", + " '1'],\n", + " ['759',\n", + " '411930498',\n", + " 'GolfNow – Book Tee Times, Golf GPS, Scorecard',\n", + " '75874304',\n", + " 'USD',\n", + " '0',\n", + " '7535',\n", + " '99',\n", + " '4',\n", + " '4.5',\n", + " '2.16.6',\n", + " '4+',\n", + " 'Sports',\n", + " '37',\n", + " '5',\n", + " '3',\n", + " '1'],\n", + " ['760',\n", + " '412223222',\n", + " 'Hudl',\n", + " '233934848',\n", + " 'USD',\n", + " '0',\n", + " '2622',\n", + " '3',\n", + " '3.5',\n", + " '2.5',\n", + " '5.12.1',\n", + " '4+',\n", + " 'Sports',\n", + " '37',\n", + " '3',\n", + " '1',\n", + " '1'],\n", + " ['761',\n", + " '412395632',\n", + " '乐视视频HD-白鹿原,欢乐颂,奔跑吧全网热播',\n", + " '136668160',\n", + " 'USD',\n", + " '0',\n", + " '2340',\n", + " '1',\n", + " '4',\n", + " '1',\n", + " '6.1.4',\n", + " '17+',\n", + " 'Entertainment',\n", + " '24',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['762',\n", + " '412403556',\n", + " 'TEDiSUB - Enjoy TED Talks with Subtitles',\n", + " '44099584',\n", + " 'USD',\n", + " '0',\n", + " '823',\n", + " '136',\n", + " '4.5',\n", + " '5',\n", + " '5.7.2',\n", + " '12+',\n", + " 'Entertainment',\n", + " '37',\n", + " '1',\n", + " '3',\n", + " '1'],\n", + " ['763',\n", + " '412792865',\n", + " 'SkyDroid - Golf GPS',\n", + " '25606144',\n", + " 'USD',\n", + " '1.99',\n", + " '261',\n", + " '1',\n", + " '4',\n", + " '5',\n", + " '1.10.1',\n", + " '4+',\n", + " 'Sports',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['765',\n", + " '413246702',\n", + " 'Verbrechen - echte Polizeifälle aus Deiner Umgebung',\n", + " '8161280',\n", + " 'USD',\n", + " '1.99',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '3.0.1',\n", + " '4+',\n", + " 'News',\n", + " '38',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['766',\n", + " '413423472',\n", + " 'Legendary Wars',\n", + " '247508992',\n", + " 'USD',\n", + " '0.99',\n", + " '29739',\n", + " '2253',\n", + " '4.5',\n", + " '5',\n", + " '2.3',\n", + " '9+',\n", + " 'Games',\n", + " '43',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['767',\n", + " '413487517',\n", + " 'ナビタイム ドライブサポーター - NAVITIMEのカーナビアプリ',\n", + " '125665280',\n", + " 'USD',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '4.28.0',\n", + " '4+',\n", + " 'Navigation',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['768',\n", + " '413511993',\n", + " 'Weather Radio by WDT',\n", + " '22879232',\n", + " 'USD',\n", + " '4.99',\n", + " '1359',\n", + " '26',\n", + " '3',\n", + " '3',\n", + " '3.0.5',\n", + " '4+',\n", + " 'Weather',\n", + " '38',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['769',\n", + " '413515229',\n", + " 'Home Design 3D - 3D Printing Edition',\n", + " '210538496',\n", + " 'USD',\n", + " '6.99',\n", + " '6001',\n", + " '72',\n", + " '4.5',\n", + " '4.5',\n", + " '4.1.1',\n", + " '4+',\n", + " 'Productivity',\n", + " '37',\n", + " '5',\n", + " '16',\n", + " '1'],\n", + " ['770',\n", + " '413618155',\n", + " \"マクドナルド - McDonald's Japan\",\n", + " '61166592',\n", + " 'USD',\n", + " '0',\n", + " '10',\n", + " '0',\n", + " '3',\n", + " '0',\n", + " '4.0.12',\n", + " '4+',\n", + " 'Food & Drink',\n", + " '38',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['771',\n", + " '413936865',\n", + " 'SkyView® Free - Explore the Universe',\n", + " '87593984',\n", + " 'USD',\n", + " '0',\n", + " '4188',\n", + " '602',\n", + " '4.5',\n", + " '4.5',\n", + " '3.5.1',\n", + " '4+',\n", + " 'Education',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['772',\n", + " '413993350',\n", + " '搜房网房天下-新房二手房租房交易平台',\n", + " '156446720',\n", + " 'USD',\n", + " '0',\n", + " '89',\n", + " '0',\n", + " '4',\n", + " '0',\n", + " '8.4.3',\n", + " '4+',\n", + " 'Lifestyle',\n", + " '37',\n", + " '3',\n", + " '3',\n", + " '1'],\n", + " ['773',\n", + " '414002091',\n", + " 'WordFoto',\n", + " '5800960',\n", + " 'USD',\n", + " '1.99',\n", + " '513',\n", + " '10',\n", + " '4',\n", + " '3.5',\n", + " '1.1.1',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '38',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['774',\n", + " '414113282',\n", + " 'IRS2Go',\n", + " '10110976',\n", + " 'USD',\n", + " '0',\n", + " '1329',\n", + " '47',\n", + " '3',\n", + " '3',\n", + " '5.3.1',\n", + " '17+',\n", + " 'Finance',\n", + " '37',\n", + " '4',\n", + " '2',\n", + " '1'],\n", + " ['775',\n", + " '414245413',\n", + " '手机京东-首次购买可领取188元优惠券',\n", + " '242618368',\n", + " 'USD',\n", + " '0',\n", + " '361',\n", + " '4',\n", + " '3.5',\n", + " '1.5',\n", + " '6.1.0',\n", + " '17+',\n", + " 'Shopping',\n", + " '38',\n", + " '0',\n", + " '2',\n", + " '1'],\n", + " ['776',\n", + " '414430589',\n", + " '搜狐视频HD-欢乐颂2 全网首播',\n", + " '79696896',\n", + " 'USD',\n", + " '0',\n", + " '3768',\n", + " '5',\n", + " '4',\n", + " '3',\n", + " '6.6',\n", + " '17+',\n", + " 'Entertainment',\n", + " '24',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['777',\n", + " '414478124',\n", + " 'WeChat',\n", + " '182624256',\n", + " 'USD',\n", + " '0',\n", + " '34584',\n", + " '100',\n", + " '4.5',\n", + " '4',\n", + " '6.5.8',\n", + " '12+',\n", + " 'Social Networking',\n", + " '38',\n", + " '4',\n", + " '21',\n", + " '1'],\n", + " ['778',\n", + " '414603431',\n", + " 'QQ音乐-来这里“发现・音乐”',\n", + " '154551296',\n", + " 'USD',\n", + " '0',\n", + " '745',\n", + " '7',\n", + " '3.5',\n", + " '5',\n", + " '7.5',\n", + " '4+',\n", + " 'Music',\n", + " '37',\n", + " '0',\n", + " '3',\n", + " '1'],\n", + " ['779',\n", + " '414706506',\n", + " 'Google Translate',\n", + " '65281024',\n", + " 'USD',\n", + " '0',\n", + " '26786',\n", + " '27',\n", + " '3.5',\n", + " '4.5',\n", + " '5.10.0',\n", + " '4+',\n", + " 'Reference',\n", + " '37',\n", + " '5',\n", + " '59',\n", + " '1'],\n", + " ['780',\n", + " '414834813',\n", + " 'Pocket Casts',\n", + " '48323584',\n", + " 'USD',\n", + " '3.99',\n", + " '1911',\n", + " '39',\n", + " '4',\n", + " '4.5',\n", + " '6.7.1',\n", + " '9+',\n", + " 'News',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['781',\n", + " '414835676',\n", + " 'The Lost City',\n", + " '106427392',\n", + " 'USD',\n", + " '1.99',\n", + " '1393',\n", + " '33',\n", + " '4.5',\n", + " '4.5',\n", + " '1.09',\n", + " '4+',\n", + " 'Games',\n", + " '40',\n", + " '5',\n", + " '16',\n", + " '1'],\n", + " ['782',\n", + " '415069562',\n", + " 'Tasty Planet',\n", + " '22515712',\n", + " 'USD',\n", + " '2.99',\n", + " '430',\n", + " '35',\n", + " '4.5',\n", + " '4.5',\n", + " '1.6',\n", + " '9+',\n", + " 'Games',\n", + " '43',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['783',\n", + " '415138546',\n", + " 'Feed the Head',\n", + " '18358272',\n", + " 'USD',\n", + " '1.99',\n", + " '193',\n", + " '40',\n", + " '4.5',\n", + " '4',\n", + " '2.1',\n", + " '4+',\n", + " 'Games',\n", + " '38',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['786',\n", + " '415468221',\n", + " 'ContactsBook -AddressBook Organizer',\n", + " '7100416',\n", + " 'USD',\n", + " '0.99',\n", + " '7',\n", + " '1',\n", + " '4.5',\n", + " '4',\n", + " '1.15.1',\n", + " '4+',\n", + " 'Utilities',\n", + " '37',\n", + " '0',\n", + " '2',\n", + " '1'],\n", + " ['787',\n", + " '415606289',\n", + " '安居客-二手房、新房、租房的找房助手',\n", + " '107184128',\n", + " 'USD',\n", + " '0',\n", + " '84',\n", + " '0',\n", + " '4.5',\n", + " '0',\n", + " '10.7',\n", + " '4+',\n", + " 'Lifestyle',\n", + " '37',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['788',\n", + " '415842508',\n", + " '汽车之家-提供新车,二手车报价及资讯',\n", + " '54815744',\n", + " 'USD',\n", + " '0',\n", + " '116',\n", + " '3',\n", + " '4',\n", + " '5',\n", + " '3.8.5',\n", + " '17+',\n", + " 'Lifestyle',\n", + " '24',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['789',\n", + " '415850124',\n", + " 'PhotoSync – transfer and backup photos & videos',\n", + " '65495040',\n", + " 'USD',\n", + " '2.99',\n", + " '4352',\n", + " '33',\n", + " '4.5',\n", + " '5',\n", + " '3.2',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '37',\n", + " '5',\n", + " '8',\n", + " '1'],\n", + " ['791',\n", + " '416023011',\n", + " 'My Verizon',\n", + " '150791168',\n", + " 'USD',\n", + " '0',\n", + " '126948',\n", + " '107245',\n", + " '4.5',\n", + " '4.5',\n", + " '5.10.0',\n", + " '4+',\n", + " 'Utilities',\n", + " '37',\n", + " '3',\n", + " '2',\n", + " '1'],\n", + " ['792',\n", + " '416048305',\n", + " 'Meitu',\n", + " '142101504',\n", + " 'USD',\n", + " '0',\n", + " '6478',\n", + " '21',\n", + " '5',\n", + " '5',\n", + " '6.7.0',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '37',\n", + " '0',\n", + " '5',\n", + " '1'],\n", + " ['793',\n", + " '416345444',\n", + " 'Talking Ben the Dog for iPad',\n", + " '78565376',\n", + " 'USD',\n", + " '0',\n", + " '31116',\n", + " '77',\n", + " '4',\n", + " '4.5',\n", + " '3.4.1',\n", + " '4+',\n", + " 'Entertainment',\n", + " '24',\n", + " '5',\n", + " '13',\n", + " '1'],\n", + " ['794',\n", + " '416457422',\n", + " '中国联通手机营业厅客户端(官方版)',\n", + " '78774272',\n", + " 'USD',\n", + " '0',\n", + " '248',\n", + " '1',\n", + " '3',\n", + " '1',\n", + " '5.3',\n", + " '4+',\n", + " 'Utilities',\n", + " '38',\n", + " '0',\n", + " '2',\n", + " '1'],\n", + " ['796',\n", + " '416981420',\n", + " 'Bodyweight Training: You Are Your Own Gym',\n", + " '425657344',\n", + " 'USD',\n", + " '4.99',\n", + " '3326',\n", + " '289',\n", + " '5',\n", + " '5',\n", + " '4.5.3',\n", + " '9+',\n", + " 'Health & Fitness',\n", + " '38',\n", + " '5',\n", + " '5',\n", + " '1'],\n", + " ['797',\n", + " '417200582',\n", + " '唯品会-欢乐颂2独家电商 同款热卖',\n", + " '160313344',\n", + " 'USD',\n", + " '0',\n", + " '100',\n", + " '0',\n", + " '4.5',\n", + " '0',\n", + " '6.1.2',\n", + " '12+',\n", + " 'Shopping',\n", + " '38',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['798',\n", + " '417352269',\n", + " 'GMX Mail',\n", + " '100336640',\n", + " 'USD',\n", + " '0',\n", + " '102',\n", + " '1',\n", + " '4.5',\n", + " '5',\n", + " '6.2',\n", + " '4+',\n", + " 'Productivity',\n", + " '37',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['799',\n", + " '417373312',\n", + " 'Talking Carl',\n", + " '64342016',\n", + " 'USD',\n", + " '0.99',\n", + " '3662',\n", + " '37',\n", + " '4.5',\n", + " '4',\n", + " '9.0',\n", + " '4+',\n", + " 'Entertainment',\n", + " '37',\n", + " '5',\n", + " '8',\n", + " '1'],\n", + " ['800',\n", + " '417817520',\n", + " 'Tiny Wings',\n", + " '30252032',\n", + " 'USD',\n", + " '0.99',\n", + " '219418',\n", + " '328',\n", + " '4.5',\n", + " '4.5',\n", + " '2.2',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '0',\n", + " '6',\n", + " '1'],\n", + " ['801',\n", + " '417906074',\n", + " 'NOAA Weather Alerts - Severe Weather Push Notifications & Warnings',\n", + " '10514432',\n", + " 'USD',\n", + " '3.99',\n", + " '2293',\n", + " '399',\n", + " '4.5',\n", + " '4',\n", + " '4.2',\n", + " '4+',\n", + " 'Weather',\n", + " '40',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['802',\n", + " '418075935',\n", + " 'Bleacher Report: Sports news, scores, & highlights',\n", + " '85283840',\n", + " 'USD',\n", + " '0',\n", + " '16979',\n", + " '183',\n", + " '4.5',\n", + " '4',\n", + " '5.1',\n", + " '12+',\n", + " 'Sports',\n", + " '37',\n", + " '0',\n", + " '8',\n", + " '1'],\n", + " ['803',\n", + " '418987775',\n", + " 'TuneIn Radio - MLB NBA Audiobooks Podcasts Music',\n", + " '101735424',\n", + " 'USD',\n", + " '0',\n", + " '110420',\n", + " '370',\n", + " '4.5',\n", + " '4.5',\n", + " '11.9',\n", + " '12+',\n", + " 'Music',\n", + " '37',\n", + " '4',\n", + " '14',\n", + " '1'],\n", + " ['804',\n", + " '419135449',\n", + " 'iTheme - Themes for iPhone and iPad',\n", + " '52618240',\n", + " 'USD',\n", + " '1.99',\n", + " '4719',\n", + " '61',\n", + " '4',\n", + " '4.5',\n", + " '5.1',\n", + " '4+',\n", + " 'Lifestyle',\n", + " '37',\n", + " '5',\n", + " '23',\n", + " '1'],\n", + " ['805',\n", + " '419261235',\n", + " 'Bitauto Autoprice',\n", + " '79730688',\n", + " 'USD',\n", + " '0',\n", + " '157',\n", + " '0',\n", + " '5',\n", + " '0',\n", + " '7.6',\n", + " '17+',\n", + " 'Utilities',\n", + " '38',\n", + " '0',\n", + " '3',\n", + " '1'],\n", + " ['807',\n", + " '419411014',\n", + " 'Math Fact Master: Addition, Subtraction, Multiplication, and Division',\n", + " '8029184',\n", + " 'USD',\n", + " '0.99',\n", + " '1537',\n", + " '159',\n", + " '4.5',\n", + " '4',\n", + " '5.0',\n", + " '4+',\n", + " 'Education',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['808',\n", + " '419724490',\n", + " 'Lieferando.de',\n", + " '31544320',\n", + " 'USD',\n", + " '0',\n", + " '29',\n", + " '1',\n", + " '3.5',\n", + " '5',\n", + " '3.6.9',\n", + " '4+',\n", + " 'Food & Drink',\n", + " '38',\n", + " '0',\n", + " '2',\n", + " '1'],\n", + " ['809',\n", + " '419805549',\n", + " '万年历-值得信赖的日历黄历查询工具',\n", + " '112928768',\n", + " 'USD',\n", + " '0',\n", + " '2270',\n", + " '4',\n", + " '4.5',\n", + " '5',\n", + " '4.5.6',\n", + " '12+',\n", + " 'Utilities',\n", + " '38',\n", + " '4',\n", + " '3',\n", + " '1'],\n", + " ['810',\n", + " '420009108',\n", + " 'Temple Run',\n", + " '65921024',\n", + " 'USD',\n", + " '0',\n", + " '1724546',\n", + " '3842',\n", + " '4.5',\n", + " '4',\n", + " '1.6.2',\n", + " '9+',\n", + " 'Games',\n", + " '40',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['811',\n", + " '420635506',\n", + " 'Angry Birds Rio',\n", + " '138319872',\n", + " 'USD',\n", + " '0',\n", + " '170843',\n", + " '123',\n", + " '4.5',\n", + " '4',\n", + " '2.6.6',\n", + " '4+',\n", + " 'Games',\n", + " '40',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['812',\n", + " '420636551',\n", + " 'Angry Birds Rio HD',\n", + " '226899968',\n", + " 'USD',\n", + " '0',\n", + " '70122',\n", + " '251',\n", + " '4.5',\n", + " '4',\n", + " '2.6.6',\n", + " '4+',\n", + " 'Games',\n", + " '24',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['813',\n", + " '420859056',\n", + " \"My Baby's Beat - Prenatal Listener\",\n", + " '70041600',\n", + " 'USD',\n", + " '4.99',\n", + " '1887',\n", + " '75',\n", + " '3',\n", + " '3.5',\n", + " '3.08',\n", + " '4+',\n", + " 'Lifestyle',\n", + " '37',\n", + " '4',\n", + " '4',\n", + " '1'],\n", + " ['814',\n", + " '421167112',\n", + " 'My Horse',\n", + " '301896704',\n", + " 'USD',\n", + " '0',\n", + " '293857',\n", + " '249',\n", + " '4.5',\n", + " '4',\n", + " '1.30.0',\n", + " '4+',\n", + " 'Games',\n", + " '40',\n", + " '5',\n", + " '8',\n", + " '1'],\n", + " ['815',\n", + " '421168738',\n", + " 'iStatVball 2 iPad Edition',\n", + " '15154176',\n", + " 'USD',\n", + " '19.99',\n", + " '193',\n", + " '0',\n", + " '4.5',\n", + " '0',\n", + " '2.18.2',\n", + " '4+',\n", + " 'Sports',\n", + " '24',\n", + " '4',\n", + " '1',\n", + " '1'],\n", + " ['816',\n", + " '421254504',\n", + " 'Magic Piano by Smule',\n", + " '55030784',\n", + " 'USD',\n", + " '0',\n", + " '131695',\n", + " '1102',\n", + " '4.5',\n", + " '4',\n", + " '8.3.1',\n", + " '4+',\n", + " 'Music',\n", + " '37',\n", + " '5',\n", + " '12',\n", + " '1'],\n", + " ['817',\n", + " '421547368',\n", + " 'DIRECTV App for iPad',\n", + " '209462272',\n", + " 'USD',\n", + " '0',\n", + " '47506',\n", + " '30',\n", + " '3.5',\n", + " '4',\n", + " '4.9.705',\n", + " '4+',\n", + " 'Entertainment',\n", + " '24',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['819',\n", + " '421894356',\n", + " 'PodCruncher podcast app - Player and manager for podcasts',\n", + " '6615040',\n", + " 'USD',\n", + " '2.99',\n", + " '2261',\n", + " '689',\n", + " '4.5',\n", + " '4',\n", + " '3.2',\n", + " '4+',\n", + " 'News',\n", + " '38',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['820',\n", + " '421988577',\n", + " 'Shell Shock 1.5',\n", + " '46864078',\n", + " 'USD',\n", + " '0.99',\n", + " '26',\n", + " '26',\n", + " '3',\n", + " '3',\n", + " '1.5',\n", + " '4+',\n", + " 'Games',\n", + " '26',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['821',\n", + " '421998342',\n", + " 'Talking Tom Cat 2 for iPad',\n", + " '73111552',\n", + " 'USD',\n", + " '0',\n", + " '56399',\n", + " '98',\n", + " '4',\n", + " '4',\n", + " '5.2.2',\n", + " '4+',\n", + " 'Entertainment',\n", + " '24',\n", + " '5',\n", + " '13',\n", + " '1'],\n", + " ['822',\n", + " '422366403',\n", + " 'MTV',\n", + " '113787904',\n", + " 'USD',\n", + " '0',\n", + " '5987',\n", + " '97',\n", + " '2.5',\n", + " '2',\n", + " '4.0.0',\n", + " '12+',\n", + " 'Entertainment',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['823',\n", + " '422667065',\n", + " 'Tiny Tower - Free City Building',\n", + " '124720128',\n", + " 'USD',\n", + " '0',\n", + " '414803',\n", + " '4536',\n", + " '4.5',\n", + " '4.5',\n", + " '3.3.12',\n", + " '12+',\n", + " 'Games',\n", + " '38',\n", + " '4',\n", + " '1',\n", + " '1'],\n", + " ['824',\n", + " '422689480',\n", + " 'Gmail - email by Google: secure, fast & organized',\n", + " '236067840',\n", + " 'USD',\n", + " '0',\n", + " '135962',\n", + " '677',\n", + " '4',\n", + " '4.5',\n", + " '5.0.170507',\n", + " '4+',\n", + " 'Productivity',\n", + " '37',\n", + " '5',\n", + " '56',\n", + " '1'],\n", + " ['825',\n", + " '422845617',\n", + " 'OneCam',\n", + " '4324352',\n", + " 'USD',\n", + " '1.99',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '5.7.0',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '37',\n", + " '0',\n", + " '2',\n", + " '1'],\n", + " ['826',\n", + " '423084029',\n", + " '美团 - 吃喝玩乐全都有',\n", + " '224955392',\n", + " 'USD',\n", + " '0',\n", + " '549',\n", + " '2',\n", + " '4.5',\n", + " '5',\n", + " '8.1.0',\n", + " '4+',\n", + " 'Lifestyle',\n", + " '37',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['828',\n", + " '423198259',\n", + " 'Chess Pro - with coach',\n", + " '43033600',\n", + " 'USD',\n", + " '9.99',\n", + " '10619',\n", + " '893',\n", + " '5',\n", + " '5',\n", + " '2017.01',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '3',\n", + " '1'],\n", + " ['829',\n", + " '423246594',\n", + " \"NCAA March Madness Live - Men's College Basketball\",\n", + " '113078272',\n", + " 'USD',\n", + " '0',\n", + " '13572',\n", + " '55',\n", + " '3',\n", + " '2.5',\n", + " '7.0.4',\n", + " '4+',\n", + " 'Sports',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['830',\n", + " '423443665',\n", + " 'Catholic New American Bible Revised Edition',\n", + " '60426240',\n", + " 'USD',\n", + " '2.99',\n", + " '149',\n", + " '0',\n", + " '3.5',\n", + " '0',\n", + " '7.5',\n", + " '4+',\n", + " 'Reference',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['831',\n", + " '423492040',\n", + " 'Planimeter - Measure Land Area and Distance on a Map',\n", + " '14495744',\n", + " 'USD',\n", + " '7.99',\n", + " '249',\n", + " '83',\n", + " '4.5',\n", + " '4',\n", + " '3.5',\n", + " '4+',\n", + " 'Productivity',\n", + " '38',\n", + " '5',\n", + " '6',\n", + " '1'],\n", + " ['832',\n", + " '423514795',\n", + " '中国工商银行',\n", + " '86083584',\n", + " 'USD',\n", + " '0',\n", + " '152',\n", + " '0',\n", + " '2.5',\n", + " '0',\n", + " '3.0.0.7.1',\n", + " '12+',\n", + " 'Finance',\n", + " '38',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['833',\n", + " '423855879',\n", + " 'Bumpy Road',\n", + " '30275615',\n", + " 'USD',\n", + " '2.99',\n", + " '1073',\n", + " '186',\n", + " '4',\n", + " '4',\n", + " '2.2',\n", + " '4+',\n", + " 'Games',\n", + " '43',\n", + " '5',\n", + " '6',\n", + " '1'],\n", + " ['835',\n", + " '424123969',\n", + " 'Dude Perfect',\n", + " '140165120',\n", + " 'USD',\n", + " '0.99',\n", + " '9763',\n", + " '1556',\n", + " '4.5',\n", + " '4.5',\n", + " '1.1.5',\n", + " '4+',\n", + " 'Games',\n", + " '43',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['836',\n", + " '424216726',\n", + " 'Countdown‼ (Event Reminders and Timer)',\n", + " '81287168',\n", + " 'USD',\n", + " '0',\n", + " '60490',\n", + " '1102',\n", + " '4',\n", + " '4',\n", + " '4.2.5',\n", + " '4+',\n", + " 'Lifestyle',\n", + " '37',\n", + " '1',\n", + " '22',\n", + " '1'],\n", + " ['837',\n", + " '424229589',\n", + " 'Dude Perfect HD',\n", + " '139853824',\n", + " 'USD',\n", + " '1.99',\n", + " '2552',\n", + " '1041',\n", + " '4.5',\n", + " '4.5',\n", + " '1.1.5',\n", + " '4+',\n", + " 'Games',\n", + " '26',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['838',\n", + " '424591347',\n", + " 'FINAL FANTASY III',\n", + " '290695168',\n", + " 'USD',\n", + " '14.99',\n", + " '1378',\n", + " '17',\n", + " '4.5',\n", + " '3.5',\n", + " '1.7.5',\n", + " '9+',\n", + " 'Games',\n", + " '40',\n", + " '0',\n", + " '8',\n", + " '1'],\n", + " ['839',\n", + " '424598114',\n", + " '苏宁易购-新人专享大礼包',\n", + " '185606144',\n", + " 'USD',\n", + " '0',\n", + " '38',\n", + " '0',\n", + " '3',\n", + " '0',\n", + " '5.2.5',\n", + " '17+',\n", + " 'Shopping',\n", + " '38',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['840',\n", + " '424881832',\n", + " 'SPIEGEL ONLINE - Nachrichten',\n", + " '31635456',\n", + " 'USD',\n", + " '0',\n", + " '299',\n", + " '29',\n", + " '4.5',\n", + " '5',\n", + " '3.1.5',\n", + " '12+',\n", + " 'News',\n", + " '37',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['841',\n", + " '424912055',\n", + " 'Superbrothers: Sword & Sworcery EP',\n", + " '212580352',\n", + " 'USD',\n", + " '3.99',\n", + " '5362',\n", + " '68',\n", + " '4.5',\n", + " '4',\n", + " '1.16',\n", + " '12+',\n", + " 'Games',\n", + " '37',\n", + " '3',\n", + " '2',\n", + " '1'],\n", + " ['842',\n", + " '425073498',\n", + " 'Procreate – Sketch, paint, create.',\n", + " '132968448',\n", + " 'USD',\n", + " '5.99',\n", + " '6109',\n", + " '356',\n", + " '4.5',\n", + " '4.5',\n", + " '3.2.1',\n", + " '4+',\n", + " 'Entertainment',\n", + " '24',\n", + " '5',\n", + " '13',\n", + " '1'],\n", + " ['843',\n", + " '425349261',\n", + " '网易新闻 - 精选好内容,算出你的兴趣',\n", + " '133134336',\n", + " 'USD',\n", + " '0',\n", + " '4263',\n", + " '6',\n", + " '4.5',\n", + " '1',\n", + " '23.2',\n", + " '17+',\n", + " 'News',\n", + " '37',\n", + " '4',\n", + " '2',\n", + " '1'],\n", + " ['845',\n", + " '425996445',\n", + " 'Tiny Planet Photos and Video',\n", + " '84909056',\n", + " 'USD',\n", + " '0.99',\n", + " '714',\n", + " '8',\n", + " '4',\n", + " '4',\n", + " '6.3.0',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '37',\n", + " '5',\n", + " '7',\n", + " '1'],\n", + " ['846',\n", + " '426072035',\n", + " 'Touchgrind BMX',\n", + " '194308096',\n", + " 'USD',\n", + " '4.99',\n", + " '3170',\n", + " '4',\n", + " '4',\n", + " '3',\n", + " '1.6.1',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '9',\n", + " '1'],\n", + " ['847',\n", + " '426097375',\n", + " 'QQ浏览器HD-极速搜索浏览器',\n", + " '82982912',\n", + " 'USD',\n", + " '0',\n", + " '936',\n", + " '4',\n", + " '4',\n", + " '4',\n", + " '5.8.2',\n", + " '17+',\n", + " 'Utilities',\n", + " '24',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['848',\n", + " '426170776',\n", + " 'QR Reader for iPad',\n", + " '55071744',\n", + " 'USD',\n", + " '0',\n", + " '1341',\n", + " '63',\n", + " '4',\n", + " '4',\n", + " '4.0',\n", + " '9+',\n", + " 'Utilities',\n", + " '24',\n", + " '5',\n", + " '29',\n", + " '1'],\n", + " ['849',\n", + " '426282304',\n", + " 'NBA JAM by EA SPORTS™ for iPad',\n", + " '415420416',\n", + " 'USD',\n", + " '4.99',\n", + " '4934',\n", + " '164',\n", + " '4',\n", + " '4',\n", + " '1.1.36',\n", + " '4+',\n", + " 'Games',\n", + " '24',\n", + " '5',\n", + " '8',\n", + " '1'],\n", + " ['850',\n", + " '426382105',\n", + " 'Toca Hair Salon',\n", + " '51366912',\n", + " 'USD',\n", + " '2.99',\n", + " '9649',\n", + " '29',\n", + " '4',\n", + " '3.5',\n", + " '1.2.7',\n", + " '4+',\n", + " 'Education',\n", + " '40',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['851',\n", + " '426414466',\n", + " 'Showroomprive - Private Fashion Sales',\n", + " '31230976',\n", + " 'USD',\n", + " '0',\n", + " '11',\n", + " '0',\n", + " '4',\n", + " '0',\n", + " '8.4',\n", + " '12+',\n", + " 'Shopping',\n", + " '37',\n", + " '5',\n", + " '8',\n", + " '1'],\n", + " ['852',\n", + " '426415634',\n", + " 'Bloons TD 4 HD',\n", + " '164235264',\n", + " 'USD',\n", + " '2.99',\n", + " '2493',\n", + " '13',\n", + " '4',\n", + " '4',\n", + " '3.0.4',\n", + " '4+',\n", + " 'Games',\n", + " '24',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['854',\n", + " '426747278',\n", + " 'Elmo Loves ABCs for iPad',\n", + " '742145024',\n", + " 'USD',\n", + " '4.99',\n", + " '1888',\n", + " '26',\n", + " '3.5',\n", + " '3.5',\n", + " '3.5.4',\n", + " '4+',\n", + " 'Games',\n", + " '24',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['855',\n", + " '427419772',\n", + " 'Forbidden Island',\n", + " '149715968',\n", + " 'USD',\n", + " '4.99',\n", + " '923',\n", + " '48',\n", + " '4.5',\n", + " '4',\n", + " '2.10',\n", + " '9+',\n", + " 'Games',\n", + " '24',\n", + " '5',\n", + " '12',\n", + " '1'],\n", + " ['856',\n", + " '427457043',\n", + " '1号店-全球超市 轻松到家',\n", + " '80944128',\n", + " 'USD',\n", + " '0',\n", + " '65',\n", + " '1',\n", + " '3.5',\n", + " '1',\n", + " '5.0.0',\n", + " '17+',\n", + " 'Shopping',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['857',\n", + " '427555239',\n", + " '易到 - 低价专车,高品质出行',\n", + " '74724352',\n", + " 'USD',\n", + " '0',\n", + " '115',\n", + " '1',\n", + " '2',\n", + " '1',\n", + " '8.0.1',\n", + " '4+',\n", + " 'Travel',\n", + " '37',\n", + " '0',\n", + " '2',\n", + " '1'],\n", + " ['858',\n", + " '427916203',\n", + " 'Expedia Hotels, Flights & Vacation Package Deals',\n", + " '125872128',\n", + " 'USD',\n", + " '0',\n", + " '10278',\n", + " '112',\n", + " '3.5',\n", + " '4.5',\n", + " '17.21',\n", + " '4+',\n", + " 'Travel',\n", + " '37',\n", + " '5',\n", + " '19',\n", + " '1'],\n", + " ['859',\n", + " '427941017',\n", + " 'YY- 小全民手机直播交友软件',\n", + " '165367808',\n", + " 'USD',\n", + " '0',\n", + " '624',\n", + " '4',\n", + " '4',\n", + " '5',\n", + " '6.3.8',\n", + " '17+',\n", + " 'Social Networking',\n", + " '37',\n", + " '0',\n", + " '2',\n", + " '1'],\n", + " ['860',\n", + " '428845974',\n", + " 'ooVoo – Free Video Call, Text and Voice',\n", + " '113510400',\n", + " 'USD',\n", + " '0',\n", + " '177501',\n", + " '1014',\n", + " '4.5',\n", + " '4.5',\n", + " '3.1.6',\n", + " '4+',\n", + " 'Social Networking',\n", + " '37',\n", + " '5',\n", + " '21',\n", + " '1'],\n", + " ['861',\n", + " '428970841',\n", + " 'Virtual Villagers 4: The Tree of Life',\n", + " '36686604',\n", + " 'USD',\n", + " '0.99',\n", + " '500',\n", + " '479',\n", + " '4',\n", + " '4',\n", + " '1.0.1',\n", + " '9+',\n", + " 'Games',\n", + " '47',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['862',\n", + " '429009175',\n", + " 'WatchESPN',\n", + " '33714176',\n", + " 'USD',\n", + " '0',\n", + " '159735',\n", + " '2556',\n", + " '4',\n", + " '4.5',\n", + " '1.9.9',\n", + " '4+',\n", + " 'Sports',\n", + " '37',\n", + " '2',\n", + " '1',\n", + " '1'],\n", + " ['863',\n", + " '429047995',\n", + " 'Pinterest',\n", + " '74778624',\n", + " 'USD',\n", + " '0',\n", + " '1061624',\n", + " '1814',\n", + " '4.5',\n", + " '4',\n", + " '6.26',\n", + " '12+',\n", + " 'Social Networking',\n", + " '37',\n", + " '5',\n", + " '27',\n", + " '1'],\n", + " ['864',\n", + " '429610587',\n", + " 'iFunny :)',\n", + " '66599936',\n", + " 'USD',\n", + " '0',\n", + " '98344',\n", + " '877',\n", + " '3.5',\n", + " '4.5',\n", + " '4.6.8',\n", + " '17+',\n", + " 'Entertainment',\n", + " '37',\n", + " '2',\n", + " '2',\n", + " '1'],\n", + " ['866',\n", + " '429775439',\n", + " 'HBO GO',\n", + " '41109504',\n", + " 'USD',\n", + " '0',\n", + " '26278',\n", + " '9',\n", + " '3',\n", + " '3',\n", + " '10.1.0',\n", + " '17+',\n", + " 'Entertainment',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['867',\n", + " '429851711',\n", + " 'Flashlight !',\n", + " '14336000',\n", + " 'USD',\n", + " '0',\n", + " '35769',\n", + " '21',\n", + " '4.5',\n", + " '2',\n", + " '2.6',\n", + " '4+',\n", + " 'Utilities',\n", + " '37',\n", + " '1',\n", + " '1',\n", + " '1'],\n", + " ['868',\n", + " '429870273',\n", + " 'DEATHSMILES',\n", + " '519446528',\n", + " 'USD',\n", + " '9.99',\n", + " '540',\n", + " '48',\n", + " '4.5',\n", + " '5',\n", + " '1.0.19',\n", + " '12+',\n", + " 'Games',\n", + " '43',\n", + " '0',\n", + " '2',\n", + " '1'],\n", + " ['869',\n", + " '429885089',\n", + " 'QQ音乐HD',\n", + " '139457536',\n", + " 'USD',\n", + " '0',\n", + " '224',\n", + " '4',\n", + " '3.5',\n", + " '5',\n", + " '5.3.1',\n", + " '4+',\n", + " 'Music',\n", + " '24',\n", + " '5',\n", + " '3',\n", + " '1'],\n", + " ['870',\n", + " '430152294',\n", + " 'Talking Pierre the Parrot for iPad',\n", + " '60313600',\n", + " 'USD',\n", + " '0',\n", + " '11665',\n", + " '364',\n", + " '4',\n", + " '4.5',\n", + " '3.3.1',\n", + " '4+',\n", + " 'Entertainment',\n", + " '24',\n", + " '5',\n", + " '13',\n", + " '1'],\n", + " ['871',\n", + " '430200224',\n", + " 'Photon Flash Player for iPad - Flash Video & Games plus Private Web Browser',\n", + " '35695616',\n", + " 'USD',\n", + " '4.99',\n", + " '20951',\n", + " '935',\n", + " '4',\n", + " '4',\n", + " '6.2',\n", + " '17+',\n", + " 'Utilities',\n", + " '26',\n", + " '5',\n", + " '10',\n", + " '1'],\n", + " ['872',\n", + " '430229059',\n", + " 'Rota Calendar - Work Shift Manager',\n", + " '1824768',\n", + " 'USD',\n", + " '1.99',\n", + " '43',\n", + " '24',\n", + " '4.5',\n", + " '4.5',\n", + " '7.3',\n", + " '4+',\n", + " 'Productivity',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['873',\n", + " '430234732',\n", + " 'Site Audit Pro',\n", + " '54476800',\n", + " 'USD',\n", + " '16.99',\n", + " '125',\n", + " '3',\n", + " '4',\n", + " '4.5',\n", + " '5.7.6',\n", + " '4+',\n", + " 'Productivity',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['874',\n", + " '430616332',\n", + " \"It's Tyrannosaurus Rex - Smithsonian Institution\",\n", + " '29496320',\n", + " 'USD',\n", + " '1.99',\n", + " '92',\n", + " '1',\n", + " '4.5',\n", + " '5',\n", + " '2.6.1',\n", + " '4+',\n", + " 'Book',\n", + " '37',\n", + " '4',\n", + " '1',\n", + " '1'],\n", + " ['875',\n", + " '430823968',\n", + " 'FINAL FANTASY III for iPad',\n", + " '283656192',\n", + " 'USD',\n", + " '16.99',\n", + " '857',\n", + " '14',\n", + " '4',\n", + " '4',\n", + " '1.6.4',\n", + " '9+',\n", + " 'Games',\n", + " '24',\n", + " '5',\n", + " '8',\n", + " '1'],\n", + " ['876',\n", + " '430856616',\n", + " 'True Red Eye Remover HD-Face Recovery',\n", + " '4511744',\n", + " 'USD',\n", + " '0.99',\n", + " '528',\n", + " '379',\n", + " '4',\n", + " '4',\n", + " '2.9',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '40',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['877',\n", + " '430920838',\n", + " 'Tikal',\n", + " '27049083',\n", + " 'USD',\n", + " '2.99',\n", + " '626',\n", + " '435',\n", + " '4.5',\n", + " '4.5',\n", + " '1.2',\n", + " '4+',\n", + " 'Games',\n", + " '47',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['878',\n", + " '431023686',\n", + " '美丽说-潮流穿搭快人一步',\n", + " '143117312',\n", + " 'USD',\n", + " '0',\n", + " '1026',\n", + " '0',\n", + " '4.5',\n", + " '0',\n", + " '9.1.0',\n", + " '17+',\n", + " 'Shopping',\n", + " '37',\n", + " '0',\n", + " '4',\n", + " '1'],\n", + " ['879',\n", + " '431033044',\n", + " 'Phone Drive - File Manager, Browser & Explorer',\n", + " '19738624',\n", + " 'USD',\n", + " '1.99',\n", + " '1403',\n", + " '121',\n", + " '4.5',\n", + " '4.5',\n", + " '6.3.9',\n", + " '17+',\n", + " 'Utilities',\n", + " '38',\n", + " '5',\n", + " '15',\n", + " '1'],\n", + " ['880',\n", + " '431065024',\n", + " 'Fake Location',\n", + " '6228992',\n", + " 'USD',\n", + " '0.99',\n", + " '117',\n", + " '7',\n", + " '1',\n", + " '1',\n", + " '3.1',\n", + " '4+',\n", + " 'Social Networking',\n", + " '37',\n", + " '5',\n", + " '13',\n", + " '1'],\n", + " ['881',\n", + " '431229633',\n", + " 'Summer Games 3D',\n", + " '99463168',\n", + " 'USD',\n", + " '0.99',\n", + " '193',\n", + " '1',\n", + " '3.5',\n", + " '4',\n", + " '2.3',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['882',\n", + " '431493086',\n", + " 'Classic Explain Everything™',\n", + " '123312128',\n", + " 'USD',\n", + " '7.99',\n", + " '896',\n", + " '0',\n", + " '4',\n", + " '0',\n", + " '3.46',\n", + " '4+',\n", + " 'Education',\n", + " '37',\n", + " '5',\n", + " '17',\n", + " '1'],\n", + " ['883',\n", + " '431865275',\n", + " 'The JMU Bus App',\n", + " '4427776',\n", + " 'USD',\n", + " '2.99',\n", + " '35',\n", + " '0',\n", + " '3',\n", + " '0',\n", + " '3.1.2',\n", + " '4+',\n", + " 'Navigation',\n", + " '38',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['884',\n", + " '431946152',\n", + " 'ROBLOX',\n", + " '115178496',\n", + " 'USD',\n", + " '0',\n", + " '183621',\n", + " '300',\n", + " '4.5',\n", + " '4.5',\n", + " '2.293.126451',\n", + " '12+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['885',\n", + " '432080204',\n", + " 'Pocket Academy',\n", + " '192954368',\n", + " 'USD',\n", + " '4.99',\n", + " '616',\n", + " '12',\n", + " '4.5',\n", + " '4',\n", + " '2.01',\n", + " '4+',\n", + " 'Games',\n", + " '38',\n", + " '5',\n", + " '5',\n", + " '1'],\n", + " ['886',\n", + " '432274380',\n", + " '知乎',\n", + " '149436416',\n", + " 'USD',\n", + " '0',\n", + " '397',\n", + " '0',\n", + " '3',\n", + " '0',\n", + " '3.52.1',\n", + " '17+',\n", + " 'Social Networking',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['887',\n", + " '432278816',\n", + " 'プチ・ロワイヤル仏和辞典(第4版)・和仏辞典(第3版)',\n", + " '205664256',\n", + " 'USD',\n", + " '47.99',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '2.4',\n", + " '9+',\n", + " 'Reference',\n", + " '37',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['888',\n", + " '432455516',\n", + " 'Round1 お得なクーポン毎週配信!',\n", + " '5999616',\n", + " 'USD',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '3.9',\n", + " '17+',\n", + " 'Sports',\n", + " '40',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['890',\n", + " '432504470',\n", + " 'Ticket to Ride',\n", + " '345904128',\n", + " 'USD',\n", + " '2.99',\n", + " '4866',\n", + " '64',\n", + " '4.5',\n", + " '3',\n", + " '2.4.1',\n", + " '4+',\n", + " 'Games',\n", + " '40',\n", + " '5',\n", + " '3',\n", + " '1'],\n", + " ['892',\n", + " '432749907',\n", + " 'Dice With Buddies: Fun New Social Dice Game',\n", + " '409732096',\n", + " 'USD',\n", + " '2.99',\n", + " '20355',\n", + " '23',\n", + " '4.5',\n", + " '4.5',\n", + " '4.30.5',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['893',\n", + " '432771571',\n", + " 'Money Origami - Learn How to Fold Money',\n", + " '15350784',\n", + " 'USD',\n", + " '1.99',\n", + " '6',\n", + " '0',\n", + " '3.5',\n", + " '0',\n", + " '4.1.0',\n", + " '4+',\n", + " 'Reference',\n", + " '37',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['894',\n", + " '432791399',\n", + " 'Cloud Baby Monitor ~ Video, Audio, Unlimited Range',\n", + " '62913536',\n", + " 'USD',\n", + " '3.99',\n", + " '1855',\n", + " '131',\n", + " '4.5',\n", + " '4.5',\n", + " '4.0.2',\n", + " '4+',\n", + " 'Lifestyle',\n", + " '38',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['895',\n", + " '432849519',\n", + " 'STREET FIGHTER IV VOLT',\n", + " '947195904',\n", + " 'USD',\n", + " '4.99',\n", + " '9741',\n", + " '924',\n", + " '4.5',\n", + " '4',\n", + " '1.05.02',\n", + " '12+',\n", + " 'Games',\n", + " '40',\n", + " '0',\n", + " '3',\n", + " '1'],\n", + " ['896',\n", + " '432850619',\n", + " 'FL Studio Mobile',\n", + " '791146496',\n", + " 'USD',\n", + " '13.99',\n", + " '818',\n", + " '9',\n", + " '3.5',\n", + " '2.5',\n", + " '3.1.50',\n", + " '4+',\n", + " 'Music',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['897',\n", + " '433156786',\n", + " 'Qzone HD',\n", + " '30027776',\n", + " 'USD',\n", + " '0',\n", + " '458',\n", + " '26',\n", + " '3.5',\n", + " '3',\n", + " '4.1.4.1',\n", + " '4+',\n", + " 'Social Networking',\n", + " '26',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['898',\n", + " '433398108',\n", + " 'PicFrame',\n", + " '36758528',\n", + " 'USD',\n", + " '0.99',\n", + " '6374',\n", + " '66',\n", + " '4.5',\n", + " '5',\n", + " '9.7.2',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '37',\n", + " '5',\n", + " '21',\n", + " '1'],\n", + " ['899',\n", + " '433508740',\n", + " 'Bank of America - Mobile Banking for iPad',\n", + " '114268160',\n", + " 'USD',\n", + " '0',\n", + " '7569',\n", + " '31',\n", + " '3.5',\n", + " '3',\n", + " '7.3.8',\n", + " '4+',\n", + " 'Finance',\n", + " '24',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['900',\n", + " '433592592',\n", + " 'Nyan Cat: Lost In Space',\n", + " '96872448',\n", + " 'USD',\n", + " '0',\n", + " '76392',\n", + " '700',\n", + " '4.5',\n", + " '4.5',\n", + " '9.0',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['901',\n", + " '433596395',\n", + " 'ZOOKEEPER\\u3000DX',\n", + " '28983296',\n", + " 'USD',\n", + " '0.99',\n", + " '274',\n", + " '24',\n", + " '3.5',\n", + " '3.5',\n", + " '1.0.7',\n", + " '4+',\n", + " 'Games',\n", + " '43',\n", + " '4',\n", + " '3',\n", + " '1'],\n", + " ['903',\n", + " '433620759',\n", + " 'Fishing Kings Free+',\n", + " '610881536',\n", + " 'USD',\n", + " '0',\n", + " '35058',\n", + " '7453',\n", + " '4.5',\n", + " '4.5',\n", + " '1.0.6',\n", + " '4+',\n", + " 'Games',\n", + " '40',\n", + " '5',\n", + " '12',\n", + " '1'],\n", + " ['904',\n", + " '433622275',\n", + " 'Werewolf \"Nightmare in Prison\"',\n", + " '17530880',\n", + " 'USD',\n", + " '0',\n", + " '78',\n", + " '0',\n", + " '4.5',\n", + " '0',\n", + " '8.6',\n", + " '12+',\n", + " 'Games',\n", + " '37',\n", + " '0',\n", + " '2',\n", + " '1'],\n", + " ['905',\n", + " '433671262',\n", + " 'PhotoToaster - Photo Editor, Filters, Effects and Borders',\n", + " '58143744',\n", + " 'USD',\n", + " '2.99',\n", + " '4748',\n", + " '391',\n", + " '5',\n", + " '5',\n", + " '6.7.5',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['906',\n", + " '433847884',\n", + " 'Bike Baron',\n", + " '183046144',\n", + " 'USD',\n", + " '1.99',\n", + " '12162',\n", + " '57',\n", + " '4.5',\n", + " '4.5',\n", + " '3.9.1',\n", + " '4+',\n", + " 'Games',\n", + " '40',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['907',\n", + " '434209233',\n", + " 'Moji Weather - Free Weather Forecast',\n", + " '86968320',\n", + " 'USD',\n", + " '0',\n", + " '2333',\n", + " '0',\n", + " '4.5',\n", + " '0',\n", + " '7.0.0',\n", + " '4+',\n", + " 'Weather',\n", + " '38',\n", + " '0',\n", + " '3',\n", + " '1'],\n", + " ['908',\n", + " '434374726',\n", + " '京东 HD',\n", + " '114121728',\n", + " 'USD',\n", + " '0',\n", + " '150',\n", + " '0',\n", + " '4',\n", + " '0',\n", + " '4.1.0',\n", + " '17+',\n", + " 'Shopping',\n", + " '24',\n", + " '4',\n", + " '1',\n", + " '1'],\n", + " ['909',\n", + " '434826169',\n", + " 'Toca Robot Lab',\n", + " '64152576',\n", + " 'USD',\n", + " '2.99',\n", + " '1006',\n", + " '17',\n", + " '4',\n", + " '4',\n", + " '1.2.3',\n", + " '4+',\n", + " 'Education',\n", + " '40',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['910',\n", + " '434832826',\n", + " 'Viator Tours & Activities',\n", + " '79013888',\n", + " 'USD',\n", + " '0',\n", + " '1839',\n", + " '174',\n", + " '4.5',\n", + " '4',\n", + " '5.5.0',\n", + " '12+',\n", + " 'Travel',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['911',\n", + " '434893913',\n", + " 'Lookout: Security and Identity Theft Protection',\n", + " '65608704',\n", + " 'USD',\n", + " '0',\n", + " '2661',\n", + " '41',\n", + " '4',\n", + " '3.5',\n", + " '5.1.1',\n", + " '4+',\n", + " 'Utilities',\n", + " '37',\n", + " '1',\n", + " '8',\n", + " '1'],\n", + " ['912',\n", + " '435138734',\n", + " 'PBS KIDS Video',\n", + " '57694208',\n", + " 'USD',\n", + " '0',\n", + " '8651',\n", + " '23',\n", + " '3.5',\n", + " '3.5',\n", + " '3.0.5',\n", + " '4+',\n", + " 'Education',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['913',\n", + " '435476174',\n", + " 'LetterSchool - learn to write letters and numbers',\n", + " '47030272',\n", + " 'USD',\n", + " '4.99',\n", + " '460',\n", + " '72',\n", + " '4.5',\n", + " '3.5',\n", + " '1.1',\n", + " '4+',\n", + " 'Education',\n", + " '40',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['914',\n", + " '435693872',\n", + " 'Kurumaki Calendar -month scroll calendar-',\n", + " '7558144',\n", + " 'USD',\n", + " '1.99',\n", + " '34',\n", + " '6',\n", + " '5',\n", + " '5',\n", + " '2.6',\n", + " '4+',\n", + " 'Productivity',\n", + " '37',\n", + " '0',\n", + " '31',\n", + " '1'],\n", + " ['915',\n", + " '435728260',\n", + " 'Building Parallel Circuits',\n", + " '31744669',\n", + " 'USD',\n", + " '0.99',\n", + " '32',\n", + " '7',\n", + " '3.5',\n", + " '3',\n", + " '1.3.1',\n", + " '4+',\n", + " 'Education',\n", + " '26',\n", + " '3',\n", + " '1',\n", + " '1'],\n", + " ['916',\n", + " '435871950',\n", + " 'HappyCow Vegan / Vegetarian Restaurant Guide',\n", + " '35261440',\n", + " 'USD',\n", + " '3.99',\n", + " '863',\n", + " '12',\n", + " '4.5',\n", + " '5',\n", + " '3.7.1',\n", + " '12+',\n", + " 'Travel',\n", + " '37',\n", + " '3',\n", + " '11',\n", + " '1'],\n", + " ['917',\n", + " '435883126',\n", + " 'Building Serial Circuits',\n", + " '21462305',\n", + " 'USD',\n", + " '0.99',\n", + " '23',\n", + " '2',\n", + " '4',\n", + " '3.5',\n", + " '1.3.1',\n", + " '4+',\n", + " 'Education',\n", + " '26',\n", + " '3',\n", + " '1',\n", + " '1'],\n", + " ['918',\n", + " '435913585',\n", + " 'Superimpose',\n", + " '25382912',\n", + " 'USD',\n", + " '1.99',\n", + " '2965',\n", + " '205',\n", + " '4.5',\n", + " '5',\n", + " '6.2',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '37',\n", + " '5',\n", + " '8',\n", + " '1'],\n", + " ['919',\n", + " '436114747',\n", + " 'ComicBook!',\n", + " '92432384',\n", + " 'USD',\n", + " '0.99',\n", + " '3702',\n", + " '112',\n", + " '4.5',\n", + " '4.5',\n", + " '2.1.1',\n", + " '9+',\n", + " 'Photo & Video',\n", + " '37',\n", + " '4',\n", + " '1',\n", + " '1'],\n", + " ['920',\n", + " '436134867',\n", + " 'Jelly Defense',\n", + " '299294720',\n", + " 'USD',\n", + " '2.99',\n", + " '5058',\n", + " '363',\n", + " '4.5',\n", + " '4.5',\n", + " '1.21',\n", + " '4+',\n", + " 'Games',\n", + " '38',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['921',\n", + " '436180275',\n", + " 'Learn to Speak Italian Fast With MosaLingua',\n", + " '43553792',\n", + " 'USD',\n", + " '4.99',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '9.2',\n", + " '12+',\n", + " 'Education',\n", + " '38',\n", + " '5',\n", + " '5',\n", + " '1'],\n", + " ['922',\n", + " '436491861',\n", + " \"Domino's Pizza USA\",\n", + " '105743360',\n", + " 'USD',\n", + " '0',\n", + " '258624',\n", + " '2481',\n", + " '5',\n", + " '4.5',\n", + " '4.2.0',\n", + " '4+',\n", + " 'Food & Drink',\n", + " '37',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['923',\n", + " '436555490',\n", + " 'Junk Jack Retro',\n", + " '33743872',\n", + " 'USD',\n", + " '2.99',\n", + " '8632',\n", + " '62',\n", + " '4.5',\n", + " '4',\n", + " '1.3.1',\n", + " '9+',\n", + " 'Games',\n", + " '38',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['924',\n", + " '436577167',\n", + " 'FiLMiC Pro',\n", + " '125991936',\n", + " 'USD',\n", + " '14.99',\n", + " '1478',\n", + " '18',\n", + " '3',\n", + " '4.5',\n", + " '6.0.3',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['925',\n", + " '436672029',\n", + " 'AliExpress Shopping App',\n", + " '133053440',\n", + " 'USD',\n", + " '0',\n", + " '10647',\n", + " '185',\n", + " '4',\n", + " '4.5',\n", + " '5.2.7',\n", + " '12+',\n", + " 'Shopping',\n", + " '37',\n", + " '0',\n", + " '18',\n", + " '1'],\n", + " ['926',\n", + " '436957087',\n", + " '搜狐新闻—新闻热点资讯掌上阅读软件',\n", + " '136421376',\n", + " 'USD',\n", + " '0',\n", + " '383',\n", + " '0',\n", + " '4.5',\n", + " '0',\n", + " '5.8.9',\n", + " '17+',\n", + " 'News',\n", + " '38',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['927',\n", + " '437025413',\n", + " 'ZDFmediathek',\n", + " '67734528',\n", + " 'USD',\n", + " '0',\n", + " '320',\n", + " '1',\n", + " '3.5',\n", + " '3',\n", + " '4.2.1',\n", + " '4+',\n", + " 'Entertainment',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['928',\n", + " '437314677',\n", + " 'Digital Domain',\n", + " '13512704',\n", + " 'USD',\n", + " '0',\n", + " '102',\n", + " '0',\n", + " '2',\n", + " '0',\n", + " '3.0.4',\n", + " '9+',\n", + " 'Photo & Video',\n", + " '37',\n", + " '4',\n", + " '9',\n", + " '1'],\n", + " ['930',\n", + " '437818260',\n", + " 'SayHi Translate',\n", + " '26569728',\n", + " 'USD',\n", + " '0',\n", + " '8623',\n", + " '292',\n", + " '4.5',\n", + " '5',\n", + " '3.9.12',\n", + " '4+',\n", + " 'Business',\n", + " '37',\n", + " '4',\n", + " '35',\n", + " '1'],\n", + " ['931',\n", + " '438314348',\n", + " 'Tank Hero',\n", + " '16048128',\n", + " 'USD',\n", + " '0.99',\n", + " '14361',\n", + " '918',\n", + " '4.5',\n", + " '4.5',\n", + " '1.1.4',\n", + " '9+',\n", + " 'Games',\n", + " '43',\n", + " '0',\n", + " '1',\n", + " '0'],\n", + " ['932',\n", + " '438426078',\n", + " '聚力视频-蓝光电视剧电影在线热播',\n", + " '99607552',\n", + " 'USD',\n", + " '0',\n", + " '1670',\n", + " '4',\n", + " '4.5',\n", + " '4',\n", + " '6.4.16',\n", + " '12+',\n", + " 'Entertainment',\n", + " '38',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['933',\n", + " '438475005',\n", + " 'TextGrabber – image to text: OCR & translate photo',\n", + " '134786048',\n", + " 'USD',\n", + " '4.99',\n", + " '1153',\n", + " '39',\n", + " '4',\n", + " '4',\n", + " '5.5.4',\n", + " '4+',\n", + " 'Productivity',\n", + " '37',\n", + " '5',\n", + " '11',\n", + " '1'],\n", + " ['934',\n", + " '438865278',\n", + " '淘宝HD-Taobao for iPad',\n", + " '119247872',\n", + " 'USD',\n", + " '0',\n", + " '1103',\n", + " '54',\n", + " '3.5',\n", + " '4.5',\n", + " '5.0.1',\n", + " '4+',\n", + " 'Shopping',\n", + " '24',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['935',\n", + " '439176506',\n", + " 'Timenote',\n", + " '4849664',\n", + " 'USD',\n", + " '0.99',\n", + " '11',\n", + " '5',\n", + " '4.5',\n", + " '5',\n", + " '2.6',\n", + " '4+',\n", + " 'Business',\n", + " '43',\n", + " '0',\n", + " '2',\n", + " '1'],\n", + " ['937',\n", + " '439438619',\n", + " 'Snapseed',\n", + " '141322240',\n", + " 'USD',\n", + " '0',\n", + " '8683',\n", + " '98',\n", + " '4',\n", + " '4.5',\n", + " '2.17',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '37',\n", + " '3',\n", + " '34',\n", + " '1'],\n", + " ['938',\n", + " '439495358',\n", + " '北京浮生记',\n", + " '1532640',\n", + " 'USD',\n", + " '0.99',\n", + " '44',\n", + " '21',\n", + " '4.5',\n", + " '4.5',\n", + " '1.2.1',\n", + " '17+',\n", + " 'Games',\n", + " '43',\n", + " '0',\n", + " '2',\n", + " '1'],\n", + " ['940',\n", + " '439628153',\n", + " 'My PlayHome',\n", + " '225615872',\n", + " 'USD',\n", + " '3.99',\n", + " '3523',\n", + " '181',\n", + " '4.5',\n", + " '4.5',\n", + " '3.1.1',\n", + " '4+',\n", + " 'Entertainment',\n", + " '43',\n", + " '5',\n", + " '18',\n", + " '1'],\n", + " ['941',\n", + " '439638720',\n", + " '腾讯手机管家-拦截骚扰电话的QQ安全助手',\n", + " '60549120',\n", + " 'USD',\n", + " '0',\n", + " '527',\n", + " '1',\n", + " '4',\n", + " '1',\n", + " '7.0',\n", + " '4+',\n", + " 'Utilities',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['942',\n", + " '439852091',\n", + " '5K Runner: 0 to 5K Run Trainer. Couch potato to 5K',\n", + " '84338688',\n", + " 'USD',\n", + " '4.99',\n", + " '10368',\n", + " '1051',\n", + " '5',\n", + " '5',\n", + " '7.3',\n", + " '4+',\n", + " 'Health & Fitness',\n", + " '37',\n", + " '5',\n", + " '31',\n", + " '1'],\n", + " ['943',\n", + " '439873467',\n", + " 'Magic Jigsaw Puzzles',\n", + " '235259904',\n", + " 'USD',\n", + " '0',\n", + " '187666',\n", + " '1263',\n", + " '4.5',\n", + " '4.5',\n", + " '2.11.1',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '10',\n", + " '1'],\n", + " ['944',\n", + " '440045374',\n", + " 'DragonVale',\n", + " '153074688',\n", + " 'USD',\n", + " '0',\n", + " '503230',\n", + " '282',\n", + " '4.5',\n", + " '4.5',\n", + " '3.15.0',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '10',\n", + " '1'],\n", + " ['945',\n", + " '440141669',\n", + " 'SHADOWGUN',\n", + " '517828608',\n", + " 'USD',\n", + " '4.99',\n", + " '4513',\n", + " '95',\n", + " '4',\n", + " '4.5',\n", + " '1.6.0',\n", + " '12+',\n", + " 'Games',\n", + " '43',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['946',\n", + " '440488550',\n", + " 'PlayerXtreme Media Player PRO - Movies & streaming',\n", + " '99442688',\n", + " 'USD',\n", + " '4.99',\n", + " '125',\n", + " '6',\n", + " '3.5',\n", + " '2',\n", + " '7.0.8',\n", + " '4+',\n", + " 'Utilities',\n", + " '37',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['947',\n", + " '440677948',\n", + " 'Lieferheld - Delicious food delivery service',\n", + " '46147584',\n", + " 'USD',\n", + " '0',\n", + " '29',\n", + " '1',\n", + " '4.5',\n", + " '5',\n", + " '3.3.9',\n", + " '12+',\n", + " 'Food & Drink',\n", + " '38',\n", + " '0',\n", + " '2',\n", + " '1'],\n", + " ['949',\n", + " '440948110',\n", + " 'Kwai - Share your video moments',\n", + " '91466752',\n", + " 'USD',\n", + " '0',\n", + " '668',\n", + " '4',\n", + " '4.5',\n", + " '5',\n", + " '4.99.6',\n", + " '17+',\n", + " 'Photo & Video',\n", + " '38',\n", + " '0',\n", + " '11',\n", + " '1'],\n", + " ['950',\n", + " '441179131',\n", + " 'ibis Paint - speed painting',\n", + " '31885312',\n", + " 'USD',\n", + " '4.99',\n", + " '112',\n", + " '1',\n", + " '4.5',\n", + " '5',\n", + " '5.0.1',\n", + " '12+',\n", + " 'Entertainment',\n", + " '37',\n", + " '5',\n", + " '19',\n", + " '1'],\n", + " ['951',\n", + " '441216572',\n", + " '360手机卫士-超安全的来电防骚扰助手',\n", + " '103390208',\n", + " 'USD',\n", + " '0',\n", + " '944',\n", + " '0',\n", + " '4',\n", + " '0',\n", + " '8.0.2',\n", + " '4+',\n", + " 'Utilities',\n", + " '37',\n", + " '0',\n", + " '2',\n", + " '1'],\n", + " ['952',\n", + " '441457218',\n", + " 'Photo Lab: Picture Editor, effects & fun face app',\n", + " '102964224',\n", + " 'USD',\n", + " '0',\n", + " '34585',\n", + " '34',\n", + " '4.5',\n", + " '4.5',\n", + " '2.8.24',\n", + " '12+',\n", + " 'Photo & Video',\n", + " '37',\n", + " '5',\n", + " '10',\n", + " '1'],\n", + " ['953',\n", + " '441599491',\n", + " 'ConjuVerb - Spanish Verb Conjugation Helper',\n", + " '49025024',\n", + " 'USD',\n", + " '0.99',\n", + " '406',\n", + " '62',\n", + " '4.5',\n", + " '4.5',\n", + " '2.2',\n", + " '4+',\n", + " 'Education',\n", + " '40',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['954',\n", + " '442012681',\n", + " 'Skype for iPad',\n", + " '129096704',\n", + " 'USD',\n", + " '0',\n", + " '60163',\n", + " '104',\n", + " '4',\n", + " '4.5',\n", + " '6.35.1',\n", + " '4+',\n", + " 'Social Networking',\n", + " '24',\n", + " '5',\n", + " '32',\n", + " '1'],\n", + " ['955',\n", + " '442378070',\n", + " 'Book Creator for iPad',\n", + " '86345728',\n", + " 'USD',\n", + " '4.99',\n", + " '415',\n", + " '2',\n", + " '4',\n", + " '3',\n", + " '5.1.1',\n", + " '4+',\n", + " 'Education',\n", + " '24',\n", + " '5',\n", + " '11',\n", + " '1'],\n", + " ['956',\n", + " '442522082',\n", + " 'Modern Combat 3: Fallen Nation',\n", + " '1978085376',\n", + " 'USD',\n", + " '6.99',\n", + " '23766',\n", + " '582',\n", + " '4.5',\n", + " '4.5',\n", + " '1.5.0',\n", + " '17+',\n", + " 'Games',\n", + " '43',\n", + " '5',\n", + " '12',\n", + " '1'],\n", + " ['957',\n", + " '442705759',\n", + " 'Toca Store',\n", + " '69277696',\n", + " 'USD',\n", + " '2.99',\n", + " '1595',\n", + " '28',\n", + " '4',\n", + " '3.5',\n", + " '1.1.5',\n", + " '4+',\n", + " 'Education',\n", + " '40',\n", + " '5',\n", + " '18',\n", + " '1'],\n", + " ['958',\n", + " '442839435',\n", + " 'NBC – Watch Now and Stream Full TV Episodes',\n", + " '135252992',\n", + " 'USD',\n", + " '0',\n", + " '55950',\n", + " '248',\n", + " '4',\n", + " '3.5',\n", + " '4.8.0',\n", + " '12+',\n", + " 'Entertainment',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['959',\n", + " '443321291',\n", + " 'CCW – Concealed Carry 50 State Guide',\n", + " '22264832',\n", + " 'USD',\n", + " '1.99',\n", + " '644',\n", + " '45',\n", + " '5',\n", + " '4.5',\n", + " '3.3',\n", + " '12+',\n", + " 'Reference',\n", + " '40',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['960',\n", + " '443324720',\n", + " 'TOEIC®テスト文法640問1',\n", + " '10928128',\n", + " 'USD',\n", + " '2.99',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '1.0.23',\n", + " '4+',\n", + " 'Education',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['962',\n", + " '443354861',\n", + " 'Camera360 - Selfie Filter Camera, Photo Editor',\n", + " '161159168',\n", + " 'USD',\n", + " '0',\n", + " '16729',\n", + " '2',\n", + " '4.5',\n", + " '4.5',\n", + " '8.5.6',\n", + " '12+',\n", + " 'Photo & Video',\n", + " '37',\n", + " '0',\n", + " '12',\n", + " '1'],\n", + " ['963',\n", + " '443369807',\n", + " 'Hotspot Shield Free VPN Proxy & Wi-Fi Privacy',\n", + " '72476672',\n", + " 'USD',\n", + " '0',\n", + " '32499',\n", + " '438',\n", + " '4.5',\n", + " '4.5',\n", + " '3.7.5',\n", + " '4+',\n", + " 'Productivity',\n", + " '37',\n", + " '5',\n", + " '11',\n", + " '1'],\n", + " ['964',\n", + " '443637419',\n", + " 'Racing Penguin Free - Top Flying and Diving Game',\n", + " '79857664',\n", + " 'USD',\n", + " '0',\n", + " '141224',\n", + " '1909',\n", + " '4.5',\n", + " '4.5',\n", + " '5.8.6',\n", + " '4+',\n", + " 'Games',\n", + " '38',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['965',\n", + " '443646748',\n", + " 'Fitness Buddy+ Gym Workout Exercise, Home Trainer',\n", + " '224675840',\n", + " 'USD',\n", + " '2.99',\n", + " '10386',\n", + " '58',\n", + " '4.5',\n", + " '4',\n", + " '5.86',\n", + " '4+',\n", + " 'Health & Fitness',\n", + " '37',\n", + " '0',\n", + " '31',\n", + " '1'],\n", + " ['966',\n", + " '443904275',\n", + " 'LINE',\n", + " '212208640',\n", + " 'USD',\n", + " '0',\n", + " '11437',\n", + " '11',\n", + " '3.5',\n", + " '3',\n", + " '7.5.0',\n", + " '4+',\n", + " 'Social Networking',\n", + " '37',\n", + " '5',\n", + " '17',\n", + " '1'],\n", + " ['967',\n", + " '443926246',\n", + " '驴妈妈旅游-订景点门票机票火车票特价酒店',\n", + " '145368064',\n", + " 'USD',\n", + " '0',\n", + " '30',\n", + " '0',\n", + " '5',\n", + " '0',\n", + " '7.9.6',\n", + " '4+',\n", + " 'Travel',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['968',\n", + " '443932954',\n", + " 'Calculator for iPad Free.',\n", + " '48484352',\n", + " 'USD',\n", + " '0',\n", + " '4021',\n", + " '538',\n", + " '4.5',\n", + " '4.5',\n", + " '2.53',\n", + " '4+',\n", + " 'Utilities',\n", + " '40',\n", + " '4',\n", + " '32',\n", + " '1'],\n", + " ['969',\n", + " '444062672',\n", + " 'NOAA Hurricane Center HD',\n", + " '8093696',\n", + " 'USD',\n", + " '1.99',\n", + " '43',\n", + " '27',\n", + " '3.5',\n", + " '3.5',\n", + " '2.0',\n", + " '4+',\n", + " 'Weather',\n", + " '26',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['971',\n", + " '444553118',\n", + " 'Jesus Calling Devotional by Sarah Young',\n", + " '125770752',\n", + " 'USD',\n", + " '9.99',\n", + " '1685',\n", + " '2',\n", + " '2.5',\n", + " '1.5',\n", + " '5.0.0',\n", + " '4+',\n", + " 'Book',\n", + " '38',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['972',\n", + " '444553167',\n", + " 'ADP Mobile Solutions',\n", + " '53805056',\n", + " 'USD',\n", + " '0',\n", + " '8324',\n", + " '306',\n", + " '4',\n", + " '3',\n", + " '2.8.2',\n", + " '4+',\n", + " 'Business',\n", + " '37',\n", + " '5',\n", + " '24',\n", + " '1'],\n", + " ['973',\n", + " '444745181',\n", + " 'Daily Audio Bible App',\n", + " '13282304',\n", + " 'USD',\n", + " '0.99',\n", + " '796',\n", + " '0',\n", + " '5',\n", + " '0',\n", + " '4.6.0',\n", + " '4+',\n", + " 'Lifestyle',\n", + " '37',\n", + " '3',\n", + " '5',\n", + " '1'],\n", + " ['974',\n", + " '444844790',\n", + " 'Scribblenauts Remix',\n", + " '209452032',\n", + " 'USD',\n", + " '0.99',\n", + " '86127',\n", + " '179',\n", + " '4.5',\n", + " '4',\n", + " '7.1',\n", + " '9+',\n", + " 'Games',\n", + " '40',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['975',\n", + " '444934666',\n", + " 'QQ',\n", + " '218936320',\n", + " 'USD',\n", + " '0',\n", + " '9109',\n", + " '17',\n", + " '3',\n", + " '1.5',\n", + " '7.0.1',\n", + " '12+',\n", + " 'Social Networking',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['976',\n", + " '444947784',\n", + " 'Talking Tom & Ben News for iPad',\n", + " '55250944',\n", + " 'USD',\n", + " '0',\n", + " '20988',\n", + " '963',\n", + " '4',\n", + " '4.5',\n", + " '2.2.1',\n", + " '4+',\n", + " 'Entertainment',\n", + " '24',\n", + " '5',\n", + " '13',\n", + " '1'],\n", + " ['977',\n", + " '445300213',\n", + " 'Calc for Loan',\n", + " '880640',\n", + " 'USD',\n", + " '3.99',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '3.0.1',\n", + " '4+',\n", + " 'Finance',\n", + " '40',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['978',\n", + " '445338486',\n", + " 'LOVOO - Dating Chat',\n", + " '85049344',\n", + " 'USD',\n", + " '0',\n", + " '1985',\n", + " '4',\n", + " '4.5',\n", + " '5',\n", + " '3.26.0',\n", + " '17+',\n", + " 'Social Networking',\n", + " '37',\n", + " '5',\n", + " '15',\n", + " '1'],\n", + " ['979',\n", + " '445375097',\n", + " '爱奇艺PPS -《欢乐颂2》电视剧热播',\n", + " '224617472',\n", + " 'USD',\n", + " '0',\n", + " '14844',\n", + " '0',\n", + " '4',\n", + " '0',\n", + " '6.3.3',\n", + " '17+',\n", + " 'Entertainment',\n", + " '38',\n", + " '5',\n", + " '3',\n", + " '1'],\n", + " ['981',\n", + " '445573854',\n", + " '当当-正品秒杀,首单立减5元',\n", + " '130363392',\n", + " 'USD',\n", + " '0',\n", + " '65',\n", + " '0',\n", + " '3',\n", + " '0',\n", + " '6.9.1',\n", + " '4+',\n", + " 'Shopping',\n", + " '38',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['982',\n", + " '445791750',\n", + " 'Phoenix HD',\n", + " '92713984',\n", + " 'USD',\n", + " '0',\n", + " '13106',\n", + " '230',\n", + " '4.5',\n", + " '4.5',\n", + " '2.6.2',\n", + " '9+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '14',\n", + " '1'],\n", + " ['983',\n", + " '445850671',\n", + " 'Zaim',\n", + " '118128640',\n", + " 'USD',\n", + " '0',\n", + " '44',\n", + " '0',\n", + " '4',\n", + " '0',\n", + " '6.1.3',\n", + " '4+',\n", + " 'Finance',\n", + " '37',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['984',\n", + " '445996226',\n", + " 'MailShot Pro- Group Email Done Right!',\n", + " '9162752',\n", + " 'USD',\n", + " '3.99',\n", + " '425',\n", + " '11',\n", + " '4.5',\n", + " '4.5',\n", + " '5.3',\n", + " '4+',\n", + " 'Productivity',\n", + " '37',\n", + " '5',\n", + " '4',\n", + " '1'],\n", + " ['988',\n", + " '446207961',\n", + " 'Human Anatomy Atlas – 3D Anatomical Model of the Human Body',\n", + " '1312071680',\n", + " 'USD',\n", + " '24.99',\n", + " '1298',\n", + " '144',\n", + " '4.5',\n", + " '4.5',\n", + " '8.0.27',\n", + " '12+',\n", + " 'Medical',\n", + " '38',\n", + " '5',\n", + " '7',\n", + " '1'],\n", + " ['989',\n", + " '446324234',\n", + " '欢乐斗地主•腾讯',\n", + " '214474752',\n", + " 'USD',\n", + " '0',\n", + " '403',\n", + " '5',\n", + " '3.5',\n", + " '4.5',\n", + " '5.52.001',\n", + " '17+',\n", + " 'Games',\n", + " '43',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['990',\n", + " '446408493',\n", + " 'Virtual Villagers 5: New Believers',\n", + " '36301672',\n", + " 'USD',\n", + " '0.99',\n", + " '309',\n", + " '309',\n", + " '4',\n", + " '4',\n", + " '1.0.0',\n", + " '9+',\n", + " 'Games',\n", + " '47',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['993',\n", + " '446760220',\n", + " 'FINAL FANTASY TACTICS: THE WAR OF THE LIONS',\n", + " '507508522',\n", + " 'USD',\n", + " '13.99',\n", + " '5180',\n", + " '3723',\n", + " '4.5',\n", + " '4.5',\n", + " '1.2.0',\n", + " '9+',\n", + " 'Games',\n", + " '45',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['995',\n", + " '447024088',\n", + " '自転車ナビ by NAVITIME(ナビタイム) - 自転車のナビができるアプリ',\n", + " '48708608',\n", + " 'USD',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '4.11.1',\n", + " '4+',\n", + " 'Navigation',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['996',\n", + " '447149103',\n", + " 'Reckless Getaway',\n", + " '123644928',\n", + " 'USD',\n", + " '0.99',\n", + " '18259',\n", + " '77',\n", + " '4.5',\n", + " '4.5',\n", + " '1.1.4',\n", + " '12+',\n", + " 'Games',\n", + " '43',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['997',\n", + " '447188370',\n", + " 'Snapchat',\n", + " '203038720',\n", + " 'USD',\n", + " '0',\n", + " '323905',\n", + " '576',\n", + " '2.5',\n", + " '3',\n", + " '10.9.2.0',\n", + " '12+',\n", + " 'Photo & Video',\n", + " '37',\n", + " '0',\n", + " '22',\n", + " '1'],\n", + " ['998',\n", + " '447313708',\n", + " '途牛旅游-订机票酒店,查旅行景点门票',\n", + " '161202176',\n", + " 'USD',\n", + " '0',\n", + " '51',\n", + " '1',\n", + " '4.5',\n", + " '5',\n", + " '9.1.4',\n", + " '17+',\n", + " 'Travel',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['1000',\n", + " '447444215',\n", + " 'PDF Converter - Convert Documents, Photos to PDF',\n", + " '55156736',\n", + " 'USD',\n", + " '4.99',\n", + " '1294',\n", + " '113',\n", + " '4.5',\n", + " '4.5',\n", + " '2.3.5',\n", + " '4+',\n", + " 'Business',\n", + " '37',\n", + " '5',\n", + " '9',\n", + " '1'],\n", + " ['1001',\n", + " '447574907',\n", + " 'Auto Palmistry',\n", + " '51680256',\n", + " 'USD',\n", + " '0',\n", + " '5',\n", + " '0',\n", + " '3',\n", + " '0',\n", + " '4.0.3',\n", + " '4+',\n", + " 'Entertainment',\n", + " '37',\n", + " '4',\n", + " '2',\n", + " '1'],\n", + " ['1002',\n", + " '447610616',\n", + " 'Muffin Knight',\n", + " '214679552',\n", + " 'USD',\n", + " '0.99',\n", + " '9302',\n", + " '401',\n", + " '4.5',\n", + " '4',\n", + " '2.0',\n", + " '9+',\n", + " 'Games',\n", + " '43',\n", + " '5',\n", + " '9',\n", + " '1'],\n", + " ['1003',\n", + " '447689011',\n", + " 'Infinity Blade II',\n", + " '1344401408',\n", + " 'USD',\n", + " '0.99',\n", + " '153588',\n", + " '595',\n", + " '4.5',\n", + " '4.5',\n", + " '1.3.4',\n", + " '12+',\n", + " 'Games',\n", + " '40',\n", + " '5',\n", + " '16',\n", + " '1'],\n", + " ['1004',\n", + " '447752317',\n", + " 'Quick Scan Pro - Barcode Scanner. Deal Finder. Money Saver.',\n", + " '24059904',\n", + " 'USD',\n", + " '0.99',\n", + " '3837',\n", + " '85',\n", + " '4.5',\n", + " '3.5',\n", + " '1.6.6',\n", + " '4+',\n", + " 'Productivity',\n", + " '43',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['1005',\n", + " '447791438',\n", + " 'Sprinkle: Water splashing fire fighting fun!',\n", + " '34025472',\n", + " 'USD',\n", + " '1.99',\n", + " '10509',\n", + " '712',\n", + " '4.5',\n", + " '4',\n", + " '1.7.2',\n", + " '4+',\n", + " 'Games',\n", + " '43',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['1006',\n", + " '447983569',\n", + " 'Lock Photos & Video.s Vault - Passcode Protect Your Secret Photo Album & Secure Private Picture.s Folders',\n", + " '14741504',\n", + " 'USD',\n", + " '2.99',\n", + " '4697',\n", + " '415',\n", + " '4.5',\n", + " '4.5',\n", + " '4.3',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '38',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['1007',\n", + " '448142450',\n", + " 'Truecaller - Spam Identification & Block',\n", + " '84406272',\n", + " 'USD',\n", + " '0',\n", + " '27791',\n", + " '5779',\n", + " '4.5',\n", + " '4.5',\n", + " '7.50',\n", + " '4+',\n", + " 'Utilities',\n", + " '37',\n", + " '0',\n", + " '30',\n", + " '1'],\n", + " ['1008',\n", + " '448165862',\n", + " 'MOMO陌陌-开启视频社交,用直播分享生活',\n", + " '156017664',\n", + " 'USD',\n", + " '0',\n", + " '1862',\n", + " '0',\n", + " '4',\n", + " '0',\n", + " '7.7.47',\n", + " '17+',\n", + " 'Social Networking',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['1009',\n", + " '448474423',\n", + " 'Couch to 5K® - Running App and Training Coach',\n", + " '95468544',\n", + " 'USD',\n", + " '2.99',\n", + " '3820',\n", + " '319',\n", + " '4.5',\n", + " '4.5',\n", + " '3.5.3',\n", + " '4+',\n", + " 'Health & Fitness',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['1010',\n", + " '448639966',\n", + " 'Pic Collage - Picture Editor & Photo Collage Maker',\n", + " '109210624',\n", + " 'USD',\n", + " '0',\n", + " '123433',\n", + " '1521',\n", + " '5',\n", + " '5',\n", + " '7.12.17',\n", + " '12+',\n", + " 'Photo & Video',\n", + " '37',\n", + " '5',\n", + " '12',\n", + " '1'],\n", + " ['1012',\n", + " '449735650',\n", + " \"Where's My Water?\",\n", + " '90853376',\n", + " 'USD',\n", + " '1.99',\n", + " '131656',\n", + " '484',\n", + " '4.5',\n", + " '4',\n", + " '1.14.1.58',\n", + " '4+',\n", + " 'Games',\n", + " '40',\n", + " '5',\n", + " '11',\n", + " '1'],\n", + " ['1013',\n", + " '449945214',\n", + " 'United Airlines',\n", + " '140942336',\n", + " 'USD',\n", + " '0',\n", + " '5748',\n", + " '106',\n", + " '2.5',\n", + " '2.5',\n", + " '2.1.19',\n", + " '4+',\n", + " 'Travel',\n", + " '37',\n", + " '1',\n", + " '1',\n", + " '1'],\n", + " ['1014',\n", + " '450123799',\n", + " 'Dictionary.com Premium Dictionary & Thesaurus for iPad',\n", + " '162652160',\n", + " 'USD',\n", + " '4.99',\n", + " '4922',\n", + " '1010',\n", + " '4.5',\n", + " '4.5',\n", + " '4.0',\n", + " '4+',\n", + " 'Reference',\n", + " '24',\n", + " '5',\n", + " '9',\n", + " '1'],\n", + " ['1015',\n", + " '450542233',\n", + " 'Cut the Rope: Experiments',\n", + " '124532736',\n", + " 'USD',\n", + " '0.99',\n", + " '63272',\n", + " '305',\n", + " '4.5',\n", + " '4.5',\n", + " '1.7.6',\n", + " '4+',\n", + " 'Games',\n", + " '40',\n", + " '0',\n", + " '11',\n", + " '1'],\n", + " ['1016',\n", + " '450555662',\n", + " 'The Singing Machine Mobile Karaoke App',\n", + " '32770048',\n", + " 'USD',\n", + " '0',\n", + " '130',\n", + " '9',\n", + " '2.5',\n", + " '1.5',\n", + " '1.10.4',\n", + " '12+',\n", + " 'Music',\n", + " '37',\n", + " '1',\n", + " '1',\n", + " '1'],\n", + " ['1017',\n", + " '450722833',\n", + " 'ibis Paint X - speed painting',\n", + " '40980480',\n", + " 'USD',\n", + " '0',\n", + " '1933',\n", + " '20',\n", + " '4.5',\n", + " '4.5',\n", + " '5.0.1',\n", + " '12+',\n", + " 'Entertainment',\n", + " '37',\n", + " '5',\n", + " '19',\n", + " '1'],\n", + " ['1018',\n", + " '450987651',\n", + " 'VIBO RealMassager',\n", + " '4009984',\n", + " 'USD',\n", + " '0',\n", + " '6',\n", + " '1',\n", + " '3',\n", + " '5',\n", + " '1.0.6',\n", + " '4+',\n", + " 'Health & Fitness',\n", + " '37',\n", + " '0',\n", + " '2',\n", + " '1'],\n", + " ['1019',\n", + " '451113455',\n", + " 'Peggle Classic HD',\n", + " '179580928',\n", + " 'USD',\n", + " '0.99',\n", + " '3912',\n", + " '627',\n", + " '4.5',\n", + " '4.5',\n", + " '2.0.9',\n", + " '4+',\n", + " 'Games',\n", + " '26',\n", + " '5',\n", + " '5',\n", + " '1'],\n", + " ['1020',\n", + " '451287325',\n", + " 'Monkey Math School Sunshine',\n", + " '235767808',\n", + " 'USD',\n", + " '1.99',\n", + " '1092',\n", + " '1',\n", + " '4',\n", + " '5',\n", + " '1.43',\n", + " '4+',\n", + " 'Games',\n", + " '38',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['1021',\n", + " '451584035',\n", + " 'Conservative Talk Radio',\n", + " '13180928',\n", + " 'USD',\n", + " '2.99',\n", + " '2436',\n", + " '274',\n", + " '4.5',\n", + " '5',\n", + " '4.1',\n", + " '9+',\n", + " 'News',\n", + " '37',\n", + " '2',\n", + " '1',\n", + " '1'],\n", + " ['1022',\n", + " '451901829',\n", + " 'Azuki Wave',\n", + " '21263360',\n", + " 'USD',\n", + " '1.99',\n", + " '14',\n", + " '1',\n", + " '4',\n", + " '5',\n", + " '1.08',\n", + " '4+',\n", + " 'Entertainment',\n", + " '37',\n", + " '4',\n", + " '2',\n", + " '1'],\n", + " ['1023',\n", + " '452176796',\n", + " '蘑菇街-网红直播搭配的购物特卖平台',\n", + " '144661504',\n", + " 'USD',\n", + " '0',\n", + " '558',\n", + " '0',\n", + " '5',\n", + " '0',\n", + " '9.4.1',\n", + " '17+',\n", + " 'Shopping',\n", + " '37',\n", + " '0',\n", + " '4',\n", + " '1'],\n", + " ['1024',\n", + " '452186370',\n", + " '百度地图-智能的手机导航,公交地铁出行必备',\n", + " '213586944',\n", + " 'USD',\n", + " '0',\n", + " '1014',\n", + " '23',\n", + " '4',\n", + " '4.5',\n", + " '9.8.2',\n", + " '17+',\n", + " 'Navigation',\n", + " '37',\n", + " '0',\n", + " '2',\n", + " '1'],\n", + " ['1025',\n", + " '452830319',\n", + " 'Smilebox Moments - Collages, Stickers, Filters, Frames & Animations',\n", + " '25620480',\n", + " 'USD',\n", + " '0.99',\n", + " '4510',\n", + " '627',\n", + " '4.5',\n", + " '4.5',\n", + " '3.2.4',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '40',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['1026',\n", + " '453051448',\n", + " 'Gangstar Rio: City of Saints',\n", + " '1820196864',\n", + " 'USD',\n", + " '6.99',\n", + " '14724',\n", + " '1043',\n", + " '4.5',\n", + " '4.5',\n", + " '1.4.1',\n", + " '17+',\n", + " 'Games',\n", + " '43',\n", + " '5',\n", + " '12',\n", + " '1'],\n", + " ['1027',\n", + " '453174055',\n", + " '去哪儿旅行HD-总有你要的低价',\n", + " '2706432',\n", + " 'USD',\n", + " '0',\n", + " '85',\n", + " '0',\n", + " '3.5',\n", + " '0',\n", + " '3.1.5',\n", + " '4+',\n", + " 'Travel',\n", + " '26',\n", + " '4',\n", + " '1',\n", + " '1'],\n", + " ['1028',\n", + " '453480684',\n", + " '咕咚-你的跑步骑行运动社区',\n", + " '141333504',\n", + " 'USD',\n", + " '0',\n", + " '160',\n", + " '0',\n", + " '4.5',\n", + " '0',\n", + " '7.16',\n", + " '17+',\n", + " 'Health & Fitness',\n", + " '37',\n", + " '0',\n", + " '3',\n", + " '1'],\n", + " ['1029',\n", + " '453546382',\n", + " 'Photon Flash Player for iPhone - Flash Video & Games plus Private Web Browser',\n", + " '35683328',\n", + " 'USD',\n", + " '3.99',\n", + " '4676',\n", + " '255',\n", + " '4',\n", + " '4',\n", + " '6.2',\n", + " '17+',\n", + " 'Utilities',\n", + " '43',\n", + " '0',\n", + " '10',\n", + " '1'],\n", + " ['1030',\n", + " '453571750',\n", + " 'Knots 3D',\n", + " '75027456',\n", + " 'USD',\n", + " '1.99',\n", + " '3196',\n", + " '95',\n", + " '5',\n", + " '5',\n", + " '5.0.0',\n", + " '4+',\n", + " 'Reference',\n", + " '37',\n", + " '5',\n", + " '19',\n", + " '1'],\n", + " ['1031',\n", + " '453629018',\n", + " 'Sight Recover 3D',\n", + " '22749184',\n", + " 'USD',\n", + " '0.99',\n", + " '1',\n", + " '1',\n", + " '1',\n", + " '1',\n", + " '3.18',\n", + " '4+',\n", + " 'Health & Fitness',\n", + " '43',\n", + " '5',\n", + " '4',\n", + " '1'],\n", + " ['1032',\n", + " '453670037',\n", + " 'Kazehakase fu-ring bank - Tokoname & Nanbu',\n", + " '22928546',\n", + " 'USD',\n", + " '1.99',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '1.2',\n", + " '4+',\n", + " 'Entertainment',\n", + " '43',\n", + " '0',\n", + " '2',\n", + " '1'],\n", + " ['1033',\n", + " '453691481',\n", + " '飞猪',\n", + " '148888576',\n", + " 'USD',\n", + " '0',\n", + " '154',\n", + " '0',\n", + " '4',\n", + " '0',\n", + " '8.2.2',\n", + " '17+',\n", + " 'Travel',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['1034',\n", + " '453718989',\n", + " 'QQ HD',\n", + " '118249472',\n", + " 'USD',\n", + " '0',\n", + " '5058',\n", + " '0',\n", + " '3.5',\n", + " '0',\n", + " '6.6.1',\n", + " '4+',\n", + " 'Social Networking',\n", + " '24',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['1035',\n", + " '453809428',\n", + " 'Bon Appetit',\n", + " '21647360',\n", + " 'USD',\n", + " '0',\n", + " '750',\n", + " '17',\n", + " '3.5',\n", + " '2',\n", + " '4.6.7',\n", + " '4+',\n", + " 'Food & Drink',\n", + " '24',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['1036',\n", + " '454021277',\n", + " 'Skins Pro Creator for Minecraft',\n", + " '25740288',\n", + " 'USD',\n", + " '1.99',\n", + " '7943',\n", + " '46',\n", + " '4.5',\n", + " '3',\n", + " '6.4.3',\n", + " '4+',\n", + " 'Utilities',\n", + " '38',\n", + " '2',\n", + " '11',\n", + " '1'],\n", + " ['1037',\n", + " '454086751',\n", + " 'Flick Home Run !',\n", + " '27196416',\n", + " 'USD',\n", + " '0.99',\n", + " '98851',\n", + " '478',\n", + " '4.5',\n", + " '4',\n", + " '1.7.2',\n", + " '4+',\n", + " 'Games',\n", + " '38',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['1038',\n", + " '454136236',\n", + " 'STEINS;GATE',\n", + " '1551412224',\n", + " 'USD',\n", + " '24.99',\n", + " '16',\n", + " '0',\n", + " '4',\n", + " '0',\n", + " '1.71',\n", + " '12+',\n", + " 'Games',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['1039',\n", + " '454316134',\n", + " 'Sonic CD',\n", + " '197306368',\n", + " 'USD',\n", + " '0',\n", + " '16358',\n", + " '1816',\n", + " '4',\n", + " '3.5',\n", + " '2.0.1',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '3',\n", + " '1',\n", + " '1'],\n", + " ['1041',\n", + " '454638411',\n", + " 'Messenger',\n", + " '275729408',\n", + " 'USD',\n", + " '0',\n", + " '351466',\n", + " '892',\n", + " '3',\n", + " '3',\n", + " '119.0',\n", + " '4+',\n", + " 'Social Networking',\n", + " '37',\n", + " '1',\n", + " '33',\n", + " '1'],\n", + " ['1042',\n", + " '454781476',\n", + " 'Zombieville USA 2',\n", + " '175780864',\n", + " 'USD',\n", + " '0.99',\n", + " '79683',\n", + " '597',\n", + " '4.5',\n", + " '4.5',\n", + " '1.6.1',\n", + " '12+',\n", + " 'Games',\n", + " '40',\n", + " '3',\n", + " '1',\n", + " '1'],\n", + " ['1043',\n", + " '454802329',\n", + " 'F18 Carrier Landing',\n", + " '168557568',\n", + " 'USD',\n", + " '5.99',\n", + " '4656',\n", + " '54',\n", + " '4.5',\n", + " '4.5',\n", + " '7.2',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '11',\n", + " '1'],\n", + " ['1044',\n", + " '454958810',\n", + " 'Flick Champions HD',\n", + " '117258240',\n", + " 'USD',\n", + " '1.99',\n", + " '7289',\n", + " '19',\n", + " '4.5',\n", + " '4.5',\n", + " '2.1.0',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['1045',\n", + " '454988262',\n", + " 'Programme TV Télé Loisirs',\n", + " '81083392',\n", + " 'USD',\n", + " '0',\n", + " '23',\n", + " '0',\n", + " '3.5',\n", + " '0',\n", + " '7.2.1',\n", + " '12+',\n", + " 'Entertainment',\n", + " '37',\n", + " '5',\n", + " '4',\n", + " '1'],\n", + " ['1047',\n", + " '455256615',\n", + " \"White Tiles 2 : Piano Master ( Don't Hit The White Tiles 4 ) - Free Music Game\",\n", + " '31578112',\n", + " 'USD',\n", + " '0',\n", + " '60',\n", + " '7',\n", + " '4',\n", + " '3.5',\n", + " '2.21',\n", + " '4+',\n", + " 'Games',\n", + " '40',\n", + " '4',\n", + " '5',\n", + " '1'],\n", + " ['1048',\n", + " '455612214',\n", + " 'Flashlight ◎',\n", + " '37967872',\n", + " 'USD',\n", + " '0',\n", + " '24744',\n", + " '171',\n", + " '4.5',\n", + " '4',\n", + " '2.0.6',\n", + " '4+',\n", + " 'Business',\n", + " '40',\n", + " '4',\n", + " '11',\n", + " '1'],\n", + " ['1049',\n", + " '455650341',\n", + " 'Real Steel',\n", + " '968384512',\n", + " 'USD',\n", + " '0.99',\n", + " '24880',\n", + " '13',\n", + " '4.5',\n", + " '4',\n", + " '1.37.1',\n", + " '9+',\n", + " 'Games',\n", + " '38',\n", + " '5',\n", + " '8',\n", + " '1'],\n", + " ['1051',\n", + " '455826958',\n", + " 'Pinball Arcade Plus',\n", + " '111875072',\n", + " 'USD',\n", + " '0.99',\n", + " '3716',\n", + " '6',\n", + " '4',\n", + " '2.5',\n", + " '7.1.0',\n", + " '9+',\n", + " 'Games',\n", + " '37',\n", + " '1',\n", + " '1',\n", + " '1'],\n", + " ['1053',\n", + " '456229650',\n", + " 'QQ游戏大厅HD',\n", + " '20161086',\n", + " 'USD',\n", + " '0',\n", + " '338',\n", + " '176',\n", + " '3.5',\n", + " '3.5',\n", + " '1.4',\n", + " '4+',\n", + " 'Entertainment',\n", + " '26',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['1054',\n", + " '456355158',\n", + " 'Doodle Jump FREE - BE WARNED: Insanely addictive',\n", + " '63676416',\n", + " 'USD',\n", + " '0',\n", + " '28153',\n", + " '100',\n", + " '4',\n", + " '4',\n", + " '2.6.3',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['1055',\n", + " '456726080',\n", + " 'Pearson eText for Schools',\n", + " '21083136',\n", + " 'USD',\n", + " '0',\n", + " '609',\n", + " '4',\n", + " '2.5',\n", + " '3',\n", + " '1.11',\n", + " '4+',\n", + " 'Education',\n", + " '24',\n", + " '5',\n", + " '8',\n", + " '1'],\n", + " ['1057',\n", + " '457446957',\n", + " 'Jetpack Joyride',\n", + " '108813312',\n", + " 'USD',\n", + " '0',\n", + " '405647',\n", + " '877',\n", + " '4.5',\n", + " '4.5',\n", + " '1.9.24',\n", + " '9+',\n", + " 'Games',\n", + " '38',\n", + " '5',\n", + " '3',\n", + " '1'],\n", + " ['1058',\n", + " '457517348',\n", + " 'FotoRus -Camera & Photo Editor & Pic Collage Maker',\n", + " '119500800',\n", + " 'USD',\n", + " '0',\n", + " '32558',\n", + " '147',\n", + " '5',\n", + " '4.5',\n", + " '7.0.4',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '38',\n", + " '5',\n", + " '3',\n", + " '1'],\n", + " ['1059',\n", + " '457561360',\n", + " 'Catholic Bible',\n", + " '103469056',\n", + " 'USD',\n", + " '1.99',\n", + " '999',\n", + " '44',\n", + " '4.5',\n", + " '5',\n", + " '3.4',\n", + " '4+',\n", + " 'Reference',\n", + " '37',\n", + " '5',\n", + " '15',\n", + " '1'],\n", + " ['1060',\n", + " '457687954',\n", + " 'Doodle Jump HD',\n", + " '164236288',\n", + " 'USD',\n", + " '2.99',\n", + " '8580',\n", + " '12',\n", + " '4.5',\n", + " '4.5',\n", + " '3.16.4',\n", + " '4+',\n", + " 'Games',\n", + " '24',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['1062',\n", + " '457876088',\n", + " 'ASOS',\n", + " '141503488',\n", + " 'USD',\n", + " '0',\n", + " '9725',\n", + " '109',\n", + " '5',\n", + " '5',\n", + " '3.4.1',\n", + " '4+',\n", + " 'Shopping',\n", + " '37',\n", + " '5',\n", + " '6',\n", + " '1'],\n", + " ['1063',\n", + " '458225159',\n", + " 'NOAA Hi-Def Radar Pro - Storm Warnings, Hurricane Tracker & Weather Forecast',\n", + " '27500544',\n", + " 'USD',\n", + " '1.99',\n", + " '15809',\n", + " '628',\n", + " '5',\n", + " '4.5',\n", + " '2.1',\n", + " '4+',\n", + " 'Weather',\n", + " '38',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['1064',\n", + " '458272450',\n", + " 'eHarmony™ Dating App - Meet Singles',\n", + " '102413312',\n", + " 'USD',\n", + " '0',\n", + " '11124',\n", + " '15',\n", + " '2.5',\n", + " '1',\n", + " '5.5.1',\n", + " '17+',\n", + " 'Social Networking',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['1066',\n", + " '458318329',\n", + " '腾讯视频-欢乐颂2全网首播',\n", + " '112337920',\n", + " 'USD',\n", + " '0',\n", + " '613',\n", + " '9',\n", + " '4',\n", + " '4.5',\n", + " '5.6.2',\n", + " '17+',\n", + " 'Entertainment',\n", + " '38',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['1067',\n", + " '458535809',\n", + " 'Calculator ∞',\n", + " '80345088',\n", + " 'USD',\n", + " '2.99',\n", + " '1138',\n", + " '59',\n", + " '4.5',\n", + " '4.5',\n", + " '4.5',\n", + " '4+',\n", + " 'Education',\n", + " '37',\n", + " '5',\n", + " '15',\n", + " '1'],\n", + " ['1068',\n", + " '458587755',\n", + " '搜狐视频-欢乐颂2 全网首播',\n", + " '109425664',\n", + " 'USD',\n", + " '0',\n", + " '774',\n", + " '0',\n", + " '4.5',\n", + " '0',\n", + " '6.6',\n", + " '17+',\n", + " 'Entertainment',\n", + " '38',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['1069',\n", + " '458813562',\n", + " 'Abby Monkey® Basic Skills: Preschool and Kindergarten Kids Educational Early Learning Adventure Games.▫ TeachMe Counting, Colors, Alphabet, Math, Numbers, Shapes Sorting, Patterns, Puzzles, Learn to Read Letters for Toddler Children',\n", + " '71766016',\n", + " 'USD',\n", + " '2.99',\n", + " '358',\n", + " '59',\n", + " '3.5',\n", + " '4',\n", + " '1.71',\n", + " '4+',\n", + " 'Games',\n", + " '40',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['1070',\n", + " '459023164',\n", + " '唯品会 HD 全球精选,正品特卖',\n", + " '106416128',\n", + " 'USD',\n", + " '0',\n", + " '68',\n", + " '0',\n", + " '4',\n", + " '0',\n", + " '6.0.2',\n", + " '17+',\n", + " 'Shopping',\n", + " '24',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['1071',\n", + " '459035295',\n", + " 'Top Eleven 2017 - Be a Soccer Manager',\n", + " '144414720',\n", + " 'USD',\n", + " '0',\n", + " '14104',\n", + " '61',\n", + " '4.5',\n", + " '4.5',\n", + " '5.7',\n", + " '4+',\n", + " 'Games',\n", + " '38',\n", + " '5',\n", + " '28',\n", + " '1'],\n", + " ['1072',\n", + " '459189186',\n", + " 'Machinarium',\n", + " '258739200',\n", + " 'USD',\n", + " '4.99',\n", + " '7919',\n", + " '73',\n", + " '4.5',\n", + " '4',\n", + " '2.1.1',\n", + " '12+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '14',\n", + " '1'],\n", + " ['1073',\n", + " '459313476',\n", + " 'Tenuto',\n", + " '13062144',\n", + " 'USD',\n", + " '3.99',\n", + " '562',\n", + " '0',\n", + " '5',\n", + " '0',\n", + " '3.0.3',\n", + " '4+',\n", + " 'Music',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['1074',\n", + " '459660048',\n", + " 'STREET FIGHTER II COLLECTION',\n", + " '196291794',\n", + " 'USD',\n", + " '3.99',\n", + " '242',\n", + " '218',\n", + " '4',\n", + " '4',\n", + " '1.00.01',\n", + " '12+',\n", + " 'Games',\n", + " '43',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['1076',\n", + " '460177396',\n", + " 'Twitch',\n", + " '79983616',\n", + " 'USD',\n", + " '0',\n", + " '109549',\n", + " '149',\n", + " '4.5',\n", + " '4.5',\n", + " '3.20.2',\n", + " '12+',\n", + " 'Entertainment',\n", + " '37',\n", + " '5',\n", + " '26',\n", + " '1'],\n", + " ['1077',\n", + " '460494135',\n", + " 'Watch TNT',\n", + " '138006528',\n", + " 'USD',\n", + " '0',\n", + " '6856',\n", + " '8',\n", + " '2',\n", + " '1.5',\n", + " '4.1.1',\n", + " '17+',\n", + " 'Entertainment',\n", + " '37',\n", + " '4',\n", + " '1',\n", + " '1'],\n", + " ['1078',\n", + " '460712294',\n", + " 'Kids Doodle - Movie Kids Color & Draw',\n", + " '21745664',\n", + " 'USD',\n", + " '0',\n", + " '8025',\n", + " '611',\n", + " '4.5',\n", + " '4',\n", + " '2.4.1',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '8',\n", + " '1'],\n", + " ['1081',\n", + " '461123279',\n", + " 'Written Legends: Nightmare at Sea HD (Full)',\n", + " '248307057',\n", + " 'USD',\n", + " '4.99',\n", + " '234',\n", + " '234',\n", + " '4.5',\n", + " '4.5',\n", + " '1.0.0',\n", + " '9+',\n", + " 'Games',\n", + " '26',\n", + " '5',\n", + " '6',\n", + " '1'],\n", + " ['1082',\n", + " '461218759',\n", + " 'Drum Beats+ (Rhythm Metronome, Loops & Grooves Machine)',\n", + " '385908736',\n", + " 'USD',\n", + " '3.99',\n", + " '879',\n", + " '612',\n", + " '4.5',\n", + " '5',\n", + " '3.4',\n", + " '4+',\n", + " 'Music',\n", + " '38',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['1083',\n", + " '461390784',\n", + " 'Real Fishing 3D',\n", + " '184315904',\n", + " 'USD',\n", + " '1.99',\n", + " '880',\n", + " '58',\n", + " '3.5',\n", + " '4',\n", + " '1.1.4',\n", + " '4+',\n", + " 'Games',\n", + " '40',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['1084',\n", + " '461504587',\n", + " 'Trello',\n", + " '140944384',\n", + " 'USD',\n", + " '0',\n", + " '2793',\n", + " '7',\n", + " '4.5',\n", + " '4.5',\n", + " '4.0.7',\n", + " '4+',\n", + " 'Productivity',\n", + " '37',\n", + " '5',\n", + " '21',\n", + " '1'],\n", + " ['1085',\n", + " '461703208',\n", + " '高德地图(精准专业的手机地图)',\n", + " '166025216',\n", + " 'USD',\n", + " '0',\n", + " '1040',\n", + " '5',\n", + " '4.5',\n", + " '4',\n", + " '8.0.8',\n", + " '4+',\n", + " 'Navigation',\n", + " '38',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['1086',\n", + " '462125072',\n", + " '广东移动手机营业厅-话费流量一手掌握,专属优惠定期发放',\n", + " '30503936',\n", + " 'USD',\n", + " '0',\n", + " '33',\n", + " '0',\n", + " '3.5',\n", + " '0',\n", + " '5.2.2',\n", + " '17+',\n", + " 'Utilities',\n", + " '38',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['1087',\n", + " '462134755',\n", + " \"Puppet Pals HD Director's Pass\",\n", + " '103233536',\n", + " 'USD',\n", + " '3.99',\n", + " '54',\n", + " '0',\n", + " '4',\n", + " '0',\n", + " '1.9.2',\n", + " '4+',\n", + " 'Education',\n", + " '24',\n", + " '4',\n", + " '1',\n", + " '1'],\n", + " ['1088',\n", + " '462155908',\n", + " 'Fisheye Lens - Retro Style Fisheye Camera',\n", + " '7671808',\n", + " 'USD',\n", + " '1.99',\n", + " '2485',\n", + " '1564',\n", + " '4.5',\n", + " '4.5',\n", + " '2.1.0',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '40',\n", + " '4',\n", + " '6',\n", + " '1'],\n", + " ['1090',\n", + " '462397814',\n", + " 'Waking Mars',\n", + " '337177600',\n", + " 'USD',\n", + " '4.99',\n", + " '2101',\n", + " '0',\n", + " '4.5',\n", + " '0',\n", + " '2.2',\n", + " '9+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '2',\n", + " '1'],\n", + " ['1091',\n", + " '462638897',\n", + " 'Fitbit',\n", + " '132913152',\n", + " 'USD',\n", + " '0',\n", + " '90496',\n", + " '399',\n", + " '4',\n", + " '3.5',\n", + " '2.36',\n", + " '4+',\n", + " 'Health & Fitness',\n", + " '37',\n", + " '0',\n", + " '9',\n", + " '1'],\n", + " ['1093',\n", + " '462780547',\n", + " 'Watch TBS',\n", + " '109416448',\n", + " 'USD',\n", + " '0',\n", + " '4050',\n", + " '12',\n", + " '2',\n", + " '2.5',\n", + " '4.1.1',\n", + " '12+',\n", + " 'Entertainment',\n", + " '37',\n", + " '4',\n", + " '1',\n", + " '1'],\n", + " ['1095',\n", + " '463142843',\n", + " 'twinkle',\n", + " '17612800',\n", + " 'USD',\n", + " '2.99',\n", + " '5',\n", + " '0',\n", + " '4',\n", + " '0',\n", + " '6.6',\n", + " '17+',\n", + " 'Entertainment',\n", + " '37',\n", + " '1',\n", + " '1',\n", + " '1'],\n", + " ['1098',\n", + " '463240522',\n", + " 'HISTORY Here',\n", + " '23040000',\n", + " 'USD',\n", + " '0',\n", + " '685',\n", + " '369',\n", + " '4',\n", + " '4.5',\n", + " '3.1',\n", + " '4+',\n", + " 'Travel',\n", + " '38',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['1099',\n", + " '463295925',\n", + " 'The Official DVSA Theory Test Kit for Car Drivers',\n", + " '403332096',\n", + " 'USD',\n", + " '4.99',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '0',\n", + " '3.2.2',\n", + " '4+',\n", + " 'Education',\n", + " '38',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['1100',\n", + " '463422433',\n", + " 'Meitu HD',\n", + " '107525120',\n", + " 'USD',\n", + " '0',\n", + " '2150',\n", + " '68',\n", + " '4.5',\n", + " '4.5',\n", + " '5.4.0',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '24',\n", + " '5',\n", + " '3',\n", + " '1'],\n", + " ['1102',\n", + " '463431091',\n", + " 'Railway Route Search',\n", + " '46950400',\n", + " 'USD',\n", + " '0',\n", + " '5',\n", + " '0',\n", + " '3',\n", + " '0',\n", + " '3.17.1',\n", + " '4+',\n", + " 'Navigation',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['1103',\n", + " '463630399',\n", + " 'PINK Nation',\n", + " '86456320',\n", + " 'USD',\n", + " '0',\n", + " '49816',\n", + " '413',\n", + " '4.5',\n", + " '4.5',\n", + " '4.13.2',\n", + " '12+',\n", + " 'Lifestyle',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['1105',\n", + " '463869460',\n", + " \"Ricky Carmichael's Motocross Matchup Pro\",\n", + " '170055680',\n", + " 'USD',\n", + " '0.99',\n", + " '4498',\n", + " '38',\n", + " '4',\n", + " '4.5',\n", + " '1.1.8',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '6',\n", + " '1'],\n", + " ['1107',\n", + " '464235764',\n", + " 'Phonics Island • Early Reading, Spelling & Tracing Montessori Preschool and Kindergarten Kids Learning Adventure Games by Abby Monkey® Alphabet and Letter Sounds Reader',\n", + " '61427712',\n", + " 'USD',\n", + " '2.99',\n", + " '199',\n", + " '73',\n", + " '3.5',\n", + " '3',\n", + " '1.71',\n", + " '4+',\n", + " 'Education',\n", + " '40',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['1108',\n", + " '464309202',\n", + " 'LotteryHUB',\n", + " '47699968',\n", + " 'USD',\n", + " '0',\n", + " '2417',\n", + " '39',\n", + " '3',\n", + " '1.5',\n", + " '5.0.3',\n", + " '12+',\n", + " 'News',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['1109',\n", + " '464352883',\n", + " 'Infinite Campus Mobile Portal',\n", + " '28331008',\n", + " 'USD',\n", + " '0',\n", + " '2286',\n", + " '46',\n", + " '2.5',\n", + " '1.5',\n", + " '3.0.9',\n", + " '4+',\n", + " 'Education',\n", + " '37',\n", + " '1',\n", + " '1',\n", + " '1'],\n", + " ['1110',\n", + " '464660903',\n", + " 'Perfect Image - Pic Collage Maker, Add Text to Photo, Cool Picture Editor',\n", + " '77390848',\n", + " 'USD',\n", + " '0',\n", + " '1646',\n", + " '141',\n", + " '4.5',\n", + " '4.5',\n", + " '3.8.2',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '38',\n", + " '5',\n", + " '5',\n", + " '1'],\n", + " ['1111',\n", + " '465092669',\n", + " 'NHL',\n", + " '160124928',\n", + " 'USD',\n", + " '0',\n", + " '15554',\n", + " '124',\n", + " '3.5',\n", + " '5',\n", + " '8.6.1',\n", + " '4+',\n", + " 'Sports',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['1112',\n", + " '465173198',\n", + " 'Cronometer',\n", + " '17243136',\n", + " 'USD',\n", + " '2.99',\n", + " '210',\n", + " '7',\n", + " '3',\n", + " '3.5',\n", + " '1.8.4',\n", + " '4+',\n", + " 'Health & Fitness',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['1113',\n", + " '465694275',\n", + " 'Zen Pinball',\n", + " '68499456',\n", + " 'USD',\n", + " '0',\n", + " '6534',\n", + " '94',\n", + " '4.5',\n", + " '4.5',\n", + " '1.42.1',\n", + " '9+',\n", + " 'Games',\n", + " '38',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['1114',\n", + " '466252999',\n", + " 'Green Kitchen – healthy vegetarian recipes',\n", + " '407632896',\n", + " 'USD',\n", + " '3.99',\n", + " '311',\n", + " '21',\n", + " '4.5',\n", + " '4.5',\n", + " '2.11',\n", + " '4+',\n", + " 'Food & Drink',\n", + " '37',\n", + " '4',\n", + " '8',\n", + " '1'],\n", + " ['1118',\n", + " '466710109',\n", + " 'HB2 PLUS',\n", + " '56817664',\n", + " 'USD',\n", + " '0.99',\n", + " '54073',\n", + " '73',\n", + " '5',\n", + " '4',\n", + " '1.3.0',\n", + " '4+',\n", + " 'Games',\n", + " '38',\n", + " '5',\n", + " '4',\n", + " '1'],\n", + " ['1119',\n", + " '466965151',\n", + " 'The Sims™ FreePlay',\n", + " '695603200',\n", + " 'USD',\n", + " '0',\n", + " '446880',\n", + " '1832',\n", + " '4.5',\n", + " '4',\n", + " '5.29.0',\n", + " '12+',\n", + " 'Games',\n", + " '38',\n", + " '5',\n", + " '12',\n", + " '1'],\n", + " ['1122',\n", + " '467067151',\n", + " '百度糯米-电影,美食团购',\n", + " '127980544',\n", + " 'USD',\n", + " '0',\n", + " '383',\n", + " '0',\n", + " '4.5',\n", + " '0',\n", + " '7.5.0',\n", + " '17+',\n", + " 'Lifestyle',\n", + " '37',\n", + " '0',\n", + " '2',\n", + " '1'],\n", + " ['1123',\n", + " '467329677',\n", + " 'Mathway - Math Problem Solver',\n", + " '94260224',\n", + " 'USD',\n", + " '0',\n", + " '1854',\n", + " '28',\n", + " '3.5',\n", + " '3.5',\n", + " '3.1.0',\n", + " '4+',\n", + " 'Education',\n", + " '37',\n", + " '5',\n", + " '7',\n", + " '1'],\n", + " ['1124',\n", + " '467703220',\n", + " 'Elmo Calls',\n", + " '87581696',\n", + " 'USD',\n", + " '1.99',\n", + " '1915',\n", + " '38',\n", + " '4',\n", + " '4.5',\n", + " '3.7',\n", + " '4+',\n", + " 'Games',\n", + " '38',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['1125',\n", + " '467738064',\n", + " 'AEO|Aerie: Jeans, Dresses, Swimsuits & Bralettes',\n", + " '64024576',\n", + " 'USD',\n", + " '0',\n", + " '6408',\n", + " '77',\n", + " '4',\n", + " '4.5',\n", + " '4.1.2',\n", + " '4+',\n", + " 'Shopping',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['1126',\n", + " '467923185',\n", + " 'Loopy HD',\n", + " '26399744',\n", + " 'USD',\n", + " '3.99',\n", + " '561',\n", + " '4',\n", + " '4',\n", + " '5',\n", + " '1.6.3',\n", + " '4+',\n", + " 'Music',\n", + " '37',\n", + " '5',\n", + " '4',\n", + " '1'],\n", + " ['1127',\n", + " '467953363',\n", + " 'Best Hunting Times',\n", + " '6603776',\n", + " 'USD',\n", + " '2.99',\n", + " '123',\n", + " '9',\n", + " '4',\n", + " '4',\n", + " '4.2',\n", + " '4+',\n", + " 'Weather',\n", + " '38',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['1129',\n", + " '468090416',\n", + " 'SamCard Pro-card reader&business card scanner&ocr',\n", + " '21118976',\n", + " 'USD',\n", + " '5.99',\n", + " '875',\n", + " '123',\n", + " '4.5',\n", + " '4.5',\n", + " '2.3.3',\n", + " '4+',\n", + " 'Business',\n", + " '37',\n", + " '0',\n", + " '7',\n", + " '1'],\n", + " ['1130',\n", + " '468401854',\n", + " 'Daily Classifieds for iPhone',\n", + " '93220864',\n", + " 'USD',\n", + " '0.99',\n", + " '7973',\n", + " '884',\n", + " '4',\n", + " '4.5',\n", + " '6.2.4.0',\n", + " '17+',\n", + " 'News',\n", + " '37',\n", + " '0',\n", + " '5',\n", + " '1'],\n", + " ['1131',\n", + " '468429333',\n", + " 'Runtastic Road Bike GPS Cycling Route Tracker PRO',\n", + " '57786368',\n", + " 'USD',\n", + " '4.99',\n", + " '3800',\n", + " '99',\n", + " '4.5',\n", + " '4.5',\n", + " '3.5',\n", + " '4+',\n", + " 'Health & Fitness',\n", + " '37',\n", + " '0',\n", + " '15',\n", + " '1'],\n", + " ['1132',\n", + " '468564994',\n", + " 'Tasty Planet: Back for Seconds',\n", + " '31039488',\n", + " 'USD',\n", + " '2.99',\n", + " '264',\n", + " '56',\n", + " '4.5',\n", + " '4.5',\n", + " '1.4',\n", + " '9+',\n", + " 'Games',\n", + " '43',\n", + " '0',\n", + " '8',\n", + " '1'],\n", + " ['1133',\n", + " '468566852',\n", + " 'Tasty Planet: Back for Seconds HD',\n", + " '29511680',\n", + " 'USD',\n", + " '4.99',\n", + " '135',\n", + " '62',\n", + " '4.5',\n", + " '4.5',\n", + " '1.4',\n", + " '9+',\n", + " 'Games',\n", + " '26',\n", + " '5',\n", + " '8',\n", + " '1'],\n", + " ['1135',\n", + " '468674094',\n", + " 'Scanner911 HD Police Radio Pro',\n", + " '4348875',\n", + " 'USD',\n", + " '3.99',\n", + " '204',\n", + " '166',\n", + " '4',\n", + " '4',\n", + " '3.95',\n", + " '12+',\n", + " 'News',\n", + " '26',\n", + " '3',\n", + " '2',\n", + " '1'],\n", + " ['1136',\n", + " '468996152',\n", + " 'OfferUp - Buy. Sell. Simple.',\n", + " '73138176',\n", + " 'USD',\n", + " '0',\n", + " '57348',\n", + " '1213',\n", + " '4.5',\n", + " '4.5',\n", + " '2.10.17',\n", + " '4+',\n", + " 'Shopping',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['1137',\n", + " '469024771',\n", + " '随手记专业版 for iPad',\n", + " '32996352',\n", + " 'USD',\n", + " '0.99',\n", + " '240',\n", + " '1',\n", + " '4.5',\n", + " '5',\n", + " '4.0.0',\n", + " '4+',\n", + " 'Finance',\n", + " '24',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['1138',\n", + " '469284907',\n", + " 'HP All-in-One Printer Remote',\n", + " '60647424',\n", + " 'USD',\n", + " '0',\n", + " '9819',\n", + " '415',\n", + " '4.5',\n", + " '4.5',\n", + " '5.3',\n", + " '4+',\n", + " 'Productivity',\n", + " '37',\n", + " '2',\n", + " '14',\n", + " '1'],\n", + " ['1139',\n", + " '469337564',\n", + " 'Adobe Acrobat Reader: View, Create, & Convert PDFs',\n", + " '81007616',\n", + " 'USD',\n", + " '0',\n", + " '20069',\n", + " '33',\n", + " '4',\n", + " '4.5',\n", + " '17.05.23',\n", + " '4+',\n", + " 'Business',\n", + " '37',\n", + " '5',\n", + " '19',\n", + " '1'],\n", + " ['1140',\n", + " '469338840',\n", + " '飞常准Pro-全球航班查询机票酒店预订',\n", + " '94053376',\n", + " 'USD',\n", + " '0.99',\n", + " '132',\n", + " '1',\n", + " '4',\n", + " '5',\n", + " '4.0.5',\n", + " '17+',\n", + " 'Travel',\n", + " '37',\n", + " '0',\n", + " '2',\n", + " '1'],\n", + " ['1142',\n", + " '469343097',\n", + " 'MEGA MAN X',\n", + " '90374144',\n", + " 'USD',\n", + " '4.99',\n", + " '3099',\n", + " '105',\n", + " '4.5',\n", + " '4.5',\n", + " '1.03.22',\n", + " '4+',\n", + " 'Games',\n", + " '40',\n", + " '5',\n", + " '6',\n", + " '1'],\n", + " ['1143',\n", + " '469369175',\n", + " 'CSR Racing',\n", + " '524803072',\n", + " 'USD',\n", + " '0',\n", + " '677247',\n", + " '2029',\n", + " '4.5',\n", + " '4.5',\n", + " '4.0.1',\n", + " '4+',\n", + " 'Games',\n", + " '37',\n", + " '5',\n", + " '10',\n", + " '1'],\n", + " ['1144',\n", + " '469610082',\n", + " 'Riptide GP',\n", + " '41246720',\n", + " 'USD',\n", + " '0.99',\n", + " '3883',\n", + " '675',\n", + " '4',\n", + " '4',\n", + " '1.4.1',\n", + " '4+',\n", + " 'Games',\n", + " '40',\n", + " '4',\n", + " '1',\n", + " '1'],\n", + " ['1145',\n", + " '469622080',\n", + " 'Math Practice - Integers',\n", + " '2598912',\n", + " 'USD',\n", + " '0.99',\n", + " '11',\n", + " '0',\n", + " '4',\n", + " '0',\n", + " '2.0',\n", + " '4+',\n", + " 'Education',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['1146',\n", + " '469863705',\n", + " 'Khan Academy: you can learn anything',\n", + " '162706432',\n", + " 'USD',\n", + " '0',\n", + " '5459',\n", + " '10',\n", + " '4',\n", + " '4.5',\n", + " '4.3.0',\n", + " '4+',\n", + " 'Education',\n", + " '37',\n", + " '5',\n", + " '6',\n", + " '1'],\n", + " ['1148',\n", + " '469960709',\n", + " 'Bejeweled Blitz',\n", + " '91591680',\n", + " 'USD',\n", + " '0',\n", + " '221002',\n", + " '131',\n", + " '4',\n", + " '4',\n", + " '1.29.1',\n", + " '4+',\n", + " 'Games',\n", + " '38',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['1149',\n", + " '469964520',\n", + " 'Lloyds Bank Mobile Banking',\n", + " '104023040',\n", + " 'USD',\n", + " '0',\n", + " '17',\n", + " '5',\n", + " '4.5',\n", + " '4',\n", + " '16.1',\n", + " '4+',\n", + " 'Finance',\n", + " '37',\n", + " '0',\n", + " '1',\n", + " '1'],\n", + " ['1150',\n", + " '470412139',\n", + " 'Sleepy Hollow: Mystery Legends HD (Full)',\n", + " '375949016',\n", + " 'USD',\n", + " '4.99',\n", + " '168',\n", + " '168',\n", + " '4',\n", + " '4',\n", + " '1.0.1',\n", + " '9+',\n", + " 'Games',\n", + " '26',\n", + " '5',\n", + " '4',\n", + " '1'],\n", + " ['1151',\n", + " '470412147',\n", + " 'Poshmark: Buy & Sell Fashion',\n", + " '58299392',\n", + " 'USD',\n", + " '0',\n", + " '18035',\n", + " '156',\n", + " '4.5',\n", + " '4.5',\n", + " '2.70',\n", + " '4+',\n", + " 'Shopping',\n", + " '37',\n", + " '5',\n", + " '1',\n", + " '1'],\n", + " ['1152',\n", + " '470578793',\n", + " 'Secret Calculator Pro - Hide photos & videos',\n", + " '14578688',\n", + " 'USD',\n", + " '1.99',\n", + " '2504',\n", + " '644',\n", + " '4.5',\n", + " '5',\n", + " '1.13',\n", + " '4+',\n", + " 'Photo & Video',\n", + " '37',\n", + " '0',\n", + " '12',\n", + " '1'],\n", + " ...]" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "apps_data" + ] + }, + { + "cell_type": "code", + "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "ratings = []\n", "for row in apps_data[1:]: #we iterated over the apps_data[1:]\n", " rating = float(row[7]) #Assign the rating as a float to a variable named rating.\n", - " price = float(row[4]) #Assign the price as a float to a variable named price.\n", + " price = float(row[5]) #Assign the price as a float to a variable named price.\n", " \n", " if price == 0.0: #If the price is equal to 0.0, that means this is a free app\n", " ratings.append(rating)# we append the rating to the ratings list" @@ -123,12 +17147,28 @@ }, { "cell_type": "code", - "execution_count": 43, + "execution_count": 10, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "569.4008875739645\n" + ] + } + ], "source": [ "## Start your code below:\n", - "\n", + "ratings = []\n", + "for row in apps_data[1:]: #we iterated over the apps_data[1:]\n", + " rating = float(row[7]) #Assign the rating as a float to a variable named rating.\n", + " price = float(row[5]) #Assign the price as a float to a variable named price.\n", + " \n", + " if price == 0.0: #If the price is equal to 0.0, that means this is a free app\n", + " ratings.append(rating)# we append the rating to the ratings list\n", + "avg_rating_free = sum(ratings)/len(ratings)\n", + "print(avg_rating_free)\n", "\n" ] }, @@ -144,7 +17184,7 @@ }, { "cell_type": "code", - "execution_count": 44, + "execution_count": 11, "metadata": {}, "outputs": [ { @@ -171,7 +17211,7 @@ }, { "cell_type": "code", - "execution_count": 45, + "execution_count": 12, "metadata": {}, "outputs": [ { @@ -180,7 +17220,7 @@ "bool" ] }, - "execution_count": 45, + "execution_count": 12, "metadata": {}, "output_type": "execute_result" } @@ -191,7 +17231,7 @@ }, { "cell_type": "code", - "execution_count": 46, + "execution_count": 13, "metadata": {}, "outputs": [ { @@ -200,7 +17240,7 @@ "bool" ] }, - "execution_count": 46, + "execution_count": 13, "metadata": {}, "output_type": "execute_result" } @@ -224,7 +17264,7 @@ }, { "cell_type": "code", - "execution_count": 47, + "execution_count": 14, "metadata": {}, "outputs": [ { @@ -244,7 +17284,7 @@ }, { "cell_type": "code", - "execution_count": 48, + "execution_count": 15, "metadata": {}, "outputs": [ { @@ -270,15 +17310,15 @@ }, { "cell_type": "code", - "execution_count": 49, + "execution_count": 16, "metadata": {}, "outputs": [ { "ename": "SyntaxError", - "evalue": "invalid syntax (, line 2)", + "evalue": "cannot assign to literal here. Maybe you meant '==' instead of '='? (2741783690.py, line 2)", "output_type": "error", "traceback": [ - "\u001b[0;36m File \u001b[0;32m\"\"\u001b[0;36m, line \u001b[0;32m2\u001b[0m\n\u001b[0;31m if 10 = 10:\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n" + "\u001b[1;36m Cell \u001b[1;32mIn[16], line 2\u001b[1;36m\u001b[0m\n\u001b[1;33m if 10 = 10:\u001b[0m\n\u001b[1;37m ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m cannot assign to literal here. Maybe you meant '==' instead of '='?\n" ] } ], @@ -297,7 +17337,7 @@ }, { "cell_type": "code", - "execution_count": 50, + "execution_count": 17, "metadata": {}, "outputs": [ { @@ -329,7 +17369,7 @@ }, { "cell_type": "code", - "execution_count": 51, + "execution_count": 18, "metadata": {}, "outputs": [ { @@ -363,13 +17403,25 @@ }, { "cell_type": "code", - "execution_count": 52, + "execution_count": 19, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "This is free\n" + ] + } + ], "source": [ "price = 0\n", "\n", - "#start your code here:\n" + "#start your code here:\n", + "if price == 0:\n", + " print(\"This is free\")\n", + "elif price == 1:\n", + " print(\"This is not free\")" ] }, { @@ -383,7 +17435,7 @@ }, { "cell_type": "code", - "execution_count": 53, + "execution_count": 20, "metadata": {}, "outputs": [ { @@ -422,7 +17474,7 @@ }, { "cell_type": "code", - "execution_count": 54, + "execution_count": 50, "metadata": {}, "outputs": [], "source": [ @@ -434,8 +17486,8 @@ "\n", "ratings = []\n", "for row in apps_data[1:]: #we looped through a list of lists named apps_data\n", - " rating = float(row[7]) #extract the rating of the app and assign the rating as a float to a variable named rating.\n", - " price = float(row[4]) #extract the price of the app and assign the price as a float to a variable named price.\n", + " rating = float(row[8]) #extract the rating of the app and assign the rating as a float to a variable named rating.\n", + " price = float(row[5]) #extract the price of the app and assign the price as a float to a variable named price.\n", " \n", " if price == 0.0: #If the price is equal to 0.0, that means this is a free app\n", " ratings.append(rating)# we append the rating to the ratings list" @@ -454,7 +17506,7 @@ }, { "cell_type": "code", - "execution_count": 55, + "execution_count": 23, "metadata": {}, "outputs": [ { @@ -480,7 +17532,7 @@ }, { "cell_type": "code", - "execution_count": 56, + "execution_count": 24, "metadata": {}, "outputs": [ { @@ -522,9 +17574,17 @@ }, { "cell_type": "code", - "execution_count": 58, + "execution_count": 49, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "3.720948742438714\n" + ] + } + ], "source": [ "# INITIAL CODE\n", "opened_file = open('AppleStore.csv', encoding='utf8')\n", @@ -532,14 +17592,16 @@ "read_file = reader(opened_file)\n", "apps_data = list(read_file)\n", "\n", - "free_apps_ratings = []\n", + "non_free_apps_ratings = []\n", "for row in apps_data[1:]:\n", - " rating = float(row[7])\n", - " price = float(row[4]) \n", - " if price == 0.0:\n", - " free_apps_ratings.append(rating)\n", + " rating = float(row[8])\n", + " price = float(row[5]) \n", + " if price != 0.0:\n", + " non_free_apps_ratings.append(rating)\n", " \n", - "avg_rating_free = sum(free_apps_ratings) / len(free_apps_ratings)" + "avg_rating_non_free = sum(non_free_apps_ratings) / len(non_free_apps_ratings)\n", + "\n", + "print(avg_rating_non_free)" ] }, { @@ -552,7 +17614,7 @@ }, { "cell_type": "code", - "execution_count": 59, + "execution_count": 28, "metadata": {}, "outputs": [ { @@ -572,7 +17634,7 @@ }, { "cell_type": "code", - "execution_count": 60, + "execution_count": 29, "metadata": {}, "outputs": [ { @@ -603,7 +17665,7 @@ }, { "cell_type": "code", - "execution_count": 62, + "execution_count": 48, "metadata": {}, "outputs": [ { @@ -618,8 +17680,8 @@ "games_ratings = [] #initialize an empty list named games_ratings\n", "\n", "for row in apps_data[1:]: \n", - " rating = float(row[7]) #extract the rating information and assign the rating to the variable rating\n", - " genre = row[11] #extract the genre information and assign the genre to the variable named genre\n", + " rating = float(row[8]) #extract the rating information and assign the rating to the variable rating\n", + " genre = row[12] #extract the genre information and assign the genre to the variable named genre\n", " \n", " if genre == 'Games': #if the genre is 'Games'\n", " games_ratings.append(rating) # append the rating value stored in rating to the list games_ratings\n", @@ -638,9 +17700,17 @@ }, { "cell_type": "code", - "execution_count": 63, + "execution_count": 47, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "3.343928035982009\n" + ] + } + ], "source": [ "#reading the dataset\n", "opened_file = open('AppleStore.csv', encoding='utf8')\n", @@ -650,13 +17720,20 @@ "\n", "#start your code here:\n", "#Initialize an empty list named non_games_ratings.\n", + "non_games_ratings=[]\n", "\n", "#Loop through the apps_data\n", + "for row in apps_data[1:]:\n", + " rating = float(row[8])\n", + " genre = row[12]\n", "\n", + " if genre != 'Games':\n", + " non_games_ratings.append(rating)\n", "\n", "#Compute the average rating of non-gaming apps\n", "#and assign the result to a variable named avg_rating_non_games\n", - "\n" + "avg_rating_non_games = sum(non_games_ratings) / len(non_games_ratings) #compute the average rating of gaming apps\n", + "print(avg_rating_non_games)\n" ] }, { @@ -682,7 +17759,7 @@ }, { "cell_type": "code", - "execution_count": 64, + "execution_count": 35, "metadata": {}, "outputs": [ { @@ -706,7 +17783,7 @@ }, { "cell_type": "code", - "execution_count": 65, + "execution_count": 36, "metadata": {}, "outputs": [ { @@ -737,7 +17814,7 @@ }, { "cell_type": "code", - "execution_count": 66, + "execution_count": 37, "metadata": {}, "outputs": [ { @@ -788,14 +17865,14 @@ }, { "cell_type": "code", - "execution_count": 71, + "execution_count": 51, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "[0.0, 0.0, 0.0, 0.0, 0.0]\n" + "[5.0, 5.0, 5.0, 5.0, 5.0]\n" ] }, { @@ -804,7 +17881,7 @@ "4029" ] }, - "execution_count": 71, + "execution_count": 51, "metadata": {}, "output_type": "execute_result" } @@ -813,8 +17890,8 @@ "games_social_ratings = []\n", "\n", "for row in apps_data[1:]:\n", - " ratings = float(row[7])\n", - " genre = row[11]\n", + " ratings = float(row[8])\n", + " genre = row[12]\n", " \n", " if genre == 'Social Networking' or genre == 'Games':\n", " games_social_ratings.append(rating)\n", @@ -832,7 +17909,7 @@ }, { "cell_type": "code", - "execution_count": 72, + "execution_count": 40, "metadata": {}, "outputs": [ { @@ -856,7 +17933,7 @@ }, { "cell_type": "code", - "execution_count": 73, + "execution_count": 41, "metadata": {}, "outputs": [ { @@ -932,16 +18009,16 @@ }, { "cell_type": "code", - "execution_count": 76, + "execution_count": 52, "metadata": {}, "outputs": [], "source": [ "free_games_social_ratings = []\n", "\n", "for row in apps_data[1:]:\n", - " rating = float(row[7])\n", - " genre = row[11]\n", - " price = float(row[4])\n", + " rating = float(row[8])\n", + " genre = row[12]\n", + " price = float(row[5])\n", " \n", " if(genre == 'Social Networking' or genre == 'Games') and price == 0:\n", " free_games_social_ratings.append(rating)" @@ -982,7 +18059,7 @@ }, { "cell_type": "code", - "execution_count": 77, + "execution_count": 44, "metadata": {}, "outputs": [ { @@ -1015,7 +18092,7 @@ }, { "cell_type": "code", - "execution_count": 78, + "execution_count": 45, "metadata": {}, "outputs": [ { @@ -1054,9 +18131,17 @@ }, { "cell_type": "code", - "execution_count": 79, + "execution_count": 46, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "3.9049844236760123\n" + ] + } + ], "source": [ "opened_file = open('AppleStore.csv', encoding='utf8')\n", "from csv import reader\n", @@ -1064,17 +18149,25 @@ "apps_data = list(read_file)\n", "\n", "free_games_social_ratings = []\n", + "non_free_games = []\n", "for row in apps_data[1:]:\n", - " rating = float(row[7])\n", - " genre = row[11]\n", - " price = float(row[4])\n", + " rating = float(row[8])\n", + " genre = row[12]\n", + " price = float(row[5])\n", " \n", " if (genre == 'Social Networking' or genre == 'Games') and price == 0:\n", " free_games_social_ratings.append(rating)\n", + "\n", + " if (genre == 'Games' and price != 0):\n", + " non_free_games.append(rating)\n", + "\n", " \n", "avg_free = sum(free_games_social_ratings) / len(free_games_social_ratings)\n", "\n", - "# Non-free apps (average)" + "# Non-free apps (average)\n", + "avg_non_free = sum(non_free_games) / len(non_free_games)\n", + "print(avg_non_free)\n", + "\n" ] }, { @@ -1101,7 +18194,7 @@ }, { "cell_type": "code", - "execution_count": 80, + "execution_count": 53, "metadata": {}, "outputs": [ { @@ -1175,7 +18268,7 @@ }, { "cell_type": "code", - "execution_count": 82, + "execution_count": 54, "metadata": {}, "outputs": [ { @@ -1184,7 +18277,7 @@ "4781" ] }, - "execution_count": 82, + "execution_count": 54, "metadata": {}, "output_type": "execute_result" } @@ -1193,7 +18286,7 @@ "apps_4_or_greater = [] #initialized an empty list named apps_4_or_greater\n", "\n", "for row in apps_data[1:]:\n", - " rating = float(row[7]) #Stored the rating value as a float to a variable named rating\n", + " rating = float(row[8]) #Stored the rating value as a float to a variable named rating\n", " if rating >= 4.0:\n", " apps_4_or_greater.append(rating)\n", " \n", @@ -1209,7 +18302,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 56, "metadata": {}, "outputs": [ { @@ -1224,7 +18317,7 @@ "n_of_apps = 0 #Initialized a variable n_of_apps with a value of 0\n", "\n", "for row in apps_data[1:]:\n", - " rating = float(row[7]) #Stored the rating value as a float to a variable named rating\n", + " rating = float(row[8]) #Stored the rating value as a float to a variable named rating\n", " if rating >= 4.0:\n", " n_of_apps = n_of_apps + 1 #Incremented the value of n_of_apps by 1 \n", " #if the value stored in rating was greater than or equal to 4.0\n", @@ -1243,7 +18336,7 @@ }, { "cell_type": "code", - "execution_count": 85, + "execution_count": 57, "metadata": {}, "outputs": [ { @@ -1281,7 +18374,7 @@ }, { "cell_type": "code", - "execution_count": 86, + "execution_count": 58, "metadata": {}, "outputs": [ { @@ -1419,14 +18512,14 @@ }, { "cell_type": "code", - "execution_count": 91, + "execution_count": 59, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "[['GoodNotes', 19.99, 'afforable'], ['Call of Duty Zombies', 5.0, 'afforable'], ['Notability', 29.99, 'expensive'], ['Snapchat', 0.0, 'free']]\n" + "[['GoodNotes', 19.99, 'affordable'], ['Call of Duty Zombies', 5.0, 'affordable'], ['Notability', 29.99, 'expensive'], ['Snapchat', 0.0, 'free']]\n" ] } ], @@ -1463,14 +18556,14 @@ }, { "cell_type": "code", - "execution_count": 92, + "execution_count": 60, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "[['GoodNotes', 19.99, 'afforable'], ['Call of Duty Zombies', 5.0, 'afforable'], ['Notability', 29.99, 'expensive'], ['Snapchat', 0.0, 'free']]\n" + "[['GoodNotes', 19.99, 'affordable'], ['Call of Duty Zombies', 5.0, 'affordable'], ['Notability', 29.99, 'expensive'], ['Snapchat', 0.0, 'free']]\n" ] } ], @@ -1508,7 +18601,7 @@ }, { "cell_type": "code", - "execution_count": 93, + "execution_count": 61, "metadata": {}, "outputs": [ { @@ -1555,9 +18648,21 @@ }, { "cell_type": "code", - "execution_count": 94, + "execution_count": 67, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['', 'id', 'track_name', 'size_bytes', 'currency', 'price', 'rating_count_tot', 'rating_count_ver', 'user_rating', 'user_rating_ver', 'ver', 'cont_rating', 'prime_genre', 'sup_devices.num', 'ipadSc_urls.num', 'lang.num', 'vpp_lic', 'price_label']\n", + "['1', '281656475', 'PAC-MAN Premium', '100788224', 'USD', '3.99', '21292', '26', '4', '4.5', '6.3.5', '4+', 'Games', '38', '5', '10', '1', 'affordable']\n", + "['2', '281796108', 'Evernote - stay organized', '158578688', 'USD', '0', '161065', '26', '4', '3.5', '8.2.2', '4+', 'Productivity', '37', '5', '23', '1', 'free']\n", + "['3', '281940292', 'WeatherBug - Local Weather, Radar, Maps, Alerts', '100524032', 'USD', '0', '188583', '2822', '3.5', '4.5', '5.0.0', '4+', 'Weather', '37', '5', '3', '1', 'free']\n", + "['4', '282614216', 'eBay: Best App to Buy, Sell, Save! Online Shopping', '128512000', 'USD', '0', '262241', '649', '4', '4.5', '5.10.0', '12+', 'Shopping', '37', '5', '9', '1', 'free']\n" + ] + } + ], "source": [ "# INITIAL CODE\n", "opened_file = open('AppleStore.csv', encoding='utf8')\n", @@ -1566,9 +18671,29 @@ "apps_data = list(read_file)\n", "\n", "for app in apps_data[1:]:\n", - " price = float(app[4])\n", - " # Complete code from here" + " price = float(app[5])\n", + " # Complete code from here\n", + " if price == 0.0:\n", + " app.append(\"free\")\n", + " elif price > 0.0 and price < 20:\n", + " app.append(\"affordable\")\n", + " elif price >= 20 and price < 50:\n", + " app.append(\"expensive\")\n", + " elif price >= 50:\n", + " app.append(\"very expensive\")\n", + "\n", + "apps_data[0].append(\"price_label\")\n", + "\n", + "for row in apps_data[:5]:\n", + " print(row)" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { @@ -1587,7 +18712,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.1" + "version": "3.10.1" } }, "nbformat": 4, From 6c13496796f7d828738a55237af013ccb02611e6 Mon Sep 17 00:00:00 2001 From: andren967 Date: Sun, 29 Oct 2023 09:54:50 +0100 Subject: [PATCH 4/5] Exercises for EH4 --- Exercises/EN/Basic/05_Control_Flow_NA.ipynb | 196 ++- ...Dictionaries_And_Frequency_Tables_NA.ipynb | 951 +++++++++++++ .../Basic/09_Functions_Fundamentals_NA.ipynb | 1101 +++++++++++++++ .../Basic/10_Functions_Intermediate_NA.ipynb | 1207 +++++++++++++++++ 4 files changed, 3434 insertions(+), 21 deletions(-) create mode 100644 Exercises/EN/Basic/08_Dictionaries_And_Frequency_Tables_NA.ipynb create mode 100644 Exercises/EN/Basic/09_Functions_Fundamentals_NA.ipynb create mode 100644 Exercises/EN/Basic/10_Functions_Intermediate_NA.ipynb diff --git a/Exercises/EN/Basic/05_Control_Flow_NA.ipynb b/Exercises/EN/Basic/05_Control_Flow_NA.ipynb index a842943c..ece4bca0 100644 --- a/Exercises/EN/Basic/05_Control_Flow_NA.ipynb +++ b/Exercises/EN/Basic/05_Control_Flow_NA.ipynb @@ -11,7 +11,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ @@ -28,14 +28,14 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "51.17707003576188\n" + "53.85629745567594\n" ] } ], @@ -65,7 +65,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "metadata": {}, "outputs": [ { @@ -1096,7 +1096,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -1115,10 +1115,54 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 35, "metadata": {}, "outputs": [], - "source": [] + "source": [ + "def print_element_pre_suc(list):\n", + " i = 0\n", + " for element in list:\n", + " prev_index = i-1\n", + " suc_index = i+1\n", + " print(\"Element: \", str(element))\n", + " if prev_index > 0: print(\"predecessor: \", str(list[i-1]))\n", + " if suc_index < len(list): print(\"successor: \", str(list[i+1]))\n", + " i+=1\n", + " print (\"-----------------------------\")" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Element: 1\n", + "successor: [2, 3, 4]\n", + "-----------------------------\n", + "Element: [2, 3, 4]\n", + "successor: 3\n", + "-----------------------------\n", + "Element: 3\n", + "predecessor: [2, 3, 4]\n", + "successor: 4\n", + "-----------------------------\n", + "Element: 4\n", + "predecessor: 3\n", + "successor: (2, 2, 3, 4)\n", + "-----------------------------\n", + "Element: (2, 2, 3, 4)\n", + "predecessor: 4\n", + "-----------------------------\n" + ] + } + ], + "source": [ + "print_element_pre_suc([1,[2,3,4],3,4,(2,2,3,4)])" + ] }, { "cell_type": "markdown", @@ -1129,10 +1173,44 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 79, "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "6.9917\n" + ] + } + ], + "source": [ + "i= 0\n", + "sum=0\n", + "releases = 10000\n", + "while i < releases:\n", + " sum += random.randint(1,6)+ random.randint(1,6)\n", + " i += 1\n", + "\n", + "print(sum/releases)" + ] + }, + { + "cell_type": "code", + "execution_count": 66, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "1\n" + ] + } + ], + "source": [ + "print(random.randint(1,6))" + ] }, { "cell_type": "markdown", @@ -1146,10 +1224,27 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 69, "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "6857\n" + ] + } + ], + "source": [ + "number = 600851475143\n", + "prime_factor = 2\n", + "while number > 1:\n", + " if number % prime_factor == 0:\n", + " number //= prime_factor\n", + " else:\n", + " prime_factor += 1\n", + "print(prime_factor)" + ] }, { "cell_type": "markdown", @@ -1173,7 +1268,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 70, "metadata": { "collapsed": false, "jupyter": { @@ -1187,7 +1282,7 @@ "'gnirts modnar A'" ] }, - "execution_count": 4, + "execution_count": 70, "metadata": {}, "output_type": "execute_result" } @@ -1198,10 +1293,44 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 94, "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ja\n", + "913*993=906609\n" + ] + } + ], + "source": [ + "number = 9009\n", + "if str(number) == str(number)[-1::-1]:\n", + " print(\"Ja\")\n", + "else:\n", + " print(\"nein\")\n", + "\n", + "i = 100\n", + "j = 100\n", + "max_number = 0\n", + "max_i = 0\n", + "max_j = 0\n", + "\n", + "while (len(str(i)) == 3 and len(str(j)) == 3):\n", + " for j in range(100,1000):\n", + " number = i*j\n", + " if str(number) == str(number)[-1::-1]:\n", + " #print(f'{i}*{j}={number}')\n", + " if number > max_number:\n", + " max_number = number\n", + " max_i = i\n", + " max_j = j\n", + " i+=1\n", + "#Answer\n", + "print(f'{max_i}*{max_j}={max_number}')\n" + ] }, { "cell_type": "markdown", @@ -1229,10 +1358,35 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 82, "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "data": { + "text/plain": [ + "[40, 20, 10, 5, 16, 8, 4, 2, 1]" + ] + }, + "execution_count": 82, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# First example\n", + "\n", + "seq = []\n", + "num = 13\n", + "while num != 1:\n", + " # rule for even numbers\n", + " if num%2 == 0:\n", + " num /= 2\n", + " else:\n", + " # rule for odd numbers \n", + " num = (3*num) + 1\n", + " seq.append(int(num))\n", + "seq" + ] } ], "metadata": { diff --git a/Exercises/EN/Basic/08_Dictionaries_And_Frequency_Tables_NA.ipynb b/Exercises/EN/Basic/08_Dictionaries_And_Frequency_Tables_NA.ipynb new file mode 100644 index 00000000..fadee348 --- /dev/null +++ b/Exercises/EN/Basic/08_Dictionaries_And_Frequency_Tables_NA.ipynb @@ -0,0 +1,951 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## About This Notebook\n", + "\n", + "In this notebook, we are moving towards a very important new concept called **dictionary**. We already know how to work with lists and lists of lists (which can store data sets). These are however rather basic forms of data. Dictionaries offer us a key/value approach to store data. For example, we might have looped through a list of lists and extracted certain *information* into a dictionary. \n", + "***\n", + "\n", + "## 1. Dictionaries" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In the previous mission, we worked with the `AppleStore.csv` data set. The cont_rating column provides a lot of information regarding the content rating of each app. See below:
\n", + "\n", + "|Content rating |Number of apps|\n", + "|--|--|\n", + "|4+|4,433|\n", + "|9+|987|\n", + "|12+|1,155|\n", + "|17+|622|" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "How can we store the data above? We can do it in two ways:\n", + "- Using two separate lists\n", + "- Using a single list of lists" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "# Two lists\n", + "content_ratings = ['4+', '9+', '12+', '17+']\n", + "numbers = [4433, 987, 1155, 622]\n", + "\n", + "# A list of lists\n", + "content_rating_numbers = [['4+', '9+', '12+', '17+'], [4433, 987, 1155, 622]]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Looking at the lists above, you may be confused which content rating corresponds to which number. Each list element has an index number and we will transform the index numbers to content rating values. We can do this using a dictionary like this:" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'4+': 4433, '9+': 987, '12+': 1155, '17+': 622}\n" + ] + } + ], + "source": [ + "content_ratings = {'4+':4433, '9+':987, '12+':1155, '17+':622}\n", + "print(content_ratings)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "What we have created above are:\n", + "- Mapped each content rating to its corresponding number by following an index:value pattern. \n", + "- Seprated each pair with a comma\n", + "- Surrounded the sequence with curly braces {}" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 2. Indexing (IMPORTANT)\n", + "\n", + "We can change the index numbers of a list to content rating values in a dictionary. So the mapping between content ratings their corresponding numbers can become much clearer.\n", + "\n", + "Now the question comes, how do we retrieve the individual values of the content_ratings dictionary? We can use the new indices like we did with the individual list elements following a variable_name[index] pattern like this:\n" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "4433\n", + "1155\n" + ] + } + ], + "source": [ + "content_ratings = {'4+':4433, '9+':987, '12+':1155, '17+':622}\n", + "print(content_ratings['4+'])\n", + "print(content_ratings['12+'])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The indexing of dictionary is something different than the list. \n", + "> The order of the dictionary is not necessarily preserved whereas in the lists, the order is **always** preserved.\n", + "\n", + "For example, the index value 0 always retrieves the list element that's positioned first in a list. With dictionaries, there is no direct connection between the index of a value and the position of that value in the dictionary, that means, the order is unimportant. The index value '4+' will retrieve tha value 4433 no matter its position, it could be the first element, or the last element in the dictionary, the retrievd value doesn't matter." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'4+': 4433, '9+': 987, '12+': 1155, '17+': 622}\n" + ] + } + ], + "source": [ + "content_ratings = {'4+':4433, '9+':987, '12+':1155, '17+':622}\n", + "print(content_ratings)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 1.5.2:\n", + "\n", + "1. Retrieve values from the ``content_ratings`` dictionary.\n", + " - Assign the value at index '9+' to a variable named `over_9`.\n", + " - Assign the value at index '17+' to a variable named `over_17`.\n", + "2. Print `over_9` and `over_17`." + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "987\n", + "622\n" + ] + } + ], + "source": [ + "### Start your code below:\n", + "over_9 = content_ratings['9+']\n", + "over_17 = content_ratings['17+']\n", + "\n", + "print(over_9)\n", + "print(over_17)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 3. Alternative way of Creating a Dictionary\n", + "\n", + "There is an alternative way of creating a dictionary like this:\n", + "1. Create an empty dictionary.\n", + "2. Add values one by one to that empty dictionary.\n", + " - like this: dictionary_name[index] = value\n", + " \n", + "Take for example, if we want to add a value 4455 with an index '5+' to a dictionary named content_ratings, we need to use the code:\n", + "\n", + "````python\n", + "content_ratings['5+'] = 4455\n", + "````" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'5+': 4455}\n" + ] + } + ], + "source": [ + "content_ratings = {}\n", + "content_ratings['5+'] = 4455\n", + "\n", + "print(content_ratings)" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'4+': 4433, '9+': 987, '12': 1155, '7+': 622}\n" + ] + } + ], + "source": [ + "#To keep adding more values, we can do like this:\n", + "\n", + "content_ratings = {}\n", + "content_ratings['4+'] = 4433\n", + "content_ratings['9+'] = 987\n", + "content_ratings['12'] = 1155\n", + "content_ratings['7+'] = 622\n", + "\n", + "print(content_ratings)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 4. Key-Value Pairs\n", + "\n", + "A key is a index of a dictionary value. Such as in our example '4+': 4433, the dictionary key is '4+', and the dictionary value is 4433. As a whole, '4+': 4433 is a key-value pair.\n", + "\n", + "All of the data types such as strings, integers, floats, Booleans, lists, and even dictionaries can be dictionary values." + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'key_1': 'value_1', 'key_2': 1, 'key_3': 1.832, 'key_4': False, 'key_5': [1, 2, 3], 'key_6': {'inside key': 100}}\n", + "value_1\n", + "{'inside key': 100}\n" + ] + } + ], + "source": [ + "d_1 = { 'key_1' :'value_1',\n", + " 'key_2' :1,\n", + " 'key_3' :1.832,\n", + " 'key_4' :False,\n", + " 'key_5' :[1,2,3],\n", + " 'key_6' :{'inside key': 100}\n", + "}\n", + "\n", + "print(d_1)\n", + "print(d_1['key_1'])\n", + "print(d_1['key_6'])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Different than the dictionary values, dictionary keys can not be [mutable types](https://towardsdatascience.com/https-towardsdatascience-com-python-basics-mutable-vs-immutable-objects-829a0cb1530a) like lists and dictionaries. A TypeError will be thrown if we try to use lists or dictionaries as dictionary keys." + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{5: 'int', '5': 'string', 3.5: 'float', False: 'Boolean'}\n" + ] + } + ], + "source": [ + "d_1 = { 5 :'int',\n", + " '5' :'string',\n", + " 3.5 :'float',\n", + " False :'Boolean'}\n", + "print(d_1)" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "ename": "TypeError", + "evalue": "unhashable type: 'list'", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32mc:\\Users\\andre\\Documents\\UNI\\Master_Digital_Humanities\\S1_WS2023\\UE_Introduction_to_DH_Tools_and_Methods\\Python_Course\\Exercises\\EN\\Basic\\08_Dictionaries_And_Frequency_Tables_NA.ipynb Cell 21\u001b[0m line \u001b[0;36m2\n\u001b[0;32m 1\u001b[0m \u001b[39m# A TypeError will be thrown\u001b[39;00m\n\u001b[1;32m----> 2\u001b[0m d_2 \u001b[39m=\u001b[39m {[\u001b[39m1\u001b[39m,\u001b[39m2\u001b[39m,\u001b[39m3\u001b[39m]:\u001b[39m'\u001b[39m\u001b[39mlist\u001b[39m\u001b[39m'\u001b[39m}\n", + "\u001b[1;31mTypeError\u001b[0m: unhashable type: 'list'" + ] + } + ], + "source": [ + "# A TypeError will be thrown\n", + "d_2 = {[1,2,3]:'list'}" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "ename": "TypeError", + "evalue": "unhashable type: 'dict'", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32mc:\\Users\\andre\\Documents\\UNI\\Master_Digital_Humanities\\S1_WS2023\\UE_Introduction_to_DH_Tools_and_Methods\\Python_Course\\Exercises\\EN\\Basic\\08_Dictionaries_And_Frequency_Tables_NA.ipynb Cell 22\u001b[0m line \u001b[0;36m2\n\u001b[0;32m 1\u001b[0m \u001b[39m# A TypeError will be thrown\u001b[39;00m\n\u001b[1;32m----> 2\u001b[0m d_2 \u001b[39m=\u001b[39m {{\u001b[39m'\u001b[39m\u001b[39mkey\u001b[39m\u001b[39m'\u001b[39m:\u001b[39m'\u001b[39m\u001b[39mvalue\u001b[39m\u001b[39m'\u001b[39m}:\u001b[39m'\u001b[39m\u001b[39mdictionary\u001b[39m\u001b[39m'\u001b[39m}\n", + "\u001b[1;31mTypeError\u001b[0m: unhashable type: 'dict'" + ] + } + ], + "source": [ + "# A TypeError will be thrown\n", + "d_2 = {{'key':'value'}:'dictionary'}" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 1.5.4:\n", + "\n", + "Create the following dictionary and assign it to a variable named ``d_1``:\n", + "\n", + "{'key_1': 'first_value',
\n", + " 'key_2': 2,
\n", + " 'key_3': 3.14,
\n", + " 'key_4': True,
\n", + " 'key_5': [4,2,1],
\n", + " 'key_6': {'inner_key' : 6}
\n", + " }
\n" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'key_1': 'first_value', 'key_2': 2, 'key_3': 3.14, 'key_4': True, 'key_5': [4, 2, 1], 'key_6': {'inner_key': 6}}\n" + ] + } + ], + "source": [ + "### Start your code below:\n", + "d_1 = {'key_1': 'first_value',\n", + " 'key_2': 2,\n", + " 'key_3': 3.14,\n", + " 'key_4': True,\n", + " 'key_5': [4,2,1],\n", + " 'key_6': {'inner_key' : 6}\n", + " }\n", + "\n", + "print(d_1)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 5. Counting with Dictionaries\n", + "\n", + "The code below will show you how to update or change the dictionary values within an existing dictionary." + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'4+': 1, '9+': 1000, '12+': 27, '17+': '511'}\n" + ] + } + ], + "source": [ + "content_ratings = {'4+':4433, '9+':987, '12+':1155, '17+':622}\n", + "\n", + "# Change the value corresponding to the dictionary key '4+' from 4433 to 1.\n", + "content_ratings['4+'] = 1\n", + "\n", + "# Add 13 to the value corresponding to the dictionary key '9+'.\n", + "content_ratings['9+'] +=13\n", + "\n", + "# Subtract 1128 from the value corresponding to the dictionary key '12+'.\n", + "content_ratings['12+'] -= 1128\n", + "\n", + "# Change the value corresponding to the dictionary key '17+' from 622 (integer) to '511' (string).\n", + "content_ratings['17+'] = '511'\n", + "\n", + "print(content_ratings)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Now we can combine the updating dictionary values technique with what we already know to count how many times each unique content rating occurs in our data set.** Let's start with this list: ['4+', '4+', '4+', '9+', '9+', '12+', '17+'], which stores a few content ratings. To count how many times each rating occurs in this short list, we should:\n", + "- Create a dictionary where all the values (initial count) are all 0:{'4+': 0, '9+': 0, '12+': 0, '17+': 0}.\n", + "- Loop through the list ['4+', '4+', '4+', '9+', '9+', '12+', '17+'], and for each iteration:\n", + " - Check whether the iteration variable exists as a key in the previously created dictionary.\n", + " - If it exists, then increment the dictionary value at that key by 1." + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'4+': 3, '9+': 2, '12+': 1, '17+': 1}" + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "content_ratings = {'4+':0, '9+':0, '12+':0, '17+':0}\n", + "ratings = ['4+','4+','4+','9+','9+','12+','17+']\n", + "\n", + "for c_rating in ratings:\n", + " if c_rating in content_ratings:\n", + " content_ratings[c_rating] += 1\n", + "content_ratings" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To get a better overview, we can print the content_rating dictionary inside the for loop and see the changes that it makes every time:" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'4+': 1, '9+': 0, '12+': 0, '17+': 0}\n", + "{'4+': 2, '9+': 0, '12+': 0, '17+': 0}\n", + "{'4+': 3, '9+': 0, '12+': 0, '17+': 0}\n", + "{'4+': 3, '9+': 1, '12+': 0, '17+': 0}\n", + "{'4+': 3, '9+': 2, '12+': 0, '17+': 0}\n", + "{'4+': 3, '9+': 2, '12+': 1, '17+': 0}\n", + "{'4+': 3, '9+': 2, '12+': 1, '17+': 1}\n", + "Final dictionary:\n" + ] + }, + { + "data": { + "text/plain": [ + "{'4+': 3, '9+': 2, '12+': 1, '17+': 1}" + ] + }, + "execution_count": 20, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "content_ratings = {'4+':0, '9+':0, '12+':0, '17+':0}\n", + "ratings = ['4+','4+','4+','9+','9+','12+','17+']\n", + "\n", + "for c_rating in ratings:\n", + " if c_rating in content_ratings:\n", + " content_ratings[c_rating] += 1\n", + " print(content_ratings)\n", + "print('Final dictionary:')\n", + "content_ratings" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "How it's time to read in our data set (AppleStore.csv) and use the technique we learned above to count number of times each unique content rating occurs.\n", + "\n", + "### Task 1.5.5:\n", + "Count the number of times each unique content rating occurs in the data set.\n", + "1. Create a dictionary named `content_ratings` where the keys are the unique content ratings and the values are all 0 (the values of 0 are temporary at this point, and they'll be updated). This dictionary should look like a set with pairing key (Feel free to take a look at the example above).\n", + "2. Loop through the apps_data list of lists. Make sure you don't include the header row. For each iteration of the loop:\n", + " - Assign the content rating value to a variable named `c_rating`. The content rating is at index number 10 in each row.\n", + " - Check whether ``c_rating`` exists as a key in ``content_ratings``. If it exists, then increment the dictionary value at that key by 1 (the key is equivalent to the value stored in c_rating).\n", + "3. Outside the loop, print `content_ratings` to check whether the counting worked as expected." + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "cont_rating\n", + "{'4+': 4432, '12+': 1154, '9+': 986, '17+': 621}\n" + ] + } + ], + "source": [ + "opened_file = open('../../../Data/csv/AppleStore.csv', encoding='utf8')\n", + "from csv import reader\n", + "read_file = reader(opened_file)\n", + "apps_data = list(read_file)\n", + "### Start your code below:\n", + "content_ratings = {}\n", + "print(apps_data[0][10])\n", + "\n", + "for row in apps_data[1:]:\n", + " c_rating = row[10]\n", + " if not c_rating in content_ratings:\n", + " content_ratings[c_rating] = 0\n", + " else:\n", + " content_ratings[c_rating] +=1\n", + "print(content_ratings)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 6. Finding the Unique Values\n", + "\n", + "In the example that we worked in the previous session, we knew each of the unique values we want to count beforehand. We if we didn't know what the unique content ratings are. For example, what should we do if we don't have enough information to create the dictionary {'4+': 0, '9+': 0, '12+': 0, '17+': 0}.\n", + "\n", + "We can update code that we did for the list ['4+', '4+', '4+', '9+', '9+', '12+', '17+'] to accomodate this charateristic. \n", + "In in addition to the if statement, we also added an else statement. If this dictionary key does not exist in our dictionary, then we create a new key-value pair in the content_ratings dictionary, where the dictionary key is the iteration variable (c_rating) and the dictionary value is 1.\n" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'4+': 3, '9+': 2, '12+': 1, '17+': 1}" + ] + }, + "execution_count": 34, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "content_ratings = {}\n", + "ratings = ['4+','4+','4+','9+','9+','12+','17+']\n", + "\n", + "for c_rating in ratings:\n", + " if c_rating in content_ratings:\n", + " content_ratings[c_rating] += 1\n", + " else:\n", + " content_ratings[c_rating] = 1\n", + "content_ratings" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To get a better overview, we can print the content_rating dictionary inside the for loop and see the changes that it makes every time:" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'4+': 1}\n", + "{'4+': 2}\n", + "{'4+': 3}\n", + "{'4+': 3, '9+': 1}\n", + "{'4+': 3, '9+': 2}\n", + "{'4+': 3, '9+': 2, '12+': 1}\n", + "{'4+': 3, '9+': 2, '12+': 1, '17+': 1}\n", + "Final dictionary:\n" + ] + }, + { + "data": { + "text/plain": [ + "{'4+': 3, '9+': 2, '12+': 1, '17+': 1}" + ] + }, + "execution_count": 35, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "content_ratings = {}\n", + "ratings = ['4+','4+','4+','9+','9+','12+','17+']\n", + "\n", + "for c_rating in ratings:\n", + " if c_rating in content_ratings:\n", + " content_ratings[c_rating] += 1\n", + " else:\n", + " content_ratings[c_rating] = 1\n", + " print(content_ratings)\n", + " \n", + "print('Final dictionary:')\n", + "content_ratings" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 1.5.6:\n", + "Now let's apply what we have just learned in our data set:\n", + "\n", + "Count the number of times each unique content rating occurs in the data set while finding the unique values automatically.\n", + "1. Create an empty dictionary named `content_ratings`.\n", + "2. Loop through the `apps_data` list of lists (make sure you don't include the header row). For each iteration of the loop:\n", + " - Assign the content rating value to a variable named `c_rating`. The content rating is at index number 10.\n", + " - Check whether c_rating exists as a key in `content_ratings`.\n", + " - If it exists, then increment the dictionary value at that key by 1 (the key is equivalent to the value stored in c_rating).\n", + " - Else, create a new key-value pair in the dictionary, where the dictionary key is c_rating and the dictionary value is 3. Outside the loop, print content_ratings to check whether the counting worked as expected." + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'4+': 4432, '12+': 1154, '9+': 986, '17+': 621}\n" + ] + } + ], + "source": [ + "opened_file = open('../../../Data/csv/AppleStore.csv', encoding='utf8')\n", + "from csv import reader\n", + "read_file = reader(opened_file)\n", + "apps_data = list(read_file)\n", + "\n", + "### Start your code here:\n", + "content_ratings = {}\n", + "for row in apps_data[1:]:\n", + " c_rating = row[10]\n", + " if not c_rating in content_ratings:\n", + " content_ratings[c_rating] = 0\n", + " else:\n", + " content_ratings[c_rating] +=1\n", + "print(content_ratings)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 7. Proportions and Percentages\n", + "\n", + "The following table is known as the frequency table. A frequency is the number of times a unique value occurs.\n", + "\n", + "|Content rating|Number of apps (frequency)|\n", + "|--|--|\n", + "|4+|4,433|\n", + "|9+|987|\n", + "|12+|1,155|\n", + "|17+|622|\n", + "\n", + "4+ occurs 4,433 times, so it has a frequency of 4,433. 12+ has a frequency of 1,155. 9+ has a frequency of 987. 17+ has the lowest frequency: 622.\n", + "\n", + "When we analyze the data set, it might also be interesting to look at the following questions:\n", + "- What proportion of apps have a content rating of 4+?\n", + "- What percentage of apps have a content rating of 17+?\n", + "- What percentage of apps can a 15-year-old download?\n", + "\n", + "To get the proportion of apps with a content rating of 4+, we can use the number of 4+ apps divide by the total number of apps like this:\n", + "4,443/7,197\n", + "\n", + "Instead of fraction, we can also express proportion as a decimal between 0 and 1. So the result of 4,443/7,197 will be 0.62.\n", + "\n", + "The percentage of 4+ apps we can get it by simply multiplying the proportions by 100, so it will be 62%." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 8. Looping over Dictionaries\n", + "\n", + "We can transform the frequencies to proportions or percentages individually by performing the required arithmetical operations like this:" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'4+': 0.6159510907322495, '9+': 0.13714047519799916, '12+': 0.16048353480616923, '17+': 0.08642489926358204}\n" + ] + } + ], + "source": [ + "content_ratings = {'4+':4433, '9+':987, '12+':1155, '17+':622}\n", + "total_number_of_apps = 7197\n", + "\n", + "content_ratings['4+']/=total_number_of_apps\n", + "content_ratings['9+']/=total_number_of_apps\n", + "content_ratings['12+']/=total_number_of_apps\n", + "content_ratings['17+']/=total_number_of_apps\n", + "\n", + "print(content_ratings)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "It can be very cumbersome to update each and every content_rating dictionary value manually. Therefore, we can use a for loop to iterate over a dictionary." + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "4+\n", + "9+\n", + "12+\n", + "17+\n" + ] + } + ], + "source": [ + "content_ratings = {'4+':4433, '9+':987, '12+':1155, '17+':622}\n", + "\n", + "for iteration_variable in content_ratings:\n", + " print(iteration_variable)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can also use the dictionary keys to access the dictionary values within the loop:" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "4+\n", + "4433\n", + "9+\n", + "987\n", + "12+\n", + "1155\n", + "17+\n", + "622\n" + ] + } + ], + "source": [ + "content_ratings = {'4+':4433, '9+':987, '12+':1155, '17+':622}\n", + "\n", + "for iteration_variable in content_ratings:\n", + " print(iteration_variable)\n", + " print(content_ratings[iteration_variable])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "With the technique above, we can update the dictionary values within loop:" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'4+': 0.6159510907322495, '9+': 0.13714047519799916, '12+': 0.16048353480616923, '17+': 0.08642489926358204}\n" + ] + } + ], + "source": [ + "content_ratings = {'4+':4433, '9+':987, '12+':1155, '17+':622}\n", + "total_number_of_apps = 7197\n", + "\n", + "for iteration_variable in content_ratings:\n", + " content_ratings[iteration_variable] /= total_number_of_apps\n", + "print(content_ratings)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 9. Small Bonus (OPTIONAL)\n", + "The looping through dictionaries which we used in this notebook is really used only for training purposes. In a productive and professional code, you would not want to use it. \n", + "\n", + "Here is a recommendation by our RBCZ colleague *Jakub Korecek*:\n", + "> Dictionary has one important and very useful method to check whether a key is ``existent``. This method is called ``get()``.\n", + "The useful part is, we can assign value if a key does not exist instead of having KeyError. The default values is ``None``, but we can set it up." + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "1\n", + "None\n", + "KEY DO NOT EXISTS\n" + ] + } + ], + "source": [ + "test_dict = {'A':1,'B':2}\n", + "print(test_dict.get('A'))\n", + "print(test_dict.get('C'))\n", + "print(test_dict.get('C','KEY DO NOT EXISTS'))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "> There is another way to iterate over Dictionary. This way is better from performance point of view. It is done by method called ``items()``." + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "A 1\n", + "B 2\n" + ] + } + ], + "source": [ + "test_dict = {'A':1,'B':2}\n", + "for key,value in test_dict.items():\n", + " print(key,value)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.1" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/Exercises/EN/Basic/09_Functions_Fundamentals_NA.ipynb b/Exercises/EN/Basic/09_Functions_Fundamentals_NA.ipynb new file mode 100644 index 00000000..1e1a5aab --- /dev/null +++ b/Exercises/EN/Basic/09_Functions_Fundamentals_NA.ipynb @@ -0,0 +1,1101 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## About This Notebook\n", + "\n", + "Function is the absolute key for any programmer! You might have already noticed that we used for example the `print()` functions. This is one of the ``built-in functions`` which we can just use right away. We will touch upon these in the beginning of a lecture. Towards the second part of the lecture, we will move towards scenarios when Python does not have a function which we would need as pre-built. We will build our first custom functions.\n", + "***" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 1. Functions\n", + "We've learned several useful commands so far: `print()`, `sum()`, `len()`, `min()`, `max()`. These commands are more often known as functions. A function takes in an input, does something to that input, and gives back an output.\n", + "\n", + "Take for example the function ``sum()``:\n", + "- ``sum()`` takes the input ``list_a``\n", + "- it sums up all the values in the list\n", + "- it returns the output ``18`` - which is the sum of this list" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "18" + ] + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "list_a = [5, 2, 11]\n", + "sum(list_a)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can understand step 1 and 3 rather quickly, however, what it is inside step 2 is rather ambiguous. " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "First, we have a list that we want to find out some information about it.\n", + "````python\n", + "list_1 = [2, 45,62, -21, 0, 55, 3]\n", + "````\n", + "We then initialize a variable named ``my_sum`` with an initial value of 0.\n", + "\n", + "````python\n", + "my_sum = 0\n", + "````\n", + "\n", + "Afterwards, we loop through the list ``list_1``and sum up all the values in the list one by one\n", + "````python\n", + "for element in list_1:\n", + " my_sum += element\n", + "````\n", + "\n", + "At the very end, we print the final result to the screen.\n", + "````python\n", + "print(my_sum)\n", + "````\n", + "***\n", + "For a better overview:\n", + "\n", + "````python\n", + "list_1 = [2, 45, 62, -21, 0, 55, 3]\n", + "my_sum = 0\n", + "\n", + "for element in list_1:\n", + " my_sum += element\n", + "print(my_sum)\n", + "\n", + "\n", + "````" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 1.6.1:\n", + "Let's try to do the same thing with `len()`.\n", + "\n", + "1. Compute the length of the `list_1` without using len().\n", + " - Initialize a variable named length with a value of 0.\n", + " - Loop through list_1 and for each iteration add 1 to the current number length.\n", + " \n", + " \n", + "2. Using `len()` function to print the length of ``list_1`` and check whether your function is correct.\n", + "> Hint: to better familiarize yourself, you may look up the documentation of ``len()`` function." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "7\n" + ] + }, + { + "data": { + "text/plain": [ + "7" + ] + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "list_1 = [2, 45,62, -21, 0, 55, 3]\n", + "\n", + "#Start your code here:\n", + "#First, initialization of the variable length \n", + "length = 0\n", + "\n", + "#Second, loop through list_1 and increment your variable length\n", + "for element in list_1:\n", + " length+=1\n", + "print(length)\n", + "len(list_1)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 2. Built-in Functions\n", + "Functions help us tremendously in working faster and simplifying our code. Whenever there is a repetitive task, try to think about using some functions to speed up your workflow.\n", + "\n", + "Python has some built-in functions like the ones we have encountered: ``sum()``, ``len()``, ``min()``, and ``max()``. However, Python doesn't have built-in functions for all the tasks we want to achieve. Therefore, it will be necessary to write functions on our own." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 3. Creating Your Own Functions (IMPORTANT)\n", + "If we want to create a function named `square()` which performs the mathematical operation of a number to the power of 2, how can we achieve this?\n", + "To find the square of a number, all we need to do is to multiply that number by itself. For example, to find the square of 4, we need to multiple 4 by itself such as: 4 * 4, which is 16.\n", + "So how do we actually create the `square()` function? See below:" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "def square(number):\n", + " squared_number = number * number\n", + " return squared_number" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To create the square() function above, we:\n", + "1. Started with the def statement\n", + " - Specified the name of the function, which is `square`\n", + " - Specified the name of the variable that will serve as input, which is `number`\n", + " - Surround the input variable number within parentheses\n", + " - End the line of the code with a colon (:)\n", + "2. Specified what we want to do with the input number\n", + " - We first multiplied number by itself: number * number\n", + " - We assigned the result of number * number to a variable named `squared_number`\n", + "3. Concluded the function with the return statement and specified what to return as the output\n", + " - The output is the variable named `squared_number`, it is the result of number * number\n", + " \n", + "After we have constructed the `square()` function, we can finally put it into practice and compute the square of a number." + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "def square(number):\n", + " squared_number = number * number\n", + " return squared_number" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "> To compute the square of 2, we use the code\n", + "````python\n", + "square_2 = square(number = 2)\n", + "````\n", + "\n", + ">To compute the square of 6, we use the code\n", + "````python\n", + "square_6 = square(number = 6)\n", + "````\n", + "\n", + ">To compute the square of 8, we use the code\n", + "````python\n", + "square_8 = square(number = 8)\n", + "````" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The variable number is the input variable and it can take various values like seen in the code above." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 4. The Structure of a Function (IMPORTANT)\n", + "\n", + "On the pervious chapter, we created and used a function named `square()` to compute the square of 2, 6, 8. And we have used number = 2, number = 6, number = 8 for every input variable." + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "4\n", + "36\n", + "64\n" + ] + } + ], + "source": [ + "def square(number):\n", + " squared_number = number * number\n", + " return squared_number\n", + "\n", + "#To compute the square of 2, we use the code\n", + "square_2 = square(number = 2)\n", + "\n", + "#To compute the square of 6, we use the code\n", + "square_6 = square(number = 6)\n", + "\n", + "#To compute the square of 8, we use the code\n", + "square_8 = square(number = 8)\n", + "\n", + "print(square_2)\n", + "print(square_6)\n", + "print(square_8)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To understand what happens when we change the value we assign to number, you should try to imagine number being replaced with that specific value inside the definition of the function like:\n" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "#For number = 2\n", + "def square(number = 2):\n", + " squared_number = number * number\n", + " return squared_number" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "#For number = 6\n", + "def square(number = 6):\n", + " squared_number = number * number\n", + " return squared_number" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [], + "source": [ + "#For number = 8\n", + "def square(number = 8):\n", + " squared_number = number * number\n", + " return squared_number" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "There are usually three elements make up the function's definition: `header` (which contains the def statement), `body` (where the magic happens), and `return statement`." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Notice we indented the body and the return statement four spaces to the right — we like we did the same for the bodies of for loops and if statements. Technically, we only need to indent at least one space character to the right, but the convention in the Python community is to use four space characters instead. This helps with readability — other people who follow this convention will be able to read your code easier, and you'll be able to read their code easier." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 1.6.4 (IMPORTANT)\n", + "\n", + "Now let's try to recreate what you have learned in the previous chapter, the ``square()`` function.\n", + "\n", + "- Assign the square of 12 to a variable named `squared_12`.\n", + "- Assign the square of 20 to a variable named `squared_20`." + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "# Start your code below:\n", + "squared_12 = square(12)\n", + "squared_20 = square(20)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 5. Parameters and Arguments (IMPORTANT)\n", + "\n", + "We have learned a bit more about functions now. However, instead of the square(number = 6) we can type just square(6) and it will just give us the same output.\n", + "\n", + "What's behind the scene is that when we use square(6) instead of square(number = 6) , Python automatically assigns 6 to the number variable and it is just the same thing as square(number = 6).\n", + "\n", + "Input variables like number are more often known as parameters. So number is a parameter of the square() function and when the parameter number takes a value (like 6 in square(number = 6)), that value is called an argument.\n", + "\n", + "For square(number=6), we'd say the number parameter took in 6 as an argument. For square(number=1000), the parameter number took in 1000 as an argument. For square(number=19), the parameter number took in 19 as an argument, and so on.\n", + "\n", + "Now let's focus on just the return statement. In the `square()` function, we have the return statement as: return square_number. However, you can return with an entire expression rather than just a single variable.\n", + "\n", + "So instead of saving the result of number * number to the variable squared_number, we can just return the expression number * number and skip the variable assignment step like this:" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [], + "source": [ + "#Instead of this:\n", + "def square(number):\n", + " squared_number = number * number\n", + " return squared_number\n", + "\n", + "#We can return the expression: number * number\n", + "def square(number ):\n", + " return number * number" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The last `square()` function makes our code looks shorter and neater and it is generally encouraged to do so in the practice." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 6. Extract Values From Any Column\n", + "Remember our goal of writing our own functions? To have a certain flexibility to speed up our own workflow during the coding process when encountered with some complex problems.\n", + "\n", + "Problem 1: Now try to generate a frequency table for a certain column from our data set. " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In order to simplify and speed up the workflow, we can try to create a separate function for each of these two tasks:\n", + "1. A function that is able to extract the value we desired for any column in a separate list; and\n", + "2. A function that can generate a frequency table for given a list" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In order the solve our problem 1, we can first use the first function, to extract the value for any column we want in a separate list. Then we can pass the output list as an argument to the second function which will give us a frequency table for that given list.\n", + "\n", + "How do we extract the values from any column we want from our apps_data data set? Please see below:" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "#Import data set\n", + "opened_file = open('../../../Data/csv/AppleStore.csv', encoding='utf8')\n", + "from csv import reader\n", + "read_file = reader(opened_file)\n", + "apps_data = list(read_file)\n", + "\n", + "#Create an empty list\n", + "content_ratings = []\n", + "\n", + "#Loop through the apps_data data set (excluding the header row)\n", + "for row in apps_data[1:]:\n", + " #for each iteration, we first store the value from the column we want in a variable\n", + " content_rating = row[10] #(rating has the index number of 10 in each list)\n", + " \n", + " #then we append that value we just stored to the empty list we have \n", + " #created outside the for loop (content_ratings)\n", + " content_ratings.append(content_rating)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 1.6.6 (IMPORTANT):\n", + "1. Write a function named ``extract()`` that can extract any column you want from the apps_data data set.\n", + " - The function should take in the index number of a column as input.\n", + "2. Inside the function's definition:\n", + " - Create an empty list.\n", + " - Loop through the apps_data data set and extract only the value you want by using the parameter.\n", + " - Append that value to the empty list.\n", + " - Return the list containing the values of the column.\n", + "3. Use the `extract()` function to extract `content_rating` column in the data set. Store them in a variable named `app_rating`. The index number of this column is `10`." + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['4+']\n" + ] + } + ], + "source": [ + "# Start your code below:\n", + "def extract(index):\n", + " list_1 = []\n", + " \n", + " for row in apps_data[1:]:\n", + " list_1.append(row[index])\n", + " return list_1\n", + "\n", + "app_rating = extract(10)\n", + "print(app_rating)\n", + " \n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 7. Creating Frequency Tables\n", + "\n", + "In this section, we will create the second function to our problem 1, which is to create a frequncy table for a given list." + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'4+': 3, '9+': 2, '12+': 1, '17+': 1}" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "ratings = ['4+', '4+', '4+', '9+', '9+', '12+', '17+']\n", + "#Create an empty list\n", + "content_ratings = {}\n", + "\n", + "#Loop through the ratings list \n", + "for c_rating in ratings:\n", + " \n", + " #and check for each iteration whether the iteration variable\n", + " #exists as a key in the dictionary created\n", + " if c_rating in content_ratings: \n", + " #If it exists, then increment by 1 the dictionary value at that key\n", + " content_ratings[c_rating] +=1\n", + " else:\n", + " #If not, then create a new key-value pair in the dictionary, where the \n", + " #dictionary key is the iteration variable and the inital dictionary value is 1.\n", + " content_ratings[c_rating] = 1\n", + " \n", + "#See the final result after the for loop\n", + "content_ratings" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 1.6.7 (OPTIONAL):\n", + "\n", + "1. Write a function named `freq_table()` generates a frequency table for any list.\n", + "- The function should take in a list as input.\n", + "- Inside the function's body, write code that generates a frequency table for that list and stores the table in a dictionary.\n", + "- Return the frequency table as a dictionary.\n", + "2. Use the `freq_table()` function on the `app_rating list` (already generated from the previous task, task 5) to generate the frequency table for the `cont_rating` column. Store the table to a variable named `rating_ft`." + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'4+': 1}\n" + ] + } + ], + "source": [ + "# Start your code below:\n", + "def freq_table(list):\n", + " dict_list = {}\n", + " for element in list:\n", + " if element in dict_list:\n", + " dict_list[element] += 1\n", + " else:\n", + " dict_list[element] = 1\n", + " return dict_list\n", + "\n", + "rating_ft = freq_table(app_rating)\n", + "\n", + "print(rating_ft)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 8. Keyword and Positional Arguments\n", + "\n", + "There are multiple ways to pass in arguments when a function has more than just one parameters.\n", + "\n", + "Take a function named divide(x, y) for example, which takes x, and y as inputs and returns their division." + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [], + "source": [ + "def divide(x, y):\n", + " return x / y" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "If we want to perform the addition 30 / 5, then we will need to pass 30 and 5 in the parameters of add() function. There are several ways of passing the parameters:" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "6.0" + ] + }, + "execution_count": 28, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def divide(x, y):\n", + " return x / y\n", + "\n", + "#Method 1:\n", + "divide(x = 30, y = 5)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "6.0" + ] + }, + "execution_count": 29, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#Method 2:\n", + "divide(y = 5, x = 30)" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "6.0" + ] + }, + "execution_count": 30, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#Method 3:\n", + "divide( 30, 5)" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "0.16666666666666666" + ] + }, + "execution_count": 31, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#All of the methods above are correct, however, you cannot do:\n", + "\n", + "divide(5, 30) #it will returns you a different result, which is not the same as 30/5" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The syntax divide(x = 30, y = 5) and divide(y = 5, x = 30) both allow us the pass in the arguments 30 and 5 to correspondingly variable x and variable y. They are also known as named arguments, orm more commonly, **keyword arguments**.\n", + "\n", + "When we use keyword arguments, the order we use to pass in the arguments doesn't make any difference. However, if we don't specify the keyword argument like in #method 3 and #method 4, then we are not explicit about what arguments correspond to what parameters and therefore we need to pass in the parameters by position. The first argument will be mapped the first parameter, and the second argument will be mapped to the second parameter. These arguments that are passed by position are known as the positional arguments.\n", + "\n", + "In the practice, data scientists often use positional arguments because they required less typing and can easily speed up the workflow. So we need to pay extra attention to the order in which we pass on our parameters." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 1.6.8:\n", + "1. Write an `add()` function that returns the sum of variable x and variable y,\n", + "2. Pass in the parameters by using keyword argument.\n", + "3. Pass in the parameters by using positional argument.\n", + "4. Compare your result of keyword argument and positional argument." + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "5\n", + "5\n" + ] + } + ], + "source": [ + "# Start your code below:\n", + "def add(x,y):\n", + " return x+y\n", + "\n", + "print(add(x=2,y=3))\n", + "print(add(2,3))\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 9. Combining Functions (OPTIONAL)\n", + "\n", + "Do you know that you can use one function inside the body of another function?\n", + "\n", + "If we want to write a function called `average()` which takes a list of numbers and returns the average of that list.\n", + "To get the mean of a list we first need to sum up all the values in this list and divide by the total number of values in this list." + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [], + "source": [ + "def find_sum(my_list):\n", + " sum = 0\n", + " for element in my_list:\n", + " sum += element\n", + " return sum\n", + "\n", + "def find_length(my_list):\n", + " length = 0\n", + " for element in my_list:\n", + " length +=1\n", + " return length" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now we can use `find_sum()` and `find_length()` inside our `average()` function like this:" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "6.0" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def average(list_of_numbers):\n", + " sum_list = find_sum(list_of_numbers)\n", + " length_of_list = find_length(list_of_numbers)\n", + " mean_list = sum_list / length_of_list\n", + " \n", + " return mean_list\n", + "\n", + "list_a = [5, 2, 11]\n", + "average(list_a)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You can see that we used `find_sum()` and `find_length()` inside the body of the `average()` function. list_of_numbers is the parameter which we passed on to the `average()` function, and inside the `average()` function body, it becomes the argument for both `find_sum()` and `find_length()` function. \n", + "\n", + "You may ask, why to we write the `find_sum()` and `find_length()` functions separately? The answer is what we learned in the previous session: reusability. Imagine we didn't write those two functions, our `average()` function would look like this:" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "6.0" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def average(list_of_numbers):\n", + " #Finding the sum\n", + " sum = 0\n", + " for element in list_of_numbers:\n", + " sum += element\n", + " \n", + " #Finding the length\n", + " length = 0\n", + " for element in list_of_numbers:\n", + " length +=1\n", + " \n", + " mean_list = sum/length\n", + " \n", + " return mean_list\n", + "list_a = [5, 2, 11]\n", + "average(list_a)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Doesn't this function seem a bit long for you? And we would have to write how to find the sum and how to find the length each time we want to perform such action. To write `find_sum()` and `find_length()` outside of the `average()` function enable us to not only use these two functions inside `average()`, but also all the other functions that need these two functions. \n", + "\n", + "Of course we can also shorten our average function like this:" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [], + "source": [ + "def average(list_of_numbers):\n", + " return find_sum(list_of_numbers)/find_length(list_of_numbers)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Which looks super concise and neat. Now let's do a little more practice with writing and combining functions.\n", + "\n", + "### Task 1.6.9:\n", + "Write a function named `mean()` that computes the mean for any column we want from a data set. Keep in mind reusability\n", + "\n", + "- This function takes in two inputs: a data set and an index value\n", + "- Inside the body of the `mean()` function, use the `extract()` function that we have defined previously to extract the values of a column into a separate list, and compute the mean by using `find_sum()` and `find_length()`. You might want to define ``find_sum()`` and ``find_length()`` yourself (look at previous examples), outside the ``mean()`` function.\n", + "- The function returns the mean of the column as end result\n", + "\n", + "Use the `mean()` function to compute the mean of the price column (index number 4) and assign the result to a variable named `avg_price`." + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "1.7262178685562666\n" + ] + } + ], + "source": [ + "# Start your code below:\n", + "def extract(data_set, index):\n", + " column = [] \n", + " for row in data_set[1:]:\n", + " value = row[index]\n", + " column.append(value) \n", + " return column\n", + "\n", + "def find_sum(a_list):\n", + " a_sum = 0\n", + " for element in a_list:\n", + " a_sum += float(element)\n", + " return a_sum\n", + "\n", + "def find_length(a_list):\n", + " a_length = 0\n", + " for element in a_list:\n", + " a_length += 1\n", + " return a_length\n", + "\n", + "def mean(data_set, index):\n", + " column = extract(apps_data, index)\n", + " mean = find_sum(column) / find_length(column)\n", + " return mean\n", + "\n", + "avg_price = mean(apps_data, 4)\n", + "\n", + "print(avg_price)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 10. Function vs. Method\n", + "\n", + "What is actually the difference between function and method? Let's take a closer look." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Definition of function: \n", + "> A function is a block of code which only runs when it is called. You can pass data, known as parameters, into a function. A function can return data as a result. (w3schools)\n", + "\n", + "Remember at the beginning of the chapter we learned that to construct a function we need: `header` (which contains the def statement), `body` (where the magic happens), and `return statement`. You can think of function as it always **returns** something. (In case nothing needed to be returned, a function automatically returns `None`)\n", + "\n", + "See example below:" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "test\n", + "None\n" + ] + } + ], + "source": [ + "# test() is a function that prints \"test\" but returns nothing (or NONE)\n", + "def test():\n", + " print(\"test\")\n", + "\n", + "a = test()\n", + "print(a)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "There are two types of functions in Python: \n", + "- `User-Defined Functions` (like in the example above)\n", + "- `Built-in Functions`\n", + "\n", + "`Built-in functions` are the functions that Python provides us with. For example, like the `sum()` function that we encountered previously.\n", + "\n", + "See example below:" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "55" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "my_list = [1,2,3,4,5,6,7,8,9,10]\n", + "\n", + "# sum() is an example of Python built-in function\n", + "sum(my_list)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "`Method` is basically a function that is associated with a `class`. Generally, function is actually associated with super class - **Object**, as all things in python.\n", + "\n", + "The `General Method Syntax` goes like this:" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "````python\n", + "class NameOfTheClass:\n", + " def method_name():\n", + " ..................\n", + " # Method_Body\n", + " .............\n", + " \n", + "````" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now let's see a concrete example of method:" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "We are learning Python!\n" + ] + } + ], + "source": [ + "class ComputerScience(object):\n", + " def my_method(self):\n", + " print(\"We are learning Python!\")\n", + " \n", + " \n", + "python = ComputerScience()\n", + "python.my_method()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In the example above we have defined a class called `ComputerScience`. Afterwards we created an object called `python` from the class blueprint. We then called our custom-defined method called `my_method` with our object `python`.\n", + "\n", + "Do you now see the difference?\n", + "\n", + ">Different than function, methods are called on an object. \n", + "\n", + "Like in the example above, we called our method `my_method` from our object `python`." + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.1" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/Exercises/EN/Basic/10_Functions_Intermediate_NA.ipynb b/Exercises/EN/Basic/10_Functions_Intermediate_NA.ipynb new file mode 100644 index 00000000..1e8ec31d --- /dev/null +++ b/Exercises/EN/Basic/10_Functions_Intermediate_NA.ipynb @@ -0,0 +1,1207 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## About This Notebook\n", + "\n", + "We started to work with functions in previous notebook. We will continue to explore this world by:\n", + "- Exploring what happens if we attempt to mess with the ``built-in`` functions.\n", + "- Learning what are *default arguments*.\n", + "- Finding how to lean about particular Python functions through *documentation*." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 1. Interfering with the Built-in Functions\n", + "Let's suppose we create a function called `find_sum()` like the one below:" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "18" + ] + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def find_sum(my_list):\n", + " sum = 0\n", + " for element in my_list:\n", + " sum += element\n", + " return sum\n", + "\n", + "list_a = [5, 2, 11]\n", + "find_sum(list_a)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The function `find_sum()` does the exact same thing just as the built-in `sum()` function, see below:" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "18" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "sum(list_a)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We see that `find_sum()` and `sum()` gives out the same result and **we might be tempted to name the find_sum() function simply sum()**.\n", + "\n", + "However, using the name ``sum()`` for our function above interferes with the ``built-in sum() function``. If we name our function sum(), and if we try to call sum(), Python won't run the built-in sum() function anymore, but instead, it will run the sum() function that we wrote.\n", + "\n", + "We can rewrite our function and return the string \"This function doesn't not sum up the number in the list\" instead of returning the sum of the elements of the list.\n" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "\"This function doesn't not sum up the number in the list\"" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#the sum() function we wrote takes precedences over the built-in sum() function\n", + "\n", + "def sum(my_list):\n", + " a_string = \"This function doesn't not sum up the number in the list\"\n", + " return a_string\n", + "\n", + "list_a = [5, 2, 11]\n", + "sum(list_a)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + ">**We should not use the name of built-in functions to name our functions**. Not only can it confuse your fellow collegues or other people who might read your code later, but also lead to some abnormal function behaviors." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 2. Variable Names and Built-in Functions\n", + "\n", + "In the previous session, we learned that we shouln't use the names of built-in functions to name our own functions. Now, let's observe the code below. We first assign 20 (the result of the sum 5 + 15) to a variable named sum. This would then cause interferes with the built-in sum() function -- when we call `sum()`. Python would therefore looks for the value stored in the sum variable and instead of calling the built-in function." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "ename": "TypeError", + "evalue": "'int' object is not callable", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32mc:\\Users\\andre\\Documents\\UNI\\Master_Digital_Humanities\\S1_WS2023\\UE_Introduction_to_DH_Tools_and_Methods\\Python_Course\\Exercises\\EN\\Basic\\10_Functions_Intermediate_NA.ipynb Cell 10\u001b[0m line \u001b[0;36m5\n\u001b[0;32m 3\u001b[0m \u001b[39msum\u001b[39m\n\u001b[0;32m 4\u001b[0m list_a \u001b[39m=\u001b[39m [\u001b[39m5\u001b[39m, \u001b[39m2\u001b[39m, \u001b[39m11\u001b[39m]\n\u001b[1;32m----> 5\u001b[0m \u001b[39msum\u001b[39;49m(list_a)\n", + "\u001b[1;31mTypeError\u001b[0m: 'int' object is not callable" + ] + } + ], + "source": [ + "del sum\n", + "sum = 5 + 15\n", + "sum\n", + "list_a = [5, 2, 11]\n", + "sum(list_a)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The sum is therefore a variable, stored with the integer 20 and when we run sum(list_a), we are running 20(list_1) and instead of the sum() function. Hence we got the error message 'int' object is not callable.\n", + "\n", + "How do we avoid built-in functions and accidentally name it to our own function?\n", + "A good way to tell built-in function is by the highlight in the editor." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "````python\n", + "sum() #highlighted \n", + "this_is_a_normal_function() #not highlighted\n", + "len() #highlighted \n", + "````" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "See more built-in functions under [this](https://docs.python.org/3/library/functions.html).

\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 3. Default Arguments\n", + "\n", + "When we write a function, we can initiate parameters with certain default values --- these are known as the default arguments.\n" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "15" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#Initiate the constant parameter with a default argument of 5\n", + "def increment_by_5(a, constant = 5):\n", + " return a + constant\n", + "\n", + "increment_by_5(10)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In the code above, we created the `increment_by_5()` function with two parameters: a and constant. When we call the function, we only need to pass in one positional argument: in the example above, 5.\n", + "From the code above we can deduce that the `increment_by_5` function used the argument 5 for the parameter constant.\n", + "\n", + "We can also modify our default arguments if we want like below:" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "15\n", + "25\n", + "30\n", + "15\n", + "25\n", + "30\n" + ] + } + ], + "source": [ + "print(increment_by_5(5, constant = 10))\n", + "print(increment_by_5(5, constant = 20))\n", + "print(increment_by_5(5, constant = 25))\n", + "\n", + "#Alternative:\n", + "\n", + "print(increment_by_5(5, 10))\n", + "print(increment_by_5(5, 20))\n", + "print(increment_by_5(5, 25))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "If all parameters have default arguments, then it is possible to call a function without passing in any argument. Otherwise we will get an error." + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "6" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#all parameters have default arguments\n", + "def increment_by_5(a = 1, constant = 5):\n", + " return a + constant\n", + "\n", + "increment_by_5()" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "ename": "TypeError", + "evalue": "increment_by_5() missing 1 required positional argument: 'a'", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32mc:\\Users\\andre\\Documents\\UNI\\Master_Digital_Humanities\\S1_WS2023\\UE_Introduction_to_DH_Tools_and_Methods\\Python_Course\\Exercises\\EN\\Basic\\10_Functions_Intermediate_NA.ipynb Cell 20\u001b[0m line \u001b[0;36m5\n\u001b[0;32m 2\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39mincrement_by_5\u001b[39m(a, constant \u001b[39m=\u001b[39m \u001b[39m5\u001b[39m):\n\u001b[0;32m 3\u001b[0m \u001b[39mreturn\u001b[39;00m a \u001b[39m+\u001b[39m constant\n\u001b[1;32m----> 5\u001b[0m increment_by_5()\n", + "\u001b[1;31mTypeError\u001b[0m: increment_by_5() missing 1 required positional argument: 'a'" + ] + } + ], + "source": [ + "#Normal function\n", + "def increment_by_5(a, constant = 5):\n", + " return a + constant\n", + "\n", + "increment_by_5()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Default arguments can be useful when we'll use an argument frequently and this can save us some time when we reuse the functions. Default arguments are also very useful for building complex functions.\n", + "\n", + "We can now try to build a function that opens a CSV file and makes use of default arguments at the same time.\n", + "\n", + "### Task 1.7.3:\n", + "1. Edit the `open_dataset()` function below and add the name of iOS apps data set ('AppleStore.csv') as a default argument for the file_name parameter.\n", + "2. Without passing any argument, try to use the `open_dataset()` function to open the AppStore.csv file and assign the data set to a variable named `apps_data`." + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [], + "source": [ + "# INITIAL CODE\n", + "def open_dataset(file_name='../../../Data/csv/AppleStore.csv'):\n", + " \n", + " opened_file = open(file_name, encoding=\"utf8\")\n", + " from csv import reader\n", + " read_file = reader(opened_file)\n", + " apps_data = list(read_file)\n", + " \n", + " return apps_data" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 4. The Official Python Documentation (IMPORTANT)\n", + "\n", + "It will come in handy when you get in touch with more complex Python Programming, [the official Python documentation](https://docs.python.org/3/) is extremely useful for all Python users.\n", + "For example if you want to get to know more about the sum() function, go to [the search page](https://docs.python.org/3/search.html) and search for \"sum\" or \"sum built-in\", then we can see the search result immediate.\n", + "\n", + "The documentation of the ``sum()`` function ends where the next function, ``super()``, begins.\n", + "On the first line, we can see all the parameters of the sum() function:\n", + "sum(iterable, /, start=0)\n", + "\n", + "We can see how useful the official Python documentation is. We can find information about all the parameters that this function takes as well as its default arguments (try to search for function \"open\" or \"open built-in\").\n", + "\n", + ">This official Python documentation will be your best friend in your data science journey. It does seem a little bit technical and a bit scary, but don't worry, it is absolutely normal to feel this way. We will definitely have a lot of fun in this Python journey together :)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 1.7.4:\n", + "1. Find the documentation of the `round()` function. Link to [the search page](https://docs.python.org/3/search.html).\n", + "2. Read and try to understand all the documentation of the `round()` function.\n", + "3. Try to use the right parameters and arguments, can you:\n", + " - Round 3.41 to one decimal point? Assign the result to a variable name of your choice.\n", + " - Round 0.532316 to two decimal points. Assign the result to a variable name of your choice.\n", + " -Round 892.3265621777 to five decimal points. Assign the result to a variable name of your choice." + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "3.4\n", + "0.53\n", + "892.32656\n" + ] + } + ], + "source": [ + "# Start your code below:\n", + "#round https://docs.python.org/3/library/functions.html?highlight=round#round\n", + "print(round(3.41,1))\n", + "print(round(0.532316,2))\n", + "print(round(892.3265621777,5))\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 5. Multiple Return Statements (OPTIONAL)\n", + "\n", + "Is it possible to build a function with multiple return statements?\n", + "For example we want to write a function that it's flexible enough to return either the sum of the two numbers or the difference.\n", + "\n", + "How can we achieve this? \n", + "\n", + "Fortunately, it is possible to use multiple return statements.\n", + "Try to understand the following code:\n" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "30\n", + "10\n" + ] + } + ], + "source": [ + "def sum_or_difference(x, y, do_sum =True):\n", + " if do_sum: \n", + " return x + y\n", + " else:\n", + " return x - y\n", + " \n", + "print(sum_or_difference(20, 10, do_sum = True))\n", + "print(sum_or_difference(20, 10, do_sum = False))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We have implemented the following logic in the function above:\n", + "\n", + "- If do_sum has a value of True, then we return x + y.\n", + "- Else (if do_sum is False), we return x - y.\n", + "\n", + "We can simply put the function above without using an else statement." + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "30\n", + "10\n" + ] + } + ], + "source": [ + "def sum_or_difference(x, y, do_sum =True):\n", + " if do_sum: \n", + " return x + y\n", + " \n", + " return x - y\n", + "\n", + "\n", + "print(sum_or_difference(20, 10, do_sum = True))\n", + "print(sum_or_difference(20, 10, do_sum = False))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The above approach works just as the same as the previous function because a function stops executing its rest code as soon as a return statement is execute. Even if there are some other important lines after that return statement, it won't get executed.\n", + "\n", + "If do_sum is `True`, then return x + y is executed, so the function stops, and it doesn't execute any of the remaining code.\n", + "If do_sum is `Flase`, then return x + y will not be executed and the function will move forward the eventually reaches the end which is the next return statement: return a - b." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 6. Returning Multiple Variables\n", + "In the previous session, we wrote a function that can either return the sum or the difference of two numbers. \n", + "\n", + "Fortunately, in Python we are able to build functions that can return more than just one variable. See below:\n" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(20, 10)" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def sum_and_difference(x, y):\n", + " a_sum = x + y\n", + " difference = x - y\n", + " \n", + " return a_sum, difference\n", + "\n", + "\n", + "sum_diff = sum_and_difference(15,5) #Passed 15 and 5 as arguments to the sum_and_difference() function\n", + "sum_diff #two values are returned at the end" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We see that both the sum and the difference of our given numbers are returned as the final output. The order of the variables in the return statement is important. For example:\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "def sum_and_difference(x, y):\n", + " a_sum = x + y\n", + " difference = x - y\n", + " \n", + " return difference, a_sum #the order of the return statement is important\n", + "\n", + "\n", + "sum_diff = sum_and_difference(15,5) \n", + "print(sum_diff)\n", + "\n", + "print(type(sum_diff))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The order of the final output above is different than the function we had previously. Please pay extra attention to how you construct your return statement.\n", + "\n", + "One thing that might surprise you is that the type of the output from the sum_and_difference is a tuple , which is a data type that is **very similar to a list**." + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "tuple" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "type(sum_diff)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + ">A tuple is usually used for storing multiple values. \n", + "\n", + "We can create a tuple just as easy as creating a list, see below:" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[1, 'a', 2.5]\n", + "\n", + "(1, 'a', 2.5)\n", + "\n" + ] + } + ], + "source": [ + "this_is_a_list = [1, 'a', 2.5]\n", + "this_is_a_tuple = (1, 'a', 2.5)\n", + "\n", + "print(this_is_a_list)\n", + "print(type(this_is_a_list))\n", + "\n", + "print(this_is_a_tuple)\n", + "print(type(this_is_a_tuple))\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The only construction difference between a list and a tuple is a list is surrounded by brackets and a tuple is surrounded by parentheses.\n", + "\n", + ">The major difference between tuples and lists is that exisiting values of a list can be modified but a tuple not." + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "1\n", + "1\n", + "2.5\n", + "1\n" + ] + } + ], + "source": [ + "this_is_a_list = [1, 'a', 2.5]\n", + "this_is_a_tuple = (1, 'a', 2.5)\n", + "\n", + "#Just as lists, tuples support positive and negative indexing.\n", + "print(this_is_a_list[0])\n", + "print(this_is_a_tuple[0])\n", + "print(this_is_a_list[-1])\n", + "print(this_is_a_tuple[0])\n", + "\n", + "#A list can be modified\n", + "this_is_a_list[0] = 2" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "ename": "TypeError", + "evalue": "'tuple' object does not support item assignment", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32mc:\\Users\\andre\\Documents\\UNI\\Master_Digital_Humanities\\S1_WS2023\\UE_Introduction_to_DH_Tools_and_Methods\\Python_Course\\Exercises\\EN\\Basic\\10_Functions_Intermediate_NA.ipynb Cell 41\u001b[0m line \u001b[0;36m2\n\u001b[0;32m 1\u001b[0m \u001b[39m#But on the contrary, a tuple cannot modify the existing values.\u001b[39;00m\n\u001b[1;32m----> 2\u001b[0m this_is_a_tuple[\u001b[39m0\u001b[39;49m] \u001b[39m=\u001b[39m \u001b[39m2\u001b[39m\n", + "\u001b[1;31mTypeError\u001b[0m: 'tuple' object does not support item assignment" + ] + } + ], + "source": [ + "#But on the contrary, a tuple cannot modify the existing values.\n", + "this_is_a_tuple[0] = 2" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + ">The non-modifiable property is called ``immutable``. Tuples are one of these immutable data types because we can't change their state after they've been created.\n", + "On the other side, lists are mutable data types because we can change their values after they've been created.\n", + "\n", + "If we want to modify tuples or any other immutable data types, the only way to change their state is to recreate them.\n", + "\n", + "Below is a list of mutable and immutable data types.\n", + "- Mutable: Lists, Dictionaries\n", + "- Immutable: Tuples, Integers, Floats, Strings, Booleans." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 7. Functions --- Code Running Quirks\n", + "\n", + "Do you know that parameters and return statements are optional for a function. See the example below:" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "This is a function that doesn't have parameters nor a return statement\n" + ] + } + ], + "source": [ + "def print_statement():\n", + " a_string = \"This is a function that doesn't have parameters nor a return statement\"\n", + " print(a_string)\n", + " \n", + "print_statement()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Functions that don't have a return statement just simply don't return any value.\n", + "\n", + "Well, theoretically, they return a `None` value, which just means the absence of a value." + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "This is a function that doesn't have parameters nor a return statement\n", + "None\n" + ] + }, + { + "data": { + "text/plain": [ + "NoneType" + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def print_statement():\n", + " a_string = \"This is a function that doesn't have parameters nor a return statement\"\n", + " print(a_string)\n", + " \n", + "f = print_statement()\n", + "print(f)\n", + "type(f)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In the function above, notice that we assigned a text to a variable named a_string. What is worth noticing here is that we cannot access a_string outside the function. If we try the following, we would get an error:" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [ + { + "ename": "NameError", + "evalue": "name 'a_string' is not defined", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32mc:\\Users\\andre\\Documents\\UNI\\Master_Digital_Humanities\\S1_WS2023\\UE_Introduction_to_DH_Tools_and_Methods\\Python_Course\\Exercises\\EN\\Basic\\10_Functions_Intermediate_NA.ipynb Cell 48\u001b[0m line \u001b[0;36m7\n\u001b[0;32m 4\u001b[0m \u001b[39mprint\u001b[39m(a_string)\n\u001b[0;32m 6\u001b[0m \u001b[39m#Outside the function\u001b[39;00m\n\u001b[1;32m----> 7\u001b[0m \u001b[39mprint\u001b[39m(a_string)\n", + "\u001b[1;31mNameError\u001b[0m: name 'a_string' is not defined" + ] + } + ], + "source": [ + "\n", + "def print_statement():\n", + " #Inside the function\n", + " a_string = \"This is a function that doesn't have parameters nor a return statement\"\n", + " print(a_string)\n", + "\n", + "#Outside the function\n", + "print(a_string)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Note that what's inside a function will only be executed after that function is called. For example, if we have some error inside that function, there won't be any error message raised until we call that function. See example below:" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Code finished running, but no error was raised\n" + ] + } + ], + "source": [ + "def do_something():\n", + " \"I cannot be divided\" / 5\n", + " \n", + "print('Code finished running, but no error was raised')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "But we will see the error message if we call that function:" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Now we see the error:\n" + ] + }, + { + "ename": "TypeError", + "evalue": "unsupported operand type(s) for /: 'str' and 'int'", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32mc:\\Users\\andre\\Documents\\UNI\\Master_Digital_Humanities\\S1_WS2023\\UE_Introduction_to_DH_Tools_and_Methods\\Python_Course\\Exercises\\EN\\Basic\\10_Functions_Intermediate_NA.ipynb Cell 52\u001b[0m line \u001b[0;36m5\n\u001b[0;32m 2\u001b[0m \u001b[39m\"\u001b[39m\u001b[39mI cannot be divided\u001b[39m\u001b[39m\"\u001b[39m \u001b[39m/\u001b[39m \u001b[39m5\u001b[39m\n\u001b[0;32m 4\u001b[0m \u001b[39mprint\u001b[39m(\u001b[39m'\u001b[39m\u001b[39mNow we see the error:\u001b[39m\u001b[39m'\u001b[39m)\n\u001b[1;32m----> 5\u001b[0m do_something()\n", + "\u001b[1;32mc:\\Users\\andre\\Documents\\UNI\\Master_Digital_Humanities\\S1_WS2023\\UE_Introduction_to_DH_Tools_and_Methods\\Python_Course\\Exercises\\EN\\Basic\\10_Functions_Intermediate_NA.ipynb Cell 52\u001b[0m line \u001b[0;36m2\n\u001b[0;32m 1\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39mdo_something\u001b[39m():\n\u001b[1;32m----> 2\u001b[0m \u001b[39m\"\u001b[39;49m\u001b[39mI cannot be divided\u001b[39;49m\u001b[39m\"\u001b[39;49m \u001b[39m/\u001b[39;49m \u001b[39m5\u001b[39;49m\n", + "\u001b[1;31mTypeError\u001b[0m: unsupported operand type(s) for /: 'str' and 'int'" + ] + } + ], + "source": [ + "def do_something():\n", + " \"I cannot be divided\" / 5\n", + " \n", + "print('Now we see the error:')\n", + "do_something()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 8. Scopes --- Global and Local\n", + "\n", + "Observe the following function carefully:" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "3.1415926\n" + ] + }, + { + "ename": "NameError", + "evalue": "name 'x' is not defined", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32mc:\\Users\\andre\\Documents\\UNI\\Master_Digital_Humanities\\S1_WS2023\\UE_Introduction_to_DH_Tools_and_Methods\\Python_Course\\Exercises\\EN\\Basic\\10_Functions_Intermediate_NA.ipynb Cell 54\u001b[0m line \u001b[0;36m6\n\u001b[0;32m 3\u001b[0m \u001b[39mprint\u001b[39m(x)\n\u001b[0;32m 5\u001b[0m print_constant()\n\u001b[1;32m----> 6\u001b[0m x\n", + "\u001b[1;31mNameError\u001b[0m: name 'x' is not defined" + ] + } + ], + "source": [ + "def print_constant():\n", + " x = 3.1415926 \n", + " print(x)\n", + " \n", + "print_constant()\n", + "x" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Notice that we get an error when x is called. However, we have already called the function print_constant(), **how come x is not defined?** x is clearly defined inside the `print_constant()` function.\n", + "\n", + "The reason for this is that Python saves the variable x only temporarily. **Python saves x into a kind of temporary memory, which is immediately erased after the print_constant() function finishes running**. This explains why we still get the x is not defined error when we try to call x outside of the `print_constant()` function. Because it is erased as soon as the print_constant() function finishes running.\n", + "\n", + "However, this kind of temporary memory storage doesn't apply to the code that is being run outside function definitions.\n", + "If we try to define x = 3.1415926 for example in our main program , or outside function definitions, we can use x later on without having any problem or worry about that it was erased from the memory." + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "x is not erased\n", + "we can call x now\n" + ] + }, + { + "data": { + "text/plain": [ + "3.1415926" + ] + }, + "execution_count": 26, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "x = 3.1415926\n", + "\n", + "print('x is not erased')\n", + "print('we can call x now')\n", + "\n", + "x" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You see that x now we don't get an error message by calling x.\n", + "\n", + "There are several advantages to have such temporary memory associated with a function. For example, if we initialize a variable x = 123 in the main program and then execute x = 3.1415926 in the body of a function, the x variable of the main program is not being overwritten." + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "3.1415926\n" + ] + }, + { + "data": { + "text/plain": [ + "123" + ] + }, + "execution_count": 27, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "x = 123\n", + "\n", + "def print_constant():\n", + " x = 3.1415926 \n", + " print(x)\n", + " \n", + "print_constant()\n", + "x" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You see that with memory isolation, we don't have to worry about overwriting variables from the main program when we write functions, or vice-versa. This can be extremely helpful when we write some large and complicated programs, we don't have to remember all the variable names declared in the main program.\n", + "\n", + ">The part of a program where a variable can be accessed is often called scope.\n", + "\n", + ">Global scope is known as the variables defined in the main program and local scope is known as the variables defined inside a function." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 1.7.8\n", + "Create a function named exponential() that takes in a single parameter named x.\n", + "- Inside the function definition:\n", + " - Assign 3.14 to a variable named `e`.\n", + " - Print e.\n", + "- The function should return e to the power of x.\n", + "- Call the `exponential()` function with an argument of 2. Assign the result to a variable named result.\n", + "- Hypothesize what you should see if you printed e in the main program after calling the `exponential()` function. Print e to confirm or reject your hypothesis." + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "3.14\n", + "9.8596\n" + ] + }, + { + "ename": "NameError", + "evalue": "name 'e' is not defined", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32mc:\\Users\\andre\\Documents\\UNI\\Master_Digital_Humanities\\S1_WS2023\\UE_Introduction_to_DH_Tools_and_Methods\\Python_Course\\Exercises\\EN\\Basic\\10_Functions_Intermediate_NA.ipynb Cell 61\u001b[0m line \u001b[0;36m9\n\u001b[0;32m 7\u001b[0m result \u001b[39m=\u001b[39m exponential(\u001b[39m2\u001b[39m)\n\u001b[0;32m 8\u001b[0m \u001b[39mprint\u001b[39m(result)\n\u001b[1;32m----> 9\u001b[0m \u001b[39mprint\u001b[39m(e)\n", + "\u001b[1;31mNameError\u001b[0m: name 'e' is not defined" + ] + } + ], + "source": [ + "# Start your code below:\n", + "def exponential(x):\n", + " e = 3.14\n", + " print(e)\n", + " return pow(e,x)\n", + "\n", + "result = exponential(2)\n", + "print(result)\n", + "print(e)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 9. Scopes --- Searching Order\n", + "\n", + "Let's take a look of the code below:" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "50\n", + "20\n", + "70\n" + ] + } + ], + "source": [ + "x = 50\n", + "y = 20\n", + "\n", + "def add():\n", + " print(x)\n", + " print(y)\n", + " return x+ y\n", + "\n", + "my_result = add()\n", + "print(my_result)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You might be surprised that the code above didn't throw any error.\n", + "\n", + ">When a variable is accessed from within a function, Python first searches in the local scope (inside the function's definition) to see if there are any matching variable defined here. If Python doesn't find the variables inside the function's definition, it will continue to search in the global score ( the scope of the main program)\n", + "\n", + "And now let's take a look of the code below:" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "5\n", + "2\n", + "7\n" + ] + } + ], + "source": [ + "x = 50\n", + "y = 20\n", + "\n", + "def add():\n", + " x = 5\n", + " y = 2\n", + " print(x)\n", + " print(y)\n", + " return x+ y\n", + "\n", + "my_result = add()\n", + "print(my_result)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "From the code above we see that the local scope is prioritized relative to the global scope. If we define x and y with different values within the local scope (like x = 5 and y = 2), Python will use those values instead of the x and y that are lying in the main program, and we'll get a different result.\n", + "\n", + ">Pay attention that even though Python searches the global scope if a variable is not found in the local scope, but the reverse doesn't apply here— Python won't search the local scope if a variable is not found in the global scope.\n", + "\n", + "Remember the error that we had at the beginning?\n", + "To refresh your member, see below:" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "3.1415926\n" + ] + }, + { + "data": { + "text/plain": [ + "50" + ] + }, + "execution_count": 31, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def print_constant():\n", + " x = 3.1415926 \n", + " print(x)\n", + " \n", + "print_constant()\n", + "x" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "If this concept is still confusing to you, for a more demonstrative overview, go ahead and check out this [video](https://www.youtube.com/watch?v=r9LtArXOYjk)." + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.1" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} From 6e4a7eb26fa0f60ba789d8554acf0980d5961e2d Mon Sep 17 00:00:00 2001 From: andren967 Date: Fri, 3 Nov 2023 17:10:15 +0100 Subject: [PATCH 5/5] Exercises EH5 numpy and pandas --- .../EN/Numpy_Pandas/1_Intro_to_NumPy_NA.ipynb | 953 ++++++++++ .../2_Working_with_NumPy_NA.ipynb | 897 +++++++++ .../Numpy_Pandas/3_Intro_to_Pandas_NA.ipynb | 1636 +++++++++++++++++ ...ing_Data_with_Pandas_Fundamentals_NA.ipynb | 1221 ++++++++++++ ...ing_Data_with_Pandas_Intermediate_NA.ipynb | 1620 ++++++++++++++++ 5 files changed, 6327 insertions(+) create mode 100644 Exercises/EN/Numpy_Pandas/1_Intro_to_NumPy_NA.ipynb create mode 100644 Exercises/EN/Numpy_Pandas/2_Working_with_NumPy_NA.ipynb create mode 100644 Exercises/EN/Numpy_Pandas/3_Intro_to_Pandas_NA.ipynb create mode 100644 Exercises/EN/Numpy_Pandas/4_Exploring_Data_with_Pandas_Fundamentals_NA.ipynb create mode 100644 Exercises/EN/Numpy_Pandas/5_Exploring_Data_with_Pandas_Intermediate_NA.ipynb diff --git a/Exercises/EN/Numpy_Pandas/1_Intro_to_NumPy_NA.ipynb b/Exercises/EN/Numpy_Pandas/1_Intro_to_NumPy_NA.ipynb new file mode 100644 index 00000000..35037d4d --- /dev/null +++ b/Exercises/EN/Numpy_Pandas/1_Intro_to_NumPy_NA.ipynb @@ -0,0 +1,953 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## About This Notebook \n", + "In this **Introduction to NumPy** chapter, we will learn:\n", + "- How vectorization makes our code faster.\n", + "- About n-dimensional arrays, and NumPy's ndarrays.\n", + "- How to select specific items, rows, columns, 1D slices, and 2D slices from ndarrays.\n", + "- How to apply simple calculations to entire ndarrays.\n", + "- How to use vectorized methods to perform calculations across any axis of an ndarray.\n", + "***\n", + "## 1. Introduction\n", + "\n", + "In this notebook, we'll learn data analysis with some of the most powerful Python libraries for working with data.\n", + "\n", + "Have you ever wondered why the Python language is so popular? One straight forward answer is that Python makes writing programs easy. Python is a **high-level language**, which means we don’t need to worry about allocating memory or choosing how certain operations are done by our computers' processors like we have to when we use a **low-level language**, such as C. It takes usually more time to code in a low-level language; however, it also gives us more ability to optimize the code in order for it to run faster.\n", + "\n", + "We have two Python libraries that enable us to write code efficiently without sacrificing performance: NumPy and pandas.\n", + "\n", + "Now let's take a closer look at NumPy.\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 2. Introduction to Ndarrays\n", + "\n", + "The core data structure in NumPy is the ndarray or n-dimensional array. In data science, array describes a collection of elements, similar to a list. The word n-dimensional refers to the fact that ndarrays can have one or more dimensions. Let's first begin this session by working with one-dimensional (1D) ndarrays.\n", + "\n", + "In order to use the NumPy library, the first step is to import numpy into our Python environment like this:\n", + "\n", + "````python\n", + "import numpy as np\n", + "````\n", + "Note that ``np`` is the common alias for numpy." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "With the NumPy library a list can be directly converted to an ndarray using the `numpy.array()` [constructor](https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.array.html).\n", + "How can we create a 1D ndarray? Look at the code below:\n", + "\n", + "````python\n", + "data_ndarray = np. array([5,10,15,20])\n", + "````" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Have you noticed that we used the syntax `np.array()` instead of `numpy.array()`? This is because we used the alias `as np` in our code: \n", + "````python\n", + "import numpy as np\n", + "````\n", + "Now, let's do some exercises creating 1D ndarrays.\n", + "\n", + "### Task 3.1.2:\n", + "1. Import `numpy` and assign it to the alias `np`.\n", + "2. Create a NumPy ndarray from the list `[10, 20, 30]`. Assign the result to the variable `data_ndarray`." + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Requirement already satisfied: numpy in c:\\users\\andre\\appdata\\local\\packages\\pythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0\\localcache\\local-packages\\python311\\site-packages (1.26.1)\n" + ] + } + ], + "source": [ + "! pip install numpy" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[10 20 30]\n" + ] + } + ], + "source": [ + "# Start your code below:\n", + "import numpy as np\n", + "\n", + "data_ndarray = np.array([10,20,30])\n", + "\n", + "print(data_ndarray)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 3. NYC Taxi-Airport Data\n", + "\n", + "So far we've only created one-dimensional ndarrys. However, ndarrays can also be two-dimensional. \n", + "To illustrate this, we will analyze New York City taxi trip data released by the city of New York.\n", + "\n", + "Our dataset is stored in a [CSV file](https://en.wikipedia.org/wiki/Comma-separated_values) called nyc_taxis.csv. To convert the data set into a 2D ndarray, we'll first use Python's built-in csv [module](https://docs.python.org/3/library/csv.html) to import our CSV as a \"list of lists\". Then we can convert the lists of lists to an ndarray like this:" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Our list of lists is stored as `data_list`:\n", + "````python\n", + "data_ndarray = np.array(data_list)\n", + "````" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Below is the information about selected columns from the data set:\n", + "- `pickup_year`: The year of the trip.\n", + "- `pickup_month`: The month of the trip (January is 1, December is 12).\n", + "- `pickup_day`: The day of the month of the trip.\n", + "- `pickup_location_code`: The airport or borough where the trip started.\n", + "- `dropoff_location_code`: The airport or borough where the trip finished.\n", + "- `trip_distance`: The distance of the trip in miles.\n", + "- `trip_length`: The length of the trip in seconds.\n", + "- `fare_amount`: The base fare of the trip, in dollars.\n", + "- `total_amount`: The total amount charged to the passenger, including all fees, tolls and tips.\n", + "\n", + "### Task 3.1.3 (IMPORTANT):\n", + "We have used Python's csv module to import the nyc_taxis.csv file and convert it to a list of lists containing float values.\n", + "\n", + "1. Add a line of code using the `numpy.array()` constructor to convert the `converted_taxi_list` variable to a NumPy ndarray.\n", + "2. Assign the result to the variable name `taxi`." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "import csv\n", + "import numpy as np\n", + "\n", + "# import nyc_taxi.csv as a list of lists\n", + "f = open(\"../../../Data/csv/nyc_taxis.csv\", \"r\")\n", + "taxi_list = list(csv.reader(f))\n", + "\n", + "# remove the header row\n", + "taxi_list = taxi_list[1:]\n", + "\n", + "# convert all values to floats\n", + "converted_taxi_list = []\n", + "for row in taxi_list:\n", + " converted_row = []\n", + " for item in row:\n", + " converted_row.append(float(item))\n", + " converted_taxi_list.append(converted_row)\n", + " \n", + "# Start your code below:\n", + "taxi = np.array(converted_taxi_list)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 4. Array Shapes\n", + "\n", + "if we want, we can use the `print()` function to take a look at the data in the `taxi` variable." + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[[2.016e+03 1.000e+00 1.000e+00 ... 1.165e+01 6.999e+01 1.000e+00]\n", + " [2.016e+03 1.000e+00 1.000e+00 ... 8.000e+00 5.430e+01 1.000e+00]\n", + " [2.016e+03 1.000e+00 1.000e+00 ... 0.000e+00 3.780e+01 2.000e+00]\n", + " ...\n", + " [2.016e+03 6.000e+00 3.000e+01 ... 5.000e+00 6.334e+01 1.000e+00]\n", + " [2.016e+03 6.000e+00 3.000e+01 ... 8.950e+00 4.475e+01 1.000e+00]\n", + " [2.016e+03 6.000e+00 3.000e+01 ... 0.000e+00 5.484e+01 2.000e+00]]\n" + ] + } + ], + "source": [ + "# the code below only works if you have solved task 1.2\n", + "print(taxi)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The elipses (...) between rows and columns indicate that there is more data in our NumPy ndarray than can easily be printed. In order to know the number of rows and columns in an ndarray, we can use the `ndarray.shape` attribute like this: " + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(2, 3)\n" + ] + } + ], + "source": [ + "import numpy as np\n", + "data_ndarray = np.array([[5, 10, 15], \n", + " [20, 25, 30]])\n", + "print(data_ndarray.shape)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "A data type **tuple** is returned as the result. Recall what we learned in the previous course about tuple — this type of value can't be modified.\n", + "\n", + "This value output gives us the following information:\n", + "1. The first number tells us that there are 2 rows in `data_ndarray`.\n", + "2. The second number tells us that there are 3 columns in `data_ndarray`." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 5. Selecting and Slicing Rows and Items from ndarrays\n", + "\n", + "The following code will compare working with ndarrays and list of lists to select one or more rows of data:" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### List of lists method:\n", + "````python\n", + "# Selecting a single row\n", + "sel_lol = data_lol[1]\n", + "\n", + "#Selecting multiple rows\n", + "sel_lol = data_lol[2:]\n", + "````" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### NumPy method:\n", + "\n", + "````python\n", + "# Selecting a single row\n", + "sel_np = data_np[1]\n", + "\n", + "#Selecting multiple rows\n", + "sel_np = data_np[2:]\n", + "````" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You see that the syntax of selecting rows in ndarrays is very similar to lists of lists. In fact, the syntax that we wrote above is a kind of shortcut. For any 2D array, the full syntax for selecting data is:" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "````python\n", + "ndarray[row_index,column_index]\n", + "````\n", + "\n", + "When you want to select the entire columns for a given set of rows, you just need to do this:\n", + "````python\n", + "ndarray[row_index]\n", + "````" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Here `row_index` defines the location along the row axis and `column_index` defines the location along the column axis.\n", + "\n", + "Like lists, array slicing is from the first specified index up to — but **not including** – the second specified index. For example, to select the items at index 1, 2, and 3, we'd need to use the slice `[1:4]`.\n", + "\n", + "This is how we **select a single item** from a 2D ndarray:" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "#### List of lists method\n", + "\n", + "````python\n", + "# Selecting a single row\n", + "sel_lol = data_lol[1][3]\n", + "````" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### NumPy method\n", + "\n", + "````python\n", + "# Selecting a single row\n", + "sel_np = data_np[1,3] # The comma here separates row/column locations. Produces a single Python object.\n", + "````" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Two separate pairs of square brackets back-to-back are used with a list of lists and a single pair of brackets with comma-separated row and column locations is used with a NumPy ndarray." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 3.1.5:\n", + "From the `taxi` ndarray:\n", + "\n", + "1. Select the row at index `0`. Assign it to `row_0`.\n", + "2. Select every column for the rows from index `391` up to and including `500`. Assign them to `rows_391_to_500`.\n", + "3. Select the item at row index `21` and column index `5`. Assign it to `row_21_column_5`." + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "4.0" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Start your code below:\n", + "row_0 = taxi[0]\n", + "rows_391_to_500 = taxi[391:501]\n", + "row_21_column_5 = taxi[21,5]\n", + "\n", + "row_0\n", + "row_21_column_5" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 6. Selecting Columns and Custom Slicing ndarrays\n", + "\n", + "Let's take a look at how to select one or more columns of data:" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "#### List of lists method\n", + "````python\n", + "# Selecting a single row\n", + "sel_lol = []\n", + "\n", + "for row in data_lol:\n", + " col4 = row[3]\n", + " sel_lol.append(col4)\n", + " \n", + "#Selecting multiple columns\n", + "sel_lol = []\n", + "\n", + "for row in data_lol:\n", + " col23 = row[2:3]\n", + " sel_lol.append(col23)\n", + " \n", + "#Selecting multiple, specific columns\n", + "sel_lol = []\n", + "\n", + "for row in data_lol:\n", + " cols = [row[1], row[3], row[4]]\n", + " sel_lol.append(cols)\n", + "````" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### NumPy Method\n", + "\n", + "````python\n", + "# Selecting a single row\n", + "sel_np = data_np[:,3] #Produces a 1D ndarray\n", + " \n", + "#Selecting multiple columns\n", + "sel_np = data_np[:, 1:3] # Produces a 2D ndarray\n", + " \n", + "#Selecting multiple, specific columns\n", + "cols = [1, 3, 4]\n", + "sel_np = data_np[:,cols] # Produces a 2D ndarray``\n", + "````" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You see that with a list of lists, we need to use a for loop to extract specific column(s) and append them back to a new list. It is much easier with ndarrays. We again use single brackets with comma-separated row and column locations, but we use a colon (`:`) for the row locations, which gives us all of the rows.\n", + "\n", + "If we want to select a partial 1D slice of a row or column, we can combine a single value for one dimension with a slice for the other dimension:" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "#### List of lists method\n", + "````python\n", + "# Selecting a 1D slice (row)\n", + "sel_lol = data_lol[2][1:4] #third row (row index of 2) of column 1, 2, 3\n", + "\n", + "#Selecting a 1D slice (column)\n", + "sel_lol = []\n", + "\n", + "rows = data_lol[1:5] #fifth column (column index of 4) of row 1, 2, 3, 4\n", + "for r in rows:\n", + " col5 = r[4]\n", + " sel_lol.append(col5) \n", + "````" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### NumPy Method\n", + "\n", + "````python\n", + "# Selecting a 1D slice (row)\n", + "sel_np = data_np[2, 1:4] # Produces a 1D ndarray\n", + " \n", + "# Selecting a 1D slice (column)\n", + "sel_np = data_np[1:5, 4] # Produces a 1D ndarray\n", + "````" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Lastly, if we want to select a 2D slice, we can use slices for both dimensions:" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### List of lists method\n", + "\n", + "````python\n", + "# Selecting a 2D slice \n", + "sel_lol = []\n", + "\n", + "rows = data_lol[1:4]\n", + "for r in rows:\n", + " new_row = r[:3]\n", + " sel_lol.append(new_row)\n", + "````" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### NumPy method\n", + "\n", + "````python\n", + "# Selecting a 2D slice \n", + "sel_np = data_np[1:4,:3]\n", + "````" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 3.1.6:\n", + "From the `taxi` ndarray:\n", + "\n", + "1. Select every row for the columns at indexes `1`, `4`, and `7`. Assign them to `columns_1_4_7`.\n", + "2. Select the columns at indexes `5` to `8` inclusive for the row at index `99`. Assign them to `row_99_columns_5_to_8`.\n", + "3. Select the rows at indexes `100` to `200` inclusive for the column at index `14`. Assign them to `rows_100_to_200_column_14`.\n" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [], + "source": [ + "# Start your code below:\n", + "columns_1_4_7 = taxi[:,[1,4,7]]\n", + "row_99_columns_5_to_8 = taxi[98,5:8]\n", + "rows_100_to_200_columns_14 = taxi[100:201,14]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 7. Vector Math\n", + "In this section we will explore the power of vectorization. Take a look at the example below:" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([ 3, 9, 15])" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# convert the list of lists to an ndarray\n", + "my_numbers = [[1,2,3],[4,5,6], [7,8,9]] \n", + "my_numbers = np.array(my_numbers)\n", + "\n", + "# select each of the columns - the result\n", + "# of each will be a 1D ndarray\n", + "col1 = my_numbers[:,0]\n", + "col2 = my_numbers[:,1]\n", + "\n", + "# add the two columns\n", + "sums = col1 + col2\n", + "sums" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The code above can be simplified into one line of code, like this:" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([ 3, 9, 15])" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "sums = my_numbers[:,0] + my_numbers[:,1]\n", + "sums" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Some key take aways from the code above:\n", + "- When we selected each column, we used the syntax `ndarray[:,c]` where `c` is the column index we wanted to select. Like we saw in the previous screen, the colon selects all rows.\n", + "- To add the two 1D ndarrays, `col1` and `col2` we can simply put the addition operator ``+`` between them." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 8. Vector Math Continued\n", + "\n", + "Do you know that the standard Python numeric operators also work with vectors such as:\n", + "\n", + "- **Addition**: `vector_a + vector_b`\n", + "- **Subtraction**: `vector_a - vector_b`\n", + "- **Multiplication**: (unrelated to the vector multiplication in linear algebra): `vector_a * vector_b`\n", + "- **Division**: `vecotr_a / vector_b`\n", + "\n", + "Note that all these operations are entry-wise.\n", + "\n", + "Below is an example table from our taxi data set:" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "|trip_distance|trip_length|\n", + "|-------------|-----------|\n", + "|21.00|2037.0|\n", + "|16.29|1520.0|\n", + "|12.70|1462.0|\n", + "|8.70|1210.0|\n", + "|5.56|759.0|" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We want to use these columns to calculate the average travel speed of each trip in miles per hour. For this we can use the formula below:
\n", + "**miles per hour = distance in miles / length in hours**\n", + "\n", + "The current column `trip_distance` is already expressed in miles, but `trip_length` is expressed in seconds. First, we want to convert `trip_length` into hours:" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "````python\n", + "trip_distance = taxi[:,7]\n", + "trip_length_seconds = taxi[:,8]\n", + "\n", + "trip_length_hours = trip_length_seconds / 3600 \n", + "````\n", + "Note: 3600 seconds is one hour" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can then divide each value in the vector by a single number, 3600, instead of another vector. Let's see the first five rows of the result below:\n", + "\n", + "|trip_length_hours|\n", + "|-------------|\n", + "|0.565833|\n", + "|0.422222|\n", + "|0.406111|\n", + "|0.336111|\n", + "|0.210833|\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 9. Calculating Statistics For 1D ndarrays\n", + "\n", + "We've created ``trip_mph`` in the previous exercise. This is a 1D ndarray of the average mile-per-hour speed of each trip in our dataset. Now, something else we can do is to calculate the ``minimum``, ``maximum``, and ``mean`` values for `trip_distance`.\n", + "\n", + "In order to calculate the minimum value of a 1D ndarray, all we need to do is to use the vectorized `ndarray.min()` [method](https://docs.scipy.org/doc/numpy-1.14.0/reference/generated/numpy.ndarray.min.html), like this:\n", + "\n", + "````python\n", + "distance_min = trip_distance.min()\n", + "````" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "For other Numpy ndarrays methods we have:\n", + "- [ndarray.min()](https://docs.scipy.org/doc/numpy-1.14.0/reference/generated/numpy.ndarray.min.html#numpy.ndarray.min) to calculate the minimum value\n", + "- [ndarray.max()](https://docs.scipy.org/doc/numpy-1.16.1/reference/generated/numpy.ndarray.max.html#numpy.ndarray.max) to calculate the maximum value\n", + "- [ndarray.mean()](https://docs.scipy.org/doc/numpy-1.14.0/reference/generated/numpy.ndarray.mean.html#numpy.ndarray.mean) to calculate the mean or average value\n", + "- [ndarray.sum()](https://docs.scipy.org/doc/numpy-1.14.0/reference/generated/numpy.ndarray.sum.html#numpy.ndarray.sum) to calculate the sum of the values\n", + "\n", + "You will find the full list of ndarray methods in the NumPy ndarray documentation [here](https://docs.scipy.org/doc/numpy-1.14.0/reference/arrays.ndarray.html#calculation).\n", + "\n", + "### Task 3.1.9:\n", + "1. Use the `ndarray.max()` method to calculate the maximum value of `trip_distance`. Assign the result to `distance_max`.\n", + "2. Use the `ndarray.mean()` method to calculate the average value of `trip_distance`. Assign the result to `distance_mean`." + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "12.6674260830728" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Selecting only the relevant column distance\n", + "trip_distance = taxi[:,7]\n", + "trip_distance_miles = taxi[:,7]\n", + "trip_length_seconds = taxi[:,8]\n", + "\n", + "trip_length_hours = trip_length_seconds / 3600 # 3600 seconds is one hour\n", + "trip_mph = trip_distance_miles / trip_length_hours\n", + "\n", + "# Start your code below:\n", + "distance_max = trip_distance.max()\n", + "distance_mean = trip_distance.mean()\n", + "\n", + "distance_mean\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 10. Calculating Statistics For 1D ndarrays Continued (IMPORTANT)\n", + "\n", + "Let's examine the difference between methods and functions.\n", + "Functions act as stand alone segments of code that usually take an input, perform some processing, and return some output. Take for example the `len()` function used to calculate the length of a list or the number of characters in a string:" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "3\n" + ] + } + ], + "source": [ + "my_list = [25,18,9]\n", + "print(len(my_list))" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "3\n" + ] + } + ], + "source": [ + "my_string = 'RBI'\n", + "print(len(my_string))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In contrast, methods are special functions that belong to a specific type of object. In other words, when we work with list objects, there are special functions or methods that can only be used with lists. For example, `list.append()` method is used to add an item to the end of a list. We will get an error if we use this method on a string:" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [ + { + "ename": "AttributeError", + "evalue": "'str' object has no attribute 'append'", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mAttributeError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32mc:\\Users\\andre\\Documents\\UNI\\Master_Digital_Humanities\\S1_WS2023\\UE_Introduction_to_DH_Tools_and_Methods\\Python_Course\\Exercises\\EN\\Numpy_Pandas\\1_Intro_to_NumPy_NA.ipynb Cell 55\u001b[0m line \u001b[0;36m1\n\u001b[1;32m----> 1\u001b[0m my_string\u001b[39m.\u001b[39;49mappend(\u001b[39m'\u001b[39m\u001b[39m is the best!\u001b[39m\u001b[39m'\u001b[39m)\n", + "\u001b[1;31mAttributeError\u001b[0m: 'str' object has no attribute 'append'" + ] + } + ], + "source": [ + "my_string.append(' is the best!')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "There are cases in NumPy where operations are sometimes implemented as both methods and functions. It can be confusing at first glance, so let's take a look at an example." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "|Calculation|Function Representation|Method Representation|\n", + "|-------------|-----------|---------------|\n", + "|Calculate the minimum value of trip_mph|np.min(trip_mph)|trip_mph.min()|\n", + "|Calculate the maximum value of trip_mph|np.ax(trip_mph)|trip_mph.max()|\n", + "|Calculate the mean average value of trip_mph|np.mean(trip_mph)|trip_mph.mean()|\n", + "|Calculate the median average value of trip_mph|np.median(trip_mph)|There is no ndarray median method|\n", + "\n", + "To help you remember, you can see it as this:\n", + "- anything that starts with `np` (e.g. `np.mean()`) is a function \n", + "- anything expressed with an object (or variable) name first (e.g. `trip_mph.mean()`) is a method\n", + "- it's up to you to decide which one to use\n", + "- however, it is more common to use the method approach " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 11. Calculating Statistics For 2D ndarrays\n", + "\n", + "We have only worked with statistics for 1D ndarrays so far. If we use the `ndarray.max()` method on a 2D ndarray without any additional parameters, a single value will be returned, just like with a 1D array.\n", + "\n", + "What happens if we want to find the **maximum value of each row**?\n", + "Specification of the axis parameter is needed as an indication that we want to calculate the maximum value for each row.\n", + "\n", + "If we want to find the maximum value of each column, we'd use an axis value of 0 like this:\n", + "\n", + "ndarray.max(axis = 0)\n", + "\n", + "Let's use what we've learned to check the data in our taxi data set. Below is an example table of our data set:\n", + "\n", + "|fare_amount|fees_amount|tolls_amount|tip_amount|total_amount|\n", + "|-------------|-----------|--------|-------------|-----------|\n", + "|52.0|0.8|5.54|11.65|69.99|\n", + "|45.0|1.3|0.00|8.00|54.3|\n", + "|36.5|1.3|0.00|0.00|37.8|\n", + "|26.0|1.3|0.00|5.46|32.76|\n", + "|17.5|1.3|0.00|0.00|18.8|\n", + "\n", + "You see that **total amount = fare amount + fees amount + tolls amount + tip amount**.\n", + "\n", + "Now let's see if you can perform a 2D ndarray calculation on the data set.\n", + "\n", + "### Task 3.1.11:\n", + "1. Use the `ndarray.sum()` method to calculate the sum of each row in `fare_components`. Assign the result to `fare_sums`.\n", + "2. Extract the 14th column in `taxi_first_five`. Assign to `fare_totals`.\n", + "3. Print `fare_totals` and `fare_sums`. You should see the same numbers." + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[69.99 54.3 37.8 32.76 18.8 ]\n", + "[69.99 54.3 37.8 32.76 18.8 ]\n" + ] + } + ], + "source": [ + "# get the table from above (first five rows of taxi and columns fare_amount, fees_amount, tolls_amount, tip_amount)\n", + "fare_components = taxi[:5,[9,10,11,12]]\n", + "# we'll compare against the first 5 rows only\n", + "taxi_first_five = taxi[:5]\n", + "\n", + "# Start your code below:\n", + "fare_sums = fare_components.sum(axis = 1)\n", + "fare_totals = taxi_first_five[:,13]\n", + "print(fare_sums)\n", + "print(fare_totals)\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.6" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/Exercises/EN/Numpy_Pandas/2_Working_with_NumPy_NA.ipynb b/Exercises/EN/Numpy_Pandas/2_Working_with_NumPy_NA.ipynb new file mode 100644 index 00000000..c7fcae20 --- /dev/null +++ b/Exercises/EN/Numpy_Pandas/2_Working_with_NumPy_NA.ipynb @@ -0,0 +1,897 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## About This Notebook \n", + "In this **Working with NumPy** notebook, we will learn:\n", + "- How to use `numpy.genfromtxt()` to read in an ndarray.\n", + "- What a boolean array is, and how to create one.\n", + "- How to use boolean indexing to filter values in one and two-dimensional ndarrays.\n", + "- How to assign one or more new values to an ndarray based on their locations.\n", + "- How to assign one or more new values to an ndarray based on their values.\n", + "***\n", + "## 1. Reading CSV files with NumPy\n", + "\n", + "In this chapter, we will learn a technique called Boolean Indexing. Before we dig deeper into this topic, let's first learn how to read files into NumPy ndarrays. Below is the simplified syntax of the function, as well as an explanation for the two parameters:\n", + "\n", + "````python\n", + "np.genfromtxt(filename, delimiter=None)\n", + "````\n", + "\n", + "- ``filename``: A positional argument, usually a string representing the path to the text file to be read.\n", + "- ``delimiter``: A named argument, specifying the string used to separate each value.\n", + "\n", + "In our case, the data is stored in a CSV file, therefore the delimiter is a comma \",\".\n", + "So this is how we can read in a file named ``data.csv``:\n", + "\n", + "\n", + "````python\n", + "data = np.genfromtxt('/data.csv', delimiter = ',')\n", + "````" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 3.2.1:\n", + "Now let's try to read our nyc_taxis.csv file into NumPy.\n", + "\n", + "1. Import the NumPy library and assign to the alias ``np``.\n", + "2. Use the `np.genfromtxt()` function to read the nyc_taxis.csv file into NumPy. Assign the result to taxi. Do not forget to use also delimiter argument, such as shown above.\n", + "3. Use the ``ndarray.shape`` attribute to assign the shape of taxi to ``taxi_shape``." + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "# Start your code here:\n", + "import numpy as np\n", + "\n", + "taxi = np.genfromtxt('../../../Data/csv/nyc_taxis.csv', delimiter = \",\")\n", + "taxi_shape = taxi.shape\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 2. Reading CSV files with NumPy Continued\n", + "\n", + "We have used the `numpy.genfromtxt()` function to read the ``nyc_taxis.csv`` file into NumPy in the previous notebook.\n", + "\n", + "Just to refresh your memory, in the previous mission we have done something like this:" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "````python\n", + "# import nyc_taxi.csv as a list of lists\n", + "f = open(\"/nyc_taxis.csv\", \"r\")\n", + "taxi_list = list(csv.reader(f))\n", + "\n", + "# remove the header row\n", + "taxi_list = taxi_list[1:]\n", + "\n", + "# convert all values to floats\n", + "converted_taxi_list = []\n", + "for row in taxi_list:\n", + " converted_row = []\n", + " for item in row:\n", + " converted_row.append(float(item))\n", + " converted_taxi_list.append(converted_row)\n", + "\n", + "taxi = np.array(converted_taxi_list)\n", + "````" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Have you noticed that we converted all the values to floats before we converted the list of lists to an ndarray? \n", + "> The reason for this is because that NumPy ndarrays can contain only **one datatype**.\n", + "\n", + "This part of the code was omitted in the previous exercise, because when `numpy.getfromtxt()` is called, the function automatically tries to determine the data type of the file by looking at the values.\n", + "\n", + "To see which datatype we have in the ndarray, simply use `ndarray.dtype` attribute like this:\n", + "````python\n", + "print(taxi.dtype)\n", + "````\n", + "### Task 3.2.2:\n", + "1. Use the `numpy.genfromtxt()` function to again read the nyc_taxis.csv file into NumPy, but this time, skip the first row. Assign the result to `taxi`.\n", + "2. Assign the shape of `taxi` to `taxi_shape`." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "# Start your code here:\n", + "taxi = np.genfromtxt('../../../Data/csv/nyc_taxis.csv', delimiter = \",\", skip_header=True)\n", + "taxi_shape = taxi.shape" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 3. Boolean Arrays\n", + "\n", + "In this session, we're going to focus on the boolean array.\n", + "\n", + "Do you remember that the boolean (or bool) type is a built-in Python type that can be one of two unique values:\n", + "\n", + "- True\n", + "- False\n", + "\n", + "Do you also remember that we've used boolean values when working with Python comparison operators like \n", + "- ``==`` equal\n", + "- ``>`` greater than\n", + "- ``<`` less than\n", + "- ``!=`` not equal\n", + "\n", + "See a couple examples of simple boolean operations below just to refresh your memory:" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "True\n" + ] + } + ], + "source": [ + "print(type(3.5) == float)" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "False\n" + ] + } + ], + "source": [ + "print(5 > 6)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In the previous notebook where we explored vector operations we learned that the result of an operation between a ndarray and a single value is a new ndarray:" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[12 14 16 18]\n" + ] + } + ], + "source": [ + "import numpy as np\n", + "print(np.array([2,4,6,8]) + 10)\n", + "\n", + "#The + 10 operation is applied to each value in the array" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Guess what happens when we perform a **boolean operation** between an ndarray and a single value:" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[ True True False False]\n" + ] + } + ], + "source": [ + "import numpy as np\n", + "print(np.array([2,4,6,8]) < 5)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 4. Boolean Indexing with 1D ndarrays\n", + "\n", + "In the last exercise, we learned how to create boolean arrays using vectorized boolean operations. Now, I want to show you a technique known as **boolean indexing**, (or index/select) using boolean arrays.\n", + "See an example from the previous notebook:" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[False True False True]\n" + ] + } + ], + "source": [ + "c = np.array([80.0, 103.4, 96.9, 200.3])\n", + "c_bool = c > 100\n", + "print(c_bool)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "How do we index using our new boolean array? All we need to do is to use the square brackets like this:" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[103.4 200.3]\n" + ] + } + ], + "source": [ + "result = c[c_bool]\n", + "print(result)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The boolean array acts as a filter, the values that corresponding to **True** become part of the result and the values that corresponding to **False** are removed from the final list.\n", + "\n", + "How can we use boolean indexing knowledge in our data set?\n", + "For example, to confirm the number of taxi rides from the month of january, we can do this:" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": true, + "jupyter": { + "outputs_hidden": true + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "13481\n" + ] + } + ], + "source": [ + "# First, select just the pickup_month column (second column in the ndarray with column index 1)\n", + "pickup_month = taxi[:,1]\n", + "\n", + "# use a boolean operation to make a boolean array, where the value 1 corresponds to January\n", + "january_bool = pickup_month == 1\n", + "\n", + "# use the new boolean array to select only the items from pickup_month that have a value of 1\n", + "january = pickup_month[january_bool]\n", + "\n", + "# use the .shape attribute to find out how many items are in our january ndarray\n", + "january_rides = january.shape[0]\n", + "print(january_rides)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 3.2.4:\n", + "\n", + "1. Calculate the number of rides in the taxi ndarray that are from **February**:\n", + " - Create a boolean array, ``february_bool``, that evaluates whether the items in ``pickup_month`` are equal to ``2``.\n", + " - Use the ``february_bool`` boolean array to index ``pickup_month``. Assign the result to ``february``.\n", + " - Use the ``ndarray.shape`` attribute to find the number of items in `february`. Assign the result to ``february_rides``." + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(13333,)" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Start your code below:\n", + "february_bool = pickup_month == 2\n", + "february = pickup_month[february_bool]\n", + "february_rides = february.shape\n", + "february_rides" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 5. Boolean Indexing with 2D ndaarays\n", + "\n", + "Now it is time to use boolean indexing with ``2D ndarrays``. \n", + "> One thing to keep in mind is that the boolean array must have the same length as the dimension you're indexing. This is one of the constraints when we work with 2D ndarrays." + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[[ 1 2 3]\n", + " [ 4 5 6]\n", + " [ 7 8 9]\n", + " [10 11 12]]\n" + ] + } + ], + "source": [ + "arr = np.array([\n", + " [1,2,3],\n", + " [4,5,6],\n", + " [7,8,9],\n", + " [10,11,12]\n", + "])\n", + "\n", + "print(arr)" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[[ 1 2 3]\n", + " [ 7 8 9]\n", + " [10 11 12]]\n" + ] + } + ], + "source": [ + "bool_1 = [True, False, \n", + " True, True]\n", + "print(arr[bool_1])" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [ + { + "ename": "IndexError", + "evalue": "boolean index did not match indexed array along dimension 1; dimension is 3 but corresponding boolean dimension is 4", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mIndexError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32mc:\\Users\\andre\\Documents\\UNI\\Master_Digital_Humanities\\S1_WS2023\\UE_Introduction_to_DH_Tools_and_Methods\\Python_Course\\Exercises\\EN\\Numpy_Pandas\\2_Working_with_NumPy_NA.ipynb Cell 26\u001b[0m line \u001b[0;36m1\n\u001b[1;32m----> 1\u001b[0m \u001b[39mprint\u001b[39m(arr[:, bool_1])\n", + "\u001b[1;31mIndexError\u001b[0m: boolean index did not match indexed array along dimension 1; dimension is 3 but corresponding boolean dimension is 4" + ] + } + ], + "source": [ + "print(arr[:, bool_1])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You see that `bool_1`'s shape (4) is not the same as the shape of `arr`'s second axis(3), so it can't be used to index and produces an error." + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[[ 2 3]\n", + " [ 5 6]\n", + " [ 8 9]\n", + " [11 12]]\n" + ] + } + ], + "source": [ + "bool_2 = [False, True, True]\n", + "print(arr[:,bool_2])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "`bool_2`'s shape (3) is the same as the shape of `arr`'s second axis (3), so this selects the 2nd and 3rd columns." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now let's apply what we have learned to our data set. This time we will analyze the average speed of trips. Recall that we calculated the ``average travel speed `` as follows:\n", + "````python\n", + "trip_mph = taxi[:,7] / (taxi[:,8] / 3600)\n", + "````" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Next, how do we check for trips with an average speed greater than 20,000 mph?" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [], + "source": [ + "trip_mph = taxi[:,7] / (taxi[:,8] / 3600)" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[[ 2. 2. 23. 1. ]\n", + " [ 2. 2. 19.6 1. ]\n", + " [ 2. 2. 16.7 2. ]\n", + " [ 3. 3. 17.8 2. ]\n", + " [ 2. 2. 17.2 2. ]\n", + " [ 3. 3. 16.9 3. ]\n", + " [ 2. 2. 27.1 4. ]]\n" + ] + } + ], + "source": [ + "# create a boolean array for trips with average\n", + "# speeds greater than 20,000 mph\n", + "trip_mph_bool = trip_mph > 20000\n", + "\n", + "# use the boolean array to select the rows for\n", + "# those trips, and the pickup_location_code,\n", + "# dropoff_location_code, trip_distance, and\n", + "# trip_length columns\n", + "trips_over_20000_mph = taxi[trip_mph_bool,5:9]\n", + "\n", + "print(trips_over_20000_mph)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 3.2.5 (HARD):\n", + "1. Create a boolean array, ``tip_bool``, that determines which rows have values for the `tip_amount` column of more than 50.
\n", + "Hint: You might have to examine the original nyc_taxis.csv file to find an index of desired column.\n", + "2. Use the ``tip_bool`` array to select all rows from taxi with values tip amounts of more than 50, and the columns from indexes `5` to `13` inclusive. Assign the resulting array to ``top_tips``." + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [], + "source": [ + "# Start your code below\n", + "tip_amount = taxi[:,12]\n", + "tip_bool = tip_amount > 50\n", + "top_tips = taxi[tip_bool, 5: 14]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 6. Assigning Values in ndarrays (OPTIONAL)\n", + "\n", + "After having learned how to retrieve data from ndarrays, now we will use the same indexing techniques to modify values within an ndarray. The syntax looks like this:
\n", + "\n", + "````python\n", + "ndarray[location_of_values] = new_value\n", + "````" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "With 1D array, all we need to do is to specify one specific index location like this:" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['orange' 'blue' 'black' 'blue' 'purple']\n" + ] + } + ], + "source": [ + "a = np.array(['red','blue','black','blue','purple'])\n", + "a[0] = 'orange'\n", + "print(a)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Or multiple values can be assigned at once:" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['orange' 'blue' 'black' 'pink' 'pink']\n" + ] + } + ], + "source": [ + "a[3:] = 'pink'\n", + "print(a)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "With a 2D ndarray, just like with a 1D ndarray, we can assign one specific index location:" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[[ 1 1 1 1 1]\n", + " [ 1 1 99 1 1]\n", + " [ 1 1 1 1 1]]\n" + ] + } + ], + "source": [ + "ones = np.array([[1, 1, 1, 1, 1],\n", + " [1, 1, 1, 1, 1],\n", + " [1, 1, 1, 1, 1]])\n", + "ones[1,2] = 99\n", + "print(ones)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Or we can assign a whole row:" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[[42 42 42 42 42]\n", + " [ 1 1 99 1 1]\n", + " [ 1 1 1 1 1]]\n" + ] + } + ], + "source": [ + "ones[0] = 42\n", + "print(ones)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Or a whole column:" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[[42 42 0 42 42]\n", + " [ 1 1 0 1 1]\n", + " [ 1 1 0 1 1]]\n" + ] + } + ], + "source": [ + "ones[:,2] = 0\n", + "print(ones)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 7. Assignment Using Boolean Arrays (OPTIONAL)\n", + "\n", + "Boolean arrays become extremely powerful when used for assignment, like this:" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[ 1 2 99 99 99]\n" + ] + } + ], + "source": [ + "a2 = np.array([1, 2, 3, 4, 5])\n", + "\n", + "a2_bool = a2 > 2\n", + "\n", + "a2[a2_bool] = 99\n", + "\n", + "print(a2)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The boolean array has the ability to control the values that the assignment applies to, and the other values remain unchanged." + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[ 1 2 99 99 99]\n" + ] + } + ], + "source": [ + "a = np.array([1, 2, 3, 4, 5])\n", + "\n", + "a [ a > 2] = 99\n", + "\n", + "print(a)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 8. Assignment Using Boolean Arrays Continued (OPTIONAL)\n", + "\n", + "Now let's take a look at an example of assignment using a boolean array with two dimensions:" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[[ 1 2 3]\n", + " [ 4 99 99]\n", + " [99 99 99]]\n" + ] + } + ], + "source": [ + "b = np.array([\n", + " [1,2,3],\n", + " [4,5,6],\n", + " [7,8,9] \n", + "])\n", + "\n", + "b[b > 4] = 99\n", + "print(b)\n", + "\n", + "# The b > 4 boolean operation produces a 2D boolean array \n", + "# which then controls the values that the assignment applies to." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can also use a 1D boolean array to perform assignment on a 2D array:" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[[ 1 2 3]\n", + " [ 4 99 6]\n", + " [ 7 99 9]]\n" + ] + } + ], + "source": [ + "c = np.array([\n", + " [1,2,3],\n", + " [4,5,6],\n", + " [7,8,9] \n", + "])\n", + "\n", + "c[c[:,1] > 2, 1] = 99\n", + "\n", + "print(c)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The above code selected the second column (with column index 1), and used boolean index technique (which value is > 2). The boolean array is only applied to the second column, while all other values remaining unchanged.\n", + "\n", + "The pseudocode syntax for this code is the following, first we used an intermediate variable:" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "````python\n", + "bool = array[:, column_for_comparison] == value_for_comparison\n", + "array[bool, column_for_assignment] = new_value\n", + "````" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "And now all in one line:" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "````python\n", + "array[array[:, column_for_comparison] == value_for_comparison, column_for_assignment] = new_value\n", + "````" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.6" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/Exercises/EN/Numpy_Pandas/3_Intro_to_Pandas_NA.ipynb b/Exercises/EN/Numpy_Pandas/3_Intro_to_Pandas_NA.ipynb new file mode 100644 index 00000000..4ebdfa9b --- /dev/null +++ b/Exercises/EN/Numpy_Pandas/3_Intro_to_Pandas_NA.ipynb @@ -0,0 +1,1636 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# About This Notebook\n", + "In this **Introduction to pandas** chapter, we will learn:\n", + "- How pandas and NumPy combine to make working with data easier.\n", + "- About the two core pandas types: series and dataframes.\n", + "- How to select data from pandas objects using axis labels.\n", + "***\n", + "## 1. Understanding Pandas and NumPy\n", + "\n", + "The pandas library provides solutions to a lot of problems. However, pandas is not so much a replacement for NumPy but serves more as an extension of NumPy. Pandas uses the the NumPy library extensively, and you will notice this more when you dig deeper into the concept.\n", + "\n", + "The primary data structure in pandas is called a **dataframe**. \n", + "This is the pandas equivalent of a Numpy 2D ndarray but with some key differences:\n", + "\n", + "> Axis values can have string **labels**, not just numeric ones. This means that the columns can now have their own meaningful names.\n", + "\n", + "> Dataframes can contain columns with **multiple data types**: including ``integer``, ``float``, and ``string``. This enables us to store, for example, strings and integers in one dataframe.\n", + "\n", + "## 2. Introduction to the Data\n", + "In this chapter, we will work with a data set from Fortune magazine's 2017 Global 500 list.\n", + "\n", + "The data set is stored in a CSV file called **f500.csv**. Here is a data dictionary for some of the columns in the CSV:\n", + "\n", + "- **company**: Name of the company.\n", + "- **rank**: Global 500 rank for the company.\n", + "- **revenues**: Company's total revenue for the fiscal year, in millions of dollars (USD).\n", + "- **revenue_change**: Percentage change in revenue between the current and prior fiscal year.\n", + "- **profits**: Net income for the fiscal year, in millions of dollars (USD).\n", + "- **ceo**: Company's Chief Executive Officer.\n", + "- **industry**: Industry in which the company operates.\n", + "- **sector**: Sector in which the company operates.\n", + "- **previous_rank**: Global 500 rank for the company for the prior year.\n", + "- **country**: Country in which the company is headquartered.\n", + "\n", + "After getting to know our data set, how do we actually import pandas library in Python?\n", + "To import pandas, we simply type in the following code:\n", + "\n", + "````python\n", + "import pandas as pd\n", + "````" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Pandas' dataframes have a `.shape` attribute which returns a tuple representing the dimensions of each axis of the object. Now we want to use this and Python's `type()` function to take a closer look at the `f500` dataframe.\n", + "\n", + "### Task 3.3.2:\n", + "\n", + "1. Use Python's `type()` function to assign the type of `f500` to `f500_type`.\n", + "2. Use the `DataFrame.shape` attribute to assign the shape of `f500` to `f500_shape`.\n", + "3. Print both the `f500_type` and `f500_shape`." + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "(500, 16)\n" + ] + } + ], + "source": [ + "import pandas as pd\n", + "f500 = pd.read_csv('../../../Data/csv/f500.csv',index_col=0)\n", + "f500.index.name = None\n", + "# Start your code below:\n", + "f500_type = type(f500)\n", + "f500_shape = f500.shape\n", + "print(f500_type)\n", + "print(f500_shape)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 3. Introducing DataFrames\n", + "\n", + "Remember how we spent so much time in the course \"Be Around of Data Science\" talking about rectangular data structures? Moreover, we discussed flat tables consisting of rows (observations) and columns (features)? Now this will come in really handy! \n", + "\n", + "I want to show you the `DataFrame.head` method. By default, it will return the first five rows of our dataframe. However, it also accepts an optional integer parameter, which specifies the number of rows:" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
rankrevenuesrevenue_changeprofitsassetsprofit_changeceoindustrysectorprevious_rankcountryhq_locationwebsiteyears_on_global_500_listemployeestotal_stockholder_equity
Walmart14858730.813643.0198825-7.2C. Douglas McMillonGeneral MerchandisersRetailing1USABentonville, ARhttp://www.walmart.com23230000077798
State Grid2315199-4.49571.3489838-6.2Kou WeiUtilitiesEnergy2ChinaBeijing, Chinahttp://www.sgcc.com.cn17926067209456
Sinopec Group3267518-9.11257.9310726-65.0Wang YupuPetroleum RefiningEnergy4ChinaBeijing, Chinahttp://www.sinopec.com19713288106523
\n", + "
" + ], + "text/plain": [ + " rank revenues revenue_change profits assets profit_change \\\n", + "Walmart 1 485873 0.8 13643.0 198825 -7.2 \n", + "State Grid 2 315199 -4.4 9571.3 489838 -6.2 \n", + "Sinopec Group 3 267518 -9.1 1257.9 310726 -65.0 \n", + "\n", + " ceo industry sector \\\n", + "Walmart C. Douglas McMillon General Merchandisers Retailing \n", + "State Grid Kou Wei Utilities Energy \n", + "Sinopec Group Wang Yupu Petroleum Refining Energy \n", + "\n", + " previous_rank country hq_location website \\\n", + "Walmart 1 USA Bentonville, AR http://www.walmart.com \n", + "State Grid 2 China Beijing, China http://www.sgcc.com.cn \n", + "Sinopec Group 4 China Beijing, China http://www.sinopec.com \n", + "\n", + " years_on_global_500_list employees total_stockholder_equity \n", + "Walmart 23 2300000 77798 \n", + "State Grid 17 926067 209456 \n", + "Sinopec Group 19 713288 106523 " + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "f500.head(3)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "There is also the `DataFrame.tail` method to show us the last rows of our dataframe:" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
rankrevenuesrevenue_changeprofitsassetsprofit_changeceoindustrysectorprevious_rankcountryhq_locationwebsiteyears_on_global_500_listemployeestotal_stockholder_equity
Wm. Morrison Supermarkets49821741-11.3406.41163020.4David T. PottsFood and Drug StoresFood & Drug Stores437BritainBradford, Britainhttp://www.morrisons.com13772105111
TUI49921655-5.51151.716247195.5Friedrich JoussenTravel ServicesBusiness Services467GermanyHanover, Germanyhttp://www.tuigroup.com23667793006
AutoNation500216093.6430.510060-2.7Michael J. JacksonSpecialty RetailersRetailing0USAFort Lauderdale, FLhttp://www.autonation.com12260002310
\n", + "
" + ], + "text/plain": [ + " rank revenues revenue_change profits assets \\\n", + "Wm. Morrison Supermarkets 498 21741 -11.3 406.4 11630 \n", + "TUI 499 21655 -5.5 1151.7 16247 \n", + "AutoNation 500 21609 3.6 430.5 10060 \n", + "\n", + " profit_change ceo \\\n", + "Wm. Morrison Supermarkets 20.4 David T. Potts \n", + "TUI 195.5 Friedrich Joussen \n", + "AutoNation -2.7 Michael J. Jackson \n", + "\n", + " industry sector \\\n", + "Wm. Morrison Supermarkets Food and Drug Stores Food & Drug Stores \n", + "TUI Travel Services Business Services \n", + "AutoNation Specialty Retailers Retailing \n", + "\n", + " previous_rank country hq_location \\\n", + "Wm. Morrison Supermarkets 437 Britain Bradford, Britain \n", + "TUI 467 Germany Hanover, Germany \n", + "AutoNation 0 USA Fort Lauderdale, FL \n", + "\n", + " website \\\n", + "Wm. Morrison Supermarkets http://www.morrisons.com \n", + "TUI http://www.tuigroup.com \n", + "AutoNation http://www.autonation.com \n", + "\n", + " years_on_global_500_list employees \\\n", + "Wm. Morrison Supermarkets 13 77210 \n", + "TUI 23 66779 \n", + "AutoNation 12 26000 \n", + "\n", + " total_stockholder_equity \n", + "Wm. Morrison Supermarkets 5111 \n", + "TUI 3006 \n", + "AutoNation 2310 " + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "f500.tail(3)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 3.3.3:\n", + "\n", + "1. Use the `head()` method to select the **first 6 rows**. Assign the result to `f500_head`.\n", + "2. Use the `tail()` method to select the **last 8 rows**. Assign the result to `f500_tail`." + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [], + "source": [ + "# Start your code here:\n", + "f500_head = f500.head(6)\n", + "f500_tail = f500.tail(8)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 4. Introducting DataFrames Continued\n", + "\n", + "Now let's talk about the `DataFrame.dtypes` attribute. The `DataFrame.dtypes` attribute returns information about the types of each column." + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "rank int64\n", + "revenues int64\n", + "revenue_change float64\n", + "profits float64\n", + "assets int64\n", + "profit_change float64\n", + "ceo object\n", + "industry object\n", + "sector object\n", + "previous_rank int64\n", + "country object\n", + "hq_location object\n", + "website object\n", + "years_on_global_500_list int64\n", + "employees int64\n", + "total_stockholder_equity int64\n", + "dtype: object\n" + ] + } + ], + "source": [ + "print(f500.dtypes)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To see a comprehensive overview of all the dtypes used in our dataframe, as well its shape and other information, we should use the `DataFrame.info()` [method](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.info.html). Remember that `DataFrame.info()` only prints the information, instead of returning it, so we can't assign it to a variable." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 3.3.4:\n", + "\n", + "1. Use the `DataFrame.info()` method to display information about the `f500` dataframe." + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Start your code below:\n", + "f500.info\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 5. Selecting a Column From a DataFrame by Label (IMPORTANT)\n", + "\n", + "Do you know that our axes in pandas all have labels and we can select data using just those labels? The **DataFrame.loc[]** attribute is exactly the syntax designed for this purpose:\n", + "\n", + "````python\n", + "df.loc[row_label, column_label]\n", + "````\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Pay close attention that we use brackets ``[]`` instead of parentheses ``()`` when selecting by location.\n", + "\n", + "Now let's look at an example:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "f500.loc[:,\"rank\"]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Notice we used `:` to specify that all rows should be selected. And also pay attention that the new dataframe has the same row labels as the original.\n", + "\n", + "The following shortcut can also be used to select a single column:" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Walmart 1\n", + "State Grid 2\n", + "Sinopec Group 3\n", + "China National Petroleum 4\n", + "Toyota Motor 5\n", + " ... \n", + "Teva Pharmaceutical Industries 496\n", + "New China Life Insurance 497\n", + "Wm. Morrison Supermarkets 498\n", + "TUI 499\n", + "AutoNation 500\n", + "Name: rank, Length: 500, dtype: int64\n" + ] + } + ], + "source": [ + "rank_col = f500[\"rank\"]\n", + "print(rank_col)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 3.3.5:\n", + "\n", + "1. Select the `industry` column. Assign the result to the variable name `industries`.\n", + "2. Use Python's `type()` function to assign the type of `industries` to `industries_type`." + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [], + "source": [ + "# Start your code below:\n", + "industries = f500[\"industry\"]\n", + "industries_type = type(industries)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 6. Selecting Columns From a DataFrame by Label Continued\n", + "Below, we use a list of labels to select specific columns:\n" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
countryrank
WalmartUSA1
State GridChina2
Sinopec GroupChina3
China National PetroleumChina4
Toyota MotorJapan5
.........
Teva Pharmaceutical IndustriesIsrael496
New China Life InsuranceChina497
Wm. Morrison SupermarketsBritain498
TUIGermany499
AutoNationUSA500
\n", + "

500 rows × 2 columns

\n", + "
" + ], + "text/plain": [ + " country rank\n", + "Walmart USA 1\n", + "State Grid China 2\n", + "Sinopec Group China 3\n", + "China National Petroleum China 4\n", + "Toyota Motor Japan 5\n", + "... ... ...\n", + "Teva Pharmaceutical Industries Israel 496\n", + "New China Life Insurance China 497\n", + "Wm. Morrison Supermarkets Britain 498\n", + "TUI Germany 499\n", + "AutoNation USA 500\n", + "\n", + "[500 rows x 2 columns]" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "f500.loc[:,[\"country\", \"rank\"]]" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
countryrank
WalmartUSA1
State GridChina2
Sinopec GroupChina3
China National PetroleumChina4
Toyota MotorJapan5
.........
Teva Pharmaceutical IndustriesIsrael496
New China Life InsuranceChina497
Wm. Morrison SupermarketsBritain498
TUIGermany499
AutoNationUSA500
\n", + "

500 rows × 2 columns

\n", + "
" + ], + "text/plain": [ + " country rank\n", + "Walmart USA 1\n", + "State Grid China 2\n", + "Sinopec Group China 3\n", + "China National Petroleum China 4\n", + "Toyota Motor Japan 5\n", + "... ... ...\n", + "Teva Pharmaceutical Industries Israel 496\n", + "New China Life Insurance China 497\n", + "Wm. Morrison Supermarkets Britain 498\n", + "TUI Germany 499\n", + "AutoNation USA 500\n", + "\n", + "[500 rows x 2 columns]" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "f500[[\"country\",\"rank\"]]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The code `f500.loc[:,[\"country\", \"rank\"]]` and `f500[[\"country\",\"rank\"]]` eventually return us the same result. " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You see that the object returned is two-dimensional, we know it's a dataframe, not a series. So instead of `df.loc[:,[\"col1\",\"col2\"]]`, we can also use `df[[\"col1\", \"col2\"]]` to select specific columns.\n", + "\n", + "Last but not least, let's finish by using **a slice object with labels** to select specific columns:" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
rankrevenuesrevenue_changeprofits
Walmart14858730.813643.0
State Grid2315199-4.49571.3
Sinopec Group3267518-9.11257.9
China National Petroleum4262573-12.31867.5
Toyota Motor52546947.716899.3
...............
Teva Pharmaceutical Industries4962190311.5329.0
New China Life Insurance49721796-13.3743.9
Wm. Morrison Supermarkets49821741-11.3406.4
TUI49921655-5.51151.7
AutoNation500216093.6430.5
\n", + "

500 rows × 4 columns

\n", + "
" + ], + "text/plain": [ + " rank revenues revenue_change profits\n", + "Walmart 1 485873 0.8 13643.0\n", + "State Grid 2 315199 -4.4 9571.3\n", + "Sinopec Group 3 267518 -9.1 1257.9\n", + "China National Petroleum 4 262573 -12.3 1867.5\n", + "Toyota Motor 5 254694 7.7 16899.3\n", + "... ... ... ... ...\n", + "Teva Pharmaceutical Industries 496 21903 11.5 329.0\n", + "New China Life Insurance 497 21796 -13.3 743.9\n", + "Wm. Morrison Supermarkets 498 21741 -11.3 406.4\n", + "TUI 499 21655 -5.5 1151.7\n", + "AutoNation 500 21609 3.6 430.5\n", + "\n", + "[500 rows x 4 columns]" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "f500.loc[:,\"rank\":\"profits\"]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The result is again a dataframe object with all of the columns from the first up until the last column in our slice. Unfortunately, there is no shortcut for selecting column slices.\n", + "\n", + "See the table below for a short summary of techniques that we have just encountered:\n", + "\n", + "|Select by Label|Explicit Syntax|Common Shorthand|\n", + "|--|--|--|\n", + "|Single column|df.loc[:,\"col1\"]|df[\"col1\"]|\n", + "|List of columns|df.loc[:,[\"col1\", \"col7\"]]|df[[\"col1\", \"col7\"]]|\n", + "|Slice of columns|df.loc[:,\"col1\":\"col4\"]|\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 3.3.6:\n", + "\n", + "1. Select the `country` column. Assign the result to the variable name `countries`.\n", + "2. In order, select the `revenues` and `years_on_global_500_list` columns. Assign the result to the variable name `revenues_years`.\n", + "3. In order, select all columns from `ceo` up to and including `sector`. Assign the result to the variable name `ceo_to_sector`." + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [], + "source": [ + "# Start your code below:\n", + "countries = f500[\"country\"]\n", + "revenue_years = f500[[\"revenues\", \"years_on_global_500_list\"]]\n", + "ceo_to_sector = f500.loc[:,\"ceo\":\"sector\"]\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 7. Selecting Rows From a DataFrame by Label\n", + "\n", + "Now, let's learn how to use the labels of the index axis to select rows.\n", + "\n", + "We can use the same syntax to select rows from a dataframe as we already have done for columns:\n", + "\n", + "````python\n", + "df.loc[row_label, column_label]\n", + "````\n", + "\n", + "#### To select a single row:" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "rank 3\n", + "revenues 267518\n", + "revenue_change -9.1\n", + "profits 1257.9\n", + "assets 310726\n", + "profit_change -65.0\n", + "ceo Wang Yupu\n", + "industry Petroleum Refining\n", + "sector Energy\n", + "previous_rank 4\n", + "country China\n", + "hq_location Beijing, China\n", + "website http://www.sinopec.com\n", + "years_on_global_500_list 19\n", + "employees 713288\n", + "total_stockholder_equity 106523\n", + "Name: Sinopec Group, dtype: object\n" + ] + } + ], + "source": [ + "single_row = f500.loc[\"Sinopec Group\"]\n", + "print(type(single_row))\n", + "print(single_row)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "A **series** is returned because it is one-dimensional. \n", + "> In short, ``series`` is a one-dimensional labeled array capable of holding data of any type (integer, string, float, python objects, etc.). \n", + "There are many data types that may need to be stored in this series, like integer, float, and string values, so pandas uses the **object** dtype, since none of the numeric types could cater for all values.\n", + "\n", + "**To select a list of rows:**" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " rank revenues revenue_change profits assets profit_change \\\n", + "Toyota Motor 5 254694 7.7 16899.3 437575 -12.3 \n", + "Walmart 1 485873 0.8 13643.0 198825 -7.2 \n", + "\n", + " ceo industry \\\n", + "Toyota Motor Akio Toyoda Motor Vehicles and Parts \n", + "Walmart C. Douglas McMillon General Merchandisers \n", + "\n", + " sector previous_rank country hq_location \\\n", + "Toyota Motor Motor Vehicles & Parts 8 Japan Toyota, Japan \n", + "Walmart Retailing 1 USA Bentonville, AR \n", + "\n", + " website years_on_global_500_list \\\n", + "Toyota Motor http://www.toyota-global.com 23 \n", + "Walmart http://www.walmart.com 23 \n", + "\n", + " employees total_stockholder_equity \n", + "Toyota Motor 364445 157210 \n", + "Walmart 2300000 77798 \n" + ] + } + ], + "source": [ + "list_rows = f500.loc[[\"Toyota Motor\", \"Walmart\"]]\n", + "print(type(list_rows))\n", + "print(list_rows)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**To select a slice object with labels:**\n", + "\n", + "For selection using slices, a shortcut can be used like below. This is the reason we can't use this shortcut for columns – because it's reserved for use with rows:" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " rank revenues revenue_change profits assets \\\n", + "State Grid 2 315199 -4.4 9571.3 489838 \n", + "Sinopec Group 3 267518 -9.1 1257.9 310726 \n", + "China National Petroleum 4 262573 -12.3 1867.5 585619 \n", + "Toyota Motor 5 254694 7.7 16899.3 437575 \n", + "\n", + " profit_change ceo \\\n", + "State Grid -6.2 Kou Wei \n", + "Sinopec Group -65.0 Wang Yupu \n", + "China National Petroleum -73.7 Zhang Jianhua \n", + "Toyota Motor -12.3 Akio Toyoda \n", + "\n", + " industry sector \\\n", + "State Grid Utilities Energy \n", + "Sinopec Group Petroleum Refining Energy \n", + "China National Petroleum Petroleum Refining Energy \n", + "Toyota Motor Motor Vehicles and Parts Motor Vehicles & Parts \n", + "\n", + " previous_rank country hq_location \\\n", + "State Grid 2 China Beijing, China \n", + "Sinopec Group 4 China Beijing, China \n", + "China National Petroleum 3 China Beijing, China \n", + "Toyota Motor 8 Japan Toyota, Japan \n", + "\n", + " website \\\n", + "State Grid http://www.sgcc.com.cn \n", + "Sinopec Group http://www.sinopec.com \n", + "China National Petroleum http://www.cnpc.com.cn \n", + "Toyota Motor http://www.toyota-global.com \n", + "\n", + " years_on_global_500_list employees \\\n", + "State Grid 17 926067 \n", + "Sinopec Group 19 713288 \n", + "China National Petroleum 17 1512048 \n", + "Toyota Motor 23 364445 \n", + "\n", + " total_stockholder_equity \n", + "State Grid 209456 \n", + "Sinopec Group 106523 \n", + "China National Petroleum 301893 \n", + "Toyota Motor 157210 \n" + ] + } + ], + "source": [ + "slice_rows = f500[\"State Grid\":\"Toyota Motor\"]\n", + "print(type(slice_rows))\n", + "print(slice_rows)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 3.3.7: \n", + "\n", + "By selecting data from `f500`:\n", + "1. Create a new variable `toyota`, with:\n", + " - Just the row with index `Toyota Motor`.\n", + " - All columns.\n", + "2. Create a new variable, `drink_companies`, with:\n", + " - Rows with indicies `Anheuser-Busch InBev, Coca-Cola, and Heineken Holding`, in that order.\n", + " - All columns.\n", + "3. Create a new variable, `middle_companies` with:\n", + " - All rows with indicies from `Tata Motors` to `Nationwide`, inclusive.\n", + " - All columns from `rank` to `country`, inclusive." + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [], + "source": [ + "# Start your code below:\n", + "toyota = f500.loc[\"Toyota Motor\"]\n", + "drink_companies = f500.loc[[\"Anheuser-Busch InBev\", \"Coca-Cola\", \"Heineken Holding\"]]\n", + "middle_companies = f500.loc[\"Tata Motors\":\"Nationwide\",\"rank\":\"country\"]\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 8. Value Counts Method\n", + "\n", + "We understand that **series** and **dataframes** are two distinct objects. They each have their own unique methods.\n", + "\n", + "First, let's select just one column from the ``f500`` dataframe:" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n" + ] + } + ], + "source": [ + "sectors = f500[\"sector\"]\n", + "print(type(sectors))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now, we want to substitute ``Series`` in `Series.value_counts()` with the name of our `sectors` series, like this:" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "sector\n", + "Financials 118\n", + "Energy 80\n", + "Technology 44\n", + "Motor Vehicles & Parts 34\n", + "Wholesalers 28\n", + "Health Care 27\n", + "Food & Drug Stores 20\n", + "Transportation 19\n", + "Telecommunications 18\n", + "Retailing 17\n", + "Food, Beverages & Tobacco 16\n", + "Materials 16\n", + "Industrials 15\n", + "Aerospace & Defense 14\n", + "Engineering & Construction 13\n", + "Chemicals 7\n", + "Household Products 3\n", + "Media 3\n", + "Hotels, Restaurants & Leisure 3\n", + "Business Services 3\n", + "Apparel 2\n", + "Name: count, dtype: int64\n" + ] + } + ], + "source": [ + "sectors_value_counts = sectors.value_counts()\n", + "print(sectors_value_counts)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You see that each unique non-null value is being counted and listed in the output above.\n", + "\n", + "Well, what happens when we try to use the `Series.value_counts()` method with a dataframe? First step, we should select the `sector` and `industry` columns to create a dataframe named `sectors_industries`, like this:" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n" + ] + } + ], + "source": [ + "sectors_industries = f500[[\"sector\", \"industry\"]]\n", + "print(type(sectors_industries))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Then, we'll try to use the `value_counts()` method:" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "sector industry \n", + "Financials Banks: Commercial and Savings 51\n", + "Motor Vehicles & Parts Motor Vehicles and Parts 34\n", + "Energy Petroleum Refining 28\n", + "Financials Insurance: Life, Health (stock) 24\n", + "Food & Drug Stores Food and Drug Stores 20\n", + "Energy Mining, Crude-Oil Production 18\n", + "Financials Insurance: Property and Casualty (Stock) 18\n", + "Telecommunications Telecommunications 18\n", + "Energy Utilities 18\n", + "Wholesalers Trading 15\n", + "Health Care Pharmaceuticals 15\n", + "Aerospace & Defense Aerospace and Defense 14\n", + "Engineering & Construction Engineering, Construction 13\n", + "Technology Electronics, Electrical Equip. 13\n", + "Energy Energy 12\n", + "Materials Metals 12\n", + "Retailing Specialty Retailers 10\n", + "Industrials Industrial Machinery 10\n", + "Financials Insurance: Life, Health (Mutual) 9\n", + "Technology Computers, Office Equipment 8\n", + "Transportation Airlines 8\n", + "Financials Diversified Financials 8\n", + "Food, Beverages & Tobacco Food Production 7\n", + "Retailing General Merchandisers 7\n", + "Chemicals Chemicals 7\n", + "Technology Internet Services and Retailing 6\n", + "Transportation Mail, Package, and Freight Delivery 6\n", + "Wholesalers Wholesalers: Health Care 6\n", + "Financials Real estate 6\n", + "Health Care Health Care: Insurance and Managed Care 6\n", + "Technology Semiconductors and Other Electronic Components 5\n", + " Information Technology Services 5\n", + "Food, Beverages & Tobacco Food Consumer Products 5\n", + "Materials Building Materials, Glass 4\n", + "Technology Network and Other Communications Equipment 4\n", + " Computer Software 3\n", + "Wholesalers Wholesalers: Food and Grocery 3\n", + " Wholesalers: Electronics and Office Equipment 3\n", + "Transportation Railroads 3\n", + "Energy Pipelines 3\n", + "Food, Beverages & Tobacco Beverages 3\n", + "Hotels, Restaurants & Leisure Food Services 3\n", + "Media Entertainment 3\n", + "Household Products Household and Personal Products 3\n", + "Apparel Apparel 2\n", + "Financials Insurance: Property and Casualty (Mutual) 2\n", + "Health Care Health Care: Medical Facilities 2\n", + "Industrials Textiles 2\n", + "Health Care Health Care: Pharmacy and Other Services 2\n", + "Transportation Shipping 2\n", + "Business Services Temporary Help 2\n", + "Industrials Construction and Farm Machinery 2\n", + "Health Care Medical Products and Equipment 2\n", + "Food, Beverages & Tobacco Tobacco 1\n", + "Industrials Miscellaneous 1\n", + "Energy Oil & Gas Equipment Services 1\n", + "Business Services Travel Services 1\n", + "Wholesalers Wholesalers: Diversified 1\n", + "Name: count, dtype: int64\n" + ] + } + ], + "source": [ + "si_value_counts = sectors_industries.value_counts()\n", + "print(si_value_counts)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We see that we have got the following error:\n", + "\n", + "> AttributeError: 'DataFrame' object has no attribute 'value_counts'\n", + "\n", + "\n", + "That is because ``value_counts()`` is only a method for Series, not DataFrame." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 3.3.8\n", + "\n", + "1. Find the counts of each unique value in the `country` column in the `f500` dataframe.\n", + " - Select the `country` column in the `f500` dataframe. Assign it to a variable named `countries*`\n", + " - Use the `Series.value_counts()` method to return the value counts for `countries`. Assign the results to `country_counts`." + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "country\n", + "USA 132\n", + "China 109\n", + "Japan 51\n", + "Germany 29\n", + "France 29\n", + "Britain 24\n", + "South Korea 15\n", + "Netherlands 14\n", + "Switzerland 14\n", + "Canada 11\n", + "Spain 9\n", + "Australia 7\n", + "Brazil 7\n", + "India 7\n", + "Italy 7\n", + "Taiwan 6\n", + "Russia 4\n", + "Ireland 4\n", + "Singapore 3\n", + "Sweden 3\n", + "Mexico 2\n", + "Malaysia 1\n", + "Thailand 1\n", + "Belgium 1\n", + "Norway 1\n", + "Luxembourg 1\n", + "Indonesia 1\n", + "Denmark 1\n", + "Saudi Arabia 1\n", + "Finland 1\n", + "Venezuela 1\n", + "Turkey 1\n", + "U.A.E 1\n", + "Israel 1\n", + "Name: count, dtype: int64" + ] + }, + "execution_count": 30, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Start your code below:\n", + "countries = f500[\"country\"]\n", + "country_counts = countries.value_counts()\n", + "country_counts" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Summary\n", + "\n", + "Below is a summary table of all the different label selection we have learned so far:\n", + "\n", + "|Select by Label|Explicit Syntax|Shorthand Convention|\n", + "|-------------|-----------|---------------|\n", + "|Single column from dataframe|df.loc[:,\"col1\"]|df[\"col1\"]|\n", + "|List of columns from dataframe|df.loc[:,\"col1\",\"col7\"]|df[\"col1\",\"col7\"]|\n", + "|Single column from dataframe|df.loc[:,\"col1\":\"col4\"]| |\n", + "|Single row from dataframe| df.loc[\"row4\"]| |\n", + "|List of rows from dataframe |df.loc[\"row1\",\"row8\"]]| |\n", + "|Slice of rows from dataframe|df.loc[\"row3\":\"row5\"]| df[\"row3\":\"row5\"]|\n", + "|Single item from series|s.loc[\"item8\"]|s[\"item8\"]|\n", + "|List of items from series|s.loc[[\"item1\", \"item7\"]]|s[[\"item1\",\"item7\"]]|\n", + "|Slice of items from series|s.loc[\"item2\":\"item4\"] |s[\"item2\":\"item4\"]|\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.6" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/Exercises/EN/Numpy_Pandas/4_Exploring_Data_with_Pandas_Fundamentals_NA.ipynb b/Exercises/EN/Numpy_Pandas/4_Exploring_Data_with_Pandas_Fundamentals_NA.ipynb new file mode 100644 index 00000000..a382b31b --- /dev/null +++ b/Exercises/EN/Numpy_Pandas/4_Exploring_Data_with_Pandas_Fundamentals_NA.ipynb @@ -0,0 +1,1221 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# About This Notebook\n", + "In this **Exploring Data with Pandas: Fundamentals** chapter, we will learn:\n", + "- How to select data from pandas objects using boolean arrays.\n", + "- How to assign data using labels and boolean arrays.\n", + "- How to create new rows and columns in pandas.\n", + "\n", + "****\n", + "## 1. Introduction to the Data\n", + "\n", + "We learned the basics of the pandas library in the previous chapter and explored some dataframes using the techniques we have learned. Just to refresh your memory:\n", + "> Axis values in dataframes can have **string labels**, not just numeric ones, which makes selecting data much easier.\n", + "\n", + "> Dataframes have the ability to contain columns with **multiple data types**: such as integer, float, and string.\n", + "\n", + "In this chapter, we'll learn some other ways working with data using pandas.\n", + "\n", + "This time, we will continue working with a data set from Fortune magazine's Global 500 list 2017.\n", + "\n", + "Here is a data dictionary for some of the columns in the CSV:\n", + "\n", + "- **company**: Name of the company.\n", + "- **rank**: Global 500 rank for the company.\n", + "- **revenues**: Company's total revenue for the fiscal year, in millions of dollars (USD).\n", + "- **revenue_change**: Percentage change in revenue between the current and prior fiscal year.\n", + "- **profits**: Net income for the fiscal year, in millions of dollars (USD).\n", + "- **ceo**: Company's Chief Executive Officer.\n", + "- **industry**: Industry in which the company operates.\n", + "- **sector**: Sector in which the company operates.\n", + "- **previous_rank**: Global 500 rank for the company for the prior year.\n", + "- **country**: Country in which the company is headquartered.\n", + "- **hq_location**: City and Country, (or City and State for the USA) where the company is headquartered.\n", + "- **employees**: Total employees (full-time equivalent, if available) at fiscal year-end." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import numpy as np\n", + "\n", + "f500 = pd.read_csv('../../../Data/csv/f500.csv',index_col=0)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 3.4.1:\n", + "Now I have already read the dataset into a pandas dataframe and assigned it to a variable named ``f500``.\n", + "\n", + "1. Use the ``DataFrame.head()`` method to select the first 10 rows in ``f500``. Assign the result to ``f500_head``.\n", + "2. Use the ``DataFrame.info()`` method to display information about the dataframe." + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Start your code here:\n", + "f500_head = f500.head()\n", + "f500.info" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 2. Vectorized Operations\n", + "\n", + "Do you remember vectorized operations which we encountered in the NumPy library? Vectorized operations enable operations applied to multiple data points at once, which does not only improve our code's performance, but also enables us to write code more quickly.\n", + "\n", + "Since pandas is an extension of NumPy, it also supports vectorized operations. Just like with NumPy, we can use any of the standard Python numeric operators with series, including:\n", + "\n", + "\n", + "- **Addition**: `vector_a + vector_b`\n", + "- **Subtraction**: `vector_a - vector_b`\n", + "- **Multiplication**: (unrelated to the vector multiplication in linear algebra): `vector_a * vector_b`\n", + "- **Division**: `vecotr_a / vector_b`\n", + "\n", + "\n", + "### Task 3.4.2: \n", + "1. Subtract the values in the `rank` column from the values in the ``previous_rank`` column. Assign the result to a variable ``rank_change``." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "# Start your code below:\n", + "rank_change = f500[\"previous_rank\"]-f500[\"rank\"]\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 3. Series Data Exploration Methods\n", + "\n", + "Just as NumPy, pandas supports many descriptive ``stats`` methods like the following:\n", + "- `Series.max()`\n", + "- `Series.min()`\n", + "- `Series.mean()`\n", + "- `Series.median()`\n", + "- `Series.mode()`\n", + "- `Series.sum()`\n", + "\n", + "Look at how you can use the stats methods below:" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "````python\n", + "print(my_series)\n", + "````" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Output:\n", + "````python\n", + "0 1\n", + "1 2\n", + "2 3\n", + "3 4\n", + "4 5\n", + "dtype: int64\n", + "````" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "````python\n", + "print(my_series.sum())\n", + "````" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Output:\n", + "````python\n", + "15\n", + "````" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 3.4.3:\n", + "1. Use the `Series.max()` method to find the maximum value for the `rank_change` series. Assign the result to the variable `rank_change_max`.\n", + "2. Use the `Series.min()` method to find the minimum value for the `rank_change` series. Assign the result to the variable `rank_change_min`." + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "226\n", + "-500\n" + ] + } + ], + "source": [ + "# Start your code below:\n", + "rank_change_max = rank_change.max()\n", + "rank_change_min = rank_change.min()\n", + "\n", + "print(rank_change_max)\n", + "print(rank_change_min)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 4. Series Describe Method\n", + "\n", + "In this session, we will learn another method called `Series.describe` This [method](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.describe.html) shows us various information such as how many non-null values are contained in the series, the average, minimum, maximum, and other statistics.\n", + "\n", + "Let's see how we can use this method:" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "count 5.000000e+02\n", + "mean 2.436323e+05\n", + "std 4.851937e+05\n", + "min 3.717000e+03\n", + "25% 3.658850e+04\n", + "50% 7.326150e+04\n", + "75% 1.805640e+05\n", + "max 3.473238e+06\n", + "Name: assets, dtype: float64\n" + ] + } + ], + "source": [ + "assets = f500[\"assets\"]\n", + "print(assets.describe())" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You can see that the values in the code segment above are displayed in E-notation, a type of [scientific notation](https://en.wikipedia.org/wiki/Scientific_notation).\n", + "\n", + "When we use `describe()` on a column which contains non-numeric values, we will get some different statistics, like the following example shows:" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "count 500\n", + "unique 34\n", + "top USA\n", + "freq 132\n", + "Name: country, dtype: object\n" + ] + } + ], + "source": [ + "country = f500[\"country\"]\n", + "print(country.describe())" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The first line of information, `count`, is the same as for numeric columns, showing us the number of non-null values. The other three statistics are described below:\n", + "\n", + "- ``unique``: Number of unique values in the series.\n", + "- ``top``: Most common value in the series.\n", + "- ``freq``: Frequency of the most common value. " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 3.4.4\n", + "1. Return a series of descriptive statistics for the rank column in ``f500``.\n", + " - Select the rank column. Assign it to a variable named ``rank``.\n", + " - Use the ``Series.describe()`` method to return a series of statistics for rank. Assign the result to ``rank_desc``.\n", + "2. Return a series of descriptive statistics for the `previous_rank` column in `f500`.\n", + " - Select the ``previous_rank`` column. Assign it to a variable named ``prev_rank``.\n", + " - Use the ``Series.describe()`` method to return a series of statistics for ``prev_rank``. Assign the result to ``prev_rank_desc``." + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "count 500.000000\n", + "mean 250.500000\n", + "std 144.481833\n", + "min 1.000000\n", + "25% 125.750000\n", + "50% 250.500000\n", + "75% 375.250000\n", + "max 500.000000\n", + "Name: rank, dtype: float64\n" + ] + } + ], + "source": [ + "# Start your code below:\n", + "rank = f500[\"rank\"]\n", + "print(rank.describe())\n", + "prev_rank = f500[\"previous_rank\"]\n", + "prev_rank_desc = prev_rank.describe()\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 5. Method Chaining (IMPORTANT)\n", + "\n", + "Method chaining is a common syntax for invoking multiple method calls in object-oriented programming languages. Each method returns an object, allowing the calls to be chained together in a single statement without requiring variables to store the intermediate results ([Wikipedia](https://en.wikipedia.org/wiki/Method_chaining)).\n", + "\n", + "We have actually used a couple of method chainings before in our previous examples." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "#### Without method chaining\n", + "````python\n", + "countries = f500[\"country\"]\n", + "countries_counts = countries.value_counts()\n", + "````" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### With method chaining\n", + "````python\n", + "countries_counts = f500[\"country\"].value_counts() \n", + "````" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "From now on, we'll try to use more and more method chaining in the code. When writing code, always assess whether method chaining will make your code harder to read. If it does, it's always preferable to break the code into more than one line.\n", + "\n", + "### Task 3.4.5\n", + "1. Use `Series.value_counts()` and `Series.loc` to return the number of companies with a value of `0` of the `previous_rank` column in the `f500` dataframe. Assign the results to `zero_previous_rank`." + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "33\n" + ] + } + ], + "source": [ + "# Start your code below:\n", + "zero_previous_rank = f500.loc[:,\"previous_rank\"].value_counts()[0]\n", + "print(zero_previous_rank)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 6. Dataframe Exploration Methods\n", + "\n", + "Since series and dataframes are two distinct objects, they have their own unique methods. However, they also have methods with the same name that behave in a similar manner. Find some examples below:\n", + "\n", + "- `Series.max()` and `DataFrame.max()`\n", + "- `Series.min()` and `DataFrame.min()`\n", + "- `Series.mean()` and `DataFrame.mean()`\n", + "- `Series.median()` and `DataFrame.median()`\n", + "- `Series.mode()` and `DataFrame.mode()`\n", + "- `Series.sum()` and `DataFrame.sum()`\n", + "\n", + "> In contrast to series, dataframe methods require an axis parameter in order to know which axis to calculate across. You can use integers to refer to the first and second axis. Pandas dataframe methods also accept the strings ``index`` and ``columns`` for the axis parameter:" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "````python\n", + "# When we try to calculate along the row axis\n", + "DataFrame.method(axis = 0)\n", + "# or \n", + "Dataframe.method(axis = \"index\")\n", + "````" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "````python\n", + "# When we try to calculate along the column axis\n", + "DataFrame.method(axis = 1)\n", + "# or \n", + "Dataframe.method(axis = \"column\")\n", + "````" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "For a more concrete example, if we want to find the median for the **revenues** and **profits** columns in our data set, we can do the following:" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "revenues 40236.0\n", + "profits 1761.6\n", + "dtype: float64\n" + ] + } + ], + "source": [ + "medians = f500[[\"revenues\", \"profits\"]].median(axis=0)\n", + "# we could also use .median(axis=\"index\")\n", + "print(medians)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 3.4.6\n", + "\n", + "Now, it's your time to shine!\n", + "1. Use the `DataFrame.max()` method to find the maximum value for only the numeric columns from `f500` (you may need to check the documentation). Assign the result to the variable `max_f500`." + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [], + "source": [ + "# Start your code below:\n", + "max_f500 = f500.max(numeric_only=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 7. Dataframe Describe Method\n", + "\n", + "Try to see how we can use `DataFrame.max()` method below:" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "rank 500.0\n", + "revenues 485873.0\n", + "revenue_change 442.3\n", + "profits 45687.0\n", + "assets 3473238.0\n", + "profit_change 8909.5\n", + "previous_rank 500.0\n", + "years_on_global_500_list 23.0\n", + "employees 2300000.0\n", + "total_stockholder_equity 301893.0\n", + "dtype: float64" + ] + }, + "execution_count": 23, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "f500.max(numeric_only=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Like series objects, there is also a `DataFrame.describe()` method that we can use to explore the dataframe more efficiently. Take a look at the `DataFrame.describe()` documentation [here](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.describe.html).\n", + "\n", + "There are a couple of differences between the `Series.describe()` method and `DataFrame.describe()` method. For example, the `Series.describe()` method returns a series object, the `DataFrame.describe()` method returns a dataframe object.\n", + "\n", + "### Task 3.4.7\n", + "\n", + "Now let's have some practice with the `DataFrame.describe()` method that we just learned.\n", + "1. Return a dataframe of descriptive statistics for all of the numeric columns in `f500`. Assign the result to `f500_desc`." + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [], + "source": [ + "# Start your code below:\n", + "f500_desc = f500.describe()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 8. Assignment with pandas\n", + "\n", + "Let's start by learning assignment, starting with the following example:" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " rank revenues\n", + "company \n", + "Walmart 1 485873\n", + "State Grid 2 315199\n", + "Sinopec Group 3 267518\n", + "China National Petroleum 4 262573\n", + "Toyota Motor 5 254694\n" + ] + } + ], + "source": [ + "top5_rank_revenue = f500[[\"rank\", \"revenues\"]].head()\n", + "print(top5_rank_revenue)" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " rank revenues\n", + "company \n", + "Walmart 1 0\n", + "State Grid 2 0\n", + "Sinopec Group 3 0\n", + "China National Petroleum 4 0\n", + "Toyota Motor 5 0\n" + ] + } + ], + "source": [ + "top5_rank_revenue[\"revenues\"] = 0\n", + "print(top5_rank_revenue)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "As in Numpy, we can apply the same technique that we use to select data to assignment. \n", + "> Just remember, when we selected a whole column by label and used assignment, we assigned the value to every item in that column.\n", + "\n", + "When we provide labels for both axes, we assign the value to a single item within our dataframe." + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " rank revenues\n", + "company \n", + "Walmart 1 0\n", + "State Grid 2 0\n", + "Sinopec Group 3 999\n", + "China National Petroleum 4 0\n", + "Toyota Motor 5 0\n" + ] + } + ], + "source": [ + "top5_rank_revenue.loc[\"Sinopec Group\", \"revenues\"] = 999\n", + "print(top5_rank_revenue)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 3.4.8\n", + "\n", + "Use again our Fortune 500 data set:\n", + "1. The company \"Dow Chemical\" has named a new CEO. Update the value where the row label is `Dow Chemical` by changing the ceo column to `Jim Fitterling` in the `f500` dataframe." + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'Jim Fitterling'" + ] + }, + "execution_count": 31, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Start your code below:\n", + "f500.loc[\"Dow Chemical\",\"ceo\"] = \"Jim Fitterling\"\n", + "f500.loc[\"Dow Chemical\",\"ceo\"]\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 9. Using Boolean Indexing with pandas Objects\n", + "\n", + "In order to replace many values at the same time, we recommend using boolean indexing to change all rows that meet the same criteria, just like we did with NumPy.\n", + "\n", + "Let's take a look at the dataframe example below. This is a dataframe of people and their favorite numbers:" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
namenum
0Kyllie12
1Rahul8
2Michael5
3Sarah8
\n", + "
" + ], + "text/plain": [ + " name num\n", + "0 Kyllie 12\n", + "1 Rahul 8\n", + "2 Michael 5\n", + "3 Sarah 8" + ] + }, + "execution_count": 33, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import pandas as pd\n", + "\n", + "d = {'name': [\"Kyllie\", \"Rahul\", \"Michael\", \"Sarah\"], 'num': [12, 8, 5, 8]}\n", + "\n", + "df = pd.DataFrame(data=d)\n", + "df" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "If we want to check which people have a favorite number of 8, we can first perform a vectorized boolean operation that produces a boolean series:" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "0 False\n", + "1 True\n", + "2 False\n", + "3 True\n", + "Name: num, dtype: bool" + ] + }, + "execution_count": 34, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "num_bool = df[\"num\"] == 8\n", + "num_bool" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We have used a series to index the whole dataframe, leaving us with the rows that correspond only to people whose favorite number is 8:" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
namenum
1Rahul8
3Sarah8
\n", + "
" + ], + "text/plain": [ + " name num\n", + "1 Rahul 8\n", + "3 Sarah 8" + ] + }, + "execution_count": 35, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "result = df[num_bool]\n", + "result" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You see that we didn't use ``loc[]``. The reason for this is that boolean arrays use the same shortcut as slices to select along the index axis. We can also use the boolean series to index just one column of the dataframe:" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1 Rahul\n", + "3 Sarah\n", + "Name: name, dtype: object" + ] + }, + "execution_count": 36, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "result = df.loc[num_bool,\"name\"]\n", + "result" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You see that we have used `df.loc[]` to specify both axes.\n", + "\n", + "### Task 3.4.9\n", + "1. Create a boolean series, `motor_bool`, that compares whether the values in the `industry` column from the `f500` dataframe are equal to `\"Motor Vehicles and Parts\"`.\n", + "2. Use the `motor_bool` boolean series to index the `country` column. Assign the result to `motor_countries`." + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": {}, + "outputs": [], + "source": [ + "# Start your code below:\n", + "motor_bool = f500[\"industry\"] == \"Motor ehicles and Parts\"\n", + "motor_countries = f500[\"industry\"][motor_bool]\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 10. Using Boolean Arrays to Assign Values (OPTIONAL)\n", + "\n", + "In this session, we will look at how we can combine assignment and boolean indexing in pandas.\n", + "\n", + "In the following example, we change the `'Motor Vehicles & Parts'` values in the sector column to `'Motor Vehicles and Parts'` – i.e. we will change the ampersand (`&`) to `and`." + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": {}, + "outputs": [], + "source": [ + "# First, we create a boolean series by comparing the values in the sector column to 'Motor Vehicles & Parts'\n", + "ampersand_bool = f500[\"sector\"] == \"Motor Vehicles & Parts\"\n", + "\n", + "# Next, we use that boolean series and the string \"sector\" to perform the assignment.\n", + "f500.loc[ampersand_bool,\"sector\"] = \"Motor Vehicles and Parts\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can do what we just did as in one line: remove the intermediate step of creating a boolean series, and combine everything like this:" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": {}, + "outputs": [], + "source": [ + "f500.loc[f500[\"sector\"] == \"Motor Vehicles & Parts\",\"sector\"] = \"Motor Vehicles and Parts\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now that we have learned how to put everything into one line, we can use this technique and replace the values in the `previous_rank` column. We want to replace the items with value `0`, as `0` is no reasonable rank. What we can replace these values with? We can replace these values with `np.nan` – this value is used in pandas to represent values that cannot be represented numerically, such as some missing values." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 3.4.10\n", + "1. Use boolean indexing to update values in the `previous_rank` column of the `f500` dataframe:\n", + " - There should now be a value of `np.nan` where there previously was a value of `0`.\n", + " - It is up to you whether you assign the boolean series to its own variable first, or whether you complete the operation in one line.\n", + "2. Create a new pandas series, `prev_rank_after`, using the same syntax that was used to create the `prev_rank_before` series.\n", + "3. Compare the `prev_rank_before` and the `prev_rank_after` series." + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "previous_rank\n", + "0 33\n", + "1 1\n", + "302 1\n", + "334 1\n", + "325 1\n", + "Name: count, dtype: int64\n", + "previous_rank\n", + "NaN 33\n", + "1.0 1\n", + "302.0 1\n", + "334.0 1\n", + "325.0 1\n", + "Name: count, dtype: int64\n" + ] + } + ], + "source": [ + "import numpy as np\n", + "f500 = pd.read_csv('../../../Data/csv/f500.csv',index_col=0)\n", + "prev_rank_before = f500[\"previous_rank\"].value_counts(dropna=False).head()\n", + "\n", + "# Start your code below:\n", + "f500.loc[f500[\"previous_rank\"] == 0] = np.nan\n", + "\n", + "prev_rank_after = f500[\"previous_rank\"].value_counts(dropna=False).head()\n", + "print(prev_rank_before)\n", + "print(prev_rank_after)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 11. Creating New Columns (IMPORTANT)\n", + "\n", + "When we try to assign a value or values to a new column label in pandas, a new column will be created in our dataframe. Below we've added a new column to a dataframe named `top5_rank_revenue`:" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "````python\n", + "top5_rank_revenue[\"year_founded\"] = 0\n", + "print(top5_rank_revenue)\n", + "````" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "|_ |rank |revenues |year_founded|\n", + "|--------------------------|-----|---------|------------|\n", + "|Walmart | 1 | 0 | 0|\n", + "|State Grid | 2 | 0 | 0|\n", + "|Sinopec Group | 3 | 999 | 0|\n", + "|China National Petroleum | 4 | 0 | 0|\n", + "|Toyota Motor | 5 | 0 | 0|" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 3.4.11\n", + "1. Add a new column named `rank_change` to the `f500` dataframe. This column should show the change of ranks which you get by subtracting the values in the `rank` column from the values in the `previous_rank` column.\n", + "2. Use the `Series.describe()` method to return a series of descriptive statistics for the `rank_change` column. Assign the result to `rank_change_desc`.\n", + "3. Verify that the minimum value of the `rank_change` column is now greater than `-500`.\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "count 467.000000\n", + "mean -3.533191\n", + "std 44.293603\n", + "min -199.000000\n", + "25% -21.000000\n", + "50% -2.000000\n", + "75% 10.000000\n", + "max 226.000000\n", + "Name: rank_change, dtype: float64" + ] + }, + "execution_count": 46, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Start your code below:\n", + "f500[\"rank_change\"] = f500[\"previous_rank\"] - f500[\"rank\"]\n", + "rank_change_desc = f500[\"rank_change\"].describe()\n", + "rank_change_desc\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.6" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/Exercises/EN/Numpy_Pandas/5_Exploring_Data_with_Pandas_Intermediate_NA.ipynb b/Exercises/EN/Numpy_Pandas/5_Exploring_Data_with_Pandas_Intermediate_NA.ipynb new file mode 100644 index 00000000..a84c80f3 --- /dev/null +++ b/Exercises/EN/Numpy_Pandas/5_Exploring_Data_with_Pandas_Intermediate_NA.ipynb @@ -0,0 +1,1620 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# About This Notebook\n", + "In this last chapter of the course, **Exploring Data with pandas: Intermediate**, we will learn:\n", + "- Select columns, rows and individual items using their integer location.\n", + "- Use `pd.read_csv()` to read CSV files in pandas.\n", + "- Work with integer axis labels.\n", + "- How to use pandas methods to produce boolean arrays.\n", + "- Use boolean operators to combine boolean comparisons to perform more complex analysis.\n", + "- Use index labels to align data.\n", + "- Use aggregation to perform advanced analysis using loops.\n", + "***\n", + "## 1. Reading CSV files with pandas(IMPORTANT)\n", + "\n", + "In the previous notebook about the fundamentals of exploring data with pandas, we worked with Fortune Global 500 dataset. In this chapter, we will learn how to use the `pandas.read_csv()` function to read in CSV files." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Previously, we used the snippet below to read our CSV file into pandas.\n" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
rankrevenuesrevenue_changeprofitsassetsprofit_changeceoindustrysectorprevious_rankcountryhq_locationwebsiteyears_on_global_500_listemployeestotal_stockholder_equity
Walmart14858730.813643.0198825-7.2C. Douglas McMillonGeneral MerchandisersRetailing1USABentonville, ARhttp://www.walmart.com23230000077798
State Grid2315199-4.49571.3489838-6.2Kou WeiUtilitiesEnergy2ChinaBeijing, Chinahttp://www.sgcc.com.cn17926067209456
Sinopec Group3267518-9.11257.9310726-65.0Wang YupuPetroleum RefiningEnergy4ChinaBeijing, Chinahttp://www.sinopec.com19713288106523
China National Petroleum4262573-12.31867.5585619-73.7Zhang JianhuaPetroleum RefiningEnergy3ChinaBeijing, Chinahttp://www.cnpc.com.cn171512048301893
Toyota Motor52546947.716899.3437575-12.3Akio ToyodaMotor Vehicles and PartsMotor Vehicles & Parts8JapanToyota, Japanhttp://www.toyota-global.com23364445157210
\n", + "
" + ], + "text/plain": [ + " rank revenues revenue_change profits assets \\\n", + "Walmart 1 485873 0.8 13643.0 198825 \n", + "State Grid 2 315199 -4.4 9571.3 489838 \n", + "Sinopec Group 3 267518 -9.1 1257.9 310726 \n", + "China National Petroleum 4 262573 -12.3 1867.5 585619 \n", + "Toyota Motor 5 254694 7.7 16899.3 437575 \n", + "\n", + " profit_change ceo \\\n", + "Walmart -7.2 C. Douglas McMillon \n", + "State Grid -6.2 Kou Wei \n", + "Sinopec Group -65.0 Wang Yupu \n", + "China National Petroleum -73.7 Zhang Jianhua \n", + "Toyota Motor -12.3 Akio Toyoda \n", + "\n", + " industry sector \\\n", + "Walmart General Merchandisers Retailing \n", + "State Grid Utilities Energy \n", + "Sinopec Group Petroleum Refining Energy \n", + "China National Petroleum Petroleum Refining Energy \n", + "Toyota Motor Motor Vehicles and Parts Motor Vehicles & Parts \n", + "\n", + " previous_rank country hq_location \\\n", + "Walmart 1 USA Bentonville, AR \n", + "State Grid 2 China Beijing, China \n", + "Sinopec Group 4 China Beijing, China \n", + "China National Petroleum 3 China Beijing, China \n", + "Toyota Motor 8 Japan Toyota, Japan \n", + "\n", + " website \\\n", + "Walmart http://www.walmart.com \n", + "State Grid http://www.sgcc.com.cn \n", + "Sinopec Group http://www.sinopec.com \n", + "China National Petroleum http://www.cnpc.com.cn \n", + "Toyota Motor http://www.toyota-global.com \n", + "\n", + " years_on_global_500_list employees \\\n", + "Walmart 23 2300000 \n", + "State Grid 17 926067 \n", + "Sinopec Group 19 713288 \n", + "China National Petroleum 17 1512048 \n", + "Toyota Motor 23 364445 \n", + "\n", + " total_stockholder_equity \n", + "Walmart 77798 \n", + "State Grid 209456 \n", + "Sinopec Group 106523 \n", + "China National Petroleum 301893 \n", + "Toyota Motor 157210 " + ] + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import pandas as pd\n", + "f500 = pd.read_csv('../../../Data/csv/f500.csv', index_col=0)\n", + "f500.index.name = None\n", + "f500.head()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "But if you look closely, you may see that the index axis labels are the values from the first column in the data set, **company**:" + ] + }, + { + "cell_type": "raw", + "metadata": {}, + "source": [ + "company,rank,revenues,revenue_change\n", + "Walmart,1,485873,0.8\n", + "State Grid,2,315199,-4.4\n", + "Sinopec Group,3,267518,-9.1\n", + "China National Petroleum,4,262573,-12.3\n", + "Toyota Motor,5,254694,7.7" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You will see that in the [`read_csv()` function](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.read_csv.html), the `index_col` parameter is optional from the official documentation. When we specify a value of `0`, the first column will be used as the row labels.\n", + "\n", + "Compare with the dataframe above, notice how the `f500` dataframe looks like if we remove the second line using `f500.index.name = None`." + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
rankrevenuesrevenue_changeprofitsassetsprofit_changeceoindustrysectorprevious_rankcountryhq_locationwebsiteyears_on_global_500_listemployeestotal_stockholder_equity
company
Walmart14858730.813643.0198825-7.2C. Douglas McMillonGeneral MerchandisersRetailing1USABentonville, ARhttp://www.walmart.com23230000077798
State Grid2315199-4.49571.3489838-6.2Kou WeiUtilitiesEnergy2ChinaBeijing, Chinahttp://www.sgcc.com.cn17926067209456
Sinopec Group3267518-9.11257.9310726-65.0Wang YupuPetroleum RefiningEnergy4ChinaBeijing, Chinahttp://www.sinopec.com19713288106523
China National Petroleum4262573-12.31867.5585619-73.7Zhang JianhuaPetroleum RefiningEnergy3ChinaBeijing, Chinahttp://www.cnpc.com.cn171512048301893
Toyota Motor52546947.716899.3437575-12.3Akio ToyodaMotor Vehicles and PartsMotor Vehicles & Parts8JapanToyota, Japanhttp://www.toyota-global.com23364445157210
\n", + "
" + ], + "text/plain": [ + " rank revenues revenue_change profits assets \\\n", + "company \n", + "Walmart 1 485873 0.8 13643.0 198825 \n", + "State Grid 2 315199 -4.4 9571.3 489838 \n", + "Sinopec Group 3 267518 -9.1 1257.9 310726 \n", + "China National Petroleum 4 262573 -12.3 1867.5 585619 \n", + "Toyota Motor 5 254694 7.7 16899.3 437575 \n", + "\n", + " profit_change ceo \\\n", + "company \n", + "Walmart -7.2 C. Douglas McMillon \n", + "State Grid -6.2 Kou Wei \n", + "Sinopec Group -65.0 Wang Yupu \n", + "China National Petroleum -73.7 Zhang Jianhua \n", + "Toyota Motor -12.3 Akio Toyoda \n", + "\n", + " industry sector \\\n", + "company \n", + "Walmart General Merchandisers Retailing \n", + "State Grid Utilities Energy \n", + "Sinopec Group Petroleum Refining Energy \n", + "China National Petroleum Petroleum Refining Energy \n", + "Toyota Motor Motor Vehicles and Parts Motor Vehicles & Parts \n", + "\n", + " previous_rank country hq_location \\\n", + "company \n", + "Walmart 1 USA Bentonville, AR \n", + "State Grid 2 China Beijing, China \n", + "Sinopec Group 4 China Beijing, China \n", + "China National Petroleum 3 China Beijing, China \n", + "Toyota Motor 8 Japan Toyota, Japan \n", + "\n", + " website \\\n", + "company \n", + "Walmart http://www.walmart.com \n", + "State Grid http://www.sgcc.com.cn \n", + "Sinopec Group http://www.sinopec.com \n", + "China National Petroleum http://www.cnpc.com.cn \n", + "Toyota Motor http://www.toyota-global.com \n", + "\n", + " years_on_global_500_list employees \\\n", + "company \n", + "Walmart 23 2300000 \n", + "State Grid 17 926067 \n", + "Sinopec Group 19 713288 \n", + "China National Petroleum 17 1512048 \n", + "Toyota Motor 23 364445 \n", + "\n", + " total_stockholder_equity \n", + "company \n", + "Walmart 77798 \n", + "State Grid 209456 \n", + "Sinopec Group 106523 \n", + "China National Petroleum 301893 \n", + "Toyota Motor 157210 " + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "f500 = pd.read_csv('../../../Data/csv/f500.csv', index_col=0)\n", + "f500.head()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Do you see the text **company** above the index labels? This is the name of the first column in the CSV. This value is used as the **axis name** for the index axis in Pandas.\n", + "\n", + "You see that both the column and index axes can have names assigned to them. Originally, we accessed the name of the index axes and set it to `None`, that's why the dataframe didn't have a name for the index axis." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 3.5.1\n", + "1. Use the `pandas.read_csv()` function to read the `f500.csv` CSV file as a pandas dataframe. Assign it to the variable name `f500`.\n", + " - Do not use the `index_col` parameter.\n", + "2. Use the following code to insert the NaN values (missing values) into the `previous_rank` column:
\n", + "````python\n", + "f500.loc[f500[\"previous_rank\"] == 0, \"previous_rank\"] = np.nan\n", + "````\n", + "Remark: If you get a notice that `np` is not defined, you have to import NumPy by typing `import numpy as np`." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "# Start your code below:\n", + "import numpy as np\n", + "f500 = pd.read_csv('../../../Data/csv/f500.csv')\n", + "f500.loc[f500[\"previous_rank\"] == 0, \"previous_rank\"] = np.nan\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 2. Using iloc to select by integer position\n", + "\n", + "In the previous exercise we read our CSV file into pandas. But this time, we didn't use the `index_col` parameter:" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " company rank revenues\n", + "0 Walmart 1 485873\n", + "1 State Grid 2 315199\n", + "2 Sinopec Group 3 267518\n", + "3 China National Petroleum 4 262573\n", + "4 Toyota Motor 5 254694\n" + ] + } + ], + "source": [ + "f500 = pd.read_csv('../../../Data/csv/f500.csv')\n", + "print(f500[['company', 'rank', 'revenues']].head())" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "There are two significant differences with the approach that we just took above:\n", + "- the **company** column is now included as a regular column, not as an index column\n", + "- the **index labels** now start from `0` as **integers**\n", + "\n", + "This is the more conventional way how we should read in a dataframe, and we will be going with this method from now on.\n", + "\n", + "However, do you still remember how we worked with a dataframe with **string index labels**? We used `loc[]` to select the data." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "For selecting rows and columns by their integer positions, we use `iloc[]`. Using `iloc[]` is almost identical to indexing with NumPy, with integer positions starting at `0` like ndarrays and Python lists.\n", + "\n", + "`DataFrame.iloc[]` behaves similarly to `DataFrame.loc[]`. The full syntax for `DataFrame.iloc[]`, in pseudocode, is: \n", + "\n", + "````python\n", + "df.iloc[row_index, column_index]\n", + "````\n", + "\n", + "To help you memorize the two syntaxes easier:\n", + "- ``loc``: label based selection\n", + "- ``iloc``: integer position based selection" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 3.5.2\n", + "1. Select just the fifth row of the `f500` dataframe. Assign the result to `fifth_row`.\n", + "2. Select the value in the first row of the `company` column. Assign the result to `company_value`." + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [], + "source": [ + "# Start your code below:\n", + "fifth_row = f500.loc[4]\n", + "company_value = f500.loc[0,\"company\"]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 3. Using iloc to select by integer position continued\n", + "\n", + "If we want to select the first column from our `f500` dataset, we need to use ``:``, a colon, to specify all rows, and then use the integer ``0`` to specify the first column, like this:" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0 Walmart\n", + "1 State Grid\n", + "2 Sinopec Group\n", + "3 China National Petroleum\n", + "4 Toyota Motor\n", + " ... \n", + "495 Teva Pharmaceutical Industries\n", + "496 New China Life Insurance\n", + "497 Wm. Morrison Supermarkets\n", + "498 TUI\n", + "499 AutoNation\n", + "Name: company, Length: 500, dtype: object\n" + ] + } + ], + "source": [ + "first_column = f500.iloc[:,0]\n", + "print(first_column)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To specify a positional slice, try to use the same shortcut that we used with labels. Below is an example how we would select the rows between index positions one to four (inclusive):" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " company rank revenues revenue_change profits assets \\\n", + "1 State Grid 2 315199 -4.4 9571.3 489838 \n", + "2 Sinopec Group 3 267518 -9.1 1257.9 310726 \n", + "3 China National Petroleum 4 262573 -12.3 1867.5 585619 \n", + "4 Toyota Motor 5 254694 7.7 16899.3 437575 \n", + "\n", + " profit_change ceo industry \\\n", + "1 -6.2 Kou Wei Utilities \n", + "2 -65.0 Wang Yupu Petroleum Refining \n", + "3 -73.7 Zhang Jianhua Petroleum Refining \n", + "4 -12.3 Akio Toyoda Motor Vehicles and Parts \n", + "\n", + " sector previous_rank country hq_location \\\n", + "1 Energy 2 China Beijing, China \n", + "2 Energy 4 China Beijing, China \n", + "3 Energy 3 China Beijing, China \n", + "4 Motor Vehicles & Parts 8 Japan Toyota, Japan \n", + "\n", + " website years_on_global_500_list employees \\\n", + "1 http://www.sgcc.com.cn 17 926067 \n", + "2 http://www.sinopec.com 19 713288 \n", + "3 http://www.cnpc.com.cn 17 1512048 \n", + "4 http://www.toyota-global.com 23 364445 \n", + "\n", + " total_stockholder_equity \n", + "1 209456 \n", + "2 106523 \n", + "3 301893 \n", + "4 157210 \n" + ] + } + ], + "source": [ + "second_to_sixth_rows = f500[1:5]\n", + "print(second_to_sixth_rows)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Pay attention to the fact that the row at index position `5` is not included, just as if we were slicing with a Python list or NumPy ndarray. Recall that `loc[]` handles slicing differently:\n", + "\n", + "- With `loc[]`, the ending slice **is** included.\n", + "- With `iloc[]`, the ending slice **is not** included.\n", + "\n", + "The table below summarizes the usage of `DataFrame.iloc[]` and `Series.iloc[]` to select by integer position:\n", + "\n", + "|Select by integer position| Explicit Syntax| Shorthand Convention|\n", + "|--|--|--|\n", + "|Single column from dataframe|df.iloc[:,3]| |\n", + "|List of columns from dataframe|df.iloc[:,[3,5,6]] | |\n", + "|Slice of columns from dataframe|df.iloc[:,3:7]| |\n", + "|Single row from dataframe|df.iloc[20]| |\n", + "|List of rows from dataframe|df.iloc[[0,3,8]]| |\n", + "|Slice of rows from dataframe|df.iloc[3:5]|df[3:5]|\n", + "|Single items from series|s.iloc[8]|s[8]|\n", + "|List of item from series |s.iloc[[2,8,1]]|s[[2,8,1]]|\n", + "|Slice of items from series|s.iloc[5:10]|s[5:10]|" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 3.5.3\n", + "1. Select the first three rows of the `f500` dataframe. Assign the result to `first_three_rows`.\n", + "2. Select the first and seventh rows and the first five columns of the `f500` dataframe. Assign the result to `first_seventh_row_slice`." + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [], + "source": [ + "# Start your code below:\n", + "first_three_rows = f500.iloc[0:2]\n", + "first_seventh_row_slice = f500.iloc[[0,6],:5]\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 4. Using pandas methods to create boolean masks\n", + "\n", + "There are two methods that I want to introduce to you in this chapter, which are the `Series.isnull()` [method](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.isnull.html) and `Series.notnull()` [method](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.notnull.html). These two methods can be either used to select rows that contain null (or NaN) values or to select rows that do **not** contain null values.\n", + "\n", + "Let's first have a look at the `Series.isnull()` method, which is used to view rows with null values (i.e. missing values) in one column.\n", + "Here is an example for the `revenue_change` column:" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0 False\n", + "1 False\n", + "2 False\n", + "3 False\n", + "4 False\n", + "Name: revenue_change, dtype: bool\n" + ] + } + ], + "source": [ + "rev_is_null = f500[\"revenue_change\"].isnull()\n", + "print(rev_is_null.head())" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We see that using `Series.isnull()` resulted in a boolean series. Just like in NumPy, we can use this series to filter our dataframe, `f500`:" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " company country sector\n", + "90 Uniper Germany Energy\n", + "180 Hewlett Packard Enterprise USA Technology\n" + ] + } + ], + "source": [ + "import pandas as pd\n", + "import numpy as np\n", + "\n", + "f500 = pd.read_csv('../../../Data/csv/f500.csv')\n", + "f500.index.name = None\n", + "\n", + "\n", + "rev_change_null = f500[rev_is_null]\n", + "print(rev_change_null[[\"company\", \"country\",\"sector\"]])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Task 3.5.4\n", + "1. Use the `Series.isnull()` method to select all rows from `f500` that have a null value for the `profit_change` column. Select only the `company`, `profits`, and `profit_change` columns. Assign the result to `null_profit_change`.\n" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " company profits profit_change\n", + "5 Volkswagen 5937.3 NaN\n", + "7 Berkshire Hathaway 24074.0 NaN\n", + "11 BP 115.0 NaN\n", + "15 Glencore 1379.0 NaN\n", + "22 AmerisourceBergen 1427.9 NaN\n", + ".. ... ... ...\n", + "472 Altice -1722.5 NaN\n", + "473 Onex -130.0 NaN\n", + "475 Shanxi Jincheng Anthracite Coal Mining Group 3.0 NaN\n", + "488 Sears Holdings -2221.0 NaN\n", + "492 Telecom Italia 1999.4 NaN\n", + "\n", + "[64 rows x 3 columns]\n" + ] + } + ], + "source": [ + "# Start your code below:\n", + "null_profit_change = f500[f500[\"profit_change\"].isnull()].loc[:,[\"company\",\"profits\",\"profit_change\"]]\n", + "print(null_profit_change)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 5. Working with Integer Labels (OPTIONAL)\n", + "\n", + "Now let's check the difference between `DataFrame.loc[]` and `DataFrame.iloc[]` – what kind of different output will they provide?:" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can use `DataFrame.iloc[]`, and it will get us the following result:" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "company Volkswagen\n", + "profits 5937.3\n", + "profit_change NaN\n", + "Name: 5, dtype: object\n" + ] + } + ], + "source": [ + "# Only works if you have completed task 3.5.4\n", + "first_null_profit_change = null_profit_change.iloc[0]\n", + "print(first_null_profit_change)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "But `DataFrame.loc[]` will throw an error:" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [ + { + "ename": "KeyError", + "evalue": "0", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mKeyError\u001b[0m Traceback (most recent call last)", + "File \u001b[1;32m~\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python311\\site-packages\\pandas\\core\\indexes\\base.py:3790\u001b[0m, in \u001b[0;36mIndex.get_loc\u001b[1;34m(self, key)\u001b[0m\n\u001b[0;32m 3789\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[1;32m-> 3790\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_engine\u001b[39m.\u001b[39;49mget_loc(casted_key)\n\u001b[0;32m 3791\u001b[0m \u001b[39mexcept\u001b[39;00m \u001b[39mKeyError\u001b[39;00m \u001b[39mas\u001b[39;00m err:\n", + "File \u001b[1;32mindex.pyx:152\u001b[0m, in \u001b[0;36mpandas._libs.index.IndexEngine.get_loc\u001b[1;34m()\u001b[0m\n", + "File \u001b[1;32mindex.pyx:181\u001b[0m, in \u001b[0;36mpandas._libs.index.IndexEngine.get_loc\u001b[1;34m()\u001b[0m\n", + "File \u001b[1;32mpandas\\_libs\\hashtable_class_helper.pxi:2606\u001b[0m, in \u001b[0;36mpandas._libs.hashtable.Int64HashTable.get_item\u001b[1;34m()\u001b[0m\n", + "File \u001b[1;32mpandas\\_libs\\hashtable_class_helper.pxi:2630\u001b[0m, in \u001b[0;36mpandas._libs.hashtable.Int64HashTable.get_item\u001b[1;34m()\u001b[0m\n", + "\u001b[1;31mKeyError\u001b[0m: 0", + "\nThe above exception was the direct cause of the following exception:\n", + "\u001b[1;31mKeyError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32mc:\\Users\\andre\\Documents\\UNI\\Master_Digital_Humanities\\S1_WS2023\\UE_Introduction_to_DH_Tools_and_Methods\\Python_Course\\Exercises\\EN\\Numpy_Pandas\\5_Exploring_Data_with_Pandas_Intermediate_NA.ipynb Cell 34\u001b[0m line \u001b[0;36m1\n\u001b[1;32m----> 1\u001b[0m first_null_profit_change \u001b[39m=\u001b[39m null_profit_change\u001b[39m.\u001b[39;49mloc[\u001b[39m0\u001b[39;49m]\n", + "File \u001b[1;32m~\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python311\\site-packages\\pandas\\core\\indexing.py:1153\u001b[0m, in \u001b[0;36m_LocationIndexer.__getitem__\u001b[1;34m(self, key)\u001b[0m\n\u001b[0;32m 1150\u001b[0m axis \u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39maxis \u001b[39mor\u001b[39;00m \u001b[39m0\u001b[39m\n\u001b[0;32m 1152\u001b[0m maybe_callable \u001b[39m=\u001b[39m com\u001b[39m.\u001b[39mapply_if_callable(key, \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mobj)\n\u001b[1;32m-> 1153\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_getitem_axis(maybe_callable, axis\u001b[39m=\u001b[39;49maxis)\n", + "File \u001b[1;32m~\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python311\\site-packages\\pandas\\core\\indexing.py:1393\u001b[0m, in \u001b[0;36m_LocIndexer._getitem_axis\u001b[1;34m(self, key, axis)\u001b[0m\n\u001b[0;32m 1391\u001b[0m \u001b[39m# fall thru to straight lookup\u001b[39;00m\n\u001b[0;32m 1392\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_validate_key(key, axis)\n\u001b[1;32m-> 1393\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_get_label(key, axis\u001b[39m=\u001b[39;49maxis)\n", + "File \u001b[1;32m~\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python311\\site-packages\\pandas\\core\\indexing.py:1343\u001b[0m, in \u001b[0;36m_LocIndexer._get_label\u001b[1;34m(self, label, axis)\u001b[0m\n\u001b[0;32m 1341\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39m_get_label\u001b[39m(\u001b[39mself\u001b[39m, label, axis: AxisInt):\n\u001b[0;32m 1342\u001b[0m \u001b[39m# GH#5567 this will fail if the label is not present in the axis.\u001b[39;00m\n\u001b[1;32m-> 1343\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mobj\u001b[39m.\u001b[39;49mxs(label, axis\u001b[39m=\u001b[39;49maxis)\n", + "File \u001b[1;32m~\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python311\\site-packages\\pandas\\core\\generic.py:4236\u001b[0m, in \u001b[0;36mNDFrame.xs\u001b[1;34m(self, key, axis, level, drop_level)\u001b[0m\n\u001b[0;32m 4234\u001b[0m new_index \u001b[39m=\u001b[39m index[loc]\n\u001b[0;32m 4235\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[1;32m-> 4236\u001b[0m loc \u001b[39m=\u001b[39m index\u001b[39m.\u001b[39;49mget_loc(key)\n\u001b[0;32m 4238\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39misinstance\u001b[39m(loc, np\u001b[39m.\u001b[39mndarray):\n\u001b[0;32m 4239\u001b[0m \u001b[39mif\u001b[39;00m loc\u001b[39m.\u001b[39mdtype \u001b[39m==\u001b[39m np\u001b[39m.\u001b[39mbool_:\n", + "File \u001b[1;32m~\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python311\\site-packages\\pandas\\core\\indexes\\base.py:3797\u001b[0m, in \u001b[0;36mIndex.get_loc\u001b[1;34m(self, key)\u001b[0m\n\u001b[0;32m 3792\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39misinstance\u001b[39m(casted_key, \u001b[39mslice\u001b[39m) \u001b[39mor\u001b[39;00m (\n\u001b[0;32m 3793\u001b[0m \u001b[39misinstance\u001b[39m(casted_key, abc\u001b[39m.\u001b[39mIterable)\n\u001b[0;32m 3794\u001b[0m \u001b[39mand\u001b[39;00m \u001b[39many\u001b[39m(\u001b[39misinstance\u001b[39m(x, \u001b[39mslice\u001b[39m) \u001b[39mfor\u001b[39;00m x \u001b[39min\u001b[39;00m casted_key)\n\u001b[0;32m 3795\u001b[0m ):\n\u001b[0;32m 3796\u001b[0m \u001b[39mraise\u001b[39;00m InvalidIndexError(key)\n\u001b[1;32m-> 3797\u001b[0m \u001b[39mraise\u001b[39;00m \u001b[39mKeyError\u001b[39;00m(key) \u001b[39mfrom\u001b[39;00m \u001b[39merr\u001b[39;00m\n\u001b[0;32m 3798\u001b[0m \u001b[39mexcept\u001b[39;00m \u001b[39mTypeError\u001b[39;00m:\n\u001b[0;32m 3799\u001b[0m \u001b[39m# If we have a listlike key, _check_indexing_error will raise\u001b[39;00m\n\u001b[0;32m 3800\u001b[0m \u001b[39m# InvalidIndexError. Otherwise we fall through and re-raise\u001b[39;00m\n\u001b[0;32m 3801\u001b[0m \u001b[39m# the TypeError.\u001b[39;00m\n\u001b[0;32m 3802\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_check_indexing_error(key)\n", + "\u001b[1;31mKeyError\u001b[0m: 0" + ] + } + ], + "source": [ + "first_null_profit_change = null_profit_change.loc[0]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We get an error, telling us that **the label [0] is not in the [index]**. Remember that `DataFrame.loc[]` is used for label based selection:\n", + "\n", + "- ``loc``: label based selection\n", + "- ``iloc``: integer position based selection\n", + "\n", + "We see that there is no row with a 0 label in the index, we got the error above. If we wanted to select a row using `loc[]`, we'd have to use the integer label for the first row — `5`.\n" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "company Volkswagen\n", + "profits 5937.3\n", + "profit_change NaN\n", + "Name: 5, dtype: object\n" + ] + } + ], + "source": [ + "first_null_profit_change = null_profit_change.loc[5]\n", + "print(first_null_profit_change)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 6. Pandas Index Alignment (OPTIONAL)\n", + "Do you know that pandas has a very powerful aspect? --- Almost every operation will align on the index labels. Let's look at an example below to understand what this means. We have a dataframe named `food` and a series named `alt_name`:" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
fruit_vegqty
tomatofruit4
carrotveg2
limefruit4
cornveg1
eggplantveg2
\n", + "
" + ], + "text/plain": [ + " fruit_veg qty\n", + "tomato fruit 4\n", + "carrot veg 2\n", + "lime fruit 4\n", + "corn veg 1\n", + "eggplant veg 2" + ] + }, + "execution_count": 22, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import pandas as pd\n", + "d = {'fruit_veg': [\"fruit\", \"veg\", \"fruit\", \"veg\",\"veg\"], 'qty': [4, 2, 4, 1, 2]}\n", + "food = pd.DataFrame(data=d)\n", + "food.index = ['tomato', 'carrot', 'lime', 'corn','eggplant'] \n", + "food" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "arugula rocket\n", + "eggplant aubergine\n", + "corn maize\n", + "dtype: object" + ] + }, + "execution_count": 23, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "alt_name = pd.Series(['rocket', 'aubergine', 'maize'], index=[\"arugula\", \"eggplant\", \"corn\"])\n", + "alt_name" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "By observing the two dataframes above, we see that though the `food` dataframe and the `alt_name` series have different numbers of items, they share two of the same index labels which are `corn` and `eggplant`. However, these are in different orders. If we wanted to add `alt_name` as a new column in our `food` dataframe, we can use the following code:" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [], + "source": [ + "food[\"alt_name\"] = alt_name" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "When we perform the code above, pandas will intentionally ignore the order of the ``alt_name`` series, and automatically align on the index labels.\n", + "\n", + "In addition, Pandas will also:\n", + "\n", + "- Discard any items that have an index that doesn't match the dataframe (like `arugula`).\n", + "- Fill any remaining rows with `NaN`.\n", + "\n", + "Observe the result again carefully." + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
fruit_vegqtyalt_name
tomatofruit4NaN
carrotveg2NaN
limefruit4NaN
cornveg1maize
eggplantveg2aubergine
\n", + "
" + ], + "text/plain": [ + " fruit_veg qty alt_name\n", + "tomato fruit 4 NaN\n", + "carrot veg 2 NaN\n", + "lime fruit 4 NaN\n", + "corn veg 1 maize\n", + "eggplant veg 2 aubergine" + ] + }, + "execution_count": 25, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Below is the result\n", + "food" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You see that with every occasion, the pandas library will align on index, no matter if our index labels are strings or integers - this makes working with data from different sources much much easier." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 7. Using Boolean Operators (IMPORTANT)\n", + "We can combine boolean arrays using **boolean operators**. In Python, these boolean operators are `and`, `or`, and `not`. But in pandas, there is a slight difference compared to Python. Take a look at the chart below: \n", + "\n", + "|pandas|Python equivalent|Meaning|\n", + "|-|-|-|\n", + "|a & b| a and b| True if both a and b are True, else False|\n", + "| a \\| b| a or b| True if either a or b is True|\n", + "|~a| not a | True if a is False, else False|\n", + "\n", + "Let's try to use the syntaxes in the table in the small example below:" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
companyrevenuescountry
0Walmart485873USA
1State Grid315199China
2Sinopec Group267518China
3China National Petroleum262573China
4Toyota Motor254694Japan
\n", + "
" + ], + "text/plain": [ + " company revenues country\n", + "0 Walmart 485873 USA\n", + "1 State Grid 315199 China\n", + "2 Sinopec Group 267518 China\n", + "3 China National Petroleum 262573 China\n", + "4 Toyota Motor 254694 Japan" + ] + }, + "execution_count": 26, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "cols = [\"company\", \"revenues\", \"country\"]\n", + "f500_sel = f500[cols].head()\n", + "f500_sel.head()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We want to find the companies in `f500_sel` with more than 265 billion in revenue, and on top of that with headquarters located in China. We can achieve this by using two boolean comparisons like this:" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0 True\n", + "1 True\n", + "2 True\n", + "3 False\n", + "4 False\n", + "Name: revenues, dtype: bool\n", + "0 False\n", + "1 True\n", + "2 True\n", + "3 True\n", + "4 False\n", + "Name: country, dtype: bool\n" + ] + } + ], + "source": [ + "over_265 = f500_sel[\"revenues\"] > 265000\n", + "china = f500_sel[\"country\"] == \"China\"\n", + "print(over_265.head())\n", + "print(china.head())" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "What we can do next is to use the `&` operator to combine the two boolean arrays to get the actual boolean we want, like this:" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "0 False\n", + "1 True\n", + "2 True\n", + "3 False\n", + "4 False\n", + "dtype: bool" + ] + }, + "execution_count": 28, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "combined = over_265 & china\n", + "combined.head()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Last but not least, we perform selection on our dataframe to get the final result like this:" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": { + "collapsed": true, + "jupyter": { + "outputs_hidden": true + } + }, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
companyrevenues
1State Grid315199
2Sinopec Group267518
\n", + "
" + ], + "text/plain": [ + " company revenues\n", + "1 State Grid 315199\n", + "2 Sinopec Group 267518" + ] + }, + "execution_count": 29, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "final_cols = [\"company\", \"revenues\"]\n", + "result = f500_sel.loc[combined, final_cols]\n", + "result.head()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This is the end result which fulfills all of our criteria.\n", + "\n", + "### Task 3.5.7\n", + "Now try to do a similar task by yourself:\n", + "1. Select all companies with revenues over **100 billion** and **negative profits** from the `f500` dataframe. Note that the entries in the profits column are given in millions of dollars (USD). The result should include all columns.\n", + " - Create a boolean array that selects the companies with revenues greater than 100 billion. Assign the result to `large_revenue`.\n", + " - Create a boolean array that selects the companies with profits less than `0`. Assign the result to `negative_profits`.\n", + " - Combine `large_revenue` and `negative_profits`. Assign the result to `combined`.\n", + " - Use combined to filter `f500`. Assign the result to `big_rev_neg_profit`." + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": {}, + "outputs": [], + "source": [ + "# Start your code below:\n", + "large_revenue = f500[\"revenues\"] > 100000\n", + "negative_profits = f500[\"profits\"] < 0\n", + "combined = large_revenue & negative_profits\n", + "big_rev_neg_profit = f500[combined]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 8. Sorting Values\n", + "\n", + "Now let's try to answer some more complicated questions about our data set. What if we wanted to find the company that employs the most people in China? How can we achieve this? We can first select all of the rows where the `country` column equals `China`, like this:" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": {}, + "outputs": [], + "source": [ + "selected_rows = f500[f500[\"country\"] == \"China\"]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Then, we can use the [`DataFrame.sort_values()` method](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.sort_values.html) to sort the rows on the employees column, like this:\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " company country employees\n", + "204 Noble Group China 1000\n", + "458 Yango Financial Holding China 10234\n", + "438 China National Aviation Fuel Group China 11739\n", + "128 Tewoo Group China 17353\n", + "182 Amer International Group China 17852\n" + ] + } + ], + "source": [ + "sorted_rows = selected_rows.sort_values(\"employees\")\n", + "print(sorted_rows[[\"company\", \"country\", \"employees\"]].head())" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The `sort_values()` method will by default automatically sort the rows in ascending order — from smallest to largest.\n", + "\n", + "But if we want to sort the rows in descending order instead, we can achieve this by setting the `ascending` parameter to `False`, like this:\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " company country employees\n", + "3 China National Petroleum China 1512048\n", + "118 China Post Group China 941211\n", + "1 State Grid China 926067\n", + "2 Sinopec Group China 713288\n", + "37 Agricultural Bank of China China 501368\n" + ] + } + ], + "source": [ + "sorted_rows = selected_rows.sort_values(\"employees\", ascending=False)\n", + "print(sorted_rows[[\"company\", \"country\", \"employees\"]].head())" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now we see the Companies in China who employ the most people is China National Petroleum. \n", + "\n", + "Can you find out the same about Japanese company?\n", + "### Task 3.5.8\n", + "\n", + "1. Find the companies headquartered in Japan with the largest number of employees.\n", + " - Select only the rows that have a country name equal to `Japan`.\n", + " - Use `DataFrame.sort_values()` to sort those rows by the `employees` column in descending order.\n", + " - Use `DataFrame.iloc[]` to select the first row from the sorted dataframe.\n", + " - Extract the company name from the index label `company` from the first row. Assign the result to `top_japanese_employer`." + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": {}, + "outputs": [], + "source": [ + "# Start your code below:\n", + "top_japanese_employer = f500[f500[\"country\"] == \"Japan\"].sort_values(\"employees\",ascending=False).iloc[0].loc[\"company\"]\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.6" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +}