repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
sns-chops/multiphonon
tests/notebooks/getdos.ipynb
mit
# where am I now? !pwd # create a new working directory and change into it workdir = '~/reduction/ARCS/getdos-demo' !mkdir -p {workdir} %cd {workdir} # Data to reduce. Change the IPTS number and run numbers to suit your need samplenxs = "/SNS/ARCS/IPTS-17327/data/ARCS_83914_event.nxs" mtnxs = "/SNS/ARCS/IPTS-17327/da...
mkuron/espresso
doc/tutorials/11-ferrofluid/11-ferrofluid_part2.ipynb
gpl-3.0
import espressomd espressomd.assert_features('DIPOLES', 'LENNARD_JONES') from espressomd.magnetostatics import DipolarP3M from espressomd.magnetostatic_extensions import DLC import numpy as np """ Explanation: Ferrofluid - Part II Table of Contents Applying an external magnetic field Magnetization curve Remark: Th...
ES-DOC/esdoc-jupyterhub
notebooks/awi/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', 'awi', 'sandbox-3', 'aerosol') """ Explanation: ES-DOC CMIP6 Model Properties - Aerosol MIP Era: CMIP6 Institute: AWI Source ID: SANDBOX-3 Topic: Aerosol Sub-Topics: Transport, Emissions, Concent...
retnuh/deep-learning
tensorboard/Anna_KaRNNa_Name_Scoped.ipynb
mit
import time from collections import namedtuple import numpy as np import tensorflow as tf """ Explanation: Anna KaRNNa In this notebook, I'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 base...
dato-code/tutorials
notebooks/fraud-detection.ipynb
apache-2.0
import graphlab as gl data = gl.SFrame('fraud_detection.sf') data.head(3) len(data) data.show() """ Explanation: Detecting Credit Card Fraud In this notebook we will use GraphLab Create to identify a large majority of fraud cases in real-world data from an online retailer. Starting by a simple fraud classifier we ...
flowersteam/naminggamesal
notebooks/6_Intro_Experiment_Database.ipynb
agpl-3.0
import naminggamesal.ngdb as ngdb import naminggamesal.ngsimu as ngsimu """ Explanation: Experiment Database End of explanation """ xp_cfg={ 'pop_cfg':{ 'voc_cfg':{ 'voc_type':'pandas', #'voc_type':'sparse_matrix', #'M':5, #'W':10 }, 'st...
ForestClaw/forestclaw
applications/clawpack/advection/2d/filament/filament.ipynb
bsd-2-clause
!filament """ Explanation: Filament Scalar advection problem with swirling velocity field. Run code in serial mode (will work, even if code is compiled with MPI) End of explanation """ !mpirun -n 4 filament """ Explanation: Or, run code in parallel mode (command may need to be customized, depending your on MPI in...
liufuyang/ManagingBigData_MySQL_DukeUniv
notebooks/MySQL_Exercise_01_Looking_at_Your_Data.ipynb
mit
%load_ext sql """ Explanation: Copyright Jana Schaich Borg/Attribution-NonCommercial 4.0 International (CC BY-NC 4.0) MySQL Exercise 1: Welcome to your first notebook! Database interfaces vary greatly across platforms and companies. The interface you will be using here, called Jupyter, is a web application designed f...
n-witt/MachineLearningWithText_SS2017
tutorials/9 Kernel Density Estimation.ipynb
gpl-3.0
%matplotlib inline import matplotlib.pyplot as plt import seaborn as sns; sns.set() import numpy as np """ Explanation: Kernel Density Estimation In this section we will discuss probability density estimation A density estimator is an algorithm which takes a $D$-dimensional dataset and produces an estimate of the $D$...
ga7g08/ga7g08.github.io
_notebooks/2015-07-17-Plotting-country-level-data-for-the-UK.ipynb
mit
%%bash cd ../data_sets/ wget http://census.edina.ac.uk/ukborders/easy_download/prebuilt/shape/England_ct_2011.zip -O zipdata.zip -q unzip -o zipdata.zip rm zipdata.zip """ Explanation: Plotting county level data for the UK In this post I wanted to give a simple example of plotting country level data. This uses the [ON...
cydcowley/Imperial-Visualizations
visuals_mechanics/mechanics_pulse_at_interface/pulse_at_interface.ipynb
mit
# import libraries/packages to be used import plotly.figure_factory as ff from plotly.offline import download_plotlyjs,init_notebook_mode,plot,iplot import plotly.graph_objs as go init_notebook_mode(connected=True) import numpy as np # Variables # x-coordinates n = 200 x = np.linspace(-10, 10, n) # Initialise inciden...
ARCHER-CSE/ci-monitoring
monitoring/io/analysis/benchioPerformanceAnalysis.ipynb
gpl-3.0
import sys import os.path import re from glob import glob from datetime import datetime """ Explanation: Analysis of performance variation of parallel I/O This notebook analyses the performance variation for write the single shared file (SSF) and file per process (FPP) on ARCHER. Results are from the benchio benchmark...
trsherborne/learn-python
lesson4.ipynb
mit
# Remember we declare an empty list as so my_list = [] # Add new elements to the end of a previous list my_list.append(1) my_list.append('Hello') my_list.append(0.05) # Delete specific elements del my_list[-1] # Remove by index my_list.remove('Hello') # Remove by value # Replace elements my_list[0...
AllenDowney/ProbablyOverthinkingIt
trivers12.ipynb
mit
from __future__ import print_function, division import thinkstats2 import thinkplot import pandas as pd import numpy as np import statsmodels.formula.api as smf %matplotlib inline """ Explanation: Does Trivers-Willard apply to people? This notebook contains a "one-day paper", my attempt to pose a research question...
atlury/deep-opencl
DL0110EN/2.5.1_training_and_validation_v2.ipynb
lgpl-3.0
# Import libraries we need for this lab, and set the random seed from torch import nn import torch import numpy as np import matplotlib.pyplot as plt from torch import nn,optim """ Explanation: <a href="http://cocl.us/pytorch_link_top"> <img src="https://cocl.us/Pytorch_top" width="750" alt="IBM 10TB Storage" /> ...
GoogleCloudPlatform/vertex-ai-samples
notebooks/community/sdk/sdk_automl_forecasting_evaluating_a_model.ipynb
apache-2.0
%%capture !pip3 uninstall -y google-cloud-aiplatform !pip3 install google-cloud-aiplatform import IPython app = IPython.Application.instance() app.kernel.do_shutdown(True) import sys if "google.colab" in sys.modules: from google.colab import auth auth.authenticate_user() """ Explanation: Vertex AI Model B...
Naereen/notebooks
Generating_permutations_with_Python.ipynb
mit
from __future__ import print_function, division # Python 2 compatibility if needed """ Explanation: Generating permutations, several approaches with Python This small notebook implements, in Python 3, several algorithms aiming at a simple task: given a certain list, generate all the permutations of the list. For inst...
mjirik/lisa
examples/liver_left_right_segmentation.ipynb
bsd-3-clause
# 6, 11, 16 nefunguje ircad_id = "10" ircad_id = "12" ircad_id = "11" ircad_id = "20" pth_left = f"C:/Users/Jirik/lisa_data/ircad{ircad_id}_left.pklz" pth_left = f"G:\Můj disk\data\medical\orig\ircad_left_right/patient_dicom_seg{ircad_id}.pklz" pth_liver = f"C:/Users/Jirik/data/medical/orig/3Dircadb1.{ircad_id}/MASKS_...
parklab/PaSDqc
examples/04_example-dispersion_estimation/Dispersion_comparisons.ipynb
mit
import seaborn as sns import pandas as pd import numpy as np import matplotlib.pyplot as plt import pathlib import sys import scipy.stats import pathlib import PaSDqc %matplotlib inline sns.set_style('ticks', {'ytick.minor.size': 0.0, 'xtick.minor.size': 0.0}) sns.set_context('poster') """ Explanation: Introduction...
ZuckermanLab/NMpathAnalysis
test/Clustering_test.ipynb
gpl-3.0
import sys sys.path.append("../") sys.path.append("../nmpath/") from test.tools_for_notebook import * %matplotlib inline from nmpath.auxfunctions import * from nmpath.mfpt import * from nmpath.mappers import rectilinear_mapper from nmpath.clustering import * #from nmpath.mappers import voronoi_mapper """ Explanation: ...
cuttlefishh/emp
code/02-sequence-processing/sequence_length.ipynb
bsd-3-clause
import pandas as pd import numpy as np import re import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline """ Explanation: author: lukethompson@gmail.com<br> date: 23 Oct 2017<br> language: Python 3.5<br> conda enviroment: emp-py3<br> license: BSD3<br> sequence_length.ipynb Distribution of study sequen...
ES-DOC/esdoc-jupyterhub
notebooks/nerc/cmip6/models/hadgem3-gc31-hh/land.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'nerc', 'hadgem3-gc31-hh', 'land') """ Explanation: ES-DOC CMIP6 Model Properties - Land MIP Era: CMIP6 Institute: NERC Source ID: HADGEM3-GC31-HH Topic: Land Sub-Topics: Soil, Snow, Vegetation, ...
kimkipyo/dss_git_kkp
Python 복습/13일차.목_pandas + SQL/13일차_2T_Pandas로 배우는 SQL 시작하기 (2) - JOIN ON.ipynb
mit
import pymysql db = pymysql.connect( "db.fastcamp.us", "root", "dkstncks", "world", charset='utf8', ) df = pd.read_sql("SELECT * FROM Country;", db) #cursor cursor = db.cursor() # 1. 실제로 명령을 수행하는 부분 - 서버 cursor.execute("SELECT * FROM Country;") # 2. 데이터를 가져오는 부분 - 서버 => 클라이언트 curso...
evanmiltenburg/python-for-text-analysis
Chapters/Chapter 17 - Data formats II (JSON).ipynb
apache-2.0
dict_doe_family = { "John": { "first name": "John", "last name": "Doe", "gender": "male", "age": 30, "favorite_animal": "panda", "married": True, "children": ["James", "Jennifer"], "hobbies": ["photography", "sky diving", "reading"]}, "Jan...
google-research/recsim
recsim/colab/RecSim_Overview.ipynb
apache-2.0
# @title Install !pip install --upgrade --no-cache-dir recsim !pip install -q tf-nightly-2.0-preview # Load the TensorBoard notebook extension %load_ext tensorboard #@title Importing generics import numpy as np import tensorflow as tf """ Explanation: Copyright 2019 The RecSim Authors. Licensed under the Apache Licen...
jasonfrowe/Kepler
example/PythonExample.ipynb
gpl-3.0
#Import module import transitfit5 as tf #import transitfit5 modules %matplotlib inline """ Explanation: Using Python Wrappers A quick example to use python to read in three-column photometry files, model files and TTVs and then do a transit model fit to the data. Currently there are binds for the transitfit5 tool su...
neurodata/ndparse
examples/isbi2012_train.ipynb
apache-2.0
%load_ext autoreload %autoreload 2 %matplotlib inline import sys, os, copy, logging, socket, time import numpy as np import pylab as plt #from ndparse.algorithms import nddl as nddl #import ndparse as ndp sys.path.append('..'); import ndparse as ndp try: logger except: # do this precisely once logger = ...
agile-geoscience/striplog
docs/tutorial/12_Calculate_sand_proportion.ipynb
apache-2.0
text = """top,base,comp number 24.22,24.17,20 24.02,23.38,19 22.97,22.91,18 22.67,22.62,17 21.23,21.17,16 19.85,19.8,15 17.9,17.5,14 17.17,15.5,13 15.18,14.96,12 14.65,13.93,11 13.4,13.05,10 11.94,11.87,9 10.17,10.11,8 7.54,7.49,7 6,5.95,6 5.3,5.25,5 4.91,3.04,4 2.92,2.6,3 2.22,2.17,2 1.9,1.75,1""" """ Explanation: Ca...
nsrchemie/code_guild
wk0/notebooks/challenges/pins/pins_challenge.ipynb
mit
## Constants used by this program CONSONANTS = "bcdfghjklmnpqrstvwyz" VOWELS = "aeiou" def convert_pin(pin): pin1 = pin.pop() pass pin1 = pi pin = '2363' pin1 = list(pin) def remove_end(g): """ Explanation: <small><i>This notebook was prepared by Thunder Shiviah. Source and license info is on Git...
IsacLira/data-science-cookbook
2016/logistic-regression/plot_iris_logistic.ipynb
mit
print(__doc__) # Code source: Gaël Varoquaux # Modified for documentation by Jaques Grobler # License: BSD 3 clause import numpy as np import matplotlib.pyplot as plt from sklearn import linear_model, datasets # import some data to play with iris = datasets.load_iris() X = iris.data[:, :2] # we only take the first...
WNoxchi/Kaukasos
FADL1/custom_model.ipynb
mit
%reload_ext autoreload %autoreload 2 %matplotlib inline from fastai.transforms import * from fastai.conv_learner import * from fastai.model import * from fastai.dataset import * from fastai.sgdr import * from fastai.plots import * import pandas as pd import numpy as np path = 'data/gloc/' model_path = path + 'results...
omoju/Fundamentals
Data/data_EDA_1_preprocessData.ipynb
gpl-3.0
%pylab inline # Import libraries from __future__ import absolute_import, division, print_function # Ignore warnings import warnings warnings.filterwarnings('ignore') import numpy as np import pandas as pd from sklearn.externals import joblib # Graphing Libraries import matplotlib.pyplot as pyplt import seaborn as s...
ercius/openNCEM
ncempy/notebooks/example_peak_find.ipynb
gpl-3.0
%matplotlib notebook import numpy as np import matplotlib.pyplot as plt # Import these from ncempy.algo from ncempy.algo import gaussND from ncempy.algo import peak_find """ Explanation: Example of how to find peaks in a synthetic image Create a set of 2D Gaussians Find the center of the Guassian to integer accurac...
xaibeing/cn-deep-learning
language-translation/dlnd_language_translation.ipynb
mit
""" DON'T MODIFY ANYTHING IN THIS CELL """ import helper import problem_unittests as tests source_path = 'data/small_vocab_en' target_path = 'data/small_vocab_fr' source_text = helper.load_data(source_path) target_text = helper.load_data(target_path) """ Explanation: 语言翻译 在此项目中,你将了解神经网络机器翻译这一领域。你将用由英语和法语语句组成的数据集,训练一个...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/production_ml/labs/sdk_metric_parameter_tracking_for_custom_jobs.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" # Install additi...
metpy/MetPy
v1.1/_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 ...
QuantCrimAtLeeds/PredictCode
examples/Prospective HotSpot.ipynb
artistic-2.0
%matplotlib inline import matplotlib.pyplot as plt import numpy as np import open_cp import open_cp.prohotspot as phs # Generate some random data import datetime times = [datetime.datetime(2017,3,10) + datetime.timedelta(days=np.random.randint(0,10)) for _ in range(20)] times.sort() xc = np.random.random(size=20) * 5...
statsmodels/statsmodels.github.io
v0.13.0/examples/notebooks/generated/statespace_news.ipynb
bsd-3-clause
%matplotlib inline import numpy as np import pandas as pd import statsmodels.api as sm import matplotlib.pyplot as plt macrodata = sm.datasets.macrodata.load_pandas().data macrodata.index = pd.period_range('1959Q1', '2009Q3', freq='Q') """ Explanation: Forecasting, updating datasets, and the "news" In this notebook,...
jinntrance/MOOC
coursera/ml-classification/assignments/module-2-linear-classifier-assignment-blank.ipynb
cc0-1.0
from __future__ import division import graphlab import math import string """ Explanation: Predicting sentiment from product reviews The goal of this first notebook is to explore logistic regression and feature engineering with existing GraphLab functions. In this notebook you will use product review data from Amazon....
d-k-b/udacity-deep-learning
intro-to-tflearn/TFLearn_Sentiment_Analysis_Solution.ipynb
mit
import pandas as pd import numpy as np import tensorflow as tf import tflearn from tflearn.data_utils import to_categorical """ Explanation: Sentiment analysis with TFLearn In this notebook, we'll continue Andrew Trask's work by building a network for sentiment analysis on the movie review data. Instead of a network w...
rusucosmin/courses
ml/ex01/solution/taskC_detailed.ipynb
mit
%matplotlib inline import numpy as np from numpy.random import rand, randn import matplotlib.pyplot as plt %load_ext autoreload %autoreload 2 # Data generation n, d, k = 100, 2, 2 np.random.seed(20) X = rand(n, d) means = [rand(d) * 0.5 + 0.5 , - rand(d) * 0.5 + 0.5] # for better plotting when k = 2 S = np.diag(rand...
mlund/labs
excess/excess.ipynb
gpl-3.0
# evaluate this cell to show a movie about MC from IPython.display import HTML HTML('<iframe width="560" height="315" src="https://www.youtube.com/embed/xVvUFB5Hk-g?rel=0&amp;controls=1&amp;showinfo=0" frameborder="0" allowfullscreen></iframe>') """ Explanation: Monte Carlo Simulation Exercise: Electrolyte Solutions ...
d00d/quantNotebooks
Notebooks/quantopian_research_public/notebooks/lectures/Arbitrage_Pricing_Theory/notebook.ipynb
unlicense
import numpy as np import pandas as pd from statsmodels import regression import matplotlib.pyplot as plt """ Explanation: Arbitrage Pricing Theory By Evgenia "Jenny" Nitishinskaya, Delaney Granizo-Mackenzie, and Maxwell Margenot. Part of the Quantopian Lecture Series: www.quantopian.com/lectures github.com/quantopia...
tensorflow/docs
site/en/r1/tutorials/load_data/images.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...
jforbess/pvlib-python
docs/tutorials/tmy.ipynb
bsd-3-clause
# built in python modules import datetime import os import inspect # python add-ons import numpy as np import pandas as pd # plotting libraries %matplotlib inline import matplotlib.pyplot as plt try: import seaborn as sns except ImportError: pass import pvlib """ Explanation: TMY tutorial This tutorial show...
DavidQiuChao/CS231nHomeWorks
assignment1/knn.ipynb
mit
# Run some setup code for this notebook. import random import numpy as np from cs231n.data_utils import load_CIFAR10 import matplotlib.pyplot as plt from __future__ import print_function # This is a bit of magic to make matplotlib figures appear inline in the notebook # rather than in a new window. %matplotlib inlin...
tensorflow/docs
site/en/tutorials/load_data/numpy.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...
Ruediger-Braun/compana16
Lektion13.ipynb
gpl-3.0
from sympy import * init_printing() from IPython.display import display """ Explanation: Lektion 13 End of explanation """ x = Symbol('x') y = Function('y') dgl = Eq(y(x).diff(x, 2), -1/x*y(x).diff(x) + 1/x**2*y(x) +4*y(x)) dgl #dsolve(dgl) # NotImplementedError #N = 8 N=18 a = [Symbol('a'+str(j)) for j in rang...
jonathanrocher/pandas_tutorial
climate_timeseries/climate_timeseries-Part1.ipynb
mit
%matplotlib inline import pandas as pd import numpy as np import matplotlib.pyplot as plt pd.set_option("display.max_rows", 16) LARGE_FIGSIZE = (12, 8) # Change this cell to the demo location on YOUR machine %cd ~/Projects/pandas_tutorial/climate_timeseries/ %ls """ Explanation: Last updated: June 29th 2016 Climat...
brentp/pedagree
data/paper-figures.ipynb
mit
DATA = "/data/" # directory where VCFs are KEPT %%bash -s $DATA DATA=$1 echo "$1" mkdir -p plots/ python -m peddy --prefix plots/ceph1463 --plot ${DATA}/ceph1463.vcf.gz ${DATA}/ceph1463.ped """ Explanation: CEPH1463 Setup We first download the ceph1463 VCF and ped into our data-directory and then run peddy. We can se...
karlstroetmann/Artificial-Intelligence
Python/3 Games/Alpha-Beta-Pruning-Pure.ipynb
gpl-2.0
import random random.seed(0) """ Explanation: Alpha-Beta Pruning This notebook implements alpha-beta pruning. Memoization techniques are only added in a naive way since adding these techniques in a sophisticated way results in an algorithm that is quite complicated. Effectively, this notebook is a game solver because ...
google/starthinker
colabs/dv360_api_to_bigquery.ipynb
apache-2.0
!pip install git+https://github.com/google/starthinker """ Explanation: 1. Install Dependencies First install the libraries needed to execute recipes, this only needs to be done once, then click play. End of explanation """ CLOUD_PROJECT = 'PASTE PROJECT ID HERE' print("Cloud Project Set To: %s" % CLOUD_PROJECT) ...
UDST/activitysim
activitysim/examples/example_estimation/notebooks/02_school_location.ipynb
bsd-3-clause
import larch # !conda install larch #for estimation import pandas as pd import numpy as np import yaml import larch.util.excel import os """ Explanation: Estimating School Location Choice This notebook illustrates how to re-estimate a single model component for ActivitySim. This process includes running ActivitySi...
staeiou/assorted-notebooks
infinite_scream/2017-02-14/infinite_scream.ipynb
mit
!pip install tweepy pandas seaborn """ Explanation: Graphing the number of favorites to @infinite_scream over time By R. Stuart Geiger (@staeiou), Released CC-BY 4.0 & MIT License Setup Installing dependencies End of explanation """ import random import twitter_login # a file containing my API keys import tweepy ...
jasonpcasey/ipeds-peers
peer_examples.ipynb
mit
nx.degree(g, 3) nx.degree(g, 4) """ Explanation: A node's degree is the number of connections it has. End of explanation """ nx.clustering(g, 0) nx.clustering(g, 4) nx.clustering(g, 1) """ Explanation: The local clustering coefficient is the fraction of a node's connections that are also connected. End of explan...
joeandrewkey/deep-learning
first-neural-network/Your_first_neural_network.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...
CubeBrowser/cube-explorer
notebooks/CubeExplorer_Prototype.ipynb
bsd-3-clause
import iris import numpy as np import holoviews as hv import holocube as hc from cartopy import crs from cartopy import feature as cf hv.notebook_extension() """ Explanation: This is an initial prototype for the cube-explorer project to integrate Iris, Cartopy and HoloViews to allow easily exploring Iris Cubes of N-d...
Olsthoorn/TransientGroundwaterFlow
Syllabus_in_notebooks/Sec6_5_6_superposition_space_Theis-wells.ipynb
gpl-3.0
from scipy.special import exp1 as W import numpy as np import matplotlib.pyplot as plt import pandas as pd from matplotlib.animation import FuncAnimation from IPython.display import HTML import pdb def newfig(title, xlabel, ylabel, xlim=None, ylim=None, xscale=None, yscale=None, size_inches=(12, 5), fonts...
seva100/optic-nerve-cnn
scripts/U-Net, OD cup on DRISHTI-GS, cropped by OD (fold 0).ipynb
mit
%load_ext autoreload %autoreload 2 import os import glob from datetime import datetime #import warnings #warnings.simplefilter('ignore') import scipy as sp import scipy.ndimage import numpy as np import pandas as pd import tensorflow as tf import skimage import skimage.exposure import skimage.transform import mahotas ...
qutip/qutip-notebooks
examples/piqs-open-dicke-model.ipynb
lgpl-3.0
import matplotlib as mpl from matplotlib import cm import matplotlib.pyplot as plt from qutip import * from qutip.piqs import * #TLS parameters N = 6 ntls = N nds = num_dicke_states(ntls) [jx, jy, jz] = jspin(N) jp = jspin(N, "+") jm = jp.dag() w0 = 1 gE = 0.1 gD = 0.01 gP = 0.1 gCP = 0.1 gCE = 0.1 gCD = 0.1 h = w0 *...
jdvelasq/ingenieria-economica
02-flujos-de-efectivo-y-tasas.ipynb
mit
# Importa la librería financiera. # Solo es necesario ejecutar la importación una sola vez. import numpy as np import pandas as pd import matplotlib.pyplot as plt import cashflows as cf """ Explanation: Representación de flujos de efectivo y tasas de interés Juan David Velásquez Henao jdvelasq@unal.edu.co Universidad...
mathLab/RBniCS
tutorials/09_advection_dominated/tutorial_advection_dominated_1_pod.ipynb
lgpl-3.0
from dolfin import * from rbnics import * from problems import * from reduction_methods import * """ Explanation: Tutorial 09 - Advection Dominated problem Keywords: POD-Galerkin method, SUPG 1. Introduction This tutorial addresses the POD-Galerkin method to the advection dominated worked problem in a two-dimensional ...
edosedgar/stm32f0_ARM
labs/09_usart_terminal/notebook/09_usart_terminal.ipynb
mit
import serial import pyaudio import numpy as np import wave import scipy.signal as signal import warnings warnings.filterwarnings('ignore') """ Explanation: В данном ноутбуке вам предлагается написать различные обработчики для команд с компьютера.Также можно реализовать свой дополнительный набор команд под свои задачи...
kaizu/nurgle
notebooks/index.ipynb
gpl-3.0
from jupyterthemes.stylefx import set_nb_theme set_nb_theme('grade3') import os PREFIX = os.environ.get('PWD', '.') # PREFIX = "../build/outputs" import numpy import pandas import plotly.graph_objs as go import plotly.figure_factory as ff from plotly.offline import init_notebook_mode, iplot init_notebook_mode(connec...
bassio/omicexperiment
doc/03_experiment_filters.ipynb
bsd-3-clause
%load_ext autoreload %autoreload 2 #Load our data from omicexperiment.experiment.microbiome import MicrobiomeExperiment mapping = "example_map.tsv" biom = "example_fungal.biom" tax = "blast_tax_assignments.txt" exp = MicrobiomeExperiment(biom, mapping,tax) """ Explanation: Experiment objects filters - the rationale...
hyunny88/study
regression/LogisticRegression.ipynb
unlicense
import tensorflow as tf import numpy as np xy = np.loadtxt('../data/logistic_data.txt',unpack=True, dtype='float32') x_data = xy[0:-1] y_data = xy[-1] """ Explanation: Logistic Classfication https://ko.wikipedia.org/wiki/%EB%A1%9C%EC%A7%80%EC%8A%A4%ED%8B%B1_%ED%9A%8C%EA%B7%80 End of explanation """ x_data = [ [1,2...
tommyogden/maxwellbloch
docs/usage/built-in-time-functions.ipynb
mit
from maxwellbloch import t_funcs tlist = np.linspace(0., 1., 201) """ Explanation: Built-in Time Functions Field profiles are defined as functions of time. A base rabi_freq is multiplied by a time function rabi_freq_t_func and related arguments rabi_freq_t_args. For example, a Gaussian pulse with a peak of $\Omega_0...
Maluuba/qgen-workshop
notebook.ipynb
mit
import tensorflow as tf from qgen.embedding import glove embedding = tf.get_variable("embedding", initializer=glove) EMBEDDING_DIMENS = glove.shape[1] """ Explanation: <img src="assets/Maluuba_Microsoft_Brandmark_Colour.png" width="60%"/> Deep Learning for Language A tutorial prepared by Maluuba Prepared by Justin ...
zzsza/Datascience_School
27. 모형 최적화/02. 모형 최적화 분산 처리.ipynb
mit
from ipyparallel import Client c = Client() c.ids dview = c[:] dview """ Explanation: 모형 최적화 분산 처리 ipyparallel http://ipyparallel.readthedocs.org/en/latest/index.html Engine <-> Client Engine: 실제 계산이 실행되는 프로세스 Client: 엔진을 제어하기 위한 인터페이스 $ conda install ipyparallel Engine 가동/중지 가동 $ ipcluster start -n 4 중지 C...
mohanprasath/Course-Work
numpy/numpy_exercises_from_kyubyong/Set_routines_Solutions.ipynb
gpl-3.0
import numpy as np np.__version__ author = 'kyubyong. longinglove@nate.com' """ Explanation: Set routines End of explanation """ x = np.array([1, 2, 6, 4, 2, 3, 2]) out, indices = np.unique(x, return_inverse=True) print "unique elements =", out print "reconstruction indices =", indices print "reconstructed =", out...
ML4DS/ML4all
U_lab1.Clustering/Lab_ShapeSegmentation_draft/LabSessionClustering.ipynb
mit
%matplotlib inline import numpy as np import matplotlib.pyplot as plt from scipy.misc import imread """ Explanation: Lab Session: Clustering algorithms for Image Segmentation Author: Jesús Cid Sueiro Jan. 2017 End of explanation """ name = "birds.jpg" name = "Seeds.jpg" birds = imread("Images/" + name) birdsG = np....
daniel-koehn/Theory-of-seismic-waves-II
00_Intro_Python_Jupyter_notebooks/0_Jupyter_Python_short_intro.ipynb
gpl-3.0
# Execute this cell to load the notebook's style sheet, then ignore it from IPython.core.display import HTML css_file = '../style/custom.css' HTML(open(css_file, "r").read()) """ Explanation: Content under Creative Commons Attribution license CC-BY 4.0, code under BSD 3-Clause License © 2017 L.A. Barba, N.C. Clementi,...
vzhuang/osim-rl
scripts/train.arm.ipynb
mit
# Derived from keras-rl import opensim as osim import numpy as np import sys from keras.models import Sequential, Model from keras.layers import Dense, Activation, Flatten, Input, concatenate from keras.optimizers import Adam import numpy as np from rl.agents import DDPGAgent from rl.memory import SequentialMemory f...
goodwordalchemy/thinkstats_notes_and_exercises
code/chap07_relationships_btw_vars_notes.ipynb
gpl-3.0
df = df.dropna(subset=['htm3', 'wtkg2']) bins = np.arange(135, 210, 5) indices = np.digitize(df.htm3, bins) groups = df.groupby(indices) for i, group in groups: print i, len(group) heights = [group.htm3.mean() for i, group in groups] cdfs = [thinkstats2.Cdf(group.wtkg2) for i, group in groups] for percent in...
zaqwes8811/micro-apps
self_driving/deps/Kalman_and_Bayesian_Filters_in_Python_master/09-Nonlinear-Filtering.ipynb
mit
from __future__ import division, print_function %matplotlib inline #format the book import book_format book_format.set_style() """ Explanation: Table of Contents Nonlinear Filtering End of explanation """ import numpy as np from numpy.random import randn import matplotlib.pyplot as plt N = 5000 a = np.pi/2. + (ran...
espressofiend/NCIL-SOC-2015
Production fMRI example/parse_pdxn_fMRI_logs.ipynb
mit
validTrials = df[pd.notnull(df['WORD'])] validTrials[0:5] """ Explanation: Select only rows with stimulus words (so, where WORD != NaN) End of explanation """ fMRIruns = {'STUDY0', 'STUDY1', 'TEST0', 'TEST1'} Conditions = {'P':'Produced', 'S':'SilentView', 'Y':'MotorControl', 'FOIL':'Foil'} for run in fMRIruns: ...
mayank-johri/LearnSeleniumUsingPython
Section 3 - Machine Learning/ThirdParty-scikit-learn-videos-master/05_model_evaluation.ipynb
gpl-3.0
# read in the iris data from sklearn.datasets import load_iris iris = load_iris() # create X (features) and y (response) X = iris.data y = iris.target """ Explanation: Comparing machine learning models in scikit-learn From the video series: Introduction to machine learning with scikit-learn Agenda How do I choose wh...
keras-team/keras-io
examples/vision/ipynb/3D_image_classification.ipynb
apache-2.0
import os import zipfile import numpy as np import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers """ Explanation: 3D image classification from CT scans Author: Hasib Zunair<br> Date created: 2020/09/23<br> Last modified: 2020/09/23<br> Description: Train a 3D convolutional neural n...
adricnet/dfirnotes
win5mem-jupyter.ipynb
mit
!vol.py --plugins=/home/sosift/f/dfirnotes/ -f /cases/win5mem/winxp_java6-meterpreter.vmem --profile WinXPSP2x86 imageinfo ## Get setup to process memory with Volatility, analyse data with Pandas, chart with matplotlib ## Charting tips from https://datasciencelab.wordpress.com/2013/12/21/beautiful-plots-with-pandas-an...
ES-DOC/esdoc-jupyterhub
notebooks/snu/cmip6/models/sandbox-3/landice.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'snu', 'sandbox-3', 'landice') """ Explanation: ES-DOC CMIP6 Model Properties - Landice MIP Era: CMIP6 Institute: SNU Source ID: SANDBOX-3 Topic: Landice Sub-Topics: Glaciers, Ice. Properties: 3...
brian-rose/ClimateModeling_courseware
Lectures/LectureTemplate.ipynb
mit
# Ensure compatibility with Python 2 and 3 from __future__ import print_function, division """ Explanation: ATM 623: Climate Modeling Brian E. J. Rose, University at Albany Lecture N: No title About these notes: This document uses the interactive Jupyter notebook format. The notes can be accessed in several different...
c24b/c24b.github.io
cours/graphviz/Tuto_graph_with_python.ipynb
gpl-2.0
#importer les libraires #pour afficher import matplotlib.pyplot as plt #pour le calcul import numpy as np #pour le réseau import networkx as nx %matplotlib inline #instancier le graph g = nx.Graph() #ajouter un noeud #g.add_node("paul") #ajouter une liste de noeud g.add_nodes_from(["paul", "matthieu", "jean", "luc", ...
julianogalgaro/udacity
nd101/c2l8-sentiment-analysis/sentiment_network/Sentiment Classification - Mini Project 5.ipynb
mit
def pretty_print_review_and_label(i): print(labels[i] + "\t:\t" + reviews[i][:80] + "...") g = open('reviews.txt','r') # What we know! reviews = list(map(lambda x:x[:-1],g.readlines())) g.close() g = open('labels.txt','r') # What we WANT to know! labels = list(map(lambda x:x[:-1].upper(),g.readlines())) g.close()...
zzsza/TIL
pytorch/Tutorial.ipynb
mit
import torch x = torch.Tensor(5, 3) print(x) len(x) x.shape y = torch.rand(5,3) print(y) print(x + y) print(torch.add(x, y)) result = torch.Tensor(5, 3) print(result) torch.add(x, y, out=result) print(result) print('before y:', y) y.add_(x) print('after y:', y) x.t_() """ Explanation: What is pytorch? gpu...
Naereen/notebooks
Oraux_CentraleSupelec_PSI__Juin_2019.ipynb
mit
import numpy as np import matplotlib as mpl mpl.rcParams['figure.figsize'] = (10, 7) import matplotlib.pyplot as plt from scipy import integrate import numpy.random as rd import seaborn as sns sns.set(context="notebook", style="whitegrid", palette="hls", font="sans-serif", font_scale=1.1) """ Explanation: Table of Co...
mit-crpg/openmc
examples/jupyter/search.ipynb
mit
# Initialize third-party libraries and the OpenMC Python API import matplotlib.pyplot as plt import numpy as np import openmc import openmc.model %matplotlib inline """ Explanation: Criticality Search This notebook illustrates the usage of the OpenMC Python API's generic eigenvalue search capability. In this Notebo...
Kaggle/learntools
notebooks/intro_to_programming/raw/tut2.ipynb
apache-2.0
# Define the function def add_three(input_var): output_var = input_var + 3 return output_var """ Explanation: Introduction In this lesson, you will learn how to organize your code with functions. A function is a block of code designed to perform a specific task. As you'll see, functions will let you do rough...
n-witt/MachineLearningWithText_SS2017
tutorials/6 Decision Trees and Random Forests.ipynb
gpl-3.0
%matplotlib inline import numpy as np import matplotlib.pyplot as plt import seaborn as sns; sns.set() """ Explanation: Decision Trees and Random Forests We'll take a look at a powerful, non-parametric algorithm called random forests. Random forests are an example of an ensemble method, meaning that it relies on ag...
ireapps/pycar
completed/basics_complete_notebook.ipynb
mit
# This could just as easily be 'horse' or 'Helen' or 'Agamemnon' or `sand` -- or 'Trojan' search_term = 'Achilles' """ Explanation: Python Basics at PyCAR2020 Let's search some text You already know the components of programming. You have been exercising the reasoning programming relies on for your entire life, probab...
rabernat/pyqg
docs/examples/two-layer.ipynb
mit
import numpy as np from matplotlib import pyplot as plt %matplotlib inline import pyqg """ Explanation: Two Layer QG Model Example Here is a quick overview of how to use the two-layer model. See the :py:class:pyqg.QGModel api documentation for further details. First import numpy, matplotlib, and pyqg: End of explanati...
ES-DOC/esdoc-jupyterhub
notebooks/ncar/cmip6/models/sandbox-2/ocnbgchem.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'ncar', 'sandbox-2', 'ocnbgchem') """ Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem MIP Era: CMIP6 Institute: NCAR Source ID: SANDBOX-2 Topic: Ocnbgchem Sub-Topics: Tracers. Properties:...
seewhydee/ntuphys_nb
jupyter/gradqm/scattering.ipynb
gpl-3.0
%matplotlib inline import numpy as np import matplotlib.pyplot as plt ## Function to estimate the first Born contribution to the scattering amplitude f. ## The inputs are: ## ## Vfun -- A function object. The function should take an array [x, y, z] ## and return the value of the potential V(x,y,z). ## ki,...
hershaw/data-science-101
course/class2/01-clean/examples/00-kill.ipynb
mit
import pandas as pd import numpy as np % matplotlib inline from matplotlib import pyplot as plt """ Explanation: 01-kill This notebook presents how to eliminate the diagnosed outliers. Some inital imports: End of explanation """ data = pd.read_csv('../../data/all_data.csv', index_col=0) print('Our dataset has %d co...
WNoxchi/Kaukasos
FACLA/L3-notes.ipynb
mit
import torch import numpy as np Q = np.eye(3) print(Q) print(Q.T) print(Q @ Q.T) # construct I matrix Q = torch.eye(3) # torch matrix multip # torch.mm(Q, Q.transpose) Q @ torch.t(Q) """ Explanation: FCLA/FNLA Fast.ai Numerical/Computational Linear Algebra Lecture 3: New Perspectives on NMF, Randomized SVD Notes / ...
planet-os/notebooks
api-examples/rtofs-reftime-vs-time.ipynb
mit
%matplotlib inline import pandas as pd import simplejson as json from urllib.parse import urlencode from urllib.request import urlopen, Request import datetime import numpy as np """ Explanation: API Time Selectors - Using Start, End, and Reftime with Forecast Data Forecast datasets typically have two time dimensions...
glasperfan/thesis
bach_code/legacy/NLL Curves.ipynb
apache-2.0
%matplotlib inline import numpy as np import scipy as sp import matplotlib as mpl import matplotlib.cm as cm import matplotlib.pyplot as plt import pandas as pd pd.set_option('display.width', 500) pd.set_option('display.max_columns', 100) pd.set_option('display.notebook_repr_html', True) import seaborn as sns sns.set_s...
JeffAbrahamson/MLWeek
practicum/05_regression/regression_logistique.ipynb
gpl-3.0
# Inspired by https://stackoverflow.com/questions/20045994/how-do-i-plot-the-decision-boundary-of-a-regression-using-matplotlib # and http://stackoverflow.com/questions/28256058/plotting-decision-boundary-of-logistic-regression X = np.array(rouge + bleu) y = [1] * len(rouge) + [0] * len(bleu) logreg = LogisticRegress...
hamzamerzic/ml-playground
notebooks/nn-regression.ipynb
mit
# Used to clear up the workspace. %reset -f import numpy as np import pickle import tensorflow as tf from sklearn.model_selection import train_test_split # Load the data. data = pickle.load(open('../data/data-ant.pkl', 'rb')) actions = data['actions'] observations = data['observations'] X_train, X_test, y_train, y_t...
voyageth/udacity-Deep_Learning_Foundations_Nanodegree
tv-script-generation/dlnd_tv_script_generation.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...
mF2C/COMPSs
tests/sources/python/9_jupyter_notebook/src/simple.ipynb
apache-2.0
import pycompss.interactive as ipycompss """ Explanation: Test suite for Jupyter-notebook Sample example of use of PyCOMPSs from Jupyter First step Import ipycompss library End of explanation """ ipycompss.start(graph=True, trace=True, debug=True, project_xml='../project.xml', resources_xml='../resources.xml') """ ...