Skip to content

Instantly share code, notes, and snippets.

@bllchmbrs
Created February 3, 2016 02:21
Show Gist options
  • Save bllchmbrs/df2a4eae19c478e70858 to your computer and use it in GitHub Desktop.
Save bllchmbrs/df2a4eae19c478e70858 to your computer and use it in GitHub Desktop.
Challenges
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" % Total % Received % Xferd Average Speed Time Time Time Current\n",
" Dload Upload Total Spent Left Speed\n",
"100 10784 100 10784 0 0 14469 0 --:--:-- --:--:-- --:--:-- 14455\n"
]
}
],
"source": [
"!curl \"https://raw.githubusercontent.com/MIDS-INFO-W18/Course-Syllabus/master/week_4/data.json?token=ABkQBzMOBCfAanGNTEiSbJPb_dS20zrGks5Wuov6wA%3D%3D\" > data.json"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import json\n",
"\n",
"with open(\"data.json\") as f:\n",
" temp = json.load(f)\n",
" data = temp['data']\n",
" cols = temp['cols']"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"1. Write a comprehension that will extract out all the names and removes duplicates in doing so. The resulting data structure may be a list or a set.\n",
"\n",
"2. Count the number of people in each state. There are several ways of doing this so I won't give any tips!\n",
"\n",
"3. Write a comprehension that will end up with a key of name and value of phone number. The result should be a dictionary.\n",
"\n",
"4. Write a comprehension to find which letters of the alphabet (if any) are not used as the first letter in their names. Don't just list which ones we have, but which ones we are missing."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"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.5.1"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment