This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import numpy as np | |
import sys, os | |
import seaborn as sns | |
import matplotlib.pyplot as plt | |
# Pandas options | |
pd.options.display.max_columns = 30 | |
pd.options.display.max_rows = 20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def draught_adjustment_factor(hour_slice_of_ais_ts): | |
# # | |
# | |
# Things we are missing: | |
# - DraughtRatio for ballasted ship (DRb) | |
# - DraughtRatio for loaded ship (DRl) | |
# - DraughtRatio for non-ballasted ship (DRnbs) | |
# Are these in IHS Fairplay? | |
# Cannot see where they come from, or how they are computed. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import spacy | |
import numpy | |
# load no model - this one: https://spacy.io/models/nb | |
nlp = spacy.load('nb_core_news_sm') | |
with open(w2v_path+'/w2vtrained.txt', 'rb') as file_: | |
header = file_.readline() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// add a debug config for python in vs code using virtual env and adding a folder to path | |
{ | |
"name": "Python: create_model", | |
"type": "python", | |
"request": "launch", | |
"env": { | |
"PYTHONPATH": "${workspaceFolder}/spaCy" | |
}, | |
"pythonPath": "${workspaceFolder}/.env/bin/python", | |
"program": "${workspaceFolder}/create_model.py", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POST _ingest/pipeline/attachment/_simulate | |
{ | |
"docs": [ | |
{"_source": | |
{"path": "../Helsedata/Helse Stavanger HF/2017/Styresak 92 - 17 Adm. direktõrs orientering til Styret nr. 7-2017.pdf", "data": "JVBERi0xLjMKJcTl8uXrp/Og0MTGCjQgMCBvYmoKPDwgL0xlbmd0aCA1IDAgUiAvRmlsdGVyIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0KeAF9jbsKwkAQRft8xfEFm2azb7FVbOwC04nVgoWQIuz/QzbZQmxkijsP5pyZkZnhViy5YLYqua6MdqHNa2ODdiQX9SWRJ65S78ZEJBPbUw3nz8SYOpkYRBwWefNE7fY91qEONQLq2PNCHtxlc/8TdVX05fvgVz4/fHXqkU+DjQtavCqICmVuZHN0cmVhbQplbmRvYmoKNSAwIG9iagoxMzIKZW5kb2JqCjIgMCBvYmoKPDwgL1R5cGUgL1BhZ2UgL1BhcmVudCAzIDAgUiAvUmVzb3VyY2VzIDYgMCBSIC9Db250ZW50cyA0IDAgUiAvTWVkaWFCb3ggWzAgMCA1OTUgODQyXQo+PgplbmRvYmoKNiAwIG9iago8PCAvUHJvY1NldCBbIC9QREYgL1RleHQgXSAvQ29sb3JTcGFjZSA8PCAvQ3MxIDcgMCBSID4+IC9Gb250IDw8IC9UVDIgOSAwIFIKPj4gPj4KZW5kb2JqCjEwIDAgb2JqCjw8IC9MZW5ndGggMTEgMCBSIC9OIDMgL0FsdGVybmF0ZSAvRGV2aWNlUkdCIC9GaWx0ZXIgL0ZsYXRlRGVjb2RlID4+CnN0cmVhbQp4AZ2Wd1RT2RaHz703vdASIiAl9Bp6CSDSO0gVBFGJSYBQAoaEJnZEBUYUESlWZFTAAUeHImNFFAuDgmLXCfIQUMbBUURF5d2Mawnvr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POST /rr_test4/1/?pipeline=attachment | |
{ | |
"data" : "JVBERi0xLjUNJeLjz9MNCjggMCBvYmoNPDwvTGluZWFyaXplZCAxL0wgODc5MzEvTyAxMC9FIDgzNzY5L04gMi9UIDg3NjU3L0ggWyA4OTYgMjM3XT4+DWVuZG9iag0gICAgICAgICAgICAgICAgICAgIA14cmVmDTggMzANMDAwMDAwMDAxNiAwMDAwMCBuDQowMDAwMDAxMTMzIDAwMDAwIG4NCjAwMDAwMDEyNTggMDAwMDAgbg0KMDAwMDAwMTcwOSAwMDAwMCBuDQowMDAwMDAyNDE3IDAwMDAwIG4NCjAwMDAwMDMxMDQgMDAwMDAgbg0KMDAwMDAwMzEzOSAwMDAwMCBuDQowMDAwMDAzMjUwIDAwMDAwIG4NCjAwMDAwMDMzNjMgMDAwMDAgbg0KMDAwMDAwMzYxMCAwMDAwMCBuDQowMDAwMDA0MTQyIDAwMDAwIG4NCjAwMDAwMDQzOTUgMDAwMDAgbg0KMDAwMDAwNDg3MyAwMDAwMCBuDQowMDAwMDA1NTAyIDAwMDAwIG4NCjAwMDAwMDU5MDcgMDAwMDAgbg0KMDAwMDAwNjI2MyAwMDAwMCBuDQowMDAwMDA2NjAwIDAwMDAwIG4NCjAwMDAwMDY5MjQgMDAwMDAgbg0KMDAwMDAwNzUzNyAwMDAwMCBuDQowMDAwMDA3OTMyIDAwMDAwIG4NCjAwMDAwMDg1NTAgMDAwMDAgbg0KMDAwMDAwOTE3NiAwMDAwMCBuDQowMDAwMDExODI0IDAwMDAwIG4NCjAwMDAwNDExMzQgMDAwMDAgbg0KMDAwMDA2NTYwMSAwMDAwMCBuDQowMDAwMDY1NzE1IDAwMDAwIG4NCjAwMDAwODI4MzcgMDAwMDAgbg0KMDAwMDA4MzA5MSAwMDAwMCBuDQowMDAwMDgzNDg4IDAwMDAwIG4NCjAwMDAwMDA4OTYgMDAwMDAgbg0KdHJh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ics import Calendar | |
import requests | |
url = "https://www.kayaposoft.com/enrico/ics/v2.0?country=nor&fromDate=01-01-2012&toDate=31-12-2028®ion=&holidayType=public_holiday&lang=no" | |
r = requests.get(url) | |
c = Calendar(r.text) | |
d = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POST _xpack/ml/calendars/norsk_standard/events | |
{ "events": [ | |
{"description": "Første nyttårsdag", "start_time": "2012-01-01T00:00:00+00:00", "end_time": "2012-01-02T00:00:00+00:00"}, | |
{"description": "Skjærtorsdag", "start_time": "2012-04-05T00:00:00+00:00", "end_time": "2012-04-06T00:00:00+00:00"}, | |
{"description": "Langfredag", "start_time": "2012-04-06T00:00:00+00:00", "end_time": "2012-04-07T00:00:00+00:00"}, | |
{"description": "Første påskedag", "start_time": "2012-04-08T00:00:00+00:00", "end_time": "2012-04-09T00:00:00+00:00"}, | |
{"description": "Andre påskedag", "start_time": "2012-04-09T00:00:00+00:00", "end_time": "2012-04-10T00:00:00+00:00"}, | |
{"description": "Første mai", "start_time": "2012-05-01T00:00:00+00:00", "end_time": "2012-05-02T00:00:00+00:00"}, | |
{"description": "Kristi himmelfartsdag", "start_time": "2012-05-17T00:00:00+00:00", "end_time": "2012-05-18T00:00:00+00:00"}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%matplotlib inline | |
%load_ext autotime | |
import pandas as pd | |
import numpy as np | |
from IPython.core.interactiveshell import InteractiveShell | |
InteractiveShell.ast_node_interactivity = "all" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%matplotlib inline | |
%load_ext autotime | |
import pandas as pd | |
import numpy as np | |
from IPython.core.interactiveshell import InteractiveShell | |
InteractiveShell.ast_node_interactivity = "all" |
NewerOlder