All our Data Science projects include bite-sized activities to test your knowledge and practice in an environment with constant feedback.
All our activities include solutions with explanations on how they work and why we chose them.
What's the jq expression used to select the 100th
pokemon? Enter it below (remember to enter the full expression, including jq
and pokemon.json
):
Write the expression to select values individually, your output should look something like:
"Torchic"
"Fire"
310
Now we want to select the same values as before, but this time we want jq
to return an object. Your expression should look like:
{
"Name": "Torchic",
"Type 1": "Fire",
"Total": 310
}
Write a slicing expression to select the last 3 pokemon.
Your output should look something like:
[
{
"Name": "Diancie",
"Type 1": "Rock",
"Type 2": "Fairy",
"Total": 600,
"HP": 50,
"Attack": 100,
"Defense": 150,
"Sp. Atk": 100,
"Sp. Def": 150,
"Speed": 50,
"Generation": 6,
"Legendary": true
}
...
]
Your output should look something like:
{
"Name": "Slaking",
"Type 1": "Normal",
"Type 2": null,
"Total": 670,
"HP": 150,
"Attack": 160,
"Defense": 100,
"Sp. Atk": 95,
"Sp. Def": 65,
"Speed": 100,
"Generation": 3,
"Legendary": false
}
{
"Name": "Rampardos",
"Type 1": "Rock",
"Type 2": null,
"Total": 495,
"HP": 97,
"Attack": 165,
"Defense": 60,
"Sp. Atk": 65,
"Sp. Def": 50,
"Speed": 58,
"Generation": 4,
"Legendary": false
}
...
Your output should look something like:
[
{
"Name": "Mewtwo",
"Total": 680
},
{
"Name": "Lugia",
"Total": 680
},
{
"Name": "Ho-oh",
"Total": 680
},
{
"Name": "Slaking",
"Total": 670
},
...
]
That is, Type 2
is not null. Limit your results to the first 5 results.
Your output should look something like:
[
{
"Name": "Bulbasaur",
"Type 1": "Grass",
"Type 2": "Poison",
"Total": 318,
"HP": 45,
"Attack": 49,
"Defense": 49,
"Sp. Atk": 65,
"Sp. Def": 65,
"Speed": 45,
"Generation": 1,
"Legendary": false
},
{
"Name": "Ivysaur",
"Type 1": "Grass",
"Type 2": "Poison",
"Total": 405,
"HP": 60,
"Attack": 62,
"Defense": 63,
"Sp. Atk": 80,
"Sp. Def": 80,
"Speed": 60,
"Generation": 1,
"Legendary": false
},
...
]
Your output should look something like:
[
"Articuno",
"Zapdos",
"Moltres",
"Mewtwo",
"Raikou",
"Entei",
"Suicune",
"Lugia",
"Ho-oh",
...
]
Your output should look something like:
[
"Bulbasaur",
"Ivysaur",
"Venusaur",
"Charizard",
"Butterfree",
"Weedle",
"Kakuna",
"Beedrill",
"Pidgey",
...
]
It should include Pokémon having Poison as either their Type 1 or as their Type 2.
Your output should look something like:
{
"Name": "Bulbasaur",
"Type 1": "Grass",
"Type 2": "Poison",
"Total": 318,
"HP": 45,
"Attack": 49,
"Defense": 49,
"Sp. Atk": 65,
"Sp. Def": 65,
"Speed": 45,
"Generation": 1,
"Legendary": false
}
{
"Name": "Ivysaur",
"Type 1": "Grass",
"Type 2": "Poison",
"Total": 405,
"HP": 60,
"Attack": 62,
"Defense": 63,
"Sp. Atk": 80,
"Sp. Def": 80,
"Speed": 60,
"Generation": 1,
"Legendary": false
}
..
...
{
"Name": "Dragalge",
"Type 1": "Poison",
"Type 2": "Dragon",
"Total": 494,
"HP": 65,
"Attack": 75,
"Defense": 90,
"Sp. Atk": 97,
"Sp. Def": 123,
"Speed": 44,
"Generation": 6,
"Legendary": false
}
Combining above concepts + Statistical methods
Your output should look something like:
[
{
"Name": "Purugly",
"Type 1": "Normal",
"Type 2": null,
"Total": 452,
"HP": 71,
"Attack": 82,
"Defense": 64,
"Sp. Atk": 64,
"Sp. Def": 59,
"Speed": 112,
"Generation": 4,
"Legendary": false
},
{
"Name": "Vanilluxe",
"Type 1": "Ice",
"Type 2": null,
"Total": 535,
"HP": 71,
"Attack": 95,
"Defense": 85,
"Sp. Atk": 110,
"Sp. Def": 95,
"Speed": 79,
"Generation": 5,
"Legendary": false
},
...
]
Your output should look something like:
[
{
"Name": "Shuckle",
"Type 1": "Bug",
"Type 2": "Rock",
"Total": 505,
"HP": 20,
"Attack": 10,
"Defense": 230,
"Sp. Atk": 10,
"Sp. Def": 230,
"Speed": 5,
"Generation": 2,
"Legendary": false
},
{
"Name": "Regirock",
"Type 1": "Rock",
"Type 2": null,
"Total": 580,
"HP": 80,
"Attack": 100,
"Defense": 200,
"Sp. Atk": 50,
"Sp. Def": 100,
"Speed": 50,
"Generation": 3,
"Legendary": true
},
...
]
Your output should look something like:
{
"Name": "Tyranitar",
"Type 1": "Rock",
"Type 2": "Dark",
"Total": 600,
"HP": 100,
"Attack": 134,
"Defense": 110,
"Sp. Atk": 95,
"Sp. Def": 100,
"Speed": 61,
"Generation": 2,
"Legendary": false
}
Your output should look something like:
[
....
{
"Name": "Volcanion",
"Type 1": "Fire",
"Type 2": "Water",
"Total": 600,
"HP": 80,
"Attack": 110,
"Defense": 120,
"Sp. Atk": 130,
"Sp. Def": 90,
"Speed": 70,
"Generation": 6,
"Legendary": true
}
]
Your output should look something like:
[
[
...
{
"Name": "Clauncher",
"Type 1": "Water",
"Type 2": null,
"Total": 330,
"HP": 50,
"Attack": 53,
"Defense": 62,
"Sp. Atk": 58,
"Sp. Def": 63,
"Speed": 44,
"Generation": 6,
"Legendary": false
},
{
"Name": "Clawitzer",
"Type 1": "Water",
"Type 2": null,
"Total": 500,
"HP": 71,
"Attack": 73,
"Defense": 88,
"Sp. Atk": 120,
"Sp. Def": 89,
"Speed": 59,
"Generation": 6,
"Legendary": false
}
]
]
Your output should look something like:
{
"1": 1,
"2": 1,
"3": 1,
"4": 1,
"5": 1,
"6": 7
}
Your output should look something like:
{
"Bug": 55.95238095238095,
"Dark": 67.17857142857143,
"Dragon": 78.04166666666667,
"Electric": 59.5,
"Fairy": 74.11764705882354,
"Fighting": 70.24,
"Fire": 68.59574468085107,
"Flying": 68,
"Ghost": 61.56521739130435,
"Grass": 66.1969696969697,
"Ground": 72.4,
"Ice": 71.65217391304348,
"Normal": 76.52688172043011,
"Poison": 67.25,
"Psychic": 70.61702127659575,
"Rock": 64.53658536585365,
"Steel": 64.81818181818181,
"Water": 70.86666666666666
}