Skip to content
Open

pull #57

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
9dc7137
First line changed
Aug 24, 2019
ca319d0
My info added
Aug 24, 2019
368fd21
Merge pull request #1 from evill013/lab-resolving-git-conflicts
evill013 Aug 24, 2019
7f8c4ed
Update about-me.md
evill013 Aug 24, 2019
1974a93
Work_In_Progress
evill013 Aug 25, 2019
a199ba7
SOLVED
evill013 Sep 7, 2019
7c77931
SOLVED
evill013 Sep 26, 2019
12fb4c0
SOLVED
evill013 Sep 26, 2019
bf1684e
SOLVED
evill013 Sep 26, 2019
df579e5
SOLVED
evill013 Sep 26, 2019
332e7ca
SOLVED
evill013 Sep 26, 2019
87fc805
SOLVED
evill013 Sep 26, 2019
1b01fdf
SOLVED
evill013 Sep 26, 2019
4a77c83
commit
Sep 29, 2019
98bdb59
SOLVED
Sep 30, 2019
72b836c
SOLVED
Sep 30, 2019
645314c
COMMIT Merge branch 'master' of https://github.com/evill013/data-labs
Sep 30, 2019
70a9c34
SOLVED
evill013 Sep 30, 2019
ba0bae9
SOLVED_IN_ONE_FILE
evill013 Oct 3, 2019
02e3f72
REPLACING FILE
evill013 Oct 3, 2019
b8ed2d6
SOLVED
evill013 Oct 3, 2019
7899c5f
SOLVED
evill013 Oct 7, 2019
f80b941
SOLVED
evill013 Oct 7, 2019
b9fbbf2
SOLVED
evill013 Oct 8, 2019
cdfd69a
SOLVED
evill013 Oct 19, 2019
58a637a
SOLVED
evill013 Oct 19, 2019
10d9a93
SOLVED
evill013 Oct 19, 2019
baae22f
SOLVED
evill013 Oct 19, 2019
ad66300
SOLVED
evill013 Oct 27, 2019
fa9ae9e
SOLVED
evill013 Oct 27, 2019
3b29534
SOLVED
evill013 Oct 27, 2019
35118d6
SOLVED
evill013 Oct 29, 2019
8cbacb0
SOLVED
evill013 Oct 29, 2019
4919123
SOLVED
evill013 Oct 30, 2019
c56d0f4
Add files via upload
evill013 Dec 5, 2019
151148f
COMPLETED
evill013 Dec 5, 2019
2ecef05
DATA SOURCE
evill013 Dec 5, 2019
485ff56
SOLVED
evill013 Jan 7, 2020
0c040ce
SOLVED
evill013 Jan 7, 2020
1a891a3
SOLVED
evill013 Jan 7, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
327 changes: 257 additions & 70 deletions module-1/lab-advanced-regex/your-code/main.ipynb

Large diffs are not rendered by default.

312 changes: 301 additions & 11 deletions module-1/lab-advanced-web-scraping/your-code/main.ipynb

Large diffs are not rendered by default.

220 changes: 220 additions & 0 deletions module-1/lab-api-scavenger-game/your-code/challenge-1-2-3.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"##CHALLENGE-1"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([None, 'Jupyter Notebook'], dtype=object)"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import requests\n",
"import pandas as pd\n",
"\n",
"#Token and username must be changed\n",
"username = 'evi*****'\n",
"token = '22262120b06d80666333a157d67e324b05f*****'\n",
"\n",
"url = \"https://api.github.com/repos/ironhack-labs/data-labs/forks\"\n",
"login = requests.get(url, auth=(username,token))\n",
"response=login.json()\n",
"data_forks = pd.DataFrame(response) \n",
"\n",
"data_forks['language'].unique()\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"##CHALLENGE-2"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Numbers of commits = 2\n"
]
}
],
"source": [
"import requests\n",
"import pandas as pd\n",
"import datetime\n",
"\n",
"#Credentials\n",
"#Token and username must be changed\n",
"username = 'evi*****'\n",
"token = '22262120b06d80666333a157d67e324b05f*****'\n",
"\n",
"#variables for date calculations\n",
"now = datetime.datetime.now()\n",
"past_week= now - datetime.timedelta(days=7)\n",
"\n",
"#Connecting to API using token\n",
"url = \"https://api.github.com/repos/ironhack-labs/data-labs/commits?since=\"+str(past_week)+\"T00:00:00&until=\"+str(now)+\"T23:59:59\"\n",
"login = requests.get(url, auth=(username,token))\n",
"\n",
"#Building object to count commits in the last past week\n",
"response=login.json()\n",
"data_commit = pd.DataFrame(response)\n",
"result = data_commit['commit'].count()\n",
"print('Numbers of commits =',result)\n"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [],
"source": [
"##CHALLENGE-3"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'In data science 80 percent of time spent is preparing data 20 percent of time is spent complaining about the need to prepare data.'"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import requests\n",
"import pandas as pd\n",
"\n",
"#Credentials\n",
"#Token and username must be changed\n",
"username = 'evi*****'\n",
"token = '22262120b06d80666333a157d67e324b05f*****'\n",
"\n",
"\n",
"#Connecting to API using token\n",
"url = \"https://api.github.com/repos/ironhack-datalabs/scavenger/contents\"\n",
"login = requests.get(url, auth=(username,token))\n",
"\n",
"#Creating a dataframe from object\n",
"response=login.json()\n",
"data_hunt = pd.DataFrame(response)\n",
"\n",
"#Creating a list of directories\n",
"path_list= [col for col in data_hunt['path']]\n",
"\n",
"\n",
"#Function to build urls\n",
"def buildURL(url):\n",
" directories=[]\n",
" for f in path_list:\n",
" file = url+\"/\"+f\n",
" directories.append(file)\n",
" return directories\n",
"\n",
"#Open diretory and read files\n",
"dir_lst = buildURL(url)\n",
"del dir_lst[0]\n",
"dir_lst\n",
"\n",
"def openDir(dirs):\n",
" username = 'evi*****'\n",
" token = '22262120b06d80666333a157d67e324b05f*****'\n",
" file_df= []\n",
" \n",
" for file in dir_lst:\n",
" url = file\n",
" login = requests.get(url, auth=(username,token))\n",
" response=login.json()\n",
" file_hunt = pd.DataFrame(response)\n",
" file_df.append(file_hunt)\n",
" return pd.concat(file_df)\n",
" \n",
"file_scavenger = openDir(dir_lst)\n",
"\n",
"#Get files ending in 'scavengerhunt'\n",
"def listSca(dataframe):\n",
" return dataframe.loc[dataframe['name'].str.endswith('scavengerhunt')]\n",
"\n",
"finale = listSca(file_scavenger).sort_values(by=['name'])\n",
"\n",
"#Reset dataframe´s index\n",
"finale = finale['download_url'].reset_index()\n",
"_lst=finale.download_url\n",
"\n",
"#Opens the RAW url to retrieve content in 'scavenger' files and concatenates the strings of every file\n",
"#into a single list.\n",
"\n",
"def openRaw(_lst):\n",
" username = 'evi*****'\n",
" token = '22262120b06d80666333a157d67e324b05f*****'\n",
"\n",
" contents = [] \n",
" seperator = ', '\n",
"\n",
" for url in _lst: \n",
" word = (requests.get(url).text).strip()\n",
" contents.append(word)\n",
" \n",
" return seperator.join(contents).replace(',','')\n",
"\n",
"openRaw(_lst)\n",
"\n",
"\n"
]
}
],
"metadata": {
"celltoolbar": "Raw Cell Format",
"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.4"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Loading