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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<title>Sandbox</title> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8"> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"> | |
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script> | |
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script> |
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
# taken from | |
# http://blindvic.blogspot.be/2010/12/frozen-column-example-pyqt4-python3.html | |
# conversion to qtpy, russian comments removal and a few minor improvements done by Gaëtan de Menten | |
# That blog post was itself inspired from | |
# http://python.su/forum/viewtopic.php?id=7346 | |
# see also | |
# http://objexx.com/labs.Efficient-Qt-Frozen-Columns-and-Rows.html | |
# to make it more efficient for large tables |
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
# 1) like others pointed out, you should use a defaultdict in this case | |
# 2) otherwise use setdefault | |
output = {} | |
for element in elements: | |
output.setdefault(element["owner"], []).append(element["pet"]) | |
# 3) if, for some reason, this does not work in your case, use a dict comprehension (if available for your version of Python, 2.7+ I think) | |
output = {e["owner"]: [] for e in elements} | |
for element in elements: |
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
>>> l = [4873.40374783, | |
5821.07686377, | |
5781.99852348, | |
5555.53769711, | |
0.0, | |
0.0, | |
0.0, | |
0.0] | |
>>> a = np.array(l) | |
>>> b = np.empty((8, 2)) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
entities: | |
person: | |
fields: | |
- age: int | |
- gender: bool | |
- test: {type: float, initialdata: false} | |
processes: | |
test: cont_regr(age, mult=0.5, filter=gender) |
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
diff --git a/src_liam/data.py b/src_liam/data.py | |
index 31fe79b..44f11b6 100644 | |
--- a/src_liam/data.py | |
+++ b/src_liam/data.py | |
@@ -35,7 +35,7 @@ def append_carray_to_table(array, table, numlines=None, buffersize=10 * MB): | |
class ColumnArray(object): | |
- def __init__(self, array=None): | |
+ def __init__(self, array=None, default_values=None): |
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
### Eclipse Workspace Patch 1.0 | |
#P liam2 | |
Index: src/alignment.py | |
=================================================================== | |
--- src/alignment.py (revision 960) | |
+++ src/alignment.py (working copy) | |
@@ -2,6 +2,7 @@ | |
from itertools import izip | |
import os |
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 ast | |
from timeit import repeat | |
import threading | |
from ctypes import pythonapi, c_void_p | |
import math | |
import numpy as np | |
try: | |
import numexpr as ne | |
nthreads = ne.ncores |
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 numpy as np | |
from numba import jit, double, autojit, void | |
def func(result, a): | |
for i in range(len(result)): | |
result[i] = a[i] | |
func_nb = jit(void[:](double[:], double[:]))(func) | |
#func_nb = autojit(func) |
NewerOlder