repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
cshankm/rebound | ipython_examples/WHFast.ipynb | gpl-3.0 | import rebound
"""
Explanation: WHFast tutorial
This tutorial is an introduction to the python interface of WHFast, a fast and unbiased symplectic Wisdom-Holman integrator. The method is described in Rein & Tamayo (2015).
This tutorial assumes that you have already installed REBOUND.
First WHFast integration
You can e... |
bjackman/lisa | ipynb/examples/utils/executor_example.ipynb | apache-2.0 | import logging
from conf import LisaLogging
LisaLogging.setup()
import os
import json
from env import TestEnv
from executor import Executor
"""
Explanation: Executor API - Executor
A tests executor is a module which supports the execution of a configured set of experiments.<br><br>
Each experiment is composed by:
... |
aravindhv10/CPP_Wrappers | AntiQCD4/Training_Notebook.ipynb | gpl-2.0 | # This program will not generate the jet images, it will only train the autoencoder
# and evaluate the results. The jet images can be found in:
# https://drive.google.com/drive/folders/1i5DY9duzDuumQz636u5YQeYQEt_7TYa8?usp=sharing
# Please download those images to your google drive and use the colab - drive integration... |
Adamage/python-training | Lesson_00_algorithms.ipynb | apache-2.0 | def bubble_sort(alist):
for pass_number in range(len(alist)-1,0,-1):
for i in range(pass_number):
left, right = alist[i], alist[i+1]
if left > right:
left, right = right, left
alist[i], alist[i+1] = left, right
pr... |
keras-team/keras-io | examples/vision/ipynb/supervised-contrastive-learning.ipynb | apache-2.0 | import tensorflow as tf
import tensorflow_addons as tfa
import numpy as np
from tensorflow import keras
from tensorflow.keras import layers
"""
Explanation: Supervised Contrastive Learning
Author: Khalid Salama<br>
Date created: 2020/11/30<br>
Last modified: 2020/11/30<br>
Description: Using supervised contrastive lea... |
Kaggle/learntools | notebooks/ml_intermediate/raw/ex1.ipynb | apache-2.0 | # Set up code checking
import os
if not os.path.exists("../input/train.csv"):
os.symlink("../input/home-data-for-ml-course/train.csv", "../input/train.csv")
os.symlink("../input/home-data-for-ml-course/test.csv", "../input/test.csv")
from learntools.core import binder
binder.bind(globals())
from learntools.... |
benkoo/fast_ai_coursenotes | deeplearning1/nbs/lesson3.ipynb | apache-2.0 | from theano.sandbox import cuda
%matplotlib inline
from imp import reload
import utils; reload(utils)
from utils import *
from __future__ import division, print_function
#path = "data/dogscats/sample/"
path = "data/dogscats/"
model_path = path + 'models/'
if not os.path.exists(model_path): os.mkdir(model_path)
... |
GoogleCloudPlatform/vertex-ai-samples | notebooks/community/feature_store/mobile_gaming/mobile_gaming_feature_store.ipynb | apache-2.0 | import os
# The Google Cloud Notebook product has specific requirements
IS_GOOGLE_CLOUD_NOTEBOOK = os.path.exists("/opt/deeplearning/metadata/env_version")
# Google Cloud Notebook requires dependencies to be installed with '--user'
USER_FLAG = ""
if IS_GOOGLE_CLOUD_NOTEBOOK:
USER_FLAG = "--user"
! pip3 install {... |
Knewton/lentil | nb/synthetic_experiments.ipynb | apache-2.0 | num_students = 2000
num_assessments = 3000
num_ixns_per_student = 1000
USING_2PL = False # False => using 1PL
proficiencies = np.random.normal(0, 1, num_students)
difficulties = np.random.normal(0, 1, num_assessments)
if USING_2PL:
discriminabilities = np.random.normal(0, 1, num_assessments)
else:
discrimina... |
MLnick/sseu16-meetup | Creating a Scalable Recommender System with Spark & Elasticsearch.ipynb | apache-2.0 | from elasticsearch import Elasticsearch
es = Elasticsearch()
create_index = {
"settings": {
"analysis": {
"analyzer": {
"payload_analyzer": {
"type": "custom",
"tokenizer":"whitespace",
"filter":"delimited_payload_filte... |
catherinedevlin/sql_quest | sqlquest.ipynb | cc0-1.0 | !libreoffice data/aelfryth.odt
"""
Explanation: SQLQuest
Catherine Devlin
Ohio LinuxFest 2015, Oct 3
https://github.com/catherinedevlin/sql_quest
Me
Database administrator since 1999
Python programmer since 2003
First chair of PyOhio
catherinedevlin.blogspot.com, @catherinedevlin
Your employee
You
Total SQL n00b. ... |
Danghor/Algorithms | Python/Chapter-02/Power.ipynb | gpl-2.0 | def power(m, n):
r = 1
for i in range(n):
r *= m
return r
power(2, 3), power(3, 2)
%%time
p = power(3, 500000)
"""
Explanation: Efficient Computation of Powers
The function power takes two natural numbers $m$ and $n$ and computes $m^n$. Our first implementation is inefficient and takes $n-1$ mul... |
catalystcomputing/DSIoT-Python-sessions | Session3/code/04 Unsupervised and supervised Learning.ipynb | apache-2.0 | # Let's import the relevant packages first
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from sklearn import manifold
import gzip, cPickle
import pandas as pd
from sklearn.cluster import KMeans
from sklearn import metrics
"""
Explanation: Supervised and Unsupervised learning example
We ar... |
JuanIgnacioGil/basket-stats | NBA_Keras/Predicting NBA players positions using Keras.ipynb | mit | %load_ext autoreload
%autoreload 2
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelBinarizer, StandardScaler
from keras.models import Sequential
from keras.layers import Dense, Activation, Dropout
"""
Explanation: Predicting NBA play... |
hetaodie/hetaodie.github.io | assets/media/uda-ml/code/boston_housing/.Trash-0/files/boston_housing-zh.ipynb | mit | # Import libraries necessary for this project
import numpy as np
import pandas as pd
from sklearn.cross_validation import ShuffleSplit
# Import supplementary visualizations code visuals.py
import visuals as vs
# Pretty display for notebooks
%matplotlib inline
# Load the Boston housing dataset
data = pd.read_csv('hou... |
nwjs/chromium.src | third_party/tflite_support/src/tensorflow_lite_support/tools/Build_TFLite_Support_Targets.ipynb | bsd-3-clause | # Create folders
!mkdir -p '/android/sdk'
# Download and move android SDK tools to specific folders
!wget -q 'https://dl.google.com/android/repository/tools_r25.2.5-linux.zip'
!unzip 'tools_r25.2.5-linux.zip'
!mv '/content/tools' '/android/sdk'
# Copy paste the folder
!cp -r /android/sdk/tools /android/android-sdk-li... |
keras-team/keras-io | examples/generative/ipynb/lstm_character_level_text_generation.ipynb | apache-2.0 | from tensorflow import keras
from tensorflow.keras import layers
import numpy as np
import random
import io
"""
Explanation: Character-level text generation with LSTM
Author: fchollet<br>
Date created: 2015/06/15<br>
Last modified: 2020/04/30<br>
Description: Generate text from Nietzsche's writings with a character-... |
CloudVLab/professional-services | examples/kubeflow-fairing-example/Fairing_Tensorflow_Keras.ipynb | apache-2.0 | import os
import logging
import tensorflow as tf
import fairing
import numpy as np
from datetime import datetime
from fairing.cloud import gcp
# Setting up google container repositories (GCR) for storing output containers
# You can use any docker container registry istead of GCR
# For local notebook, GCP_PROJECT shoul... |
LSSTC-DSFP/LSSTC-DSFP-Sessions | Sessions/Session11/Day2/FindingSourcesSolutions.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import norm
from matplotlib.ticker import MultipleLocator
%matplotlib notebook
def pixel_plot(pix, counts, fig=None, ax=None):
'''Make a pixelated 1D plot'''
if fig is None and ax is None:
fig, ax = plt.subplots()
ax.step(pi... |
rishuatgithub/MLPy | nlp/UPDATED_NLP_COURSE/00-Python-Text-Basics/04-Python-Text-Basics-Assessment-Solutions.ipynb | apache-2.0 | abbr = 'NLP'
full_text = 'Natural Language Processing'
# Enter your code here:
print(f'{abbr} stands for {full_text}')
"""
Explanation: <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a>
Python Text Basics Assessment - Solutions
Welcome to your assessment! Complete the tasks described i... |
amitkaps/applied-machine-learning | reference/Module-01a-reference.ipynb | mit | #Load the libraries
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
#Defualt Variables
%matplotlib inline
plt.rcParams['figure.figsize'] = (16,9)
plt.style.use('fivethirtyeight')
pd.set_option('display.float_format', lambda x: '%.2f' % x)
#Load the dataset
df = pd.read_csv("data/loan_data.csv")... |
kabrapratik28/Stanford_courses | cs231n/assignment3/NetworkVisualization-PyTorch.ipynb | apache-2.0 | import torch
from torch.autograd import Variable
import torchvision
import torchvision.transforms as T
import random
import numpy as np
from scipy.ndimage.filters import gaussian_filter1d
import matplotlib.pyplot as plt
from cs231n.image_utils import SQUEEZENET_MEAN, SQUEEZENET_STD
from PIL import Image
%matplotlib i... |
skkandrach/foundations-homework | data-databases/Homeowrk_3.ipynb | mit | from bs4 import BeautifulSoup
from urllib.request import urlopen
html_str = urlopen("http://static.decontextualize.com/widgets2016.html").read()
document = BeautifulSoup(html_str, "html.parser")
"""
Explanation: Homework assignment #3
These problem sets focus on using the Beautiful Soup library to scrape web pages.
Pr... |
FedericoMuciaccia/SistemiComplessi | src/Adiacenza, grafo e grado.ipynb | mit | import geopy
from geopy import distance
import math
import itertools
import pandas
import numpy
import networkx
from matplotlib import pyplot
%matplotlib inline
"""
Explanation: Importo tutte le librerie necessarie
End of explanation
"""
colosseo = (41.890173, 12.492331)
raccordo = [(41.914456, 12.615807),(41.990672... |
ghvn7777/ghvn7777.github.io | content/fluent_python/2_2_list_split.ipynb | apache-2.0 | l = list(range(10))
l
l[2:5] = 100 #当赋值对象是切片时候,即使只有一个元素,等式右面也必须是一个可迭代元素
l[2:5] = [100]
l
"""
Explanation: 切片
为了计算 seq[start:stop:step],Python 会调用 seq.__getitem__(slice(start, stop, step))。
多维切片
[ ] 运算符也可以接收以逗号分隔的多个索引或切片,举例来说,Numpy 中,你可以使用 a[i, j] 取得二维的 numpy.ndarray,以及使用 a[m:n, k:l] 这类的运算符获取二维的切片。处理 [ ] 运算符的 __getit... |
tkurfurst/deep-learning | autoencoder/Simple_Autoencoder_Solution.ipynb | mit | %matplotlib inline
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', validation_size=0)
"""
Explanation: A Simple Autoencoder
We'll start off by building a simple autoencoder to compres... |
ardiya/siamesenetwork-tensorflow | Similar image retrieval.ipynb | mit | img_placeholder = tf.placeholder(tf.float32, [None, 28, 28, 1], name='img')
net = mnist_model(img_placeholder, reuse=False)
"""
Explanation: Create the siamese net feature extraction model
End of explanation
"""
saver = tf.train.Saver()
with tf.Session() as sess:
sess.run(tf.global_variables_initializer())
c... |
openexp/OpenEXP | notebooks/N170 Emotiv Exploratory.ipynb | mit | from mne import Epochs, find_events, set_eeg_reference, read_epochs, viz, combine_evoked
from time import time, strftime, gmtime
from collections import OrderedDict
from glob import glob
from collections import OrderedDict
from mne import create_info, concatenate_raws
from mne.io import RawArray
from mne.channels impor... |
SunPower/pvfactors | docs/tutorials/Run_full_parallel_simulations.ipynb | bsd-3-clause | # Import external libraries
import os
import numpy as np
import matplotlib.pyplot as plt
from datetime import datetime
import pandas as pd
import warnings
# Settings
%matplotlib inline
np.set_printoptions(precision=3, linewidth=300)
warnings.filterwarnings('ignore')
# Paths
LOCAL_DIR = os.getcwd()
DATA_DIR = os.path.j... |
bakanchevn/DBCourseMirea2017 | Неделя 2/Задание в классе/Лабораторная 2-1-Решение.ipynb | gpl-3.0 | %%sql
SELECT t.name
FROM tracks t
INNER JOIN genres g
ON t.genreid = g.genreid
INNER JOIN media_types m
ON m.mediatypeid = t.mediatypeid
ORDER BY t.bytes desc
limit 10
"""
Explanation: Задание 1
Вывести 10 самых больших по размеру треков жанра ROCK и формата MPEG
End of explanation
"""
%%sql
SEL... |
angelmtenor/data-science-keras | machine_translation.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import helper
import keras
helper.info_gpu()
np.random.seed(9)
%matplotlib inline
%load_ext autoreload
%autoreload 2
"""
Explanation: Machine Translation
Recurrent Neural Network that accepts English text as input and returns the French transla... |
google/eng-edu | ml/cc/prework/ko/creating_and_manipulating_tensors.ipynb | apache-2.0 | # 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 the L... |
r31415smith/intro_python | @Crash+Course+v0.63.ipynb | lgpl-3.0 | import matplotlib.pyplot as plt
import numpy as np
%matplotlib inline
"""
Explanation: A Crash Course in Python for Scientists
Rick Muller, Sandia National Laboratories
version 0.62, Updated Dec 15, 2016 by Ryan Smith, Cal State East Bay
version 0.63, Updated Oct 2017 by Ryan Smith, Cal State East Bay
Using Py... |
acuzzio/GridQuantumPropagator | Scripts/Final_cube_analysis.ipynb | gpl-3.0 | import quantumpropagator as qp
import matplotlib.pyplot as plt
%matplotlib ipympl
plt.rcParams.update({'font.size': 8})
from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as pltfrom
from ipywidgets import interact,fixed #, interactive, fixed, interact_manual
import ipywidgets as widgets
from matplotli... |
tritemio/multispot_paper | out_notebooks/usALEX-5samples-PR-raw-dir_ex_aa-fit-out-AexAem-17d.ipynb | mit | ph_sel_name = "AexAem"
data_id = "17d"
# ph_sel_name = "all-ph"
# data_id = "7d"
"""
Explanation: Executed: Mon Mar 27 11:38:07 2017
Duration: 10 seconds.
usALEX-5samples - Template
This notebook is executed through 8-spots paper analysis.
For a direct execution, uncomment the cell below.
End of explanation
"""
f... |
brockk/clintrials | tutorials/EffTox.ipynb | gpl-3.0 | import numpy as np
from scipy.stats import norm
from clintrials.dosefinding.efftox import EffTox, LpNormCurve, scale_doses
real_doses = [7.5, 15, 30, 45]
dose_indices = range(1, len(real_doses)+1)
trial_size = 30
cohort_size = 3
first_dose = 3
prior_tox_probs = (0.025, 0.05, 0.1, 0.25)
prior_eff_probs = (0.2, 0.3, 0... |
karlstroetmann/Algorithms | Python/Chapter-07/ListMap.ipynb | gpl-2.0 | class ListNode:
def __init__(self, key, value):
self.mKey = key
self.mValue = value
self.mNextPtr = None
"""
Explanation: Implementing Maps as Lists of Key-Value-Pairs
The class ListNode implements a node of a <em style="color:blue">linked lists</em> of
key-value pairs. Every node h... |
phobson/paramnormal | docs/tutorial/overview.ipynb | mit | %matplotlib inline
import numpy as np
from scipy import stats
"""
Explanation: Why paramnormal ?
The currect state of the ecosystem
Both in numpy and scipy.stats and in the field of statistics in general, you can refer to the location (loc) and scale (scale) parameters of a distribution. Roughly speaking, they refer ... |
sdpython/ensae_teaching_cs | _doc/notebooks/competitions/2016/td2a_eco_competition_comparer_classifieurs.ipynb | mit | from jyquickhelper import add_notebook_menu
add_notebook_menu()
from pyensae.datasource import download_data
download_data("ensae_competition_2016.zip",
url="https://github.com/sdpython/ensae_teaching_cs/raw/master/_doc/competitions/2016_ENSAE_2A/")
%matplotlib inline
"""
Explanation: 2A.ml - 2016 - Co... |
ES-DOC/esdoc-jupyterhub | notebooks/hammoz-consortium/cmip6/models/sandbox-2/ocean.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'hammoz-consortium', 'sandbox-2', 'ocean')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocean
MIP Era: CMIP6
Institute: HAMMOZ-CONSORTIUM
Source ID: SANDBOX-2
Topic: Ocean
Sub-Topics: Timeste... |
metpy/MetPy | dev/_downloads/8532b75251585046a16f04a9afaef079/Advanced_Sounding.ipynb | bsd-3-clause | import matplotlib.pyplot as plt
import pandas as pd
import metpy.calc as mpcalc
from metpy.cbook import get_test_data
from metpy.plots import add_metpy_logo, SkewT
from metpy.units import units
"""
Explanation: Advanced Sounding
Plot a sounding using MetPy with more advanced features.
Beyond just plotting data, this ... |
wmvanvliet/neuroscience_tutorials | eeg-bci/2. Frequency analysis.ipynb | bsd-2-clause | %pylab inline
"""
Explanation: 2. Frequency analysis
This tutorial covers basic frequency analysis of the EEG signal. The recording that is used is of a subject performing the SSVEP (steady-state visual evoked potential) paradigm. In simplest terms: when we look at a light that is flashing on and off at a certain freq... |
enchantner/python-zero | lesson_10/Slides.ipynb | mit | import logging
import sys
logger = logging.getLogger(__file__) # логгер идентифицируется по имени
logger.setLevel(logging.DEBUG) # глобальный уровень логирования (WARNING по умолчанию)
fh = logging.FileHandler('test.log') # обработчик для записи в файл, еще есть RotationFileHandler
fh.setLevel(logging.DEBUG) # вы... |
JWarmenhoven/DBDA-python | Notebooks/Chapter 9.ipynb | mit | import pandas as pd
import numpy as np
import pymc3 as pm
import matplotlib.pyplot as plt
import seaborn as sns
import warnings
warnings.filterwarnings("ignore", category=FutureWarning)
from IPython.display import Image
from matplotlib import gridspec
%matplotlib inline
plt.style.use('seaborn-white')
color = '#87cee... |
Vvkmnn/books | ThinkBayes/08_Observer_Bias.ipynb | gpl-3.0 | def BiasPmf(pmf):
new_pmf = pmf.Copy()
for x, p in pmf.Items():
new_pmf.Mult(x, x)
new_pmf.Normalize()
return new_pmf
"""
Explanation: Observer Bias
The Red Line problem
In Massachusetts, the Red Line is a subway that connects Cambridge and
Boston. When I was working in Cambridge I took the R... |
yaoxx151/UCSB_Boot_Camp_copy | Day06_GraphAlgorithms2/notebooks/Fun with graphs 1.ipynb | cc0-1.0 | %matplotlib inline
import networkx as nx
import matplotlib.pyplot as plt
from IPython.display import Image
n = 10
m = 20
rgraph1 = nx.gnm_random_graph(n,m)
print "Nodes: ", rgraph1.nodes()
print "Edges: ", rgraph1.edges()
if nx.is_connected(rgraph1):
print "Graph is connected"
else:
print "Graph is not connect... |
McIntyre-Lab/ipython-demo | pickle.ipynb | gpl-2.0 | from IPython.display import YouTubeVideo
YouTubeVideo('yYey8ntlK_E', width=800, height=500)
"""
Explanation: Using Stream Serialization (Pickling)
In python pickling|unpickling is a process of serializing a python object into a file. Basically it takes the hunk of memory that a file is sitting in and writes it out to ... |
tmylk/gensim | docs/notebooks/WMD_tutorial.ipynb | gpl-3.0 | from time import time
start_nb = time()
# Initialize logging.
import logging
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s')
sentence_obama = 'Obama speaks to the media in Illinois'
sentence_president = 'The president greets the press in Chicago'
sentence_obama = sentence_obama.lower().split()... |
cmshobe/landlab | notebooks/tutorials/grid_object_demo/grid_object_demo.ipynb | mit | import numpy as np
from landlab import RasterModelGrid, VoronoiDelaunayGrid, HexModelGrid
smg = RasterModelGrid(
(3, 4), 1.) # a square-cell raster, 3 rows x 4 columns, unit spacing
rmg = RasterModelGrid((3, 4), xy_spacing=(1., 2.)) # a rectangular-cell raster
hmg = HexModelGrid(shape=(3, 4))
# ^a hexagonal grid... |
UCBerkeleySETI/breakthrough | SDR/stations/.ipynb_checkpoints/sdr_stations-checkpoint.ipynb | gpl-3.0 | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import csv
from collections import OrderedDict
from FMstations import *
raw_data = np.genfromtxt("stationsdata.csv", delimiter = ",", dtype = None)
MINFREQ = 87900000
MAXFREQ = 107900000
FREQ_BIN = raw_data[0][4]
INTERVAL = 10
TOTAL_TIME = 900
S... |
mckinziebrandon/DeepChatModels | notebooks/ubuntu_reformat.ipynb | mit | import numpy as np
import os.path
import pdb
import pandas as pd
from pprint import pprint
#DATA_DIR = '/home/brandon/terabyte/Datasets/ubuntu_dialogue_corpus/'
DATA_DIR = '/home/brandon/ubuntu_dialogue_corpus/src/' # sample/'
TRAIN_PATH = DATA_DIR + 'train.csv'
VALID_PATH = DATA_DIR + 'valid.csv'
TEST_PATH = DATA_DIR... |
KshitijT/fundamentals_of_interferometry | 1_Radio_Science/1_6_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
Section status: <span sty... |
HaFl/ufldl-tutorial-python | Linear_Regression.ipynb | mit | data_original = np.loadtxt('stanford_dl_ex/ex1/housing.data')
data = np.insert(data_original, 0, 1, axis=1)
np.random.shuffle(data)
"""
Explanation: Load and preprocess the data.
End of explanation
"""
train_X = data[:400, :-1]
train_y = data[:400, -1]
test_X = data[400:, :-1]
test_y = data[400:, -1]
m, n = trai... |
Hash--/documents | notebooks/Fusion_Basics/Fusion Cross Sections and Reaction Rates.ipynb | mit | """
Plot the Reaction rates in m^3 s^-1 as a function of
E, the energy in keV of the incident particle
[the first ion of the reaction label]
Data taken from NRL Formulary 2013.
"""
E, DD, DT, DH = loadtxt('reaction_rates_vs_energy_incident_particle.txt',
skiprows=1, unpack=True)
cm3_2_m3 = 1e... |
mathinmse/mathinmse.github.io | Lecture-23-Cahn-Hilliard.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from ipywidgets import interact, fixed
def idealSolution(GA, GB, XB, temperature):
"""
Computes the free energy of solution for an ideal binary mixture.
Parameters
----------
GA : float
The partial molar Gibbs free e... |
wy1iu/sphereface | tools/caffe-sphereface/examples/02-fine-tuning.ipynb | mit | caffe_root = '../' # this file should be run from {caffe_root}/examples (otherwise change this line)
import sys
sys.path.insert(0, caffe_root + 'python')
import caffe
caffe.set_device(0)
caffe.set_mode_gpu()
import numpy as np
from pylab import *
%matplotlib inline
import tempfile
# Helper function for deprocessin... |
jtwhite79/pyemu | verification/Freyberg/verify_null_space_proj.ipynb | bsd-3-clause | %matplotlib inline
import os
import shutil
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import pyemu
"""
Explanation: verify pyEMU null space projection with the freyberg problem
End of explanation
"""
mc = pyemu.MonteCarlo(jco="freyberg.jcb",verbose=False,forecasts=[])
mc.drop_prior_inform... |
calroc/joypy | docs/4. Replacing Functions in the Dictionary.ipynb | gpl-3.0 | from notebook_preamble import D, J, V
"""
Explanation: Preamble
End of explanation
"""
V('[23 18] average')
"""
Explanation: A long trace
End of explanation
"""
J('[sum] help')
J('[size] help')
"""
Explanation: Replacing sum and size with "compiled" versions.
Both sum and size are catamorphisms, they each conve... |
uqyge/combustionML | ode/ode_mlp_good.ipynb | mit | '''
keras mlp regression
'''
from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation
%matplotlib inline
"""
Explanation: Deep Lea... |
dwhswenson/annotated_trajectories | examples/annotation_example.ipynb | lgpl-2.1 | from __future__ import print_function
import openpathsampling as paths
from annotated_trajectories import AnnotatedTrajectory, Annotation, plot_annotated
"""
Explanation: Annotated Trajectory Example
This example shows how to annotate a trajectory (and save the annotations) using the annotated_trajectories package, wh... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive/09_sequence/text_classification.ipynb | apache-2.0 | !sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst
!pip install --user google-cloud-bigquery==1.25.0
"""
Explanation: <h1> Text Classification using TensorFlow/Keras on AI Platform </h1>
This notebook illustrates:
<ol>
<li> Creating datasets for AI Platform using BigQuery
<li> Creating a text classif... |
NLeSC/noodles | notebooks/control_your_flow.ipynb | apache-2.0 | sentence = 'the quick brown fox jumps over the lazy dog'
reverse = []
def reverse_word(word):
return word[::-1]
for word in sentence.split():
reverse.append(reverse_word(word))
result = ' '.join(reverse)
print(result)
"""
Explanation: Advanced: Control your flow
Here we dive a bit deeper in advanced flo... |
diegocavalca/Studies | phd-thesis/nilmtk/loading_data_into_memory.ipynb | cc0-1.0 | from nilmtk import DataSet
iawe = DataSet('/data/iawe.h5')
elec = iawe.buildings[1].elec
elec
"""
Explanation: Loading data into memory
Loading API is central to a lot of nilmtk operations and provides a great deal of flexibility. Let's look at ways in which we can load data from a NILMTK DataStore into memory. To se... |
miykael/nipype_tutorial | notebooks/example_2ndlevel.ipynb | bsd-3-clause | from nilearn import plotting
%matplotlib inline
from os.path import join as opj
from nipype.interfaces.io import SelectFiles, DataSink
from nipype.interfaces.spm import (OneSampleTTestDesign, EstimateModel,
EstimateContrast, Threshold)
from nipype.interfaces.utility import IdentityInt... |
tensorflow/hub | examples/colab/tf_hub_delf_module.ipynb | apache-2.0 | # Copyright 2018 The TensorFlow Hub Authors. All Rights Reserved.
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
oditorium/blog | iPython/CurveFitting.ipynb | agpl-3.0 | import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
"""
Explanation: iPython Cookbook - Curve Fitting
End of explanation
"""
a,b,c=(1,2,1)
def func0 (x,a,b,c):
return a*exp(-b*x)+c
"""
Explanation: Generating some data to play with
We first generate some data to play with. So in the first st... |
ethen8181/machine-learning | projects/kaggle_rossman_store_sales/rossman_deep_learning.ipynb | mit | from jupyterthemes import get_themes
from jupyterthemes.stylefx import set_nb_theme
themes = get_themes()
set_nb_theme(themes[3])
# 1. magic for inline plot
# 2. magic to print version
# 3. magic so that the notebook will reload external python modules
# 4. magic to enable retina (high resolution) plots
# https://gist... |
azogue/esiosdata | notebooks/esiosdata - Factura electricidad con datos enerPI.ipynb | mit | %matplotlib inline
%config InlineBackend.figure_format = 'retina'
from glob import glob
import matplotlib.pyplot as plt
import os
import pandas as pd
import requests
from esiosdata import FacturaElec
from esiosdata.prettyprinting import *
# enerPI JSON API
ip_enerpi = '192.168.1.44'
t0, tf = '2016-11-01', '2016-12-24... |
phoebe-project/phoebe2-docs | 2.3/tutorials/atm_passbands.ipynb | gpl-3.0 | #!pip install -I "phoebe>=2.3,<2.4"
"""
Explanation: Atmospheres & Passbands
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
import numpy as n... |
DawesLab/LabNotebooks | 1D Numerov Schrodinger Solver.ipynb | mit | import numpy as np
from scipy.linalg import eigh, inv
import matplotlib.pyplot as plt
%matplotlib inline
N = 1000
x, dx = np.linspace(-1,1,N,retstep=True)
#dx = dx*0.1
# Finite square well
V_0 = np.zeros(N)
V_0[:] = 450
V_0[int(N/2 - N/6):int(N/2+N/6)] = 0
plt.plot(x,V_0)
plt.ylim(V.min() - 0.1*V_0.max(),V_0.max()*1... |
hoenir/GestaltAppreciation | analysis/.ipynb_checkpoints/AppreciationNumerosity-checkpoint.ipynb | gpl-3.0 | import pandas as pd
from pandas import DataFrame
from psychopy import data, core, gui, misc
import numpy as np
import seaborn as sns
#from ggplot import *
from scipy import stats
import statsmodels.formula.api as smf
import statsmodels.api as sm
from __future__ import division
from pivottablejs import pivot_ui
%pylab ... |
Quantiacs/quantiacs-python | sampleSystems/svm_tutorial.ipynb | mit | import quantiacsToolbox
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from sklearn import svm
%matplotlib inline
%%html
<style>
table {float:left}
</style>
"""
Explanation: Quantiacs Toolbox Sample: Support Vector Machine
This tutorial will show you how to use svm with the Quantiacs Toolbox t... |
IST256/learn-python | content/lessons/07-Files/Slides.ipynb | mit | x = input()
if x.find("rr")!= -1:
y = x[1:]
else:
y = x[:-1]
print(y)
"""
Explanation: IST256 Lesson 07
Files
Zybook Ch7
P4E Ch7
Links
Participation: https://poll.ist256.com
Zoom Chat!
Agenda
Go Over Homework H06
New Stuff
The importance of a persistence layer in programming.
How to read and write from f... |
Upward-Spiral-Science/ugrad-data-design-team-0 | reveal/pdfs/nuis_methods.ipynb | apache-2.0 | %matplotlib inline
import numpy as np
import ndmg.nuis.nuis as ndn # nuisance correction scripts
import matplotlib.pyplot as plt
import nibabel as nb
import scipy.fftpack as scifft
from sklearn.metrics import r2_score
L = 200
tr = 2 # the tr of our data
t = np.linspace(0, L-1, L) # generate time steps
stim_freq = .... |
AllenDowney/ThinkBayes2 | soln/chap20.ipynb | mit | # If we're running on Colab, install libraries
import sys
IN_COLAB = 'google.colab' in sys.modules
if IN_COLAB:
!pip install empiricaldist
# Get utils.py
from os.path import basename, exists
def download(url):
filename = basename(url)
if not exists(filename):
from urllib.request import urlretri... |
maxalbert/paper-supplement-nanoparticle-sensing | notebooks/fig_9b_dependence_of_frequency_change_on_particle_size.ipynb | mit | import matplotlib.lines as mlines
import matplotlib.pyplot as plt
import pandas as pd
from style_helpers import style_cycle
%matplotlib inline
plt.style.use('style_sheets/custom_style.mplstyle')
"""
Explanation: Fig. 9(b): Dependence of Frequency Change $\Delta f$ on Particle Size
This notebook reproduces Fig. 9(b) i... |
ProjectQ-Framework/ProjectQ | examples/awsbraket.ipynb | apache-2.0 | from projectq import MainEngine
from projectq.backends import AWSBraketBackend
from projectq.ops import Measure, H, C, X, All
"""
Explanation: Running ProjectQ code on AWS Braket service provided devices
Compiling code for AWS Braket Service
In this tutorial we will see how to run code on some of the devices provided... |
NathanYee/ThinkBayes2 | code/chap02soln.ipynb | gpl-2.0 | from __future__ import print_function, division
% matplotlib inline
from thinkbayes2 import Hist, Pmf, Suite
"""
Explanation: Think Bayes: Chapter 2
This notebook presents example code and exercise solutions for Think Bayes.
Copyright 2016 Allen B. Downey
MIT License: https://opensource.org/licenses/MIT
End of expla... |
mroberge/hydrofunctions | docs/notebooks/Selecting_Sites.ipynb | mit | # First things first
import hydrofunctions as hf
"""
Explanation: Selecting Sites By Location
The National Water Information System (NWIS) makes data available for approximately 1.9 Million different locations in the US and Territories. Finding the data you need within this collection can be a challenge!
There are fou... |
keir-rex/zipline | docs/notebooks/tutorial.ipynb | apache-2.0 | !tail ../zipline/examples/buyapple.py
"""
Explanation: Zipline beginner tutorial
Basics
Zipline is an open-source algorithmic trading simulator written in Python.
The source can be found at: https://github.com/quantopian/zipline
Some benefits include:
Realistic: slippage, transaction costs, order delays.
Stream-based... |
phoebe-project/phoebe2-docs | 2.1/tutorials/20_21_xyz_uvw.ipynb | gpl-3.0 | !pip install -I "phoebe>=2.1,<2.2"
"""
Explanation: 2.0 - 2.1 Migration: xyz vs uvw coordinates
Let's first make sure we have the latest version of PHOEBE 2.1 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
"""
im... |
mne-tools/mne-tools.github.io | 0.18/_downloads/0f794e75f963d5793938890d6f3d2513/plot_receptive_field_mtrf.ipynb | bsd-3-clause | # Authors: Chris Holdgraf <choldgraf@gmail.com>
# Eric Larson <larson.eric.d@gmail.com>
# Nicolas Barascud <nicolas.barascud@ens.fr>
#
# License: BSD (3-clause)
# sphinx_gallery_thumbnail_number = 3
import numpy as np
import matplotlib.pyplot as plt
from scipy.io import loadmat
from os.path import jo... |
GoogleCloudPlatform/ai-platform-samples | notebooks/samples/aihub/xgboost_regression/xgboost_regression.ipynb | apache-2.0 | PROJECT_ID = "[your-project-id]" #@param {type:"string"}
! gcloud config set project $PROJECT_ID
"""
Explanation: By deploying or using this software you agree to comply with the AI Hub Terms of Service and the Google APIs Terms of Service. To the extent of a direct conflict of terms, the AI Hub Terms of Service will ... |
kuchaale/X-regression | examples/xarray_coupled_w_GLSAR_JRA55_analysis.ipynb | gpl-3.0 | import supp_functions as fce
import xarray as xr
import pandas as pd
import statsmodels.api as sm
import numpy as np
import matplotlib.pyplot as plt
"""
Explanation: Table of Contents
<p><div class="lev1"><a href="#Import-libraries-1"><span class="toc-item-num">1 </span>Import libraries</a></div><div class=... |
lwcook/horsetail-matching | notebooks/Surrogates.ipynb | mit | from horsetailmatching import HorsetailMatching, UniformParameter
from horsetailmatching.demoproblems import TP2
from horsetailmatching.surrogates import PolySurrogate
import numpy as np
uparams = [UniformParameter(), UniformParameter()]
"""
Explanation: When we cannot afford to sample the quantity of interest many ... |
OSHI7/Learning1 | MatplotLib Pynotebooks/AnatomyOfMatplotlib-Part6-mpl_toolkits.ipynb | mit | from mpl_toolkits.mplot3d import Axes3D, axes3d
fig, ax = plt.subplots(1, 1, subplot_kw={'projection': '3d'})
X, Y, Z = axes3d.get_test_data(0.05)
ax.plot_wireframe(X, Y, Z, rstride=10, cstride=10)
plt.show()
"""
Explanation: mpl_toolkits
In addition to the core library of matplotlib, there are a few additional util... |
johnnyliu27/openmc | examples/jupyter/nuclear-data.ipynb | mit | %matplotlib inline
import os
from pprint import pprint
import shutil
import subprocess
import urllib.request
import h5py
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm
from matplotlib.patches import Rectangle
import openmc.data
"""
Explanation: In this notebook, we will go through the salien... |
relopezbriega/mi-python-blog | content/notebooks/Python-Librerias-esenciales.ipynb | gpl-2.0 | import numpy as np
"""
Explanation: Python - Librerías esenciales para el analisis de datos
Esta notebook fue creada originalmente como un blog post por Raúl E. López Briega en Mi blog sobre Python. El contenido esta bajo la licencia BSD.
En mi artículo anterior hice una breve introducción al mundo de Python, hoy voy ... |
tritemio/multispot_paper | out_notebooks/usALEX-5samples-E-corrected-all-ph-out-27d.ipynb | mit | ph_sel_name = "None"
data_id = "27d"
# data_id = "7d"
"""
Explanation: Executed: Mon Mar 27 11:39:46 2017
Duration: 7 seconds.
usALEX-5samples - Template
This notebook is executed through 8-spots paper analysis.
For a direct execution, uncomment the cell below.
End of explanation
"""
from fretbursts import *
ini... |
GoogleCloudPlatform/vertex-ai-samples | notebooks/official/pipelines/metrics_viz_run_compare_kfp.ipynb | apache-2.0 | import os
# Google Cloud Notebook
if os.path.exists("/opt/deeplearning/metadata/env_version"):
USER_FLAG = "--user"
else:
USER_FLAG = ""
! pip3 install --upgrade google-cloud-aiplatform $USER_FLAG
"""
Explanation: Vertex AI Pipelines: Metrics visualization and run comparison using the KFP SDK
<table align="l... |
MaxPoint/spylon | examples/02_SpylonExample-WithJar.ipynb | bsd-3-clause | !mkdir helloscala
%%file helloscala/hw.scala
object HelloScala
{
def sayHi(): String = "Hi! from scala"
def sum(x: Int, y: Int) = x + y
}
"""
Explanation: Lets make some simple examples with scala
We'll make a very simple scala object compile it and use it in the python process
End of explanation
"""
%%ba... |
dhuppenkothen/ShiftyLines | demos/ShiftyLines.ipynb | gpl-3.0 | %matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_context("notebook", font_scale=2.5, rc={"axes.labelsize": 26})
sns.set_style("darkgrid")
plt.rc("font", size=24, family="serif", serif="Computer Sans")
plt.rc("text", usetex=True)
import cPickle as pickle
import numpy as np
import scip... |
tensorflow/docs-l10n | site/ja/tutorials/distribute/save_and_load.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... |
ES-DOC/esdoc-jupyterhub | notebooks/nerc/cmip6/models/sandbox-1/atmos.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'nerc', 'sandbox-1', 'atmos')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmos
MIP Era: CMIP6
Institute: NERC
Source ID: SANDBOX-1
Topic: Atmos
Sub-Topics: Dynamical Core, Radiation, Turbul... |
wikistat/Apprentissage | HAR/ML-4-IoT-Har.ipynb | gpl-3.0 | import pandas as pd
import numpy as np
import copy
import random
import itertools
%matplotlib inline
import matplotlib.pyplot as plt
import time
"""
Explanation: <center>
<a href="http://www.insa-toulouse.fr/" ><img src="http://www.math.univ-toulouse.fr/~besse/Wikistat/Images/logo-insa.jpg" style="float:left; max-widt... |
totalgood/talks | notebooks/HyperParamOpts_TechFestNW_interactive.ipynb | mit | import numpy as np
from time import time
from operator import itemgetter
from scipy.stats import randint as sp_randint
from sklearn.grid_search import GridSearchCV, RandomizedSearchCV
from sklearn.datasets import load_digits
from sklearn.ensemble import RandomForestClassifier
"""
Explanation: TechFestNW Interactive
... |
adityaka/misc_scripts | python-scripts/data_analytics_learn/link_pandas/Ex_Files_Pandas_Data/Exercise Files/02_11/Begin/.ipynb_checkpoints/Resampling-checkpoint.ipynb | bsd-3-clause | # min: minutes
my_index = pd.date_range('9/1/2016', periods=9, freq='min')
"""
Explanation: Resampling
documentation: http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.resample.html
For arguments to 'freq' parameter, please see Offset Aliases
create a date range to use as an index
End of explanati... |
kimkipyo/dss_git_kkp | 통계, 머신러닝 복습/160615수_16일차_문서 전처리 Text Preprocessing/3.konlpy 한국어 처리 패키지 소개.ipynb | mit | from konlpy.corpus import kolaw
kolaw.fileids()
c = kolaw.open('constitution.txt').read()
print(c[:100])
from konlpy.corpus import kobill
kobill.fileids()
d = kobill.open('1809890.txt').read()
print(d[:100])
"""
Explanation: konlpy 한국어 처리 패키지 소개
앞의 내용은 영어. 지금은 한국어
konlpy는 한국어 정보처리를 위한 파이썬 패키지이다.
http://konlpy.org... |
mne-tools/mne-tools.github.io | 0.20/_downloads/85b80d223414f32365a9175978a38cb4/plot_limo_data.ipynb | bsd-3-clause | # Authors: Jose C. Garcia Alanis <alanis.jcg@gmail.com>
#
# License: BSD (3-clause)
import numpy as np
import matplotlib.pyplot as plt
from mne.datasets.limo import load_data
from mne.stats import linear_regression
from mne.viz import plot_events, plot_compare_evokeds
from mne import combine_evoked
print(__doc__)
... |
dh7/ML-Tutorial-Notebooks | word2vec/word2vec.ipynb | bsd-2-clause | # import and init
from annoy import AnnoyIndex
import gensim
import os.path
import numpy as np
prefix_filename = 'word2vec'
ann_filename = prefix_filename + '.ann'
i2k_filename = prefix_filename + '_i2k.npy'
k2i_filename = prefix_filename + '_k2i.npy'
"""
Explanation: A Word2Vec playground
To play with this notebook,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.