repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
alexmojaki/flower
docs/api.ipynb
bsd-3-clause
from celery import Celery from time import sleep celery = Celery() celery.config_from_object({ 'BROKER_URL': 'amqp://localhost', 'CELERY_RESULT_BACKEND': 'amqp://', 'CELERYD_POOL_RESTARTS': True, # Required for /worker/pool/restart API }) @celery.task def add(x, y): return x + y @celery.task def s...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive/05_artandscience/b_hyperparam.ipynb
apache-2.0
!sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst # Ensure the right version of Tensorflow is installed. !pip freeze | grep tensorflow==2.5 import os PROJECT = 'cloud-training-demos' # REPLACE WITH YOUR PROJECT ID BUCKET = 'cloud-training-demos-ml' # REPLACE WITH YOUR BUCKET NAME REGION = 'us-central...
lilleswing/deepchem
examples/tutorials/14_Modeling_Protein_Ligand_Interactions_With_Atomic_Convolutions.ipynb
mit
!curl -Lo conda_installer.py https://raw.githubusercontent.com/deepchem/deepchem/master/scripts/colab_install.py import conda_installer conda_installer.install() !/root/miniconda/bin/conda info -e !pip install --pre deepchem import deepchem deepchem.__version__ import deepchem as dc import os from deepchem.utils impo...
flowmatters/veneer-py
doc/training/7_Parallel_Processing_and_Veneer_Command_Line.ipynb
isc
from veneer.manage import create_command_line help(create_command_line) veneer_install = 'D:\\src\\projects\\Veneer\\Compiled\\Source 4.1.1.4484 (public version)' source_version = '4.1.1' cmd_directory = 'E:\\temp\\veneer_cmd' veneer_cmd = create_command_line(veneer_install,source_version,dest=cmd_directory) veneer_c...
jmhsi/justin_tinker
data_science/courses/learning_dl_packages/models/research/syntaxnet/examples/dragnn/interactive_text_analyzer.ipynb
apache-2.0
def _parse_tree_explorer(): # put stuff in a function to not pollute global scope text = widgets.Text("John is eating pizza with anchovies") # Also try: John is eating pizza with a fork display.display(text) html = widgets.HTML() display.display(html) def handle_submit(sender): del sen...
tensorflow/docs
site/en/tutorials/generative/autoencoder.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...
darioizzo/optimal_landing
examples/2 - Training.ipynb
lgpl-3.0
import matplotlib.pyplot as plt %matplotlib inline import sys sys.path.append('..') import numpy as np import deep_control as dc """ Explanation: Training deep neural networks @cesans End of explanation """ # The time column is automatically discarded # For free landing we drop the 'x' column col_names = ['t', '...
TUW-GEO/pygeogrids
docs/examples/subsetting_grid_objects_with_shape_files.ipynb
mit
import pygeogrids.grids as grids import pygeogrids.shapefile as shapefile import numpy as np import os testgrid = grids.genreg_grid(0.1, 0.1) """ Explanation: Subsetting grids using shapefiles. End of explanation """ austria = shapefile.get_gad_grid_points( testgrid, os.path.join('/home', os.environ['USER'], 'D...
ES-DOC/esdoc-jupyterhub
notebooks/nasa-giss/cmip6/models/giss-e2-1h/seaice.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'nasa-giss', 'giss-e2-1h', 'seaice') """ Explanation: ES-DOC CMIP6 Model Properties - Seaice MIP Era: CMIP6 Institute: NASA-GISS Source ID: GISS-E2-1H Topic: Seaice Sub-Topics: Dynamics, Thermody...
Ccaccia73/NLAAS-Labs
lab02_membrane.ipynb
mit
import FEM_utilities as FEM """ Explanation: Module for computations End of explanation """ a = 1000. # lenght [mm] b = 200. # width [mm] t = 1.5 # thickness [mm] """ Explanation: Parameters: End of explanation """ nx = 40 ny = 8 nodes, elements, fixed, loaded = FEM.Nodes(nx, ny, a, b) #nodes #elements #...
pybel/pybel-notebooks
algorithms/Generating Candidate Mechanisms.ipynb
apache-2.0
import logging import itertools as itt import os import time from collections import defaultdict from operator import itemgetter import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from matplotlib_venn import venn2 import pybel import pybel_tools as pbt from pybel.canonicalize...
XinyiGong/pymks
notebooks/stress_homogenization_2D.ipynb
mit
%matplotlib inline %load_ext autoreload %autoreload 2 import numpy as np import matplotlib.pyplot as plt """ Explanation: Effective Stiffness Introduction This example uses the MKSHomogenizationModel to create a homogenization linkage for the effective stiffness. This example starts with a brief background of the ho...
eneskemalergin/OldBlog
_oldnotebooks/Biology_with_Python.ipynb
mit
# Here is the genetic code of the amino acids defined as dictionaries STANDARD_GENETIC_CODE = {'UUU':'Phe', 'UUC':'Phe', 'UCU':'Ser', 'UCC':'Ser', 'UAU':'Tyr', 'UAC':'Tyr', 'UGU':'Cys', 'UGC':'Cys', 'UUA':'Leu', 'UCA':'Ser', 'UAA':None, 'UGA':None, ...
YuriyGuts/kaggle-quora-question-pairs
notebooks/preproc-nn-sequences-fasttext.ipynb
mit
from pygoose import * from gensim.models.wrappers.fasttext import FastText """ Explanation: Preprocessing: FastText Sequences & Embeddings Based on the tokenized questions and a pre-built word embedding database, build fixed-length (padded) sequences of word indices for each question, as well as a lookup matrix that ...
ellamil/bubblepopper
bubblepopper_4recommendations.ipynb
mit
from bubble_popper_model import twitter_profile,twitter_links,twitter_articles from bubble_popper_model import clean_articles,article_topics,publication_scores from bubble_popper_model import define_bubble,burst_bubble import tweepy from sqlalchemy import create_engine from sqlalchemy_utils import database_exists, cre...
jve2kor/machine-learning-nanodegree
projects/titanic_survival_exploration/titanic_survival_exploration.ipynb
gpl-3.0
# Import libraries necessary for this project import numpy as np import pandas as pd from IPython.display import display # Allows the use of display() for DataFrames # Import supplementary visualizations code visuals.py import visuals as vs # Pretty display for notebooks %matplotlib inline # Load the dataset in_file...
SJSlavin/phys202-2015-work
assignments/assignment10/ODEsEx01.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np import seaborn as sns from scipy.integrate import odeint from IPython.html.widgets import interact, fixed """ Explanation: Ordinary Differential Equations Exercise 1 Imports End of explanation """ def solve_euler(derivs, y0, x): """Solve a 1d ...
HUDataScience/StatisticalMethods2016
notebooks/GlobalWarming.ipynb
apache-2.0
# == Basic import == # # plot within the notebook %matplotlib inline # No annoying warnings import warnings warnings.filterwarnings('ignore') import numpy as np """ Explanation: Correction Python part of the Exo3: Exercise 3 — Global Warming Get the data in the “BerkeleyEarth GlobalLandTemperature.dat” from the gith...
FZJ-IEK3-VSA/tsam
examples/aggregation_segment_period_animation.ipynb
mit
%load_ext autoreload %autoreload 2 import copy import os import pandas as pd import matplotlib.pyplot as plt import tsam.timeseriesaggregation as tsam import tsam.hyperparametertuning as tune import tqdm import numpy as np from matplotlib.animation import FuncAnimation %matplotlib inline import matplotlib import subpro...
google/learned_optimization
docs/notebooks/Part6_custom_learned_optimizers.ipynb
apache-2.0
import flax from typing import Any import jax.numpy as jnp import jax from learned_optimization.learned_optimizers import base as lopt_base from learned_optimization.optimizers import base as opt_base """ Explanation: Part 6: Custom learned optimizer architectures In Part 1 we introduced the LearnedOptimizer abstract...
wmfschneider/CHE30324
Resources/Python_Tutorial.ipynb
gpl-3.0
import numpy as np #handles arrays of values similar to MATLAB from scipy import linalg #contains certain operators you may need for class import matplotlib.pyplot as plt #contains everything you need to create plots import sympy as sy from sympy.functions import ln import math """ Explanatio...
NEONScience/NEON-Data-Skills
tutorials/Python/Hyperspectral/intro-hyperspectral/Intro_NEON_AOP_HDF5_Reflectance_Tiles_py/Intro_NEON_AOP_HDF5_Reflectance_Tiles_py.ipynb
agpl-3.0
import numpy as np import h5py import gdal, osr, os import matplotlib.pyplot as plt """ Explanation: syncID: 61ad1fc43ddd45b49cad1bca48656bbe title: "NEON AOP Hyperspectral Data in HDF5 format with Python - Tiled Data" description: "Learn how to read NEON AOP hyperspectral flightline data using Python and develop ski...
Alexoner/skynet
notebooks/FullyConnectedNets.ipynb
mit
# As usual, a bit of setup import time import numpy as np import matplotlib.pyplot as plt from skynet.neural_network.classifiers.fc_net import * from skynet.utils.data_utils import get_CIFAR10_data from skynet.utils.gradient_check import eval_numerical_gradient, eval_numerical_gradient_array from skynet.solvers.solver...
GoogleCloudPlatform/vertex-ai-samples
notebooks/community/migration/UJ15 AutoML for vision with Vertex AI Video Object Tracking.ipynb
apache-2.0
! pip3 install -U google-cloud-aiplatform --user """ Explanation: Vertex SDK: AutoML video object tracking model Installation Install the latest (preview) version of Vertex SDK. End of explanation """ ! pip3 install google-cloud-storage """ Explanation: Install the Google cloud-storage library as well. End of expla...
phoebe-project/phoebe2-docs
2.2/examples/single_spots.ipynb
gpl-3.0
!pip install -I "phoebe>=2.2,<2.3" """ Explanation: Single Star with Spots Setup Let's first make sure we have the latest version of PHOEBE 2.2 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 fro...
wmvanvliet/neuroscience_tutorials
eeg-erp/beginner.ipynb
bsd-2-clause
x = 1 y = 2 z = x + y z * 3 """ Explanation: <img src="images/charmander.png" alt="Beginner" width="200"> <img src="images/coffee_machine.jpeg" width="300" style="float: right; margin-top: 30px"> Introduction to programming Welcome! Our goal in this module will be to let you have a taste of what programming is like. I...
apryor6/apryor6.github.io
visualizations/seaborn/.ipynb_checkpoints/countplot-checkpoint.ipynb
mit
%matplotlib inline import pandas as pd import matplotlib.pyplot as plt import seaborn as sns plt.rcParams['figure.figsize'] = (20.0, 10.0) plt.rcParams['font.family'] = "serif" df = pd.read_csv('../../datasets/movie_metadata.csv') df.head() """ Explanation: seaborn.countplot Bar graphs are useful for displaying rel...
igabr/Metis_Projects_Chicago_2017
03-Project-McNulty/Random_Forest_Parameter_Tuning.ipynb
mit
%matplotlib inline import pickle %run helper_functions.py %run s3.py %run show_cnf_mtx.py pd.options.display.max_columns = 1000 plt.rcParams["figure.figsize"] = (15,10) from datetime import datetime from sklearn.ensemble import RandomForestClassifier from sklearn.model_selection import GridSearchCV, StratifiedKFold, t...
rbiswas4/TimingComparisons
timers/UnderstandingTimeitOutputs.ipynb
mit
from __future__ import absolute_import, print_function, division import timeit import time import numpy as np import pandas import functools """ Explanation: Understanding outputs of Timeit in python The objective of this notebook is to set up some examples to understand the output of timeit and work towards havin...
Upward-Spiral-Science/claritycontrol
rough/HW6.ipynb
apache-2.0
# change working dir path = "/Users/albertlee/claritycontrol/code/scripts" # use your own path import os os.chdir(path) import numpy as np import matplotlib.pyplot as plt import os import csv import igraph as ig %matplotlib inline # Initializing dataset names dnames = list(['../data/hist']) print "Dataset: " + ", "...
Erotemic/ubelt
docs/notebooks/Ubelt Demo.ipynb
apache-2.0
import math import ubelt as ub timer = ub.Timer('Timer demo!', verbose=1) with timer: math.factorial(100000) """ Explanation: Timing Quickly time a single line. End of explanation """ import ubelt as ub import math for n in ub.ProgIter(range(7500)): math.factorial(n) import ubelt as ub import math for n in...
opesci/devito
examples/seismic/tutorials/02_rtm.ipynb
mit
import numpy as np %matplotlib inline from devito import configuration configuration['log-level'] = 'WARNING' """ Explanation: 02 - Reverse Time Migration This notebook is the second in a series of tutorial highlighting various aspects of seismic inversion based on Devito operators. In this second example we aim to h...
NikitaLoik/machineLearning_andrewNg
notebooks/4_neural_networks_II.ipynb
mit
file_path = '../course_materials/ex4data1.mat' data = loadmat(file_path) eights_file_path = '../course_materials/ex4weights.mat' weights = loadmat(eights_file_path) print(weights['Theta1'].shape) print(weights['Theta2'].shape) print(type(weights)) """ Explanation: 0 Data Structure End of explanation """ def get_data...
tensorflow/docs
site/en/guide/effective_tf2.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...
GPflow/GPflowOpt
doc/source/notebooks/constrained_bo.ipynb
apache-2.0
%matplotlib inline import matplotlib.pyplot as plt import gpflow import gpflowopt import numpy as np """ Explanation: Bayesian Optimization with black-box constraints Joachim van der Herten Introduction This notebook demonstrates the optimization of an analytical function using the well known Expected Improvement (EI...
peastman/deepchem
examples/tutorials/Introduction_to_Graph_Convolutions.ipynb
mit
!pip install --pre deepchem """ Explanation: Introduction to Graph Convolutions In this tutorial we will learn more about "graph convolutions." These are one of the most powerful deep learning tools for working with molecular data. The reason for this is that molecules can be naturally viewed as graphs. Note how stan...
royalosyin/Python-Practical-Application-on-Climate-Variability-Studies
ex17-EOF analysis global hgt500.ipynb
mit
% matplotlib inline import numpy as np from scipy import signal import numpy.polynomial.polynomial as poly from netCDF4 import Dataset import matplotlib.pyplot as plt from mpl_toolkits.basemap import Basemap from eofs.standard import Eof """ Explanation: EOF analysis - global hgt500 In statistics and signal processi...
Dharamsitejas/E4571-Personalisation-Theory-Project
Part2/analysis/feature_extraction_from_api.ipynb
mit
import requests from goodreads import client import pandas as pd # This this is the URL prefix common for each record url_prefix = 'https://www.goodreads.com/book/isbn_to_id/0441172717,0739467352?key=' # Setting up the GoodReads API client file = open('goodreads_credentials') key , secret = [element.strip() for el...
zingale/hydro_examples
compressible/euler-conserved.ipynb
bsd-3-clause
from sympy.abc import rho rho, u, c = symbols('rho u c') A = Matrix([[u, rho, 0], [0, u, rho**-1], [0, c**2 * rho, u]]) A """ Explanation: Euler Equations The Euler equations in primitive variable form, $q = (\rho, u, p)^\intercal$ appear as: $$q_t + A(q) q_x = 0$$ with the matrix $A(q)$: $$A(q) = \left ( \begin{arra...
manoharan-lab/structural-color
tutorial.ipynb
gpl-3.0
import structcol # or import structcol as sc """ Explanation: Tutorial for the structural-color python package Copyright 2016, Vinothan N. Manoharan, Victoria Hwang. This file is part of the structural-color python package. This package is free software: you can redistribute it and/or modify it under the terms of th...
gagneurlab/concise
nbs/spline_transformation.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt from concise.utils.splines import BSpline from concise.preprocessing import EncodeSplines # uses BSpline def plot_order(degree, ax): x = np.linspace(0, 1, 100).reshape((-1,1)) y = EncodeSplines(n_bases=10, degree=degree).fit_transform(x).squeeze() # alter...
Jackporter415/phys202-2015-work
assignments/assignment07/AlgorithmsEx02.ipynb
mit
%matplotlib inline from matplotlib import pyplot as plt import seaborn as sns import numpy as np """ Explanation: Algorithms Exercise 2 Imports End of explanation """ def find_peaks(a): """Find the indices of the local maxima in a sequence.""" #empty list and make the parameter into an array empty =...
aisaacso/SafeBoss
crimes.ipynb
mit
# Load modules, apply settings import pandas as pd import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sns import scipy.stats as stats import statsmodels.api as sm import requests import json from statsmodels.formula.api import ols from statsmodels.formula.api import logit impo...
dietmarw/EK5312_ElectricalMachines
Chapman/Ch6-Problem_6-03.ipynb
unlicense
%pylab notebook %precision 4 """ Explanation: Excercises Electric Machinery Fundamentals Chapter 6 Problem 6-3 End of explanation """ fe = 60.0 # [Hz] n_noload = 715.0 # [r/min] n_m = 670.0 # [r/min] """ Explanation: Description A three-phase 60-Hz induction motor runs at 715 r/min at no-load and at 670...
jdhp-docs/python_notebooks
nb_dev_python/python_scipy_optimize_newton.ipynb
mit
%matplotlib inline import matplotlib try: from ailiib.utils.plot import plot_2d_contour_solution_space, plot_2d_solution_space from ailib.optimize.functions.unconstrained import rosen2d except ModuleNotFoundError: print("Please install ailib:") print("pip install ailib") import numpy as np from scip...
LinkHS/incubator-mxnet
example/adversary/adversary_generation.ipynb
apache-2.0
%matplotlib inline import mxnet as mx import numpy as np import matplotlib.pyplot as plt import matplotlib.cm as cm from mxnet.test_utils import get_mnist_iterator """ Explanation: Fast Sign Adversary Generation Example This notebook demos find adversary example by using symbolic API and integration with Numpy Refer...
tkurfurst/deep-learning
dcgan-svhn/DCGAN.ipynb
mit
%matplotlib inline import pickle as pkl import matplotlib.pyplot as plt import numpy as np from scipy.io import loadmat import tensorflow as tf !mkdir data """ Explanation: Deep Convolutional GANs In this notebook, you'll build a GAN using convolutional layers in the generator and discriminator. This is called a De...
alasdairtran/mclearn
projects/alasdair/notebooks/05_class_proportion_estimation.ipynb
bsd-3-clause
# remove after testing %load_ext autoreload %autoreload 2 import pickle import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from sklearn.ensemble import RandomForestClassifier from mclearn.classifier import print_classification_result, predict_unlabelled_objects, map_unlabelled...
InsightLab/data-science-cookbook
2019/02-python-bibliotecas-manipulacao-dados/garimpagem-de-dados-02-numpy.ipynb
mit
import numpy as np a = np.array([1, 2, 3]) print(a) print('') b = np.array([(1, 2, 3), (4, 5, 6)]) print(b) a + b a * b b - a a**2 10*np.sin(a) # seno trigonométrico b<35 print('Axis 1: %s' % b[0]) print(np.average(b)) print(b.sum()) print(b.min()) print(b.max()) b.sum(axis=0) # sum of each column b.min(axi...
tylerwmarrs/billboard-hot-100-lyric-analysis
notebooks/exploratory/01-web-scraping.ipynb
mit
# Fetch the Billboard Hot 100 for this week import requests from lxml import etree def get_billboard_hot_100(): hot_100_rss = requests_get('http://www.billboard.com/rss/charts/hot-100') xml = bytes(bytearray(hot_100_rss.text, encoding='utf-8')) tree = etree.XML(xml) songs = [] items = tree.xpath(...
tensorflow/docs-l10n
site/en-snapshot/tfx/tutorials/tfx/gcp/vertex_pipelines_simple.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...
guyk1971/deep-learning
tv-script-generation/dlnd_tv_script_generation_orig.ipynb
mit
""" DON'T MODIFY ANYTHING IN THIS CELL """ import helper data_dir = './data/simpsons/moes_tavern_lines.txt' text = helper.load_data(data_dir) # Ignore notice, since we don't use it for analysing the data text = text[81:] """ Explanation: TV Script Generation In this project, you'll generate your own Simpsons TV scrip...
dacr26/CompPhys
09_02_random_distributions.ipynb
mit
%matplotlib inline import numpy as np from matplotlib import pyplot N = 10000 r = np.random.random(N) xlambda = 0.1 x = -np.log(r)/xlambda binwidth=xlambda*5 pyplot.hist(x,bins=np.arange(0.,100., binwidth),normed=True); pyplot.plot(np.arange(0.,100.,binwidth),xlambda*np.exp(-xlambda*np.arange(0.,100.,binwidth)),ls='...
arturops/deep-learning
gan_mnist/Intro_to_GANs_Solution.ipynb
mit
%matplotlib inline import pickle as pkl import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets('MNIST_data') """ Explanation: Generative Adversarial Network In this notebook, we'll be building a generativ...
BrunoSanchez/VVV_galaxies
correccion_resto.ipynb
bsd-2-clause
import numpy as np import pandas as pd import matplotlib.pyplot as plt from IPython.display import display from astropy.io import ascii from astropy.table import Table, Column %matplotlib inline from astroquery.irsa_dust import IrsaDust """ Explanation: Galaxias en VVV Clasificacion con Machine Learning usando est...
oasis-open/cti-python-stix2
docs/guide/memory.ipynb
bsd-3-clause
from stix2 import MemoryStore, Indicator # create default MemoryStore mem = MemoryStore() # insert newly created indicator into memory ind = Indicator(description="Crusades C2 implant", pattern_type="stix", pattern="[file:hashes.'SHA-256' = '54b7e05e39a59428743635242e4a867c932140a999f5...
dchud/warehousing-course
lectures/week-05-20151006-basic-sql.ipynb
cc0-1.0
!wget http://files.software-carpentry.org/survey.db %load_ext sql %sql sqlite:///survey.db """ Explanation: Exercise 1 - Basic SQL DML and DDL Part 1 - Data manipulation (DML) Get the survey.db SQLite3 database file from the Software Carpentry lesson and connect to it. End of explanation """ %%sql SELECT personal,...
mikedewar/RealTimeStorytelling
4/relationships.ipynb
apache-2.0
time = np.arange(0,20,0.1) A = [np.sin(x)**2 for x in time] sns.tsplot(A,interpolate=False) B = [np.sin(x)**2 + np.random.exponential(0.2) for x in time] sns.tsplot(B,interpolate=False) phi, p = scipy.stats.pearsonr(A,B) print phi # correlation is between -1 and 1. -1 means that one series goes up when the other goe...
dhimmel/hetio
test/data/create-subgraphs.ipynb
cc0-1.0
import random import hetnetpy.readwrite import hetnetpy.pathtools import hetnetpy.stats # Read Hetionet v1.0 url = 'https://github.com/hetio/hetionet/raw/{}/{}'.format( '00bf0b6f8886821d91cfdf00eadad145a7a1b6da', 'hetnet/json/hetionet-v1.0.json.bz2', ) graph = hetnetpy.readwrite.read_graph(url) metagraph = gr...
GoogleCloudPlatform/training-data-analyst
quests/bq-teradata/02_teradata_bq_sql_translation/labs/teradata_bq_sql_translation.ipynb
apache-2.0
!bq head -n 5 --selected_fields rental_id,duration,bike_id,end_date,end_station_id,start_date,start_station_id bigquery-public-data:london_bicycles.cycle_hire """ Explanation: Teradata to BigQuery SQL Translation Introduction Both BigQuery and Teradata Database conform to the ANSI/ISO SQL:2011 standard. In addition, ...
swirlingsand/deep-learning-foundations
gans/dcgan-svhn/.ipynb_checkpoints/DCGAN_Exercises-checkpoint.ipynb
mit
%matplotlib inline import pickle as pkl import matplotlib.pyplot as plt import numpy as np from scipy.io import loadmat import tensorflow as tf !mkdir data """ Explanation: Deep Convolutional GANs In this notebook, you'll build a GAN using convolutional layers in the generator and discriminator. This is called a De...
elsuizo/Charlas_presentaciones
Python_scientific/numpy_matplot_ejemplos.ipynb
gpl-2.0
#Importamos el modulo numpy con el alias np import numpy as np #Creo un array a = np.array([1,0,0]) a type(a) """ Explanation: <img src="files/Images/Numpylogo.png" style="float: left;"/> <div style="clear: both;"> ## Numpy ### Biblioteca(modulo) numérico de Python * Arrays multimensionales (ndarray) * Más cerca...
ingJSNA/IS-assigment2
assign2-a.ipynb
mit
class Directions: NORTH = 'North' SOUTH = 'South' EAST = 'East' WEST = 'West' STOP = 'Stop' """ Explanation: Intelligent Systems Assignment 2 Bayes' net inference Names: IDs: End of explanation """ def getMapa(): mapa = [[0] * 6 for i in range(1, 6)] mapa[1][1] = 1 mapa[1][3] = 1 ...
AnoshZahir/Greengraph
Section_2_Notebook_Student_Version.ipynb
mit
num_respondents = 1156 dates = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'June', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', 'Jan2020'] data = {} data['approve'] = [37, 40, 42, 43, 43, 43, 40, 39, 41, 42, 43, 43] data['disapprove'] = [57, 55, 51, 52, 52, 52, 54, 55, 57, 54, 53, 53] data['no_opinion'] = [7, 5, 8, 5, 5, 5, 6, 6, 2, 4...
katyhuff/berkeley
sklearn/sklearn_intro.ipynb
bsd-3-clause
import sklearn import numpy as np %matplotlib import matplotlib.pyplot as plt """ Explanation: Messing Around with Scikit-Learn End of explanation """ # Code source: Gaël Varoquaux # Andreas Müller # Modified for documentation by Jaques Grobler # License: BSD 3 clause from matplotlib.colors import List...
ketch/PseudoSpectralPython
PSPython_02-pseudospectral-collocation.ipynb
mit
%matplotlib inline import numpy as np import matplotlib.pyplot as plt import matplotlib from matplotlib import animation from IPython.display import HTML font = {'size' : 15} matplotlib.rc('font', **font) """ Explanation: Content provided under a Creative Commons Attribution license, CC-BY 4.0; code under MIT Licens...
gregcaporaso/short-read-tax-assignment
ipynb/mock-community/taxonomy-assignment-qiime1.ipynb
bsd-3-clause
from os.path import join, expandvars from joblib import Parallel, delayed from glob import glob from os import system from tax_credit.framework_functions import (parameter_sweep, generate_per_method_biom_tables, move_results_to_rep...
rmoehn/cartpole
notebooks/IntegrationExperiments.ipynb
mit
mc_env = gym.make("MountainCar-v0") mc_n_weights, mc_feature_vec = fourier_fa.make_feature_vec( np.array([mc_env.low, mc_env.high]), n_acts=3, order=2) mc_experience = linfa.init(lmbda=0.9, init_alp...
ga7g08/ga7g08.github.io
_notebooks/2015-01-30-Applying-python-functions-in-moving-windows.ipynb
mit
import numpy as np import matplotlib.pyplot as plt import pandas as pd %matplotlib inline # The user defined function we want to apply in a moving window mad = lambda x: np.fabs(x - x.mean()).mean() # Some random data N = 1000 t = np.linspace(0, 10, N) x = np.random.randn(N).cumsum() # The moving window parameters ...
davidfumo/intro-to-machine-learning
linear regression/linear-regression-nb.ipynb
mit
import numpy as np import pandas as pd data_path = "data/Advertising.csv" # or load the dataset directly from the link # # data_link = "http://www-bcf.usc.edu/~gareth/ISL/Advertising.csv" data = pd.read_csv(data_path, index_col=0) # display the first 5 rows data.head() """ Explanation: TODO: Place the Advertisi...
mcc-petrinets/formulas
spot/tests/python/stutter-inv.ipynb
mit
f = spot.formula('a U b') print(f.is_syntactic_stutter_invariant()) f = spot.formula('a U Xb') print(f.is_syntactic_stutter_invariant()) """ Explanation: Stutter-invariant languages A language $L$ is said to be stutter-invariant iff $\ell_0\ldots\ell_{i-1}\ell_i\ell_{i+1}\ldots\in L \iff \ell_0\ldots\ell_{i-1}\ell_i\...
mattiasostmar/GAR_Syria_2016-06
create_metatdata_textfiles.ipynb
mit
def strip(text): try: return text.strip() except AttributeError: return text it_converters = {"Folder":strip, "Nome foto":strip, "Anno":strip, "Luogo":strip, "Nome monumento":strip, "Descrizione":strip, "Nome autore":strip} metadata_it = pd.read_excel("./data/COH_GAR_metadata.xlsx",sheetnam...
metpy/MetPy
v0.7/_downloads/isentropic_example.ipynb
bsd-3-clause
import cartopy.crs as ccrs import cartopy.feature as cfeature import matplotlib.pyplot as plt from netCDF4 import Dataset, num2date import numpy as np import metpy.calc as mcalc from metpy.cbook import get_test_data from metpy.plots import add_metpy_logo from metpy.units import units """ Explanation: Isentropic Analy...
oditorium/blog
iPython/ReportLab1-Intro.ipynb
agpl-3.0
from io import BytesIO from IPython.core import display from PIL import Image def display_pil_image(im): """Displayhook function for PIL Images, rendered as PNG.""" b = BytesIO() im.save(b, format='png') data = b.getvalue() ip_img = display.Image(data=data, format='png', embed=True) return ip_img....
rgarcia-herrera/sistemas-dinamicos
Leslie Model.ipynb
gpl-3.0
# el modelo de Leslie L = np.array([[0, 1, 2], [0.8, 0, 0], [0, 0.7, 0]]) # las cuatro clases de edad tienen 100 pobladoras al inicio poblacion_inicial = [100,100,100] # lista para contener un vector de tamaños de población por clase para # cada unidad de tiempo transcurrida en ...
ClaudioVZ/Metodos_numericos_I
01_Raices_de_ecuaciones_de_una_variable/02_Falsa_posicion.ipynb
gpl-2.0
def raiz(f, x_l, x_u): x_r = x_u - (f(x_u)*(x_u - x_l))/(f(x_u) - f(x_l)) return x_r def intervalo_de_raiz(f, x_l, x_u): x_r = raiz(f, x_l, x_u) if f(x_l)*f(x_r) < 0: x_u = x_r if f(x_l)*f(x_r) > 0: x_l = x_r return x_l, x_u """ Explanation: Método de la falsa posición El métod...
Kaggle/learntools
notebooks/ml_intermediate/raw/ex7.ipynb
apache-2.0
# Set up code checking from learntools.core import binder binder.bind(globals()) from learntools.ml_intermediate.ex7 import * print("Setup Complete") """ Explanation: Most people find target leakage very tricky until they've thought about it for a long time. So, before trying to think about leakage in the housing pric...
greg-ashby/deep-learning-nanodegree
first-neural-network/.ipynb_checkpoints/nn-Copy1-checkpoint.ipynb
mit
%matplotlib inline %config InlineBackend.figure_format = 'retina' import numpy as np import pandas as pd import matplotlib.pyplot as plt """ Explanation: Your first neural network In this project, you'll build your first neural network and use it to predict daily bike rental ridership. We've provided some of the code...
wikistat/Intro-Python
Cal2-PythonPandas.ipynb
mit
# Exemple de data frame import pandas as pd data = {"state": ["Ohio", "Ohio", "Ohio", "Nevada", "Nevada"], "year": [2000, 2001, 2002, 2001, 2002], "pop": [1.5, 1.7, 3.6, 2.4, 2.9]} frame = pd.DataFrame(data) # ordre des colonnes pd.DataFrame(data, columns=["year", "state", "pop"]) # index des lignes ...
mnishida/RII_Pandas
docs/notebooks/02_RiiDataFrame.ipynb
mit
import riip ri = riip.RiiDataFrame() """ Explanation: RiiDataFrame Here, a little bit more detail about RiiDataFrame class will be given. End of explanation """ ri.catalog.head(3) """ Explanation: RiiDataFrame has an attribute named catalog that is a Pandas DataFrame provinding the catalog of experimental data as s...
IBM/differential-privacy-library
notebooks/exploration.ipynb
mit
%matplotlib inline import numpy as np import diffprivlib as dp import matplotlib.pyplot as plt """ Explanation: Data exploration workflow with diffprivlib End of explanation """ acc = dp.BudgetAccountant(1, 0) acc.set_default() # Our default epsilon value for this exploration eps = 0.04 """ Explanation: Data and ...
GoogleCloudPlatform/vertex-ai-samples
notebooks/community/migration/UJ15 legacy AutoML Vision Video Object Tracking.ipynb
apache-2.0
! pip3 install -U google-cloud-automl --user """ Explanation: AutoML SDK: AutoML video object tracking model Installation Install the latest (preview) version of AutoML SDK. End of explanation """ ! pip3 install google-cloud-storage """ Explanation: Install the Google cloud-storage library as well. End of explana...
mdeff/ntds_2016
project/reports/fisheries_monitoring/3.Fish_detection.ipynb
mit
import os import glob import time from SimpleCV import * import scipy import numpy as np import tensorflow as tf import collections import matplotlib.pyplot as plt import cv2 import imutils from skimage.transform import pyramid_gaussian import argparse import cv2 from scipy import ndimage from scipy.ndimage import sum ...
xesscorp/myhdlpeek
examples/peeker_dataframe.ipynb
mit
from myhdl import * from myhdlpeek import Peeker # Import the myhdlpeeker module. def mux(z, a, b, sel): """A simple multiplexer.""" @always_comb def mux_logic(): if sel == 1: z.next = a # Signal a sent to mux output when sel is high. else: z.next = b # Signal b s...
usantamaria/iwi131
ipynb/20-Conjuntos/Conjuntos.ipynb
cc0-1.0
# Utilizando strings def letras_en_comun(p, r): n = 0 letras_a_revisar = p + r letras_vistas = "" for c in letras_a_revisar: if (c in p) and (c in r) and not (c in letras_vistas): n += 1 letras_vistas += c return n ## Verificación print(letras_en_comun('murcielagoo', 'g...
relf/smt
tutorial/SMT_MixedInteger_application.ipynb
bsd-3-clause
!pip install smt %matplotlib inline from math import exp import numpy as np import matplotlib.pyplot as plt from matplotlib import colors from mpl_toolkits.mplot3d import Axes3D from scipy.stats import norm from scipy.optimize import minimize import scipy import six from smt.applications import EGO from smt.surroga...
tarasane/h2o-3
h2o-py/demos/H2O_tutorial_medium.ipynb
apache-2.0
import pandas as pd import numpy from numpy.random import choice from sklearn.datasets import load_boston import h2o h2o.init() # transfer the boston data from pandas to H2O boston_data = load_boston() X = pd.DataFrame(data=boston_data.data, columns=boston_data.feature_names) X["Median_value"] = boston_data.target X ...
RafaelNH/Reproduce-Hoy-et-al-2014
notebook/run_simulations_3.ipynb
bsd-3-clause
import numpy as np import matplotlib.pyplot as plt import matplotlib import time import sys import os %matplotlib inline # Change directory to the code folder os.chdir('..//code') # Functions to sample the diffusion-weighted gradient directions from dipy.core.sphere import disperse_charges, HemiSphere # Function to...
AstroHackWeek/AstroHackWeek2016
notebook-tutorial/notebooks/08-More_basics.ipynb
mit
names = ['alice', 'jonathan', 'bobby'] ages = [24, 32, 45] ranks = ['kinda cool', 'really cool', 'insanely cool'] for (name, age, rank) in zip(names, ages, ranks): print(name, age, rank) for index, (name, age, rank) in enumerate(zip(names, ages, ranks)): print(index, name, age, rank) # return, esc, shift+ent...
w4zir/ml17s
lectures/.ipynb_checkpoints/lec05-multinomial-regression-checkpoint.ipynb
mit
%matplotlib inline import pandas as pd import numpy as np from sklearn import linear_model import matplotlib.pyplot as plt import matplotlib as mpl # read data in pandas frame dataframe = pd.read_csv('datasets/house_dataset2.csv', encoding='utf-8') # check data by printing first few rows dataframe.head() from mpl_t...
edwardd1/phys202-2015-work
assignments/assignment03/NumpyEx03.ipynb
mit
import numpy as np %matplotlib inline import matplotlib.pyplot as plt import seaborn as sns import antipackage import github.ellisonbg.misc.vizarray as va """ Explanation: Numpy Exercise 3 Imports End of explanation """ def brownian(maxt, n): """Return one realization of a Brownian (Wiener) process with n steps...
HazyResearch/deepdive
examples/spouse/DeepDive Tutorial - Extracting mentions of spouses from the news.ipynb
apache-2.0
# PATH needs correct setup to use DeepDive import os; PWD=os.getcwd(); HOME=os.environ["HOME"]; PATH=os.environ["PATH"] # home directory installation %env PATH=$HOME/local/bin:$PATH # notebook-local installation %env PATH=$PWD/deepdive/bin:$PATH !type deepdive no_deepdive_found = !type deepdive >/dev/null if no_deepdi...
kit-cel/lecture-examples
nt1/vorlesung/1_quellencodierung/Huffman.ipynb
gpl-2.0
# importing import numpy as np """ Explanation: Content and Objectives Realizing Huffman encoding by a recursive function constructing of the Huffman tree Application of this function to several examples Import End of explanation """ # Huffman function def huffman_recursive( symb_dict, show_steps = 0 ): ''' ...
WNoxchi/Kaukasos
FAI_old/Lesson6/Theano_RNN_test_4.ipynb
mit
import theano import os, sys sys.path.insert(1, os.path.join('../utils')) from utils import * # from __future__ import division, print_functions path = get_file('nietzsche.txt', origin="https://s3.amazonaws.com/text-datasets/nietzsche.txt") text = open(path).read() print('corpus length:', len(text)) chars = sorted(lis...
jmschrei/pomegranate
examples/distributions_test_table.ipynb
mit
from pomegranate import * import math """ Explanation: Distribution Test Tables This example demonstrates how to create some conditional probability tables and a bayesian network. End of explanation """ c_table = [[0, 0, 0, 0.6], [0, 0, 1, 0.4], [0, 1, 0, 0.7], [0, 1, 1, 0.3], ...
ES-DOC/esdoc-jupyterhub
notebooks/cnrm-cerfacs/cmip6/models/cnrm-esm2-1/atmos.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'cnrm-cerfacs', 'cnrm-esm2-1', 'atmos') """ Explanation: ES-DOC CMIP6 Model Properties - Atmos MIP Era: CMIP6 Institute: CNRM-CERFACS Source ID: CNRM-ESM2-1 Topic: Atmos Sub-Topics: Dynamical Cor...
bMzi/ML_in_Finance
0102_Pandas.ipynb
mit
# We start by importing the NumPy, Pandas packages import numpy as np import pandas as pd """ Explanation: Pandas Pandas Objects In the previous chapter we discussed the very basics of Python and NumPy. Here we go one step further and introduce the Pandas package and its data structures. At the very basic level, Panda...
fastai/course-v3
nbs/dl2/07a_lsuv.ipynb
apache-2.0
x_train,y_train,x_valid,y_valid = get_data() x_train,x_valid = normalize_to(x_train,x_valid) train_ds,valid_ds = Dataset(x_train, y_train),Dataset(x_valid, y_valid) nh,bs = 50,512 c = y_train.max().item()+1 loss_func = F.cross_entropy data = DataBunch(*get_dls(train_ds, valid_ds, bs), c) mnist_view = view_tfm(1,28,...
monicathieu/cu-psych-r-tutorial
public/tutorials/python/2-datacleaning/index.ipynb
mit
import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns sns.set_context("poster") sns.set(style="ticks",font="Arial",font_scale=2) """ Explanation: title: "Data Cleaning in Python" subtitle: "CU Psych Scientific Computing Workshop" weight: 1201 tags: ["core", "python"] Goals of t...
elsdrm/shared_note
Tools for High-Performance Computing Applications.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt """ Explanation: Lecture 6B - Tools for high-performance computing applications J.R. Johansson (robert@riken.jp) http://dml.riken.jp/~rob/ The latest version of this IPython notebook lecture is available at http://github.com/jrjohansson/scientific-python-lectures. The...