repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
dfm/george
docs/_static/notebooks/mixture.ipynb
mit
import george george.__version__ """ Explanation: Mixtures of GPs This notebook was made with the following version of george: End of explanation """ import numpy as np import matplotlib.pyplot as plt from george import kernels np.random.seed(42) N = 256 t = np.sort(np.random.uniform(0, 10, N)) theta = np.random.u...
joverbee/electromagnetism_course
vector_example.ipynb
gpl-3.0
import numpy as np import matplotlib.pyplot as plt import scipy.signal as signal %matplotlib inline """ Explanation: Example of fields and operators acting on them Simple script to show a 2D vector field and apply curl and divergence operator on it. can you predict from looking at the vectorfield what the qualitative...
ajgpitch/qutip-notebooks
examples/homodyned-Jaynes-Cummings-emission.ipynb
lgpl-3.0
%matplotlib inline %config InlineBackend.figure_format = 'retina' import matplotlib.pyplot as plt import numpy as np from qutip import * """ Explanation: QuTiP example: Homodyned Jaynes-Cummings emission K.A. Fischer, Stanford University This Jupyter notebook demonstrates how to simulate quantum statistics of homody...
ResearchComputing/xsede_2015
04a_exploratory_pandas.ipynb
mit
import os import numpy as np import pandas as pd import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Getting Started with Exploratory Data Analysis 3 important Python packages 1. NumPy for efficient computation on arrays 2. Pandas for data analysis for small and medium data 3. Matplotlib for plotting i...
qinwf-nuan/keras-js
notebooks/layers/convolutional/Cropping2D.ipynb
mit
data_in_shape = (3, 5, 4) L = Cropping2D(cropping=((1,1),(1, 1)), data_format='channels_last') layer_0 = Input(shape=data_in_shape) layer_1 = L(layer_0) model = Model(inputs=layer_0, outputs=layer_1) # set weights to random (use seed for reproducibility) np.random.seed(250) data_in = 2 * np.random.random(data_in_shap...
rcurrie/tumornormal
genesets.ipynb
apache-2.0
import os import json import numpy as np import pandas as pd import tensorflow as tf import keras import matplotlib.pyplot as plt # fix random seed for reproducibility np.random.seed(42) # See https://github.com/h5py/h5py/issues/712 os.environ["HDF5_USE_FILE_LOCKING"] = "FALSE" """ Explanation: Gene Sets and Expres...
qingshuimonk/STA663
docs/vae.ipynb
mit
import numpy as np import tensorflow as tf import matplotlib.pyplot as plt %matplotlib inline np.random.seed(0) tf.set_random_seed(0) # Load MNIST data in a format suited for tensorflow. # The script input_data is available under this URL: # https://raw.githubusercontent.com/tensorflow/tensorflow/master/tensorflow/e...
python-control/python-control
examples/kincar-fusion.ipynb
bsd-3-clause
import numpy as np import scipy as sp import matplotlib.pyplot as plt import control as ct import control.optimal as opt import control.flatsys as fs from IPython.display import Image # Define line styles ebarstyle = {'elinewidth': 0.5, 'capsize': 2} xdstyle = {'color': 'k', 'linestyle': '--', 'linewidth': 0.5, ...
CELMA-project/CELMA
MES/singleOperators/subConvergenceDDXOverJ.ipynb
lgpl-3.0
%matplotlib notebook from IPython.display import display from sympy import Function, S, Eq from sympy import symbols, init_printing, simplify, Limit from sympy import sin, cos, tanh, exp, pi, sqrt from boutdata.mms import x # Import common import os, sys # If we add to sys.path, then it must be an absolute path comm...
chusine/dlnd
intro-to-rnns/Anna_KaRNNa_Exercises.ipynb
mit
import time from collections import namedtuple import numpy as np import tensorflow as tf """ Explanation: Anna KaRNNa In this notebook, we'll build a character-wise RNN trained on Anna Karenina, one of my all-time favorite books. It'll be able to generate new text based on the text from the book. This network is bas...
jmausolf/jmausolf.github.io
courses/cfss/hw05-python-data-analysis.ipynb
apache-2.0
# Import libraries import pandas as pd import numpy as np # Turn off notebook package warnings import warnings warnings.filterwarnings('ignore') # print graphs in the document %matplotlib inline """ Explanation: title: "Homework 05: Analyzing the gapminder dataset using Python" output: html_document Overview Due be...
calroc/joypy
docs/Advent of Code 2017 December 6th.ipynb
gpl-3.0
from notebook_preamble import D, J, V, define J('[0 2 7 0] dup max') from joy.library import SimpleFunctionWrapper from joy.utils.stack import list_to_stack @SimpleFunctionWrapper def index_of(stack): '''Given a sequence and a item, return the index of the item, or -1 if not found. E.g.: [a b c] a ...
quantopian/research_public
notebooks/lectures/Introduction_to_Volume_Slippage_and_Liquidity/notebook.ipynb
apache-2.0
import numpy as np import pandas as pd import matplotlib.pyplot as plt num_shares = np.asarray([30000, 60000, 10000]) prices = np.asarray([30, 31, 33]) np.dot(num_shares, prices) """ Explanation: Introduction to Volume, Slippage, and Liquidity by Delaney Mackenzie and Maxwell Margenot Part of the Quantopian Lecture...
turbomanage/training-data-analyst
courses/fast-and-lean-data-science/01_MNIST_TPU_Keras.ipynb
apache-2.0
import os, re, time, json import PIL.Image, PIL.ImageFont, PIL.ImageDraw import numpy as np import tensorflow as tf from matplotlib import pyplot as plt print("Tensorflow version " + tf.__version__) #@title visualization utilities [RUN ME] """ This cell contains helper functions used for visualization and downloads on...
mne-tools/mne-tools.github.io
0.20/_downloads/05c57a644672d33707fd1264df7f5617/plot_time_frequency_global_field_power.ipynb
bsd-3-clause
# Authors: Denis A. Engemann <denis.engemann@gmail.com> # Stefan Appelhoff <stefan.appelhoff@mailbox.org> # # License: BSD (3-clause) import os.path as op import numpy as np import matplotlib.pyplot as plt import mne from mne.datasets import somato from mne.baseline import rescale from mne.stats import boots...
tbereau/auto_martini
examples/01_our_first_molecule.ipynb
gpl-2.0
import auto_martini as am import rdkit from rdkit import Chem from rdkit.Chem import Draw from rdkit.Chem import AllChem print(rdkit.__version__) """ Explanation: Tutorial 1: Parametrizing our first molecule Let's parametrize our first molecule with auto_martini. We will focus on phenylmethanimine. Feeding only its S...
keras-team/keras-io
examples/nlp/ipynb/question_answering.ipynb
apache-2.0
!pip install git+https://github.com/huggingface/transformers.git !pip install datasets !pip install huggingface-hub """ Explanation: Question Answering with Hugging Face Transformers Author: Matthew Carrigan and Merve Noyan<br> Date created: 13/01/2022<br> Last modified: 13/01/2022<br> Description: Question answering ...
esa-as/2016-ml-contest
MandMs/Facies_classification-M&Ms_SVM_rbf_kernel_optimal.ipynb
apache-2.0
%matplotlib inline import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.colors as colors from mpl_toolkits.axes_grid1 import make_axes_locatable from sklearn import preprocessing from sklearn.metrics import f1_score, accuracy_score, make_scorer from sklearn.model_selection imp...
ZhiangChen/deep_learning
Tutorials/Udacity/3_regularization.ipynb
mit
# These are all the modules we'll be using later. Make sure you can import them # before proceeding further. from __future__ import print_function import numpy as np import tensorflow as tf from six.moves import cPickle as pickle """ Explanation: Deep Learning Assignment 3 Previously in 2_fullyconnected.ipynb, you tra...
streamreasoning/rsplab
collector/lab/streamapp/StreamApp - Part 1 - RDF Stream Processing with the CSPARQL engine.ipynb
apache-2.0
from IPython.display import Image from IPython.core.display import HTML from rsplib.processing import RSPSource, RSPEngine """ Explanation: Part 1 : RDF Stream Processing with CSPARQL Engine In this part of the tutorial, we will see how to query RDF Streams using an RDF Stream Processing (RSP) engine. The CSPARQL e...
analysiscenter/dataset
examples/experiments/profiling/profiling.ipynb
apache-2.0
%%time %run ./tf_model.py """ Explanation: Comparison of batchflow performance with tf and torch Models Firstly, we comapre torch and tf versions of VGG16. Train them on MNIST. TensorFlow model End of explanation """ %%time %run ./torch_model.py """ Explanation: ... then restart kernel to clear GPU Torch model En...
weinbe58/QuSpin
examples/notebooks/GPE.ipynb
bsd-3-clause
from quspin.operators import hamiltonian # Hamiltonians and operators from quspin.basis import boson_basis_1d # Hilbert space boson basis from quspin.tools.evolution import evolve import numpy as np # generic math functions from six import iteritems # loop over elements of dictionary import matplotlib.pyplot as plt # #...
indranilsinharoy/PyZDDE
Examples/IPNotebooks/01 Notes on ipzCaptureWindow functions.ipynb
mit
import os import matplotlib.pyplot as plt import pyzdde.zdde as pyz %matplotlib inline l = pyz.createLink() # create a DDE link object for communication """ Explanation: Using ipzCaptureWindow and ipzCaptureWindow2 for embedding graphic analysis windows into notebook <img src="https://raw.githubusercontent.com/indran...
UltronAI/Deep-Learning
CS231n/assignment3/GANs-PyTorch.ipynb
mit
import torch import torch.nn as nn from torch.nn import init from torch.autograd import Variable import torchvision import torchvision.transforms as T import torch.optim as optim from torch.utils.data import DataLoader from torch.utils.data import sampler import torchvision.datasets as dset import numpy as np import ...
sytays/openanalysis
doc/Langauge/09-Inbuilt Data Structures 4 - Dictionaries.ipynb
gpl-3.0
x = {'eight':8,'nine':9} x['eight'] x[0] """ Explanation: Dictionaries Dictionary is a set of key-value pairs, where value is any hashable object. As Lists are indexed by integers, Dictionries are indexed by keys. Creating Dictionaries Creating an Empty Dictionary python x = {} # {} denotes dictionary ...
kabrapratik28/Stanford_courses
cs231n/assignment2/ConvolutionalNetworks.ipynb
apache-2.0
# As usual, a bit of setup from __future__ import print_function import numpy as np import matplotlib.pyplot as plt from cs231n.classifiers.cnn import * from cs231n.data_utils import get_CIFAR10_data from cs231n.gradient_check import eval_numerical_gradient_array, eval_numerical_gradient from cs231n.layers import * fro...
Honestpuck/charming
Notebooks/JavaScript Notebook Extensions.ipynb
artistic-2.0
## you can inspect the autosave code to see what it does. %autosave?? """ Explanation: Embracing web standards One of the reasons we developed the current notebook web application was to embrace web technologies. By being a pure web application using HTML, Javascript and CSS, the Notebook can get all the web technol...
Smith42/neuralnet-mcg
CNNs/ECG-CNN-2D.ipynb
gpl-3.0
import tensorflow as tf #import tensorflow.contrib.learn.python.learn as learn import tflearn import scipy as sp import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from random import shuffle, randint from sklearn.utils import shuffle as mutualShuf import os import pandas as pd ...
ShubhamDebnath/Coursera-Machine-Learning
Course 4/Keras Tutorial Happy House v2.ipynb
mit
import numpy as np from keras import layers from keras.layers import Input, Dense, Activation, ZeroPadding2D, BatchNormalization, Flatten, Conv2D from keras.layers import AveragePooling2D, MaxPooling2D, Dropout, GlobalMaxPooling2D, GlobalAveragePooling2D from keras.models import Model from keras.preprocessing import im...
arokem/seaborn
doc/docstrings/displot.ipynb
bsd-3-clause
sns.displot(data=penguins, x="flipper_length_mm", kind="ecdf") """ Explanation: There are three main plot kinds; in addition to histograms and kernel density estimates (KDEs), you can also draw empirical cumulative distribution functions (ECDFs): End of explanation """ sns.displot(data=penguins, x="flipper_length_mm...
gwulfs/research_public
lectures/Risk Factor Exposure.ipynb
apache-2.0
import numpy as np import statsmodels.api as sm from statsmodels import regression import matplotlib.pyplot as plt import pandas as pd # Get market cap and book-to-price for all assets in universe fundamentals = init_fundamentals() data = get_fundamentals(query(fundamentals.valuation.market_cap, ...
jamesfolberth/NGC_STEM_camp_AWS
notebooks/20Q/loadMechanicalTurkData.ipynb
bsd-3-clause
# Read in the list of 250 movies, making sure to remove commas from their names # (actually, if it has commas, it will be read in as different fields) import csv movies = [] with open('movies.csv','r') as csvfile: myreader = csv.reader(csvfile) for index, row in enumerate(myreader): movies.append( ' '.j...
mbuchove/notebook-wurk-b
stats/HW_6_PS.ipynb
mit
%matplotlib inline import numpy as np import matplotlib.pyplot as plt from scipy.special import iv from scipy.optimize import fmin from csv import reader from astropy.io import fits from __future__ import print_function """ Explanation: <h1>Astro 283 Homework 6</h1> Bijan Pourhamzeh End of explanation """ #Read in...
eyaltrabelsi/my-notebooks
Lectures/elegent_exception_handling/Exceptions Handling Interactive.ipynb
mit
! pip install typeguard rollbar returns tenacity icontract > /dev/null 2>&1 import contextlib import json import icontract import logging import pathlib import os from typing import Union import requests from typeguard import typechecked def get_relevant_restaurants(user): base_url = "https://en.wikipedia.org/wi...
adrn/globber
notebooks/Proper Motions of MW stuffs.ipynb
mit
import os # Third-party from astropy.io import ascii import astropy.coordinates as coord import astropy.units as u import matplotlib as mpl import matplotlib.pyplot as pl import numpy as np %matplotlib inline import gary.coordinates as gc import gary.dynamics as gd import gary.potential as gp from ophiuchus import g...
dataworkshop/xgboost
step1.ipynb
mit
import xgboost as xgb from sklearn.datasets import load_boston from sklearn.cross_validation import train_test_split from sklearn.metrics import r2_score, auc boston = load_boston() #print(boston.DESCR) print(boston.data.shape) X_train, X_test, y_train, y_test = train_test_split(boston.data, boston.target) model = ...
linamnt/studyGroup
lessons/python/object_oriented_programming/Object_oriented_programming.ipynb
apache-2.0
# first we need to creat a class. # If you like to create an empty class at first, you use the command pass inside the class class Subject: pass # create the objects of that class. # we create 2 and call them S1 and S2: S1 = Subject() S1.fname = "Jane" S1.lname = "Doe" S1.ID = 111 S1.date_of_admission = "20...
tpin3694/tpin3694.github.io
sql/create_index_for_a_table.ipynb
mit
# Ignore %load_ext sql %sql sqlite:// %config SqlMagic.feedback = False """ Explanation: Title: Create An Index For A Table Slug: create_index_for_a_table Summary: Create An Index For A Table in SQL. Date: 2016-05-01 12:00 Category: SQL Tags: Basics Authors: Chris Albon Note: This tutorial was written using Cat...
min2bro/WebScraping
.ipynb_checkpoints/FilmfareDataAnalysis-checkpoint.ipynb
mit
%matplotlib inline from selenium import webdriver import os,time,json import pandas as pd from collections import defaultdict,Counter import matplotlib.pyplot as plt """ Explanation: Web Scraping & Data Analysis with Selenium and Python Vinay Babu Github: https://github.com/min2bro/WebScrapingwithSelenium Twitter: @m...
manoharan-lab/structural-color
color_mixing_tutorial.ipynb
gpl-3.0
%matplotlib inline import numpy as np import time import structcol as sc import structcol.refractive_index as ri from structcol import montecarlo as mc from structcol import detector as det from structcol import phase_func_sphere as pfs import matplotlib.pyplot as plt import seaborn as sns from scipy.misc import factor...
magenta/magenta-demos
colab-notebooks/MusicVAE.ipynb
apache-2.0
#@title Setup Environment #@test {"output": "ignore"} import glob BASE_DIR = "gs://download.magenta.tensorflow.org/models/music_vae/colab2" print('Installing dependencies...') !apt-get update -qq && apt-get install -qq libfluidsynth1 fluid-soundfont-gm build-essential libasound2-dev libjack-dev !pip install -q pyflu...
tvaught/compintro
12_camera_explorer.ipynb
bsd-3-clause
from picamera import PiCamera, Color from time import sleep camera = PiCamera() """ Explanation: Camera Explorer End of explanation """ camera.resolution = (480, 320) camera.vflip = True camera.hflip = True camera.start_preview() camera.annotate_foreground = Color('white') camera.annotate_text = "Colorswap Effect"...
synthicity/activitysim
activitysim/examples/example_estimation/notebooks/20_atwork_subtour_scheduling.ipynb
agpl-3.0
import os import larch # !conda install larch -c conda-forge # for estimation import pandas as pd """ Explanation: Estimating At-work Subtour Scheduling This notebook illustrates how to re-estimate the at-work subtour scheduling component for ActivitySim. This process includes running ActivitySim in estimation mode...
mmathioudakis/networkx-tutorial
network_analysis_with_networkx.ipynb
mit
# load image """ Explanation: Network analysis with networkx What is network analysis? What is networkx? A simple example Consider the social network shown in the figure below. End of explanation """ import networkx as nx G = nx.Graph() # create a Graph object people = ["Michael", "Jane", "John", "Peter", "An...
astroumd/GradMap
notebooks/Lectures2021/Lecture2/Lecture2_Student.ipynb
gpl-3.0
ourList = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] """ Explanation: Contents Review Intro to Numpy Arrays a. Negative Indexing Exercise b. Ranges Exercise c. Indexing & Slicing Exercises 3. Functions in Numpy a. Numpy Trig Function Exercises 4. User-Defined Functions a. Path Length Function Exercises 5. Loading and Saving Num...
landmanbester/fundamentals_of_interferometry
1_Radio_Science/01_06_synchrotron_emission.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 1. Radio Science using Interferometric Arrays Previous: 1.5 Black body radiation Next: 1.7 Line emission Import standard modules: ...
KUrushi/knocks
06/英語テキストの処理.ipynb
mit
import pickle """ Explanation: 第6章: 英語テキストの処理 英語テキストのnlp.txtに対して, 以下の処理を実行せよ End of explanation """ def separate_sentences(filename): checks = ['. ', '; ', '? ', '! '] for sentences in open(filename, 'r'): sentences = sentences.strip() sep_flag = False sep_index = 0 check_sign...
yevheniyc/Projects
1m_ML_Security/notebooks/answers/Worksheet 1 - Working with One Dimensional Data - Answers.ipynb
mit
import pandas as pd import numpy as np import matplotlib.pyplot as plt """ Explanation: <img src="../../img/logo_white_bkg_small.png" align="left" /> Worksheet 1: Working with One Dimensional Data This worksheet covers concepts covered in the first half of Module 1 - Exploratory Data Analysis in One Dimension. It s...
noppanit/linear-regression-basic
Basic Linear Regression.ipynb
mit
%matplotlib inline import pandas as pd import numpy as np from scipy import stats import collections import time from sklearn.linear_model import SGDRegressor """ Explanation: Introduction This is going to be a very basic examples of Linear Regression. Basically, we have generated data of total amount of meals and ti...
ProfessorKazarinoff/staticsite
content/code/circuit_diagrams/SchemDraw_circuit_diagrams.ipynb
gpl-3.0
import matplotlib.pyplot as plt #plt.xkcd() #to make the diagram look hand drawn %matplotlib inline %config InlineBackend.figure_format = 'svg' import SchemDraw as schem import SchemDraw.elements as e """ Explanation: I've tried a bunch of different ways to make circuit diagrams for exams, homework assignments and wor...
ES-DOC/esdoc-jupyterhub
notebooks/cnrm-cerfacs/cmip6/models/sandbox-1/land.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'cnrm-cerfacs', 'sandbox-1', 'land') """ Explanation: ES-DOC CMIP6 Model Properties - Land MIP Era: CMIP6 Institute: CNRM-CERFACS Source ID: SANDBOX-1 Topic: Land Sub-Topics: Soil, Snow, Vegetati...
jsnajder/StrojnoUcenje
notebooks/SU-2015-10-VrednovanjeModela.ipynb
cc0-1.0
# Učitaj osnovne biblioteke... import scipy as sp import sklearn import pandas as pd %pylab inline """ Explanation: Sveučilište u Zagrebu<br> Fakultet elektrotehnike i računarstva Strojno učenje <a href="http://www.fer.unizg.hr/predmet/su">http://www.fer.unizg.hr/predmet/su</a> Ak. god. 2015./2016. Bilježnica 10: Vred...
tgquintela/temporal_tasks
deliver/Report-ToyProblem.ipynb
mit
import numpy as np import matplotlib.pyplot as plt from svm import SVM ## Apply test to the code %run tests.py """ Explanation: A toy problem: implement training a Support Vector Machine with SGD Antonio G. Quintela SVM Support Vectors Machines are generalizations of linear decision boundaries for linearly nonsepara...
jomavera/Work
Center of Gravity with JAX.ipynb
mit
from jax import grad, jit, vmap import jax.numpy as np import numpy as np2 #2D coordinates of locations of demand or supply x_n = np.array([[-0.97,-80.7], [-1.05, -80.45], [-2.15, -79.92], [-1.81, -79.53], [-1.03, -79.47]]) #Quantities of demand/supply for ...
appanacca/tutmom
intro.ipynb
bsd-3-clause
import numpy as np objective = np.poly1d([1.3, 4.0, 0.6]) print(objective) """ Explanation: Introduction to optimization The basic components The objective function (also called the 'cost' function) End of explanation """ import scipy.optimize as opt x_ = opt.fmin(objective, [3]) print("solved: x={}".format(x_)) %...
beyondvalence/biof509_wtl
Wk01-overview/Wk01-Overview.ipynb
mit
import numpy as np print("Numpy:", np.__version__) """ Explanation: Week 1 - Getting Started End of explanation """ location = 'Bethesda' zip_code = 20892 elevation = 71.9 print("We're in", location, "zip code", zip_code, ", ", elevation, "m above sea level") print("We're in " + location + " zip code " + str(zip_c...
jhconning/Dev-II
notebooks/jupyter_notebooks.ipynb
bsd-3-clause
import matplotlib.pyplot as plt %matplotlib inline import pandas as pd import seaborn as sns from ipywidgets import interact df = pd.read_stata(".\data\country.dta") """ Explanation: Economics with Jupyter Notebooks Jupyter Notebook is "a web application that allows you to create and share documents that contain li...
foxan/dataquest
Data Visualization/Challenge - Data Visualization.ipynb
apache-2.0
# %sh # wget https://raw.githubusercontent.com/jgoodall/cinevis/master/data/csvs/moviedata.csv # ls -l import pandas as pd import matplotlib.pyplot as plt %matplotlib inline import seaborn as sns hollywood_movies = pd.read_csv('moviedata.csv') print hollywood_movies.head() print hollywood_movies['exclude'].value_c...
JAmarel/Phys202
LaTeX/.ipynb_checkpoints/ProjectEuler17-checkpoint.ipynb
mit
def round_down(n): s = str(n) if n <= 20: return n elif n < 100: return int(s[0] + '0'), int(s[1]) elif n<1000: return int(s[0] + '00'),int(s[1]),int(s[2]) assert round_down(5) == 5 assert round_down(55) == (50,5) assert round_down(222) == (200,2,2) def number_to_word...
shikhar413/openmc
examples/jupyter/candu.ipynb
mit
%matplotlib inline from math import pi, sin, cos import numpy as np import openmc """ Explanation: Modeling a CANDU Bundle In this example, we will create a typical CANDU bundle with rings of fuel pins. At present, OpenMC does not have a specialized lattice for this type of fuel arrangement, so we must resort to manua...
sysid/nbs
lstm/CNTK_106A_LSTM_Timeseries_with_Simulated_Data.ipynb
mit
# Figure 1 Image(url="http://www.cntk.ai/jup/sinewave.jpg") """ Explanation: CNTK 106: Part A - Time series prediction with LSTM (Basics) This tutorial demonstrates how to use CNTK to predict future values in a time series using LSTMs. Goal We use simulated data set of a continuous function (in our case a sine wave). ...
phoebe-project/phoebe2-docs
2.3/tutorials/alternate_backends.ipynb
gpl-3.0
#!pip install -I "phoebe>=2.3,<2.4" import phoebe from phoebe import u # units logger = phoebe.logger() b = phoebe.default_binary() """ Explanation: Advanced: Alternate Backends 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 sessi...
southpaw94/MachineLearning
TextExamples/3547_05_Code.ipynb
gpl-2.0
%load_ext watermark %watermark -a 'Sebastian Raschka' -u -d -v -p numpy,scipy,matplotlib,scikit-learn # to install watermark just uncomment the following line: #%install_ext https://raw.githubusercontent.com/rasbt/watermark/master/watermark.py """ Explanation: Sebastian Raschka, 2015 Python Machine Learning Essential...
ES-DOC/esdoc-jupyterhub
notebooks/messy-consortium/cmip6/models/sandbox-3/aerosol.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'messy-consortium', 'sandbox-3', 'aerosol') """ Explanation: ES-DOC CMIP6 Model Properties - Aerosol MIP Era: CMIP6 Institute: MESSY-CONSORTIUM Source ID: SANDBOX-3 Topic: Aerosol Sub-Topics: Tra...
GoogleCloudPlatform/asl-ml-immersion
notebooks/bigquery/labs/c_extract_and_benchmark.ipynb
apache-2.0
import pandas as pd from google.cloud import bigquery PROJECT = !gcloud config get-value project PROJECT = PROJECT[0] %env PROJECT=$PROJECT """ Explanation: Extract Datasets and Establish Benchmark Learning Objectives - Divide into Train, Evaluation and Test datasets - Understand why we need each - Pull data out of ...
california-civic-data-coalition/python-calaccess-notebooks
calaccess-exploration/campaign_finance_filings.ipynb
mit
%load_ext sql from django.conf import settings connection_string = 'postgresql+psycopg2://{USER}:{PASSWORD}@{HOST}:{PORT}/{NAME}'.format( **settings.DATABASES['default'] ) %sql $connection_string """ Explanation: Campaign Finance Disclosure Filings Setup End of explanation """ %%sql SELECT cvr."FILING_ID", COUN...
giacomov/3ML
examples/Photometry_demo.ipynb
bsd-3-clause
import numpy as np import matplotlib.pyplot as plt %matplotlib inline from threeML import * # we will need XPSEC models for extinction from astromodels.xspec import * # The filter library takes a while to load so you must import it explicitly.. from threeML.plugins.photometry.filter_library import threeML_filter_li...
widdowquinn/SI_Holmes_etal_2017
notebooks/03-crossvalidation.ipynb
mit
%pylab inline import os import pickle import warnings; warnings.filterwarnings('ignore') import numpy as np import pandas as pd import scipy import seaborn as sns; sns.set_context('notebook') import tools """ Explanation: <img src="images/JHI_STRAP_Web.png" style="width: 150px; float: right;"> Supplementary Informa...
ES-DOC/esdoc-jupyterhub
notebooks/cas/cmip6/models/sandbox-2/land.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'cas', 'sandbox-2', 'land') """ Explanation: ES-DOC CMIP6 Model Properties - Land MIP Era: CMIP6 Institute: CAS Source ID: SANDBOX-2 Topic: Land Sub-Topics: Soil, Snow, Vegetation, Energy Balance...
FZJ-IEK3-VSA/tsam
examples/aggregation_example.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 %matplotlib inline """ Explanation: tsam - 1. Example Example usage of the time series aggregation module (tsam) Date: 08.05.2017 Author: Leander Kotzur Import pandas a...
andreyf/machine-learning-examples
visualization/part1_seaborn.ipynb
gpl-3.0
%matplotlib inline import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt plt.rcParams['figure.figsize'] = (10, 6) """ Explanation: <center> <img src="../img/ods_stickers.jpg"> Открытый курс по машинному обучению </center> Автор материала: программист-исследователь Mail.ru Group, ...
NlGG/MachineLearning
NeuralNetwork/nn.ipynb
mit
def example1(x_1, x_2): z = x_1**0.5*x_2*0.5 return z fig = pl.figure() ax = Axes3D(fig) X = np.arange(0, 1, 0.1) Y = np.arange(0, 1, 0.1) X, Y = np.meshgrid(X, Y) Z = example1(X, Y) ax.plot_surface(X, Y, Z, rstride=1, cstride=1) pl.show() """ Explanation: コブ・ダクラス型生産関数と課題文で例に出された関数を用いる。 いずれも定義域は0≤x≤1である。 ...
dnc1994/MachineLearning-UW
ml-regression/blank/week-4-ridge-regression-assignment-2-blank.ipynb
mit
import graphlab """ Explanation: Regression Week 4: Ridge Regression (gradient descent) In this notebook, you will implement ridge regression via gradient descent. You will: * Convert an SFrame into a Numpy array * Write a Numpy function to compute the derivative of the regression weights with respect to a single feat...
AMICI-developer/AMICI
python/examples/example_steadystate/ExampleSteadystate.ipynb
bsd-2-clause
# SBML model we want to import sbml_file = 'model_steadystate_scaled.xml' # Name of the model that will also be the name of the python module model_name = 'model_steadystate_scaled' # Directory to which the generated model code is written model_output_dir = model_name import libsbml import importlib import amici impor...
statsmodels/statsmodels.github.io
v0.12.1/examples/notebooks/generated/mixed_lm_example.ipynb
bsd-3-clause
%matplotlib inline import numpy as np import pandas as pd import statsmodels.api as sm import statsmodels.formula.api as smf from statsmodels.tools.sm_exceptions import ConvergenceWarning """ Explanation: Linear Mixed Effects Models End of explanation """ data = sm.datasets.get_rdataset('dietox', 'geepack').data md...
egodat/chaos_game_fractal
fractal_mandlebrot_julia.ipynb
mit
from PIL import Image, ImageDraw import math, colorsys, numpy from matplotlib import colors from IPython.display import Image as ipythonImage """ Explanation: Table of Contents <p><div class="lev1 toc-item"><a href="#Honors-Physics-PHYS1010" data-toc-modified-id="Honors-Physics-PHYS1010-1"><span class="toc-item-num">1...
statsmodels/statsmodels.github.io
v0.13.0/examples/notebooks/generated/markov_regression.ipynb
bsd-3-clause
%matplotlib inline import numpy as np import pandas as pd import statsmodels.api as sm import matplotlib.pyplot as plt # NBER recessions from pandas_datareader.data import DataReader from datetime import datetime usrec = DataReader( "USREC", "fred", start=datetime(1947, 1, 1), end=datetime(2013, 4, 1) ) """ Exp...
alihalabyah/flexx
examples/notebooks/flexx_tutorial_pyscript.ipynb
bsd-2-clause
from flexx.pyscript import py2js, evalpy """ Explanation: Tutorial for flexx.pyscript - Python to JavaScript transpilation End of explanation """ js = py2js('for i in range(10): print(i)') print(js) """ Explanation: We can transpile strings of Python code: End of explanation """ def foo(x): res = [] for i...
cavaunpeu/willwolf.io-source
content/downloads/notebooks/neural_implicit_mf.ipynb
mit
from collections import namedtuple from copy import deepcopy import random import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from sklearn.manifold import TSNE from sklearn.metrics.pairwise import cosine_similarity from sqlalchemy import create_engine from dotify.config impor...
leliel12/scikit-criteria
ahp_ext/tuto.ipynb
bsd-3-clause
from skcriteria import Data, MIN, MAX mtx = [ [1, 2, 3], # alternative 1 [4, 5, 6], # alternative 2 ] mtx # let's says the first two alternatives are # for maximization and the last one for minimization criteria = [MAX, MAX, MIN] criteria # et’s asume we know in our case, that the importance of # the auto...
fluffy-hamster/A-Beginners-Guide-to-Python
A Beginners Guide to Python/07.2. Philosophy, Part Two.ipynb
mit
def net_force(mass, acceleration): return mass * acceleration """ Explanation: “Explicit is better than implicit” What does this line of the poem refer to? Well, there are several examples and interpretations one could give, but today I would to interpret this line with reference to the idea of readability. We ...
peteWT/cec_apl
IOUdata/.ipynb_checkpoints/ReadFromDB-Copy1-checkpoint.ipynb
mit
import pandas as pd from sqlalchemy import create_engine """ Explanation: This notebook is intended to show how to use pandas, and sql alchemy to upload data into DB2-switch. Install using pip or any other package manager pandas, sqlalchemy and pg8000. The later one is the driver to connect to the db. End of explanati...
dwhswenson/openpathsampling
examples/tests/langevin_integrator_check.ipynb
mit
import openpathsampling.engines.toy as toys import openpathsampling as paths import numpy as np """ Explanation: Langevin Integrator Check The toy_dynamics subpackage provides an integrator called LangevinBAOABIntegrator, which is based on a paper by Leimkuhler and Matthews. This notebook uses the toy_dynamics package...
ES-DOC/esdoc-jupyterhub
notebooks/nims-kma/cmip6/models/sandbox-1/land.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'nims-kma', 'sandbox-1', 'land') """ Explanation: ES-DOC CMIP6 Model Properties - Land MIP Era: CMIP6 Institute: NIMS-KMA Source ID: SANDBOX-1 Topic: Land Sub-Topics: Soil, Snow, Vegetation, Ener...
adrn/TriandRRLyrae
notebooks/2016 A13 + GASS observing run.ipynb
mit
css = ascii.read("/Users/adrian/projects/triand-rrlyrae/data/catalina.csv") print(css.colnames) linear = ascii.read("/Users/adrian/projects/triand-rrlyrae/data/linear.csv") print(linear.colnames) css_c = coord.SkyCoord(ra=css['ra']*u.deg, dec=css['dec']*u.deg, distance=css['helio_dist']*u.kpc) lin_c = coord.SkyCoord(...
mne-tools/mne-tools.github.io
stable/_downloads/7ca3f34c286b629113cbb522edf26a21/75_cluster_ftest_spatiotemporal.ipynb
bsd-3-clause
# Authors: Denis Engemann <denis.engemann@gmail.com> # Jona Sassenhagen <jona.sassenhagen@gmail.com> # Alex Rockhill <aprockhill@mailbox.org> # Stefan Appelhoff <stefan.appelhoff@mailbox.org> # # License: BSD-3-Clause import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.axes_...
DTOcean/dtocean-core
notebooks/DTOcean Fixed Tidal Scenario Analysis.ipynb
gpl-3.0
%matplotlib inline from IPython.display import display, HTML import matplotlib.pyplot as plt plt.rcParams['figure.figsize'] = (14.0, 8.0) import numpy as np from datetime import datetime from dtocean_core import start_logging from dtocean_core.core import Core from dtocean_core.menu import DataMenu, ModuleMenu, Pro...
StudyExchange/Udacity
MachineLearning(Advanced)/p2_finding_donors/finding_donors.ipynb
mit
# 为这个项目导入需要的库 import numpy as np import pandas as pd from time import time from IPython.display import display # 允许为DataFrame使用display() # 导入附加的可视化代码visuals.py import visuals as vs # 为notebook提供更加漂亮的可视化 %matplotlib inline # 导入人口普查数据 data = pd.read_csv("census.csv") # 成功 - 显示第一条记录 display(data.head()) """ Explanati...
adicu/AccessibleML
5. Dimensionality Reduction via Principal Component Analysis.ipynb
mit
from sklearn.decomposition import PCA import numpy as np from matplotlib import pyplot as plt from mpl_toolkits.mplot3d import Axes3D # 3D Plotting from scipy import stats import ipywidgets # interactions %matplotlib inline """ Explanation: Dimensionality Reduction via Principal Component An...
rasbt/pyprind
examples/pyprind_demo.ipynb
bsd-3-clause
%load_ext watermark %watermark -v -d -u -p pyprind """ Explanation: Sebastian Raschka End of explanation """ import pyprind """ Explanation: PyPrind demo <a name='sections'></a> Sections Basic Progress Bar Basic Percentage Indicator Progress Bar and Percentage Indicator generators Progress Bar/Percentage Indica...
mrcinv/matpy
01b_neenacbe.ipynb
gpl-2.0
import sympy as sym sym.init_printing() # lepši izpis formul """ Explanation: ^ gor: Uvod Neenačbe Podobno kot enačb, se tudi neenačb lotimo s knjižnico Sympy. Bolj konkretno z modulom solvers.inequalities. End of explanation """ from sympy.solvers.inequalities import solve_univariate_inequality from sympy import Sy...
Santana9937/Classification_ML_Specialization
Week_1_Predicting_Sentiment_from_Reviews/week_1_lin_classifier_assign.ipynb
mit
import os import zipfile import string import numpy as np import pandas as pd from sklearn import linear_model from sklearn.feature_extraction.text import CountVectorizer import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sns sns.set_style('darkgrid') %matplotlib inline """ Explanation: Predict...
CNS-OIST/STEPS_Example
user_manual/source/API_2/Interface_Tutorial_1_wm.ipynb
gpl-2.0
import steps.interface from steps.model import * from steps.geom import * from steps.rng import * from steps.sim import * from steps.saving import * from matplotlib import pyplot as plt import numpy as np mdl = Model() r = ReactionManager() """ Explanation: Well-Mixed Reaction System <div class="admonition note"> ...
tuanavu/python-cookbook-3rd
notebooks/ch01/04_finding_the_largest_or_smallest_n_items.ipynb
mit
import heapq nums = [1, 8, 2, 23, 7, -4, 18, 23, 42, 37, 2] print(heapq.nlargest(3, nums)) # Prints [42, 37, 23] print(heapq.nsmallest(3, nums)) # Prints [-4, 1, 2] """ Explanation: Finding the Largest or Smallest N Items Problem You want to make a list of the largest or smallest N items in a collection. Solution ...
NLeSC/embodied-emotions-scripts
03_AnalysisCorpora.ipynb
apache-2.0
# Render our plots inline %matplotlib inline import pandas as pd import matplotlib.pyplot as plt import numpy as np import os pd.set_option('display.mpl_style', 'default') # Make the graphs a bit prettier plt.rcParams['figure.figsize'] = (16, 6) # adjust to your local directories embem_data_dir = '/home/jvdzwaan/da...
dataDogma/Computer-Science
Databases-Content/Intro_to_DB/Stanford - Introduction_to_database - Getting the database ready.ipynb
gpl-3.0
# importing the sqlalechemy ORM( object realtional mapper ) import sqlalchemy """ Explanation: Using SQL in Jupyter via SqlAlchemy ORM Using the ORM( Object Relational Mappers) for various databases used in this notebook, some of them are: Sqlite MySQL Oracle PostgreSQL MongoDB Neo4j Sqlite Table of C...
mne-tools/mne-tools.github.io
0.17/_downloads/3ebd331f774b241a9eda870b8410800d/plot_info.ipynb
bsd-3-clause
import mne import os.path as op """ Explanation: The :class:Info &lt;mne.Info&gt; data structure The :class:Info &lt;mne.Info&gt; data object is typically created when data is imported into MNE-Python and contains details such as: date, subject information, and other recording details the sampling rate information ab...
guidesc/DSBA---case-study
RATP.ipynb
mit
import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import numpy as np # ---- Summary of the twitter accounts -----# # RER_A # RERB # RERC_SNCF --< Infotrafic # RERD_SNCF --< Infotrafic # RERE_SNCF --< Infotrafic # Ligne12_RATP --< from 1 to 14 lines line_list = ['RER_A', 'RER_B', 'RER_C', 'RER_...
aKumpan/hse-shad-ml
02-metric_classification/statement_neighbours/statement_neighbours.ipynb
apache-2.0
df = pd.read_csv('../data/wine.data') """ Explanation: 1. Загрузите выборку Wine End of explanation """ X_train = df[df.columns[1:]] y_train = df[df.columns[0]] """ Explanation: 2. Извлеките из данных признаки и классы. Класс записан в первом столбце (три варианта), признаки — в столбцах со второго по последний. Бо...
P7h/FutureLearn__Learn_to_Code_for_Data_Analysis
Week#3/Week_3_exercises.ipynb
apache-2.0
import sys sys.version import warnings warnings.simplefilter('ignore', FutureWarning) from pandas import * show_versions() """ Explanation: Table of Contents <p><div class="lev1 toc-item"><a href="#Exercise-notebook-3:-Transforming-and-Combining-Data" data-toc-modified-id="Exercise-notebook-3:-Transforming-and-Comb...