This file contains hidden or 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
""" | |
Weird stuff happens when you define python functions with lots of inputs | |
""" | |
from subprocess import check_call | |
def make_file(N=500, out='tmp.py'): | |
args = ['a_%i' % i for i in range(N)] | |
with open(out, 'w') as outfile: |
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 15 columns, instead of 1 in line 7.
This file contains hidden or 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
time,latitude,longitude,depth,mag,magType,nst,gap,dmin,rms,net,id,updated,place,type | |
2014-09-10T18:28:00.300Z,52.111,178.2967,121.25,5.3,mb,,41,0.964,0.79,us,usb000sb5e,2014-09-10T19:00:35.547Z,"23km NW of Little Sitkin Island, Alaska",earthquake | |
2014-09-10T16:31:59.480Z,-24.6524,179.1728,528.24,5.3,mb,,88,5.254,0.86,us,usb000sb48,2014-09-10T17:19:15.617Z,"South of the Fiji Islands",earthquake | |
2014-09-10T16:01:48.000Z,62.5897,-152.0797,5,4.2,ml,,,,0.78,ak,ak11385482,2014-09-10T16:31:10.413Z,"105km WNW of Talkeetna, Alaska",earthquake | |
2014-09-10T14:52:49.860Z,12.9885,144.6495,51.75,4.8,mb,,105,0.634,0.72,us,usb000sb3j,2014-09-10T19:04:47.878Z,"30km S of Merizo Village, Guam",earthquake | |
2014-09-10T14:08:21.290Z,36.5759,69.037,52.39,4,mb,,71,1.351,0.54,us,usb000sb2c,2014-09-10T15:29:02.360Z,"13km SSW of Khanabad, Afghanistan",earthquake | |
2014-09-10T14:01:01.100Z,-21.4773,169.1454,23.26,5,mb,,64,2.579,0.43,us,usb000sb2b,2014-09-10T15:12:24.204Z,"131km E of Tadine, New Caledonia",earthquake | |
2014-09-10T13:38:46.100Z |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 hidden or 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 astrodendro import Dendrogram, ppv_catalog | |
from astropy.io import fits | |
from astropy import units as u | |
data = fits.getdata('DHT21_Taurus_mom.fits') | |
dg = Dendrogram.compute(data, verbose=True, | |
min_value=0.01, | |
min_delta = 0.005, | |
min_npix = 20) |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
""" | |
This script loads a Brain Tumor DICOM dataset into Glue. | |
The data comes from http://www.osirix-viewer.com/datasets/DATA/BRAINIX.zip | |
To run this locally, download and unzip that file, and run this script | |
from the directory that you dowloaded the ZIP file to | |
This requires the dicom library, which you can install via |
This file contains hidden or 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 astrodendro.analysis import ppv_catalog | |
import numpy as np | |
class TruncatedStructure(object): | |
def __init__(self, parent, value): | |
self._parent = parent | |
self.value = value | |
self.idx = parent.idx |
This file contains hidden or 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 glue import qglue | |
from glue.core.data_factories import panda_process | |
import pandas as pd | |
df = pd.read_csv(...) | |
data = panda_process(df) # convert to Glue data, detect categorical components | |
qglue(data=data) #start ui | |
#alternatively, from the GUI, choose file->open data set, and choose file type=Pandas table |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.