repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
phoebe-project/phoebe2-docs
2.1/tutorials/animations.ipynb
gpl-3.0
!pip install -I "phoebe>=2.1,<2.2" """ Explanation: Advanced: Animations NOTE: this tutorial may take a while to load in a browser as there are many embedded animations. Setup 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 installa...
lionell/university-labs
eco_systems/lab2.ipynb
mit
X = np.array([[500, 300], [150, 200]]) """ Explanation: Diversified economy Matrix $X$ - production needs, where $x_{ij}$ is how much of $i$-th product is needed to make $j$-th product End of explanation """ y = np.array([900, 500]) """ Explanation: Vector $y$ - consumer needs, where $y_i$ shows how much of $i$-th ...
marioberges/F16-12-752
homeworks/homework1/exercise0.ipynb
gpl-3.0
%matplotlib inline import numpy as np import matplotlib.pyplot as plt import sys print('Python version:') print(sys.version) print('Numpy version:') print(np.__version__) import sklearn print('Sklearn version:') print(sklearn.__version__) """ Explanation: 12-752: Data-Driven Building Energy Management Fall 2016, Car...
xpharry/Udacity-DLFoudation
tutorials/autoencoder/Convolutional_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) img = mnist.train.images[2] plt.imshow(img.reshape((28, 28)), cmap='Greys_r') """ Explanation: C...
gururajl/deep-learning
intro-to-rnns/Anna_KaRNNa.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...
DBWangGroupUNSW/COMP6714
BackProp-example.ipynb
mit
import torch import numpy as np from math import exp, log device = torch.device('cpu') """ Explanation: Back Propagation Example We do backprop in some concrete examples. Import the package and set device End of explanation """ def _acti(z): return 1.0 / (1.0 + exp(-z)) def acti(zs): return 1.0/(1.0 + np...
keylime1/courses_12-752
projects/kenanz/Final_Project.ipynb
mit
import numpy as np import matplotlib.pyplot as plt import datetime as dt %matplotlib inline """ Explanation: 12-752 Course Project Xiaowen Gu (xiaoweng), Kenan Zhang (kenanz) End of explanation """ gatesDateConverter = lambda d : dt.datetime.strptime(d,'%m/%d/%Y %H:%M') gates_elect = np.genfromtxt('pointData_gates.c...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive/05_artandscience/labs/b_hyperparam.ipynb
apache-2.0
!sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst # Ensure the right version of Tensorflow is installed. !pip freeze | grep tensorflow==2.5 import os PROJECT = 'cloud-training-demos' # REPLACE WITH YOUR PROJECT ID BUCKET = 'cloud-training-demos-ml' # REPLACE WITH YOUR BUCKET NAME REGION = 'us-central...
GoogleCloudPlatform/vertex-ai-samples
notebooks/community/sdk/sdk_automl_text_classification_online.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 SDK: AutoML training text classification model for online prediction <table align="left"...
Yu-Group/scikit-learn-sandbox
jupyter/backup_deprecated_nbs/19_refined_combined_run_through.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt from sklearn.datasets import load_breast_cancer import numpy as np from functools import reduce # Import our custom utilities from imp import reload from utils import irf_jupyter_utils from utils import irf_utils reload(irf_jupyter_utils) reload(irf_utils) """ Expla...
mitdbg/modeldb
client/workflows/demos/census-experiment-versioning-registry.ipynb
mit
# restart your notebook if prompted on Colab try: import verta except ImportError: !pip install verta """ Explanation: Logistic Regression (scikit-learn) Experiment Versioning & Registry <a href="https://colab.research.google.com/github/VertaAI/modeldb/blob/master/client/workflows/demos/census-experiment-versi...
brettavedisian/phys202-2015-work
assignments/assignment09/IntegrationEx01.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np from scipy import integrate """ Explanation: Integration Exercise 1 Imports End of explanation """ def trapz(f, a, b, N): """Integrate the function f(x) over the range [a,b] with N points.""" h=(b-a)/N k=np.arange(1,N) return h*(0....
thalesians/tsa
src/jupyter/python/foundations/linear-algebra-1.ipynb
apache-2.0
# Copyright (c) Thalesians Ltd, 2018-2019. All rights reserved # Copyright (c) Paul Alexander Bilokon, 2018-2019. All rights reserved # Author: Paul Alexander Bilokon <paul@thalesians.com> # Version: 3.0 (2019.05.27) # Previous versions: 1.0 (2018.08.03), 2.0 (2019.04.19) # Email: education@thalesians.com # Platform: T...
statsmodels/statsmodels.github.io
v0.13.2/examples/notebooks/generated/discrete_choice_example.ipynb
bsd-3-clause
%matplotlib inline import matplotlib.pyplot as plt import numpy as np import pandas as pd import statsmodels.api as sm from scipy import stats from statsmodels.formula.api import logit print(sm.datasets.fair.SOURCE) print(sm.datasets.fair.NOTE) dta = sm.datasets.fair.load_pandas().data dta["affair"] = (dta["affair...
yucelkilic/robotics
python3/python3_2.ipynb
gpl-3.0
a = 5 b = 6 a > b """ Explanation: Koşul Durumları Hiç kuşkusuz, koşula bağlı durumlar Python’daki en önemli konulardan biridir. Giriş bölümünde bahsettiğimiz koşullu işlemleri yapabilmek için ‘koşul deyimleri’ adı verilen birtakım araçlardan yararlanacağız. Gelin şimdi bu araçların neler olduğunu görelim (Özgül, Pyt...
lorserker/bridgesim
notebooks/Test_BBO_HandViewer.ipynb
mit
from IPython.display import IFrame IFrame('http://www.bridgebase.com/tools/handviewer.html?s=saj874ha986daca53&d=n&a=3cp?', width=250, height=250) """ Explanation: A Simulation Tutorial for Better Decisionmaking at Bridge This article describes how computers can be used to help with the analysis of decisions made at ...
computational-class/computational-communication-2016
code/.ipynb_checkpoints/0-Introduction-to-Non-Personalized-Recommenders-checkpoint.ipynb
mit
from IPython.core.display import Image Image(filename='./imgs/recsys_arch.png') """ Explanation: Introduction to Non-Personalized Recommenders The recommendation problem Recommenders have been around since at least 1992. Today we see different flavours of recommenders, deployed across different verticals: Amazon Ne...
ES-DOC/esdoc-jupyterhub
notebooks/cas/cmip6/models/fgoals-f3-h/ocean.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'cas', 'fgoals-f3-h', 'ocean') """ Explanation: ES-DOC CMIP6 Model Properties - Ocean MIP Era: CMIP6 Institute: CAS Source ID: FGOALS-F3-H Topic: Ocean Sub-Topics: Timestepping Framework, Advecti...
adityaka/misc_scripts
python-scripts/data_analytics_learn/link_pandas/Ex_Files_Pandas_Data/Exercise Files/02_11/Final/Resampling.ipynb
bsd-3-clause
# min: minutes my_index = pd.date_range('9/1/2016', periods=9, freq='min') my_index """ 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...
mtchem/Twitter-Politics
EDA.ipynb
mit
# load federal document data from pickle file fed_reg_data = r'data/fed_reg_data.pickle' fed_data = pd.read_pickle(fed_reg_data) # load twitter data from csv twitter_file_path = r'data/twitter_01_20_17_to_3-2-18.pickle' twitter_data = pd.read_pickle(twitter_file_path) len(fed_data) """ Explanation: The following data...
johnpfay/environ859
06_WebGIS/Notebooks/05-Scraping-Data-With-Requests-and-BeautifulSoup.ipynb
gpl-3.0
# Import the requests package; install if necessary try: import requests except: import pip pip.main(['install','requests']) import requests # Import BeautifulSoup from the bs4 package; install bs4 if necessary try: from bs4 import BeautifulSoup except: import pip pip.main(['install','bs4']...
apache/climate
RCMES/CORDEX/CORDEX.ipynb
apache-2.0
domain = 'NAM-44' # The output directory cwd = os.getcwd() workdir = cwd +'/evaluation_result' # Location of obs4Mips files obs_dir = '/mnt/efs/obs4mips' # Location of CORDEX files models_dir = '/mnt/efs/'+domain+'/*'.format(domain=domain) # Extract metadata from model and obs files, pairing up files with the same ...
zzsza/Datascience_School
15. 선형 회귀 분석/08. patsy 패키지 소개.ipynb
mit
from patsy import dmatrix, dmatrices np.random.seed(0) x1 = np.random.rand(5) + 10 x2 = np.random.rand(5) * 10 x1, x2 dmatrix("x1") """ Explanation: patsy 패키지 소개 회귀 분석 전처리 패키지 encoding/transform/design matrix 기능 R-style formula 문자열 지원 design matrix dmatrix(fomula[, data]) R-style formula 문자열을 받아서 X matrix 생성 자동으로...
awhite40/pymks
notebooks/Fiber Homogenization.ipynb
mit
import numpy as np %matplotlib inline %load_ext autoreload %autoreload 2 import matplotlib.pyplot as plt """ Explanation: Homogenization with fiber-like structures Introduction This example demonstrates the use of the homogenization model from pyMKS on a set of fiber-like structures. These structures are simulated t...
gurbanics/pytech-vis
notebooks/MainSlides.ipynb
mit
# importing matplotlib as usual import numpy as np %config InlineBackend.print_figure_kwargs = {'bbox_inches': None} %matplotlib inline import matplotlib.pyplot as plt from IPython.display import set_matplotlib_formats set_matplotlib_formats('pdf', 'png', 'svg') sigma = 10 mu = 5 normal_random = np.random.randn(1000) ...
jplourenco/bokeh
examples/interactions/interactive_bubble/gapminder.ipynb
bsd-3-clause
fertility_df, life_expectancy_df, population_df_size, regions_df, years, regions = process_data() sources = {} region_color = regions_df['region_color'] region_color.name = 'region_color' for year in years: fertility = fertility_df[year] fertility.name = 'fertility' life = life_expectancy_df[year] li...
trangel/Data-Science
.ipynb_checkpoints/MNIST-dimensionality-reduction-checkpoint.ipynb
gpl-3.0
import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv) import plotly.offline as py py.init_notebook_mode(connected=True) import plotly.graph_objs as go import plotly.tools as tls import seaborn as sns import matplotlib.image as mpimg import matplotlib.pyplot as plt i...
mattilyra/gensim
docs/notebooks/doc2vec-IMDB.ipynb
lgpl-2.1
import locale import glob import os.path import requests import tarfile import sys import codecs import smart_open dirname = 'aclImdb' filename = 'aclImdb_v1.tar.gz' locale.setlocale(locale.LC_ALL, 'C') if sys.version > '3': control_chars = [chr(0x85)] else: control_chars = [unichr(0x85)] # Convert text to l...
enury/collation-viz
pycoviz.ipynb
mit
#python modules import json import sys import re from IPython.display import display,HTML from datetime import datetime #ipywidgets modules from __future__ import print_function from ipywidgets import * import ipywidgets as widgets """ Explanation: Exploring the collation of Calpurnius Flaccus In this notebook, I pre...
MotokiShiga/stem-nmf
python/demo_libnmf.ipynb
mit
%matplotlib inline import numpy as np import scipy.io as sio from libnmf import NMF, NMF_SO, NMF_ARD_SO """ Explanation: Demo of NMF-SO and NMF-ARD-SO [1] Motoki Shiga, Kazuyoshi Tatsumi, Shunsuke Muto, Koji Tsuda, Yuta Yamamoto, Toshiyuki Mori, Takayoshi Tanji, "Sparse Modeling of EELS and EDX Spectral Imaging Data b...
FZJ-IEK3-VSA/tsam
examples/aggregation_method_showcase.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 - 3. Example Examples of the different methods used in the time series aggregation module (tsam) Date: 04.01.2019 Author: Leand...
rusucosmin/courses
lds/DSLab_week1_CCPython.ipynb
mit
v = [1,2,3,4] # Overwrite the function moving_avg def moving_avg(): avg = None _sum = 0 _cnt = 0 while True: term = yield avg _cnt += 1 _sum += term avg = _sum / _cnt # Testing your function ma = moving_avg() next(ma) mavg = [] for value in v: mavg.append(ma.send(v...
mwegrzyn/mindReading2017
content/_004_Kreuzvalidierung.ipynb
gpl-3.0
import os imgList = ['../training/%s'%x for x in os.listdir('../training/')]; imgList.sort() imgList """ Explanation: Diesmal machen wir da weiter, wo wir letztes Mal aufgehört haben: Wir berechnen wieder Ähnlichkeiten (als Korrelationen), vergleichen diesmal aber unabhängige Daten. Dazu teilen wir unseren Datensatz...
curiouspal/python-lessons
test2-pal.ipynb
cc0-1.0
import numpy as np import pandas as pd import matplotlib import scipy import scipy.stats import json import requests from pprint import pprint from ggplot import * import csv """ Explanation: Learning Python End of explanation """ "string "*4 'String'[4] len('strings') 'Search String'.find('r') 'Search String'.f...
rickiepark/python-tutorial
tutorial-2/word-histogram.ipynb
mit
import re import random import json """ Explanation: 필요한 모듈을 임포트 합니다. End of explanation """ hist = {} with open('jungle-book.txt') as f: for line in f.readlines(): lines = re.findall('[a-zA-Z0-9]+', line) for word in lines: word = word.lower() hist[word] = hist.get(word, ...
tensorflow/quantum
docs/tutorials/noise.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...
hongsups/insightfl_shin
project/clean_zipcodes.ipynb
mit
import requests import numpy as np import pandas as pd import matplotlib import matplotlib.pyplot as plt %matplotlib inline import csv import seaborn as sns font = {'family' : 'Arial', 'weight' : 'bold', 'size' : 25} matplotlib.rc('font', **font) """ Explanation: Clean zip code data by convertin sha...
phoebe-project/phoebe2-docs
2.1/examples/animation_binary_complete.ipynb
gpl-3.0
!pip install -I "phoebe>=2.1,<2.2" """ Explanation: Complete Binary Animation NOTE: animating within Jupyter notebooks can be very resource intensive. This script will likely run much quicker as a Python script. Setup Let's first make sure we have the latest version of PHOEBE 2.1 installed. (You can comment out this ...
fwmeng88/Machine_Learning_at_McMaster_University
Introduction_to_Python3.ipynb
apache-2.0
# set a variable to an argument # Variable types don’t need to be declared x = 5 print(x) y = x * 3 # print(y) y # assign a string x = 'This is a math for chem class.' print(x) x = 'Apple' y = 'Orange' z = x + ' ' + y print(z) # Keywords can not be used for variable names import keyword keyword.kwlist # for number...
hunterherrin/phys202-2015-work
assignments/assignment07/AlgorithmsEx01.ipynb
mit
%matplotlib inline from matplotlib import pyplot as plt import numpy as np """ Explanation: Algorithms Exercise 1 Imports End of explanation """ s=""" APRIL--this is the cruellest month, breeding Lilacs out of the dead land, mixing Memory and desire, stirring Dull roots with spring rain. """ stop_words='the is' s=s....
atlury/deep-opencl
cs480/05 Fitting Gaussians.ipynb
lgpl-3.0
import numpy as np import matplotlib.pyplot as plt %matplotlib inline def normald(X, mu, sigma): """ normald: X contains samples, one per row, N x D. mu is mean vector, D x 1. sigma is covariance matrix, D x D. """ D = X.shape[1] detSigma = sigma if D == 1 else np.linalg.det(sigma) ...
lfairchild/PmagPy
PmagPy_iodp_HOLE_template.ipynb
bsd-3-clause
# import a bunch of packages for use in the notebook import pmagpy.pmag as pmag # a bunch of PmagPy modules import pmagpy.pmagplotlib as pmagplotlib import pmagpy.ipmag as ipmag import pmagpy.contribution_builder as cb from pmagpy import convert_2_magic as convert # conversion scripts for many lab formats from pmagpy i...
lamahechag/clubes_de_ciencia
Dia_1_monitor/Dia_1.ipynb
mit
2+3 """ Explanation: Opreaciones Matematicas Suma : $2+3$ End of explanation """ 2*3 """ Explanation: Multiplicación: $2x3$ End of explanation """ 2/3 """ Explanation: División: $\frac{2}{3}$ End of explanation """ 2**3 """ Explanation: Potencia: $ 2^{3}$ End of explanation """ # Importar una libreria en Py...
AllenDowney/ThinkBayes2
examples/hospital3.ipynb
mit
# If we're running on Colab, install libraries import sys IN_COLAB = 'google.colab' in sys.modules if IN_COLAB: !pip install pymc3 !pip install arviz !pip install empiricaldist # PyMC generates a FutureWarning we don't need to deal with yet import warnings warnings.filterwarnings("ignore", category=Futur...
ncullen93/pyBN
examples/Drawing.ipynb
mit
from pyBN import * bn = read_bn('data/cancer.bif') """ Explanation: Drawing (Plotting) Bayesian Networks in pyBN The importance of drawing a Bayesian network can not be understated, especially in a research setting. Being able to visualize a network's random variables and the dependencies between them is critical to ...
phoebe-project/phoebe2-docs
development/tutorials/atm_passbands.ipynb
gpl-3.0
#!pip install -I "phoebe>=2.4,<2.5" """ Explanation: Atmospheres & Passbands Setup Let's first make sure we have the latest version of PHOEBE 2.4 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...
KMFleischer/PyEarthScience
Tutorial/03_Xarray_PyNIO_basics.ipynb
mit
import numpy as np fname = './data/tsurf.nc' """ Explanation: 3. Xarray & PyNIO To read and write scientific data xarray and PyNIO are very efficient, and easy to use because the internal data structure is netCDF like. Xarray can read netCDF and Grib files, and handle the metadata following the netCDF CF-convention. ...
tensorflow/lucid
notebooks/feature-visualization/neuron_diversity.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...
enthought/distarray
examples/julia_set/julia_set.ipynb
bsd-3-clause
from __future__ import print_function import numpy import matplotlib.pyplot as plt # DistArray imports from distarray.globalapi import Context, Distribution from distarray.globalapi.distarray import DistArray # inline plots %matplotlib inline # bigger figures plt.rcParams.update({'figure.figsize': (10, 10)}) """ E...
jiumem/tuthpc
mpi.ipynb
bsd-3-clause
%%file hellompi.py """ Parallel Hello World """ from mpi4py import MPI import sys size = MPI.COMM_WORLD.Get_size() rank = MPI.COMM_WORLD.Get_rank() name = MPI.Get_processor_name() sys.stdout.write( "Hello, World! I am process %d of %d on %s.\n" % (rank, size, name)) """ Explanation: MPI and cluster computi...
google-coral/tutorials
retrain_classification_qat_tf1.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...
marc-moreaux/Deep-Learning-classes
notebooks/Intro_to_RNN.ipynb
mit
with open('./fables.txt') as f: text = f.read() print text """ Explanation: Text generation with RNN In this lab, we are going to generate text with RNNs. We'll try to have a RNN learning the fables de la Fontaine. Lets load into variable the Fables: End of explanation """ import numpy as np vocab = sorted(set...
tuanavu/coursera-university-of-washington
machine_learning/2_regression/lecture/week5/Overfitting_Demo_Ridge_Lasso.ipynb
mit
import sys sys.path.append('C:\Anaconda2\envs\dato-env\Lib\site-packages') import graphlab import math import random import numpy from matplotlib import pyplot as plt %matplotlib inline """ Explanation: Overfitting demo Create a dataset based on a true sinusoidal relationship Let's look at a synthetic dataset consist...
keras-team/autokeras
docs/ipynb/customized.ipynb
apache-2.0
input_node = ak.ImageInput() output_node = ak.Normalization()(input_node) output_node1 = ak.ConvBlock()(output_node) output_node2 = ak.ResNetBlock(version="v2")(output_node) output_node = ak.Merge()([output_node1, output_node2]) output_node = ak.ClassificationHead()(output_node) auto_model = ak.AutoModel( inputs=...
saashimi/code_guild
wk2/extras/linked_lists/palindrome/palindrome_challenge.ipynb
mit
%run ../linked_list/linked_list.py %load ../linked_list/linked_list.py class MyLinkedList(LinkedList): def is_palindrome(self): # TODO: Implement me pass """ Explanation: <small><i>This notebook was prepared by Donne Martin. Source and license info is on GitHub.</i></small> Challenge Notebook Pro...
weikang9009/pysal
notebooks/explore/pointpats/process.ipynb
bsd-3-clause
from pysal.explore.pointpats import PoissonPointProcess, PoissonClusterPointProcess, Window, poly_from_bbox, PointPattern import pysal.lib as ps from pysal.lib.cg import shapely_ext %matplotlib inline import numpy as np #import matplotlib.pyplot as plt """ Explanation: Point Processes Author: Serge Rey &#115;&#106;&#1...
STREAM3/pyisc
docs/pyISC_multivariable_example.ipynb
lgpl-3.0
import pyisc; import numpy as np from scipy.stats import poisson, norm %matplotlib inline from pylab import plot """ Explanation: pyISC Example: MultivariableAnomaly Detection In this example, we extend the simple example with one Poisson distributed variable to the multivariate case with three variables, two Poisson ...
ydluo/qdyn
examples/notebooks/RSF_spring-block.ipynb
gpl-3.0
# Make plots interactive in the notebook %matplotlib notebook import matplotlib.pyplot as plt import numpy as np import os import sys # Add QDYN source directory to PATH # Go up in the directory tree upup = [os.pardir]*2 qdyn_dir = os.path.join(*upup) # Get QDYN src directory src_dir = os.path.abspath( os.path.j...
ML4DS/ML4all
R2.kNN_Regression/regression_knn_student.ipynb
mit
# Import some libraries that will be necessary for working with data and displaying plots # To visualize plots in the notebook %matplotlib inline import matplotlib import matplotlib.pyplot as plt import numpy as np import pylab # Packages used to read datasets import scipy.io # To read matlab files import pan...
mne-tools/mne-tools.github.io
0.16/_downloads/plot_otp.ipynb
bsd-3-clause
# Author: Eric Larson <larson.eric.d@gmail.com> # # License: BSD (3-clause) import os.path as op import mne import numpy as np from mne import find_events, fit_dipole from mne.datasets.brainstorm import bst_phantom_elekta from mne.io import read_raw_fif print(__doc__) """ Explanation: Plot sensor denoising using ov...
graphistry/pygraphistry
demos/demos_databases_apis/hypernetx/hypernetx.ipynb
bsd-3-clause
# ! pip install hypernetx -q # ! pip install graphistry -q """ Explanation: HyperNetX + Graphistry = 💪💪💪 You can quickly explore HyperNetX graphs using Graphistry through the below sample class. PNNL's HyperNetX is a new Python library for manipulating hypergraphs: graphs where an edge may connect any number of nod...
paris-saclay-cds/python-workshop
Day_1_Scientific_Python/03-matplotib_seaborn.ipynb
bsd-3-clause
%matplotlib inline """ Explanation: <p style="margin-top: 3em; margin-bottom: 3em;"><font size="7"><b>Matplotlib & Seaborn: Introduction </b></font></p> End of explanation """ import numpy as np import matplotlib.pyplot as plt """ Explanation: Matplotlib Matplotlib is a Python package used widely throughout the sci...
mdeff/cnn_graph
trials/1_learning_filters.ipynb
mit
import time import numpy as np import scipy.sparse, scipy.sparse.linalg, scipy.spatial.distance import matplotlib.pyplot as plt %matplotlib inline tol = 1e-10 """ Explanation: Trial 1: learning graph filters Random kNN graph: $W \in \mathbb{R}^{M \times M} \rightarrow L \rightarrow U, \Lambda$. Random graph signals: ...
tensorflow/tensorflow
tensorflow/lite/g3doc/models/modify/model_maker/text_searcher.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...
gschivley/ghgforcing
Example/Example notebook.ipynb
mit
tstep = 0.01 time = np.linspace(0, 100, 100/tstep+1) """ Explanation: Example uses of ghgforcing Define the time axis along which all emissions and calculations take place, from year 0 to 100. The time-step (tstep) is set to 0.01 years to improve the accuracy of calcuations. End of explanation """ co2_emission = np....
GoogleCloudPlatform/cloudml-samples
notebooks/scikit-learn/20_newsgroups_automl.ipynb
apache-2.0
import numpy as np import pandas as pd import csv from sklearn.datasets import fetch_20newsgroups """ Explanation: Prepare data for Google Cloud AutoML Natural Language from scikit-learn Overview This notebook demonstrates how to prepare text data available in scikit-learn (or other libraries), so that it can be used...
mtat76/atm-py
examples/timeseries.ipynb
mit
from atmPy.instruments.POPS import housekeeping from atmPy.instruments.piccolo import piccolo %matplotlib inline """ Explanation: Introduction The timeseries module provides the TimeSeries class which deals with all 1D timeseries (sizedistribution timeseries are considered 2D timeseries and are delt with in a differen...
shikhar413/openmc
examples/jupyter/mgxs-part-iii.ipynb
mit
import math import pickle from IPython.display import Image import matplotlib.pyplot as plt import numpy as np import openmc import openmc.mgxs from openmc.openmoc_compatible import get_openmoc_geometry import openmoc import openmoc.process from openmoc.materialize import load_openmc_mgxs_lib %matplotlib inline """...
GoogleCloudPlatform/asl-ml-immersion
notebooks/tfx_pipelines/guided_projects/guided_project_3_nlp_starter/reusable_embeddings.ipynb
apache-2.0
import os import pandas as pd from google.cloud import bigquery %load_ext google.cloud.bigquery """ Explanation: Reusable Embeddings Learning Objectives 1. Learn how to use a pre-trained TF Hub text modules to generate sentence vectors 1. Learn how to incorporate a pre-trained TF-Hub module into a Keras model 1. Lea...
WomensCodingCircle/CodingCirclePython
Lesson03_Functions/Functions.ipynb
mit
my_string = "Howdy, welcome to my ranch?" print(len(my_string)) print(max(my_string)) print(min(my_string)) """ Explanation: Functions A function is a set of statements that you store and can run multiple times. We have already used some functions. type("I've been using functions since the beginning?") This is a bui...
catalyst-cooperative/pudl
notebooks/work-in-progress/better-heatrates.ipynb
mit
%load_ext autoreload %autoreload 2 # Standard libraries import logging import os import pathlib import sys # 3rd party libraries import matplotlib.pyplot as plt import matplotlib as mpl import numpy as np import pandas as pd import seaborn as sns import sqlalchemy as sa # Local libraries import pudl import pudl.cons...
jerkos/cobrapy
documentation_builder/getting_started.ipynb
lgpl-2.1
from __future__ import print_function import cobra.test model = cobra.test.create_test_model("textbook") # "ecoli" and "salmonella" are also valid arguments """ Explanation: Getting Started To begin with, cobrapy comes with bundled models for Salmonella and E. coli, as well as a "textbook" model of E. coli core meta...
ComputationalModeling/spring-2017-danielak
past-semesters/spring_2016/day-by-day/day18-kinematics-terminal-velocity-of-a-skydiver/Day_18_pre_class_notebook-SOLUTIONS.ipynb
agpl-3.0
from IPython.display import YouTubeVideo # WATCH THE VIDEO IN FULL-SCREEN MODE YouTubeVideo("JXJQYpgFAyc",width=640,height=360) # Numerical integration """ Explanation: Day 18 Pre-class assignment Goals for today's pre-class assignment In this pre-class assignment, you are going to learn how to: Numerically integ...
4dsolutions/Python5
Martian Volume.ipynb
mit
from qrays import Qvector, Vector a = Qvector((1,0,0,0)) a.length() b = Qvector((0,1,0,0)) (a-b).length() """ Explanation: Martian Volume Whoever heard of a linear algebra with four independent basis vectors in 3-space, which basis vectors are not unit length? This all sounds absurd. Welcome to Quadrays. End of ex...
vpw/AndroidForBeginners
Ass2.5/END3_MNIST_addnumber_ass2_5.ipynb
apache-2.0
#pip install --force-reinstall torch==1.2.0 torchvision==0.4.0 -f https://download.pytorch.org/whl/torch_stable.html %pylab inline import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.utils.data import Dataset import torch.utils.data.dataloader as dataloader import torch.opt...
shevkunov/workout
labs/2.2_Hydrogen_Spectre.ipynb
bsd-3-clause
plt.plot(h1_phi - h2_phi[:3], h2_phi[:3]) plt.show() """ Explanation: Подгон (предсказываем по данным h2_phi с чужой устнановки четвёртое значение в h1_phi - на нашей установке) End of explanation """ from sklearn.linear_model import LinearRegression LR = LinearRegression() LR.fit(h2_phi[:3].reshape(3, 1), (h1_...
flohorovicic/pynoddy
docs/notebooks/.ipynb_checkpoints/Feature-Analysis-checkpoint.ipynb
gpl-2.0
from IPython.core.display import HTML css_file = 'pynoddy.css' HTML(open(css_file, "r").read()) import sys, os import matplotlib.pyplot as plt # adjust some settings for matplotlib from matplotlib import rcParams # print rcParams rcParams['font.size'] = 15 # determine path of repository to set paths corretly below rep...
tensorflow/docs-l10n
site/ko/hub/tutorials/spice.ipynb
apache-2.0
#@title Copyright 2020 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 ...
mommermi/Introduction-to-Python-for-Scientists
notebooks/.ipynb_checkpoints/FileIO_Formatting_Errors_20160923-checkpoint.ipynb
mit
outf = open('table.dat', 'w') # syntax (filename, mode), mode can be 'w' (write), 'r' (read), or 'a' (append) outf.writelines('# index some_value another_value\n') # table header line for i in range(20): outf.write('{:02d} {:4d} {:3d}\n'.format(i, i**3, i+200)) # just some numbers outf.close() """ Exp...
weikang9009/pysal
notebooks/explore/segregation/inference_wrappers_example.ipynb
bsd-3-clause
%matplotlib inline import geopandas as gpd from pysal.explore import segregation import pysal.lib import pandas as pd import numpy as np from pysal.explore.segregation.inference import SingleValueTest, TwoValueTest """ Explanation: Inference Wrappers use cases This is an example of the PySAL segregation framework to...
gon1213/SDC
behavioral_cloning/CarND-Keras-Lab/traffic-sign-classification-with-keras-solution.ipynb
gpl-3.0
from urllib.request import urlretrieve from os.path import isfile from tqdm import tqdm class DLProgress(tqdm): last_block = 0 def hook(self, block_num=1, block_size=1, total_size=None): self.total = total_size self.update((block_num - self.last_block) * block_size) self.last_block = b...
aliparsai/LittleDarwin
notebooks/mutateJavaSourceCode.ipynb
gpl-3.0
myJavaCode = """ public class MyCode { void bubbleSort(int array[]) { int len = array.length; for (int i = 0; i < len - 1; i++) for (int j = 0; j < len - i - 1; j++) if (array[j] > array[j+1]) { int temp = array[j]; ...
chemiskyy/simmit
Examples/Continuum_Mechanics/constitutive_relations.ipynb
gpl-3.0
%matplotlib inline import numpy as np import matplotlib.pyplot as plt from simmit import smartplus as sim import os """ Explanation: constitutive : The Constitutive Library End of explanation """ E = 70000.0 nu = 0.3 L = sim.L_iso(E,nu,"Enu") print np.array_str(L, precision=4, suppress_small=True) d = sim.check_sy...
jsharpna/DavisSML
lectures/lecture10/lecture10p3.ipynb
mit
from lxml import html, etree import numpy as np from sklearn import cluster, feature_extraction, metrics, preprocessing, decomposition import collections import nltk import pandas as pd import plotnine as p9 # nltk.download() # Download Corpora -> stopwords, Models -> punkt from nltk.corpus import stopwords from nltk....
Naereen/notebooks
Verification_de_numeros_CB_RIB_NIRPP_IBAN.ipynb
mit
def l_to_c(l): try: return str(int(l)) except ValueError: return str(10 + ord(l.upper()) - ord('A')) for l in 'ABCDEFGHIJKLMNROPQRSTUVWXYZ': print("l = {} --> c = {}".format(l, l_to_c(l))) """ Explanation: Vérification de numéros de Cartes Bleues, RIB (IBAN) et NIRPP (sécu) Ce petit notebo...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/feature_engineering/labs/5_tftransform_taxifare.ipynb
apache-2.0
!sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst !pip install tensorflow==2.3.0 tensorflow-transform==0.24.0 apache-beam[gcp]==2.24.0 """ Explanation: Exploring tf.transform # Learning Objectives 1. Preprocess data and engineer new features using TfTransform. 1. Create and deploy Apache Beam pipeli...
philmui/datascience2016fall
lecture08.ML2/regression.ipynb
mit
import numpy as np import pandas as pd from pandas import Series, DataFrame import matplotlib.pyplot as plt import seaborn as sns sns.set_style('whitegrid') %matplotlib inline """ Explanation: Regression This notebook covers univariate & multi-variate "linear regression". We'll be going over how to use the scikit-le...
statsmaths/stat665
lectures/lec16/notebook16.ipynb
gpl-2.0
%pylab inline import numpy as np import pandas as pd import matplotlib.pyplot as plt from keras.datasets import mnist from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation from keras.optimizers import SGD, RMSprop from keras.utils import np_utils from keras.regularizers import l...
brucefan1983/GPUMD
examples/empirical_potentials/thermal_expansion/Thermal Expansion.ipynb
gpl-3.0
from pylab import * from ase.lattice.cubic import Diamond from thermo.gpumd.io import ase_atoms_to_gpumd import pandas as pd """ Explanation: Thermal Expansion 1. Introduction A given crystal should have a well defined average lattice constant at a given pressure and temperature. Here we use silicon as an example to ...
planetlabs/notebooks
jupyter-notebooks/crop-classification/datasets-prepare-cdl.ipynb
apache-2.0
import os import pathlib from subprocess import check_output, STDOUT, CalledProcessError import tempfile import rasterio """ Explanation: Prepare CDL Data In this notebook, we prepare the 2016 from the USDA 2016 Crop Data Layer (CDL) for Iowa for use in the crop classification notebooks. This involves taking the CDL ...
mmatera/qmnotebooks
paqueteviajero.ipynb
gpl-3.0
import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation from IPython.display import HTML import ipywidgets as widgets from IPython.display import display L = 200 dx = 2. buttonrunsim=widgets.Button(description="Simulate") outwdt = widgets.Output() centropaquete = widgets.FloatSli...
oscar6echo/ezmarkdown
demo_ezmarkdown.ipynb
mit
# path_img1 = 'data/svgclock.svg' # path_img2 = 'data/example2.jpg' # path_img3 = 'data/example4.png' path_img1 = 'http://upload.wikimedia.org/wikipedia/commons/f/fd/Ghostscript_Tiger.svg' path_img2 = 'http://upload.wikimedia.org/wikipedia/commons/thumb/3/3e/Einstein_1921_by_F_Schmutzer_-_restoration.jpg/220px-Einstei...
joelagnel/lisa
ipynb/examples/energy_meter/EnergyMeter_ACME.ipynb
apache-2.0
import logging from conf import LisaLogging LisaLogging.setup() """ Explanation: Energy Meter Examples BayLibre's ACME Cape and IIOCapture More information can be found at https://github.com/ARM-software/lisa/wiki/Energy-Meters-Requirements#iiocapture---baylibre-acme-cape. End of explanation """ # Generate plots inl...
a-mt/dev-roadmap
docs/!matplotlib/Basemap.ipynb
mit
# https://rabernat.github.io/research_computing_2018/xarray-tips-and-tricks.html url = 'http://www.esrl.noaa.gov/psd/thredds/dodsC/Datasets/ncep.reanalysis/surface/air.sig995.2018.nc' from netCDF4 import Dataset as NetCDFFile nc = NetCDFFile(url) nc # Extract data from NetCDF file (will take a minute) lats = nc.varia...
xqding/StatisticsExamples
Hit_Run_Sampler/main.ipynb
gpl-3.0
%matplotlib notebook import numpy as np import matplotlib.pyplot as plt import ternary ## generate order statistics from uniform distribution between 0 and 1 U = [[np.random.uniform(), np.random.uniform()] for i in range(50000)] for u in U: u.sort() ## calculate the spacing and plot the sampling results x_1 = [u[...
sassoftware/sas-viya-programming
developerTrial/python/Basic+Predictive+Modeling+Example.ipynb
apache-2.0
import os import pandas as pd import swat import sys from matplotlib import pyplot as plt %matplotlib inline target = "bad" class_inputs = ["reason", "job"] class_vars = [target] + class_inputs interval_inputs = ["im_clage", "clno", "im_debtinc", "loan", "mortdue", "value", "im_yoj", "im_ninq", "derog...
SKA-ScienceDataProcessor/algorithm-reference-library
processing_library/notebooks/gridding.ipynb
apache-2.0
%matplotlib inline import sys, os sys.path.append(os.path.join('..','..')) from matplotlib import pylab import numpy from matplotlib import pyplot as plt from processing_library.fourier_transforms.convolutional_gridding import * from processing_library.fourier_transforms.convolutional_gridding import coordinates ...
sclamons/murraylab_tools
examples/Echo Setup Usage Examples.ipynb
mit
import murraylab_tools.echo as mt_echo import os.path # Relevant input and output files. Check these out for examples of input file format. txtl_inputs = os.path.join("txtl_setup", "inputs") txtl_outputs = os.path.join("txtl_setup", "outputs") stock_file = os.path.join(txtl_inputs, "TX-TL_setup_example_stocks.csv") ...
slerch/ppnn
nn_postprocessing/notebooks/presentation_notebook.ipynb
mit
# Imports import numpy as np import sys sys.path.append('../') # This is where all the python files are! from importlib import reload import utils; reload(utils) from utils import * import keras_models; reload(keras_models) from keras_models import * from losses import crps_cost_function from scipy.stats import norm...
kubeflow/kfserving-lts
docs/samples/drift-detection/alibi-detect/cifar10/cifar10_drift.ipynb
apache-2.0
!pip install -r requirements_notebook.txt """ Explanation: Cifar10 Drift Detection In this example we will deploy an image classification model along with a drift detector trained on the same dataset. For in depth details on creating a drift detection model for your own dataset see the alibi-detect project and associa...