Skip to content

Instantly share code, notes, and snippets.

'''
script to fetch all GCS URIs of diagnostic whole slide images of TCGA SKCM, to copy to your google bucket
'''
from io import StringIO
import json
import pandas as pd
import requests
@grisaitis
grisaitis / tcga_bigquery_tables.ipynb
Created August 25, 2022 15:13
demo of GDC's google buckets with TCGA data, and their BigQuery tables with metadata thereof
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@grisaitis
grisaitis / stackoverflow_question_22381497.ipynb
Created October 12, 2019 18:44
stackoverflow.com/questions/22381497
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@grisaitis
grisaitis / altair.ipynb
Last active August 25, 2022 15:22
altair.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@grisaitis
grisaitis / demo.py
Last active August 25, 2022 15:22
Symbolic differentiation
from symdiff import Term, Polynomial
expression = "4x**3 - x"
polynomial = Polynomial.from_string(expression)
print("Polynomial:", polynomial)
print("Differentiated:", polynomial.differentiate())
@grisaitis
grisaitis / gist:172068ac532e13b46d8289e4838d04a2
Created October 3, 2018 19:19
Create postgres connection in python using `PG*` environment variables
import os
assert os.environ['PGUSER'] != '', os.environ
connection_string = \
'postgresql://{user}:{password}@{host}/{database}'.format(
user=os.environ['PGUSER'],
password=os.environ['PGPASSWORD'],
host=os.environ['PGHOST'],
database=os.environ['PGDATABASE'])
# For a comment on this SO answer: http://stackoverflow.com/a/19726078/781938
import pandas as pd
# create a DataFrame with two columns: 'a' and 'A'
data = pd.DataFrame({'a':[1],'A':[2]})
# print the result
print data
# prints: