Skip to content

Commit

Permalink
Adding
Browse files Browse the repository at this point in the history
  • Loading branch information
ctivanovich committed Jul 13, 2018
1 parent c4aaaa6 commit d3478ce
Show file tree
Hide file tree
Showing 12 changed files with 193,102 additions and 38 deletions.
16 changes: 16 additions & 0 deletions .ipynb_checkpoints/coditility-checkpoint.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# you can write to stdout for debugging purposes, e.g.
# print("this is a debug message")

def solution(predicted, observed):
# write your code in Python 3.6
sqdeviations = []
for obs, pre in zip(observed, predicted):
sqdeviations.append((obs-pre)**2)

mse = (sum(sqdeviations))/len(sqdeviations)
rmse = mse ** 0.5
return rmse
predicted = [4, 25, 0.75, 11]
observed = [3, 21, -1.25, 13]

solution(predicted, observed)
194 changes: 194 additions & 0 deletions .ipynb_checkpoints/linked in skills-checkpoint.ipynb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions AnalyzeABTestResults 2/Analyze_ab_test_results_notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1731,7 +1731,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python [default]",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand All @@ -1745,7 +1745,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.5"
"version": "3.6.6"
}
},
"nbformat": 4,
Expand Down
58 changes: 22 additions & 36 deletions IndeedJobs.ipynb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 20 18:51:14 2017
@author: Christopher
"""
OSM_FILE = "tokyo_japan.xml" # Replace this with your osm file
SAMPLE_FILE = "tokyo_extract_k_10000.xml"

import codecs

import xml.etree.ElementTree as ET # Use cElementTree or lxml if too slow


k = 3000 # Parameter: take every k-th top level element

def get_element(osm_file, tags=('node', 'way', 'relation')):
"""Yield element if it is the right type of tag
Reference:
http://stackoverflow.com/questions/3095434/inserting-newlines-in-xml-file-generated-via-xml-etree-elementtree-in-python
"""
context = iter(ET.iterparse(osm_file, events=('start', 'end')))
_, root = next(context)
for event, elem in context:
if event == 'end' and elem.tag in tags:
yield elem
root.clear()

if __name__== "__main__":
with codecs.open(SAMPLE_FILE, 'wb') as output:
output.write(b'<?xml version="1.0" encoding="UTF-8"?>\n')
output.write(b'<osm>\n ')

# Write every kth top level element
for i, element in enumerate(get_element(OSM_FILE)):
if i % k == 0:
output.write(ET.tostring(element, encoding='utf-8'))

output.write(b'</osm>')
File renamed without changes.
194 changes: 194 additions & 0 deletions linked in skills.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit d3478ce

Please sign in to comment.