repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
xR86/ml-stuff
kaggle/iris/Simple analysis of Iris dataset.ipynb
mit
# analytics libraries installed listed in the kaggle/python docker image: https://github.com/kaggle/docker-python # Input data files are available in the "../input/" directory. #from subprocess import check_output #print(check_output(["ls", "../input"]).decode("utf8")) # Any results you write to the current directory ...
tpin3694/tpin3694.github.io
regex/match_text_between_html_tags.ipynb
mit
# Load regex package import re """ Explanation: Title: Match Text Between HTML Tags Slug: match_text_between_html_tags Summary: Match Text Between HTML Tags Date: 2016-05-01 12:00 Category: Regex Tags: Basics Authors: Chris Albon Based on: Regular Expressions Cookbook Preliminaries End of explanation """ # Create ...
danielgoncalvesti/BIGDATA2017
Atividade02/Lab/Lab1_Rev_Python_Numpy_AlgeLin.ipynb
gpl-3.0
x = 10 # x é um inteiro print type(x) x = 1.3 # x é um ponto flutuante print type(x) x = "Ola" # x é uma string print type(x) x = [1, 5, 10] # x é uma lista print type(x) """ Explanation: Lab 1: Revisão de Conceitos Básicos Nesse notebook revisaremos os conceitos básicos da linguagem de prog...
Mashimo/datascience
01-Regression/prob.ipynb
apache-2.0
import random def genEven(): ''' Returns a random even number x, where 0 <= x < 100 ''' return random.randrange(0,100,2) genEven() def stochasticNumber(): ''' Stochastically generates and returns a uniformly distributed even number between 9 and 21 ''' return random.randrange(10,...
gboeing/urban-data-science
modules/11-supervised-learning/lecture.ipynb
mit
import matplotlib.pyplot as plt import numpy as np import pandas as pd from sklearn.ensemble import RandomForestClassifier from sklearn.linear_model import LogisticRegression, Perceptron from sklearn.metrics import classification_report from sklearn.model_selection import train_test_split from sklearn.naive_bayes impor...
ES-DOC/esdoc-jupyterhub
notebooks/ec-earth-consortium/cmip6/models/ec-earth3-lr/land.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'ec-earth-consortium', 'ec-earth3-lr', 'land') """ Explanation: ES-DOC CMIP6 Model Properties - Land MIP Era: CMIP6 Institute: EC-EARTH-CONSORTIUM Source ID: EC-EARTH3-LR Topic: Land Sub-Topics: ...
LCAV/pyroomacoustics
notebooks/norm_music_demo.ipynb
mit
# imports import pickle import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from scipy.signal import stft from random import uniform, sample from pyroomacoustics import doa, Room, ShoeBox """ Explanation: NormMUSIC Demo The goal of this notebook is to demonstrate the effect of ...
cliburn/sta-663-2017
notebook/18A_Dask.ipynb
mit
! pip install dask import dask import dask.array as da import dask.bag as db import dask.dataframe as dd from dask import delayed """ Explanation: Working with large data sets Small-scale distributed programming Using dask For data sets that are not too big (say up to 1 TB), it is typically sufficient to process on a...
Neuroglycerin/neukrill-net-work
notebooks/tutorials/Training a Maxout CIFAR10-based model.ipynb
mit
!obj:pylearn2.train.Train { dataset: &train !obj:neukrill_net.dense_dataset.DensePNGDataset { settings_path: %(settings_path)s, run_settings: %(run_settings_path)s, training_set_mode: "train" }, model: !obj:pylearn2.models.mlp.MLP { batch_size: &batch_size 128, ...
eds-uga/csci1360e-su17
lectures/L15.ipynb
mit
import matplotlib as mpl import matplotlib.pyplot as plt """ Explanation: Lecture 15: Data Visualization CSCI 1360E: Foundations for Informatics and Analytics Overview and Objectives Data visualization is one of, if not the, most important method of communicating data science results. It's analogous to writing: if you...
gidden/aneris
doc/source/convenience.ipynb
apache-2.0
import matplotlib.pyplot as plt import pandas as pd import aneris.tutorial import aneris.convenience plt.rcParams["figure.figsize"] = (12, 8) """ Explanation: Convenience This is an example of aneris' convenience module. This module doesn't have anywhere near the error checking of aneris' other features, but it does...
timothyb0912/pylogit
examples/notebooks/.ipynb_checkpoints/Main PyLogit Example-checkpoint.ipynb
bsd-3-clause
from collections import OrderedDict # For recording the model specification import pandas as pd # For file input/output import numpy as np # For vectorized math operations import pylogit as pl # For MNL model estimation and ...
mkarakoc/aim
examples/04_AIMpy_spiked_harmonic_oscillator_potentials.ipynb
gpl-3.0
# Python program to use AIM tools from asymptotic import * """ Explanation: ENERGY EIGENVALUES OF SPIKED HARMONIC <br> OSCILLATOR POTENTIALS USING AIMpy CODE M. Karakoc Presented at https://technoscience2020.weebly.com/live-hall.html Reference: ASYMPTOTIC ITERATION METHOD FOR SINGULAR POTENTIALS B. Champion, R. L. Hal...
kit-cel/wt
wt/vorlesung/ch7_9/annulus.ipynb
gpl-2.0
# importing import numpy as np import matplotlib.pyplot as plt import matplotlib # showing figures inline %matplotlib inline # plotting options font = {'size' : 20} plt.rc('font', **font) plt.rc('text', usetex=1) matplotlib.rc('figure', figsize=(18, 6) ) """ Explanation: Content and Objective Show points that ...
dsiufl/2015-Fall-Hadoop
instructor-notes/4-pyspark-example.ipynb
mit
import findspark import os findspark.init('/home/ubuntu/shortcourse/spark-1.5.1-bin-hadoop2.6') from pyspark import SparkContext, SparkConf conf = SparkConf().setAppName("pyspark-example").setMaster("local[2]") sc = SparkContext(conf=conf) """ Explanation: Example: Use pyspark to process GDELT event data GDELT: Globa...
martinjrobins/hobo
examples/toy/model-stochastic-degradation.ipynb
bsd-3-clause
import matplotlib.pyplot as plt import numpy as np import pints import pints.toy """ Explanation: Stochastic degradation model This example shows how the stochastic degradation model can be used. This model describes the stochastic process of a single chemical reaction, in which the concentration of a substance degrad...
datacommonsorg/api-python
notebooks/intro_data_science/Classification_and_Model_Evaluation.ipynb
apache-2.0
""" Install Data Commons API We need to install the Data Commons API, since they don't ship natively with most python installations. In Colab, we'll be installing the Data Commons python and pandas APIs through pip. """ !pip install datacommons --upgrade --quiet !pip install datacommons_pandas --upgrade --quiet ""...
keras-team/keras-io
examples/vision/ipynb/pointnet_segmentation.ipynb
apache-2.0
import os import json import random import numpy as np import pandas as pd from tqdm import tqdm from glob import glob import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers import matplotlib.pyplot as plt """ Explanation: Point cloud segmentation with PointNet Author: Soumik Rakshi...
setiQuest/ML4SETI
tutorials/Step_5c_Convert_TS_to_unit8Dataset_PowerAI.ipynb
apache-2.0
import requests import json #!pip install ibmseti import ibmseti import numpy as np import matplotlib.pyplot as plt %matplotlib inline import tensorflow as tf import os from PIL import Image #!pip install pandas #import pandas as pd import findspark findspark.init() import pyspark import random sc = pyspark.SparkCo...
fcollonval/coursera_data_visualization
RandomForest.ipynb
mit
# Magic command to insert the graph directly in the notebook %matplotlib inline # Load a useful Python libraries for handling data import pandas as pd import numpy as np import statsmodels.formula.api as smf import seaborn as sns import matplotlib.pyplot as plt from IPython.display import Markdown, display, Image from...
jnobre/lxmls-toolkit-2017
lxmls/laboratories/day2/Lxmls_Day2.ipynb
mit
import sys sys.path.append('../../../') import lxmls.readers.simple_sequence as ssr simple = ssr.SimpleSequence() print simple.train print simple.test for sequence in simple.train.seq_list: print sequence for sequence in simple.train.seq_list: print sequence.x, sequence.y """ Explanation: LXMLS 2017 - Day 2...
GoogleCloudPlatform/asl-ml-immersion
notebooks/feature_engineering/labs/4_keras_adv_feat_eng.ipynb
apache-2.0
import datetime import logging import os import matplotlib.pyplot as plt import numpy as np import tensorflow as tf from tensorflow import feature_column as fc from tensorflow.keras import layers, models # set TF error log verbosity logging.getLogger("tensorflow").setLevel(logging.ERROR) print(tf.version.VERSION) "...
Hiteshsaai/BikeShare_DataAnalysis
Bike_Share_Analysis.ipynb
mit
## import all necessary packages and functions. import csv # read and write csv files from datetime import datetime # operations to parse dates from datetime import time from datetime import date import pprint # use to print data structures like dictionaries in # a nicer way than the base pri...
anilcs13m/MachineLearning_Mastering
week-4-ridge-regression-assignment-1-blank.ipynb
gpl-2.0
import graphlab """ Explanation: Regression Week 4: Ridge Regression (interpretation) In this notebook, we will run ridge regression multiple times with different L2 penalties to see which one produces the best fit. We will revisit the example of polynomial regression as a means to see the effect of L2 regularization....
jo-c-2017/DS_Projects
JC_inferential_statistics_ex2.ipynb
apache-2.0
import pandas as pd import numpy as np import math from scipy import stats import matplotlib.pyplot as plt data = pd.io.stata.read_stata('data/us_job_market_discrimination.dta') data.head(5) """ Explanation: Examining Racial Discrimination in the US Job Market Background Racial discrimination continues to be pervasiv...
djfan/yelp-challenge
descriptive_stats/descriptive_statistics.ipynb
mit
{ "business_id":"encrypted business id", "name":"business name", "neighborhood":"hood name", "address":"full address", "city":"city", "state":"state -- if applicable --", "postal code":"postal code", "latitude":latitude, "longitude":longitude, "stars":star rating, ***rounded to h...
probml/pyprobml
notebooks/misc/numpyro_intro.ipynb
mit
import numpy as np np.set_printoptions(precision=3) import matplotlib.pyplot as plt import math # When running in colab pro (high RAM mode), you get 4 CPUs. # But we need to force XLA to use all 4 CPUs # This is generally faster than running in GPU mode import os os.environ["XLA_FLAGS"] = "--xla_force_host_platfor...
yongtang/tensorflow
tensorflow/lite/g3doc/guide/model_analyzer.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under...
SKA-ScienceDataProcessor/crocodile
examples/notebooks/awtowers.ipynb
apache-2.0
%matplotlib inline import sys sys.path.append('../..') from matplotlib import pylab as plt from ipywidgets import interact import itertools import numpy import numpy.linalg import scipy import scipy.special import time import astropy from crocodile.synthesis import * from crocodile.simulate import * from util.visua...
kubeflow/examples
mnist/mnist_azure.ipynb
apache-2.0
import os # This is the Kubernetes namespace into which you installed Kubeflow os.environ['TARGET_NAMESPACE'] = '<your-kubeflow-namespace-name>' # The credentials you obtained from the newly created Service Principal os.environ['AZ_CLIENT_ID'] = '<your-service-principal-client-id>' os.environ['AZ_CLIENT_SECRET'] = '<...
natronics/rust-fc
analysis/results.ipynb
gpl-3.0
import psas_packet from psas_packet.io import BinFile import csv import matplotlib.pyplot as plt from matplotlib import gridspec %matplotlib inline FPS2M = 0.3048 LBF2N = 4.44822 LBS2KG = 0.453592 # Extend PSAS Packet to include our state message psas_packet.messages.MESSAGES["STAT"] = psas_packet.messages.Message({ ...
Rotvig/cs231n
Project/Deep Network Comparison.ipynb
mit
#Load necessary libraries import tensorflow as tf import numpy as np import tensorflow.contrib.slim as slim import input_data import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Deep Neural Network Comparison End of explanation """ def unpickle(file): import cPickle fo = open(file, 'rb') ...
mne-tools/mne-tools.github.io
0.14/_downloads/plot_head_positions.ipynb
bsd-3-clause
# Authors: Eric Larson <larson.eric.d@gmail.com> # # License: BSD (3-clause) from os import path as op import mne print(__doc__) data_path = op.join(mne.datasets.testing.data_path(verbose=True), 'SSS') pos = mne.chpi.read_head_pos(op.join(data_path, 'test_move_anon_raw.pos')) """ Explanation: Visualize subject he...
metpy/MetPy
v0.10/_downloads/395a4944c820661485ef078b05c2140c/Combined_plotting.ipynb
bsd-3-clause
import xarray as xr from metpy.cbook import get_test_data from metpy.plots import ContourPlot, ImagePlot, MapPanel, PanelContainer from metpy.units import units # Use sample NARR data for plotting narr = xr.open_dataset(get_test_data('narr_example.nc', as_file_obj=False)) """ Explanation: Combined Plotting Demonstra...
CLEpy/CLEpy-MotM
Boltons/Boltons.ipynb
mit
# Some imports used in examples import time from datetime import datetime from pprint import pprint """ Explanation: Boltons Like builtins, but boltons. Constructs/recipes/snippets that would be handy in the standard library. Nothing like Michael Bolton. https://boltons.readthedocs.org Boltons is a set of pure-Python ...
phoebe-project/phoebe2-docs
2.0/tutorials/building_a_system.ipynb
gpl-3.0
!pip install -I "phoebe>=2.0,<2.1" """ Explanation: Building a System Setup Let's first make sure we have the latest version of PHOEBE 2.0 installed. (You can comment out this line if you don't use pip for your installation or don't want to update to the latest release). End of explanation """ import phoebe from pho...
metpy/MetPy
v1.0/_downloads/e1a6a28aa03f7e0f88631b525fc7c40d/Hodograph_Inset.ipynb
bsd-3-clause
import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1.inset_locator import inset_axes import pandas as pd import metpy.calc as mpcalc from metpy.cbook import get_test_data from metpy.plots import add_metpy_logo, Hodograph, SkewT from metpy.units import units """ Explanation: Hodograph Inset Layout a Skew-T plo...
EricChiquitoG/Simulacion2017
Modulo1/Clase5_OsciladorAmortiguado.ipynb
mit
# Primero importamos todas las librerias, paquetes y/o funciones que vamos a utlizar import matplotlib.pyplot as plt # ¿Para qué sirve? import numpy as np # ¿Para qué sirve? from scipy.integrate import odeint # Función para integrar EDO vectoriales de primer orden %matplotlib inline ...
dsacademybr/PythonFundamentos
Cap03/Notebooks/DSA-Python-Cap03-02-For.ipynb
gpl-3.0
# Versão da Linguagem Python from platform import python_version print('Versão da Linguagem Python Usada Neste Jupyter Notebook:', python_version()) """ Explanation: <font color='blue'>Data Science Academy - Python Fundamentos - Capítulo 3</font> Download: http://github.com/dsacademybr End of explanation """ # Crian...
google/starthinker
colabs/sa_report.ipynb
apache-2.0
!pip install git+https://github.com/google/starthinker """ Explanation: SA360 Report Move SA360 report to BigQuery. License Copyright 2020 Google LLC, Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License a...
ceos-seo/data_cube_notebooks
notebooks/training/ardc_training/Training_TaskF_DataExport.ipynb
apache-2.0
import datacube import utils.data_cube_utilities.data_access_api as dc_api from datacube.utils.aws import configure_s3_access configure_s3_access(requester_pays=True) api = dc_api.DataAccessApi() dc = datacube.Datacube(app = 'ardc_task_f') api.dc = dc """ Explanation: ARDC Training: Python Notebooks Task-F: Data E...
tpin3694/tpin3694.github.io
python/chain_together_lists.ipynb
mit
from itertools import chain """ Explanation: Title: Chain Together Lists Slug: chain_together_lists Summary: Chain Together Lists Using Python. Date: 2017-02-02 12:00 Category: Python Tags: Basics Authors: Chris Albon Preliminaries End of explanation """ # Create a list of allies allies = ['Spain', 'Germany', 'Nam...
batrlatom/udacityP2
LeNet-Lab-Solution.ipynb
gpl-3.0
from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("MNIST_data/", reshape=False) X_train, y_train = mnist.train.images, mnist.train.labels X_validation, y_validation = mnist.validation.images, mnist.validation.labels X_test, y_test = mnist.test.images, mn...
HarllanAndrye/nilmtk
docs/manual/user_guide/elecmeter_and_metergroup.ipynb
apache-2.0
from matplotlib import rcParams import matplotlib.pyplot as plt %matplotlib inline rcParams['figure.figsize'] = (13, 6) plt.style.use('ggplot') from nilmtk import DataSet redd = DataSet('/data/REDD/redd.h5') elec = redd.buildings[1].elec elec """ Explanation: MeterGroup, ElecMeter, selection and basic statistics All...
iRipVanWinkle/ml
Data Science UA - September 2017/Lecture 04 - Overview of Linear Algebra and Matrix Computations/Linear_Equations.ipynb
mit
import numpy as np import scipy.linalg as la import sys """ Explanation: Systems of Linear Equations In this notebook we leran various functions for solving and manipulating systems of linear equations. Initialization End of explanation """ la? """ Explanation: The main linear algebra routines are contained in scip...
ondrolexa/sg2
14_Simultaneous_deformation.ipynb
mit
%pylab inline from sg2lib import * """ Explanation: Simultaneous deformation End of explanation """ gamma = 1 Sx = 2 Fs = array([[1, gamma], [0, 1]]) Fp = array([[Sx, 0], [0, 1/Sx]]) """ Explanation: Naive concept of simultaneous deformation Here we try to split simple shear and pure shear to several incremental s...
ES-DOC/esdoc-jupyterhub
notebooks/nasa-giss/cmip6/models/sandbox-3/atmos.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'nasa-giss', 'sandbox-3', 'atmos') """ Explanation: ES-DOC CMIP6 Model Properties - Atmos MIP Era: CMIP6 Institute: NASA-GISS Source ID: SANDBOX-3 Topic: Atmos Sub-Topics: Dynamical Core, Radiati...
cliburn/sta-663-2017
homework/02_Working_With_Text_Solutions.ipynb
mit
def encode(s, k): """Caesar cipher encoding with offset k for string s""" import string t = {c: chr(ord('A') + (ord(c) - ord('A') + k) % 26) for c in string.ascii_uppercase} t1 = {c: chr(ord('a') + (ord(c) - ord('a') + k) % 26) for c in string.ascii_lowercase} t.update(t1) ...
phoebe-project/phoebe2-docs
2.3/tutorials/compute_times_phases.ipynb
gpl-3.0
#!pip install -I "phoebe>=2.3,<2.4" """ Explanation: Advanced: compute_times & compute_phases Setup Let's first make sure we have the latest version of PHOEBE 2.3 installed (uncomment this line if running in an online notebook session such as colab). End of explanation """ import phoebe from phoebe import u # units ...
bajorekp/ForexPredictor
GradientBoostingRegressor.ipynb
mit
import pandas as pd import numpy as np import scipy as sp import matplotlib as mpl import matplotlib.pyplot as plt %matplotlib inline import urllib.request # for HTTP requests (web scraping, APIs) from datetime import datetime import os from sklearn.ensemble import GradientBoostingRegressor """ Explanation: Import t...
Neuroglycerin/neukrill-net-work
notebooks/model_run_and_result_analyses/Analyse alexnet_based_extra_convlayer model.ipynb
mit
import pylearn2.utils import pylearn2.config import theano import neukrill_net.dense_dataset import neukrill_net.utils import numpy as np %matplotlib inline import matplotlib.pyplot as plt import holoviews as hl %load_ext holoviews.ipython import sklearn.metrics m = pylearn2.utils.serial.load( "/disk/scratch/neuro...
metpy/MetPy
v0.10/_downloads/951207f2bc1e1100e2784e6132c75710/GINI_Water_Vapor.ipynb
bsd-3-clause
import cartopy.feature as cfeature import matplotlib.pyplot as plt import xarray as xr from metpy.cbook import get_test_data from metpy.io import GiniFile from metpy.plots import add_metpy_logo, add_timestamp, colortables # Open the GINI file from the test data f = GiniFile(get_test_data('WEST-CONUS_4km_WV_20151208_2...
necromuralist/machine_learning_studies
machine_learning/udacity/project_2/student_intervention.ipynb
mit
# Import libraries import numpy import pandas as pd # my imports import matplotlib.pyplot as plot import seaborn from sklearn.cross_validation import train_test_split from sklearn.grid_search import GridSearchCV from sklearn.metrics import f1_score, make_scorer %matplotlib inline # Read student data student_data = p...
rainyear/pytips
Tips/2016-03-30-Date-and-Time.ipynb
mit
from calendar import TextCalendar, HTMLCalendar tc = TextCalendar(firstweekday=6) tc.prmonth(2016, 3) """ Explanation: Python 时间与日期 时间和日期可能涉及到不同的时区、格式,同时又经常需要作为时间戳保存,有时候还需要进行一些加减操作,因此处理起来通常会因为方法太多而无从下手。Python 中与时间和日期相关的标准库有3个:time、datetime 和 calendar。其中 time 模块更偏向于系统相关的时间数据,最常用的可能就是获取当前时间的秒数 time.time(),此外该模块中的很多方法都是...
schaber/deep-learning
image-classification/dlnd_image_classification.ipynb
mit
""" DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE """ from urllib.request import urlretrieve from os.path import isfile, isdir from tqdm import tqdm import problem_unittests as tests import tarfile cifar10_dataset_folder_path = 'cifar-10-batches-py' # Use Floyd's cifar-10 dataset if present floyd_cifar10...
fazzolini/fast_ai
deeplearning1/nbs/lesson1_old.ipynb
apache-2.0
%matplotlib inline """ Explanation: Using Convolutional Neural Networks Welcome to the first week of the first deep learning certificate! We're going to use convolutional neural networks (CNNs) to allow our computer to see - something that is only possible thanks to deep learning. Introduction to this week's task: 'Do...
ES-DOC/esdoc-jupyterhub
notebooks/dwd/cmip6/models/sandbox-3/toplevel.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'dwd', 'sandbox-3', 'toplevel') """ Explanation: ES-DOC CMIP6 Model Properties - Toplevel MIP Era: CMIP6 Institute: DWD Source ID: SANDBOX-3 Sub-Topics: Radiative Forcings. Properties: 85 (42 re...
mtasende/Machine-Learning-Nanodegree-Capstone
notebooks/dev/n01_first_look_at_the_data.ipynb
mit
import os import pandas as pd import matplotlib.pyplot as plt import numpy as np import datetime as dt import scipy.optimize as spo import sys %matplotlib inline %pylab inline pylab.rcParams['figure.figsize'] = (20.0, 10.0) %load_ext autoreload %autoreload 2 sys.path.append('../../') data_df = pd.read_pickle('../....
poldrack/fmri-analysis-vm
analysis/firstlevel/FirstLevelModeling.ipynb
mit
import nipype.algorithms.modelgen as model # model generation from nipype.interfaces import fsl, ants from nipype.interfaces.base import Bunch import os,json,glob,sys import numpy import nibabel import nilearn.plotting sys.path.append('../utils/') from compute_fd_dvars import compute_fd,compute_dvars from mak...
gogartom/caffe-textmaps
examples/hdf5_classification.ipynb
mit
import numpy as np import pandas as pd import matplotlib.pyplot as plt %matplotlib inline # Make sure that caffe is on the python path: caffe_root = '../' # this file is expected to be in {caffe_root}/examples import sys sys.path.insert(0, caffe_root + 'python') import caffe import os import h5py import shutil impo...
sujitpal/polydlot
src/keras/04-mnist-rnn.ipynb
apache-2.0
from __future__ import division, print_function from keras.callbacks import ModelCheckpoint from keras.layers.recurrent import LSTM from keras.layers.core import Dense, Dropout from keras.models import Model, Sequential, load_model from keras.utils import np_utils from sklearn.metrics import accuracy_score, confusion_m...
ES-DOC/esdoc-jupyterhub
notebooks/cnrm-cerfacs/cmip6/models/sandbox-1/atmoschem.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'cnrm-cerfacs', 'sandbox-1', 'atmoschem') """ Explanation: ES-DOC CMIP6 Model Properties - Atmoschem MIP Era: CMIP6 Institute: CNRM-CERFACS Source ID: SANDBOX-1 Topic: Atmoschem Sub-Topics: Trans...
turbomanage/training-data-analyst
courses/machine_learning/deepdive/09_sequence/reusable-embeddings.ipynb
apache-2.0
!sudo pip3 install -q tensorflow-hub==0.4.0 !sudo pip3 install -q --upgrade tensorflow==1.15.0 """ Explanation: <h1>Using pre-trained embeddings with TensorFlow Hub</h1> This notebook illustrates: <ol> <li>How to instantiate a TensorFlow Hub module</li> <li>How to find pre-trained TensorFlow Hub modules for a...
akchinSTC/systemml
scripts/nn/examples/Example - MNIST LeNet.ipynb
apache-2.0
# Create a SystemML MLContext object from systemml import MLContext, dml ml = MLContext(sc) """ Explanation: Quick Setup End of explanation """ %%sh mkdir -p data/mnist/ cd data/mnist/ curl -O https://pjreddie.com/media/files/mnist_train.csv curl -O https://pjreddie.com/media/files/mnist_test.csv """ Explanation: D...
jorisvandenbossche/DS-python-data-analysis
notebooks/pandas_05_groupby_operations.ipynb
bsd-3-clause
import pandas as pd import numpy as np import matplotlib.pyplot as plt plt.style.use('seaborn-whitegrid') """ Explanation: <p><font size="6"><b>06 - Pandas: "Group by" operations</b></font></p> © 2021, Joris Van den Bossche and Stijn Van Hoey (&#106;&#111;&#114;&#105;&#115;&#118;&#97;&#110;&#100;&#101;&#110;&#98;&#...
geodocker/geodocker-jupyter-geopyspark
notebooks/Park citing.ipynb
apache-2.0
import geopyspark as gps import fiona from pyspark import SparkContext, StorageLevel from shapely.geometry import MultiPoint, MultiPolygon, shape import folium """ Explanation: Finding the Optimal Location for a New Park This example notebook will show how to find the next potential location for a new park in San Fr...
IS-ENES-Data/submission_forms
dkrz_forms/Templates/Forms/Doc/Workflow_Form_Overview.ipynb
apache-2.0
## the following libraries are needed to interact with ## json based form submissions from dkrz_forms import form_handler, utils, checks,wflow_handler from datetime import datetime ## info_file = "path to json file" info_file = "../Forms/../xxx.json" # load json file and convert to Form object for simple updating m...
metpy/MetPy
v0.7/_downloads/Point_Interpolation.ipynb
bsd-3-clause
import cartopy import cartopy.crs as ccrs from matplotlib.colors import BoundaryNorm import matplotlib.pyplot as plt import numpy as np from metpy.cbook import get_test_data from metpy.gridding.gridding_functions import (interpolate, remove_nan_observations, remove_repeat...
KshitijT/fundamentals_of_interferometry
3_Positional_Astronomy/3_4_direction_cosine_coordinates.ipynb
gpl-2.0
import numpy as np import matplotlib.pyplot as plt %matplotlib inline from IPython.display import HTML HTML('../style/course.css') #apply general CSS """ Explanation: Outline Glossary Positional Astronomy Previous: 3.3 Horizontal Coordinates (ALT/AZ) Next: 3.x Further Reading and References Import standard mo...
ES-DOC/esdoc-jupyterhub
notebooks/csir-csiro/cmip6/models/sandbox-3/toplevel.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'csir-csiro', 'sandbox-3', 'toplevel') """ Explanation: ES-DOC CMIP6 Model Properties - Toplevel MIP Era: CMIP6 Institute: CSIR-CSIRO Source ID: SANDBOX-3 Sub-Topics: Radiative Forcings. Propert...
gtzan/mir_book
ConditionalProbabilities.ipynb
cc0-1.0
%matplotlib inline import matplotlib.pyplot as plt from scipy import stats import numpy as np class Random_Variable: def __init__(self, name, values, probability_distribution): self.name = name self.values = values self.probability_distribution = probability_distribution ...
PmagPy/2017_MagIC_Workshop_PmagPy_Tutorial
Jupyter_notebook_introduction.ipynb
bsd-3-clause
print('hello, world.') """ Explanation: Jupyter notebook tutorial introduction The goal of this short tutorial is to introduce some of the basics of using a Jupyter notebook. Looking at the official Jupyter documentation can also be helpful. Some materials in this tutorial were modified from materials of the Caltech c...
amitkaps/full-stack-data-science
credit-risk/notebooks/1-ML-Model.ipynb
mit
#Load the libraries import numpy as np import pandas as pd import matplotlib.pyplot as plt #Default Variables %matplotlib inline plt.rcParams['figure.figsize'] = (8,6) plt.style.use('ggplot') pd.set_option('display.float_format', lambda x: '%.2f' % x) #Load the training dataset df = pd.read_csv("../data/historical_lo...
tensorflow/docs
site/en/r1/tutorials/non-ml/pdes.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under...
ledatelescope/bifrost
BifrostDemo.ipynb
bsd-3-clause
# @title Install C++ deps %%shell sudo apt-get -qq install exuberant-ctags libopenblas-dev software-properties-common build-essential # @title Install python deps %%shell pip install -q contextlib2 pint simplejson ctypesgen==1.0.2 # @title Build and Install Bifrost %%shell cd "${HOME}" if [ -d "${HOME}/bifrost_repo...
sraejones/phys202-2015-work
assignments/assignment07/AlgorithmsEx01.ipynb
mit
%matplotlib inline from matplotlib import pyplot as plt import numpy as np """ Explanation: Algorithms Exercise 1 Imports End of explanation """ def tokenize(s, stop_words= None, punctuation='`~!@#$%^&*()_-+={[}]|\:;"<,>.?/}\t'): """Split a string into a list of words, removing punctuation and stop words.""" ...
ireapps/cfj-2017
exercises/13. Web scraping (Part 3)-working.ipynb
mit
# use the `get()` method to fetch a copy of the IRE home page # feed the text of the web page to a BeautifulSoup object """ Explanation: Let's scrape the IRE homepage Our goal: Print out the headlines from the IRE home page. requests is a handy third-party library for making HTTP requests. It does the same thing yo...
ajgpitch/qutip-notebooks
examples/qip-processor-DJ-algorithm.ipynb
lgpl-3.0
import numpy as np from qutip.qip.device import OptPulseProcessor, LinearSpinChain from qutip.qip.circuit import QubitCircuit from qutip.operators import sigmaz, sigmax, identity from qutip.tensor import tensor from qutip.states import basis from qutip.qobj import ptrace basis00 = tensor([basis(2,0), basis(2,0)]) qc =...
alasdairtran/mclearn
projects/david/lab/test_accpm_toy.ipynb
bsd-3-clause
import numpy as np import pandas as pd import accpm %load_ext autoreload %autoreload 1 %aimport accpm """ Explanation: Computation of cutting planes: example 1 The set-up End of explanation """ def funcobj(x): return (x[0]-5)**2 + (x[1]-5)**2 def func0(x): return x[0] - 20 def func1(x): return -x[0...
AllenDowney/ThinkBayes2
examples/sister.ipynb
mit
import pandas as pd qs = [(2, 0), (1, 1), (0, 2), (3, 0), (2, 1), (1, 2), (0, 3), (4, 0), (3, 1), (2, 2), (1, 3), (0, 4), ] index = pd.MultiIndex.from_tuples(qs, names=['Boys', 'Girls']) """ Explanation: The Left Handed Sister Problem Think Bayes, ...
tensorflow/docs-l10n
site/en-snapshot/io/tutorials/dicom.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under...
jay-johnson/sci-pype
red10/Red10-IRIS-Predictions.ipynb
apache-2.0
from __future__ import print_function import sys, os, requests, json, datetime # Load the environment and login the user from src.common.load_redten_ipython_env import user_token, user_login, csv_file, run_job, core, api_urls, ppj, rt_url, rt_user, rt_pass, rt_email, lg, good, boom, anmt, mark, ppj, uni_key, rest_logi...
ocarneiro/twitter-reach
TwitterReach.ipynb
apache-2.0
import tweepy """ Explanation: The Reach of a Tweet What are we doing? Have you ever guessed how many people could see a tweet that has been retweeted by a lot of people? Could you find it out using python and Twitter API? Let's do it! Which tweet are we looking at? My latest tweet received a ton more attention than a...
pastas/pasta
examples/notebooks/03_diagnostic_checking.ipynb
mit
import numpy as np import pandas as pd import pastas as ps from scipy import stats import matplotlib.pyplot as plt ps.set_log_level("ERROR") ps.show_versions(numba=True) """ Explanation: Model Diagnostic Checking R.A. Collenteur, University of Graz, July 2020. This notebook provides an overview of the different metho...
tensorflow/docs-l10n
site/ko/model_optimization/guide/pruning/pruning_with_keras.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under...
phoebe-project/phoebe2-docs
2.1/examples/legacy.ipynb
gpl-3.0
!pip install -I "phoebe>=2.1,<2.2" """ Explanation: Comparing PHOEBE 2 vs PHOEBE Legacy NOTE: PHOEBE 1.0 legacy is an alternate backend and is not installed with PHOEBE 2.0. In order to run this backend, you'll need to have PHOEBE 1.0 installed and manually build the python bindings in the phoebe-py directory. Setup ...
google-research/neural-structural-optimization
notebooks/optimization-examples.ipynb
apache-2.0
# Install dependencies with pip. Only run this once. ! pip install -q tf-nightly git+https://github.com/google-research/neural-structural-optimization.git # Copyright 2019 Google LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. ...
lmoresi/UoM-VIEPS-Intro-to-Python
Notebooks/SphericalMeshing/CartesianTriangulations/Ex1-Cartesian-Triangulations.ipynb
mit
import stripy as stripy import numpy as np # Vertices of a square mesh vertices_xy = np.array([[0.0, 0.0], [1.0, 0.0], [0.0, 1.0], [1.0, 1.0]]) vertices_x = vertices_xy.T[0] vertices_y = vertices_xy.T[1] triangulation = stripy.Triangu...
AndreySheka/dl_ekb
hw3/HW3_main.ipynb
mit
%matplotlib inline from time import time, sleep import numpy as np import matplotlib.pyplot as plt from IPython import display """ Explanation: Home work 3: Basic Artificial Neural Networks The goal of this homework is simple, yet an actual implementation may take some time :). We are going to write an Artificial Neur...
tensorflow/docs
site/en/tutorials/customization/basics.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under...
keras-team/keras-io
examples/generative/ipynb/deep_dream.ipynb
apache-2.0
import numpy as np import tensorflow as tf from tensorflow import keras from tensorflow.keras.applications import inception_v3 base_image_path = keras.utils.get_file("sky.jpg", "https://i.imgur.com/aGBdQyK.jpg") result_prefix = "sky_dream" # These are the names of the layers # for which we try to maximize activation,...
matthiaskoenig/sbmlutils
docs/presentations/harmony2017/sbmlutils-HARMONY2017-flash-talk.ipynb
lgpl-3.0
from sbmlutils.report import sbmlreport sbmlreport.create_sbml_report('./examples/glucose/Hepatic_glucose_3.xml', out_dir='./examples/glucose', validate=True) """ Explanation: <img alt="sbmlutils logo" src="./images/sbmlutils-logo-small.png" style="height: 60px;" /> sbmlutils: Python uti...
ES-DOC/esdoc-jupyterhub
notebooks/mpi-m/cmip6/models/icon-esm-lr/seaice.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'mpi-m', 'icon-esm-lr', 'seaice') """ Explanation: ES-DOC CMIP6 Model Properties - Seaice MIP Era: CMIP6 Institute: MPI-M Source ID: ICON-ESM-LR Topic: Seaice Sub-Topics: Dynamics, Thermodynamics...
metpy/MetPy
v0.8/_downloads/Find_Natural_Neighbors_Verification.ipynb
bsd-3-clause
import matplotlib.pyplot as plt import numpy as np from scipy.spatial import Delaunay from metpy.gridding.triangles import find_natural_neighbors # Create test observations, test points, and plot the triangulation and points. gx, gy = np.meshgrid(np.arange(0, 20, 4), np.arange(0, 20, 4)) pts = np.vstack([gx.ravel(), ...
phobson/statsmodels
examples/notebooks/statespace_cycles.ipynb
bsd-3-clause
%matplotlib inline import numpy as np import pandas as pd import statsmodels.api as sm import matplotlib.pyplot as plt from pandas.io.data import DataReader endog = DataReader('UNRATE', 'fred', start='1954-01-01') """ Explanation: Trends and cycles in unemployment Here we consider three methods for separating a tren...
hungiyang/StatisticalMethods
notes/LMreview4.ipynb
gpl-2.0
import numpy as np import matplotlib.pyplot as plt %matplotlib inline plt.rcParams['figure.figsize'] = (8.0, 8.0) # the model parameters a = np.pi b = 1.6818 # my arbitrary constants mu_x = np.exp(1.0) # see definitions above tau_x = 1.0 s = 1.0 N = 50 # number of data points # get some x's and y's x = mu_x + tau_x...
quantopian/research_public
notebooks/data/zacks.broker_ratings/notebook.ipynb
apache-2.0
# import the free sample of the dataset from quantopian.interactive.data.zacks import broker_ratings as dataset # import data operations from odo import odo # import other libraries we will use import pandas as pd import matplotlib.pyplot as plt # Let's use blaze to understand the data a bit using Blaze dshape() data...
sdss/marvin
docs/sphinx/jupyter/dap_maps.ipynb
bsd-3-clause
# import the maps from marvin.tools.maps import Maps # Load a MPL-5 map mapfile = '/Users/Brian/Work/Manga/analysis/v2_0_1/2.0.2/SPX-GAU-MILESHC/8485/1901/manga-8485-1901-MAPS-SPX-GAU-MILESHC.fits.gz' # Let's get a default map of maps = Maps(filename=mapfile) print(maps) """ Explanation: Marvin Maps Marvin Maps is h...
jdsanch1/SimRC
02. Parte 2/15. Clase 15/.ipynb_checkpoints/11Class NB-checkpoint.ipynb
mit
#importar los paquetes que se van a usar import pandas as pd import numpy as np import datetime from datetime import datetime import scipy.stats as stats import scipy as sp import matplotlib.pyplot as plt import seaborn as sns import sklearn.covariance as skcov import cvxopt as opt from cvxopt import blas, solvers solv...
transcranial/keras-js
notebooks/layers/recurrent/LSTM.ipynb
mit
data_in_shape = (3, 6) rnn = LSTM(4, activation='tanh', recurrent_activation='hard_sigmoid') layer_0 = Input(shape=data_in_shape) layer_1 = rnn(layer_0) model = Model(inputs=layer_0, outputs=layer_1) # set weights to random (use seed for reproducibility) weights = [] for i, w in enumerate(model.get_weights()): np...