Skip to content

Instantly share code, notes, and snippets.

Panel
Context
Specify -> Sequence Attributes
Search -> Event Attributes
Select -> Focus
Sequence Attributes
Filter -> Context
Event Attributes
Insert -> Context
Split -> Focus
Panel
Context
Specify -> Sequence Attributes
Second State
Sequence Attributes
Event attributes
@ananis25
ananis25 / pandas_nd_ext.py
Created December 7, 2020 12:45
pandas extension type for n-dim numpy array
"""
This module implements a pandas extension datatype/array wrapping multidim numpy arrays.
The default pandas behavior is to convert it to a numpy array of type `object`, which is
not the most efficient. For ex - an arrow dataset of size 500MB with some multidim arrays
as columns explodes to 3GB. All I want is to filter on other column values, till an arrow
native dataframe library comes along!
Even so, a lot of other libraries require a pandas dataframe as input, so this gives us
efficient conversion.
"""
@ananis25
ananis25 / arrow_metadata.c
Created November 27, 2020 05:14
adding metadata to arrow field using the C API
#include <stdlib.h>
#include <arrow-glib/arrow-glib.h>
int main(int argc, char **argv)
{
int success = EXIT_FAILURE;
GError *error = NULL;
GArrowMemoryMappedInputStream *input;
GArrowRecordBatchFileReader *reader;
@ananis25
ananis25 / oauth_server_github.py
Created October 13, 2019 13:36
asgi app to provide OAuth using Github
import uvicorn
from http.cookies import SimpleCookie
from urllib.parse import parse_qsl
from datasette_auth_github import GitHubAuth, utils
class GitHubAuthProxy(GitHubAuth):
login_path = "/-/login"