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 PIL import image | |
import pandas as pd | |
import numpy as np | |
empty_pixel = np.array([255, 255, 255, 0]).reshape(1, 1, -1) | |
# !wget https://github.com/theislab/scanpy/raw/master/docs/_static/img/Scanpy_Logo_RGB.png | |
im = Image.open("./Scanpy_Logo_RGB.png") | |
a = np.array(im) |
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
"""Simple OrderedSet implementation.""" | |
from collections import OrderedDict | |
from collections.abc import MutableSet | |
from functools import reduce | |
from itertools import repeat | |
from operator import or_, sub | |
class OrderedSet(MutableSet): |
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
All benchmarks: | |
before after ratio | |
[4440b90f] [a80db25c] | |
<doc-fix2> <obsp-update> | |
- 2.1052631578947367 1.4814814814814814 0.70 views.SubsetMemorySuite.track_repeated_subset_memratio(100, 100, 'X-csr', 'obs', 'boolarray') | |
- 1.8181818181818181 1.2758620689655173 0.70 views.SubsetMemorySuite.track_repeated_subset_memratio(100, 100, 'X-csr', 'obs', 'intarray') | |
- 0.6666666666666666 0.5 0.75 views.SubsetMemorySuite.track_repeated_subset_memratio(100, 100, 'X-csr', 'obs', 'slice') | |
- 1.9473684210526316 1.375 0.71 views.SubsetMemorySuite.track_repeated_subset_memratio(100, 100, 'X-csr', 'var', 'boolarray') |
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
""" | |
TODO: | |
* Get dates for each state | |
""" | |
from requests_html import HTMLSession | |
import pandas as pd | |
import string |
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
# Attempt at split apply combine for DimensionalData.jl | |
# This does require some bug fixes for various reduction methods on DimensionalArray's I've got on my local branch. | |
# Currently not type stable, but performance still beats pandas + scipy for grouping on a sparse array | |
# It was type stable when I was just grouping over one dimension, but then I hit https://github.com/JuliaLang/julia/issues/29368 | |
# It's quite a fight between being able to preallocate output and having a type-stable function. | |
# Even though I'm only really avoiding high total memory usage by allocating. | |
using SplitApplyCombine | |
using CategoricalArrays | |
using Dictionaries |
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
--- src | |
+++ dst | |
@@ -2612,10 +2612,20 @@ | |
) # /Load | |
id= | |
'C', # str | |
) # /Name | |
) # /Assign | |
+ Return( | |
+ value= |
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
Python 3.7.4 (default, Sep 7 2019, 18:27:02) | |
Type 'copyright', 'credits' or 'license' for more information | |
IPython 7.8.0 -- An enhanced Interactive Python. Type '?' for help. | |
In [1]: import h5py | |
In [2]: import numpy as np | |
In [3]: indices = np.sort(np.random.choice(int(1e7), int(1e4), replace=False)) |
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
Python 3.7.4 (default, Sep 7 2019, 18:27:02) | |
Type 'copyright', 'credits' or 'license' for more information | |
IPython 7.8.0 -- An enhanced Interactive Python. Type '?' for help. | |
In [1]: import h5py | |
In [2]: import numpy as np | |
In [3]: indices = np.sort(np.random.choice(int(1e7), int(1e4), replace=False)) |
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
--------------------------------------------------------------------------- | |
NotImplementedError Traceback (most recent call last) | |
/usr/local/lib/python3.7/site-packages/numba/errors.py in new_error_context(fmt_, *args, **kwargs) | |
661 try: | |
--> 662 yield | |
663 except NumbaError as e: | |
/usr/local/lib/python3.7/site-packages/numba/lowering.py in lower_block(self, block) | |
257 loc=self.loc, errcls_=defaulterrcls): | |
--> 258 self.lower_inst(inst) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.