repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
ES-DOC/esdoc-jupyterhub | notebooks/noaa-gfdl/cmip6/models/gfdl-am4/toplevel.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'noaa-gfdl', 'gfdl-am4', 'toplevel')
"""
Explanation: ES-DOC CMIP6 Model Properties - Toplevel
MIP Era: CMIP6
Institute: NOAA-GFDL
Source ID: GFDL-AM4
Sub-Topics: Radiative Forcings.
Properties:... |
gngdb/variational-dropout | notebooks/Opening Results.ipynb | mit | outdir = "/disk/scratch/gavin/results/vardroprepl/"
resultsfiles = glob.glob(outdir+"*")
resultsfiles = [f for f in resultsfiles if "pkl.gz" in f]
results = {}
for rfile in resultsfiles:
with gzip.open(rfile, "rb") as f:
if rfile.split(".")[-1] == "gz":
k = rfile.split(".")[0]+"0"
else:... |
pvalienteverde/ElCuadernillo | ElCuadernillo/20160220_TensorFlowRegresionMultiple/tensorflow_regresion_multiple_gradiente_descendente.ipynb | mit | import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
import seaborn as sns
sns.set(color_codes=True)
%matplotlib inline
import sys
sys.path.append('/home/pedro/git/ElCuadernillo/ElCuadernillo/20160220_TensorFlowRegresionMultiple')
import gradient_descent_tensorflow as gdt
"""
Explanation: Regre... |
fastai/course-v3 | nbs/dl2/12b_lm_pretrain.ipynb | apache-2.0 | %load_ext autoreload
%autoreload 2
%matplotlib inline
#export
from exp.nb_12a import *
"""
Explanation: Pretraining on WT103
End of explanation
"""
#path = datasets.Config().data_path()
#version = '103' #2
#! wget https://s3.amazonaws.com/research.metamind.io/wikitext/wikitext-{version}-v1.zip -P {path}
#! unzip ... |
nravi89/nlphu | Amazon Food Review.ipynb | bsd-2-clause | import sqlite3
import pandas as pd
con = sqlite3.connect('database.sqlite')
dat = pd.read_sql_query("""SELECT * FROM Reviews""", con)
dat.head(5)
import matplotlib.pyplot as plt
%matplotlib inline
print 'There are %f percentage unique products'% (len(set(dat['ProductId']))/(len(dat['ProductId'])*1.))
print 'There ... |
mikekestemont/wuerzb15 | Chapter 1 - Number crunching with Numpy.ipynb | mit | import numpy as np
"""
Explanation: Chapter 1 - Number crunching and matrix manipulation with Numpy
Numpy's typed array
At the most basic level of computing, numpy ('Numerical Python') has become an indispensable package for scientific computing in Python, on which many other packages fundamentally rely. Numpy is conv... |
maxis42/ML-DA-Coursera-Yandex-MIPT | 2 Supervised learning/Homework/1 linear regression and main data analysis libraries/peer_review_linreg_height_weight.ipynb | mit | import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Линейная регрессия и основные библиотеки Python для анализа данных и научных вычислений
Это задание посвящено линейной регрессии. На примере прогнозирования роста человека по его весу Вы уви... |
dewitt-li/deep-learning | intro-to-tensorflow/intro_to_tensorflow.ipynb | mit | import hashlib
import os
import pickle
from urllib.request import urlretrieve
import numpy as np
from PIL import Image
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelBinarizer
from sklearn.utils import resample
from tqdm import tqdm
from zipfile import ZipFile
print('All m... |
tensorflow/docs-l10n | site/en-snapshot/tutorials/distribute/dtensor_ml_tutorial.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... |
mne-tools/mne-tools.github.io | 0.22/_downloads/80342e62fc31882c2b53e38ec1ed14a6/plot_background_filtering.ipynb | bsd-3-clause | import numpy as np
from numpy.fft import fft, fftfreq
from scipy import signal
import matplotlib.pyplot as plt
from mne.time_frequency.tfr import morlet
from mne.viz import plot_filter, plot_ideal_filter
import mne
sfreq = 1000.
f_p = 40.
flim = (1., sfreq / 2.) # limits for plotting
"""
Explanation: Background in... |
DoWhatILove/turtle | programming/python/notebooks/scikit/clustering/plot_face_segmentation.ipynb | mit | print(__doc__)
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>, Brian Cheung
# License: BSD 3 clause
import time
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
from sklearn.feature_extraction import image
from sklearn.cluster import spectral_clustering
from sklearn.utils.testing import... |
gte620v/PythonTutorialWithJupyter | python/Module-03-An_Informal_Introduction_to_Python.ipynb | mit | from __future__ import print_function
# this is the first comment
spam = 1 # and this is the second comment
# ... and now a third!
text = "# This is not a comment because it's inside quotes."
print(spam)
print(text)
"""
Explanation: Module 03 - An Informal Introduction to Python
Python Example
End of explan... |
thomasmeagher/DS-501 | lectures/05 Basic Statistics, Probability, and Linear Algebra/PythonExamples.ipynb | mit | import numpy as np
import matplotlib.pylab as py
import pandas as pa
import scipy.stats as st
np.set_printoptions(precision=2)
%matplotlib inline
"""
Explanation: Loading packages
End of explanation
"""
X=st.bernoulli(p=0.3)
X.rvs(100)
# Note that "high" is not included.
X=st.randint(low=1,high=5)
X.rvs(100)
"""
E... |
phoebe-project/phoebe2-docs | 2.1/examples/legacy_spots.ipynb | gpl-3.0 | !pip install -I "phoebe>=2.1,<2.2"
"""
Explanation: Comparing Spots in PHOEBE 2 vs PHOEBE Legacy
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 installation or don't want to update to the latest release).
End of explanation
"... |
jamesnw/wtb-data | notebooks/Addition Similarity.ipynb | mit | # Import libraries
import numpy as np
import pandas as pd
# Import the data
import WTBLoad
wtb = WTBLoad.load()
"""
Explanation: Addition Similarity
End of explanation
"""
import math
# Square the difference of each row, and then return the mean of the column.
# This is the average difference between the two.
# It ... |
gfeiden/Notebook | Projects/dynam_pressure/mlt_velocity_profile.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
"""
Explanation: Convective Velocity Profiles
Exploring convective velocity prediction from mixing length theory (MLT) as a function of different variables and at different evolutionary stages. The idea is to develop a phenomenological model for eff... |
cliburn/sta-663-2017 | notebook/15C_MonteCarloIntegration.ipynb | mit | from scipy.integrate import quad
def f(x):
return x * np.cos(71*x) + np.sin(13*x)
x = np.linspace(0, 1, 100)
plt.plot(x, f(x))
pass
"""
Explanation: Numerical Evaluation of Integrals
Integration problems are common in statistics whenever we are dealing with continuous distributions. For example the expectation o... |
metpy/MetPy | v0.10/_downloads/98f29c056841d0a15e65eb4289574392/Station_Plot.ipynb | bsd-3-clause | import cartopy.crs as ccrs
import cartopy.feature as cfeature
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from metpy.calc import reduce_point_density
from metpy.calc import wind_components
from metpy.cbook import get_test_data
from metpy.plots import add_metpy_logo, current_weather, sky_cove... |
Automating-GIS-processes/2017 | source/codes/AutoGIS15_Lecture7_PythonGIS.ipynb | mit | # Import necessary modules
import geopandas as gpd # geopandas is usually shortened as gpd
# Set filepath
fp = r"C:\HY-Data\HENTENKA\Data\DAMSELFISH_distributions.shp"
# Read file using gpd.read_file()
data = gpd.read_file(fp)
# Let's see what we got --> print the 'head' of the file (first 5 rows)
data.head()
"""... |
lukasmerten/CRPropa3 | doc/pages/example_notebooks/density/density_model_example.ipynb | gpl-3.0 | from crpropa import *
import numpy as np
import matplotlib.pyplot as plt
# define densities
FER = Ferriere()
NAK = Nakanishi()
COR = Cordes()
"""
Explanation: Example for the implemented massdistributions of the Milky Way
The following example shows the use of density distribution for the Milky-Way and gives some fig... |
kubeflow/pipelines | samples/contrib/pytorch-samples/Pipeline-Bert.ipynb | apache-2.0 | ! pip uninstall -y kfp
! pip install --no-cache-dir kfp
import kfp
import json
import os
from kfp.onprem import use_k8s_secret
from kfp import components
from kfp.components import load_component_from_file, load_component_from_url
from kfp import dsl
from kfp import compiler
kfp.__version__
"""
Explanation: Bert Pip... |
deepmind/deepmind-research | memo/load_memo_data.ipynb | apache-2.0 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
import collections
import os
from google.colab import auth
auth.authenticate_user()
#@title Choices about the dataset you want to load.
# Make choices about the dat... |
dwcaraway/intro-to-python-talk | python-basics.ipynb | unlicense | print('Hello, World!')
"""
Explanation: Introduction to Python
An introduction to Python for middle and high school students using Python 3 syntax.
Getting started
We're assuming that you already have Python 3.6 or higher installed. If not, go to Python.org to download the latest for your operating system. Verify tha... |
JAmarel/Phys202 | Project-Euler/ProjectEuler17.ipynb | mit | def round_down(n):
s = str(n)
if n <= 20:
return n
elif n < 100:
return int(s[0] + '0'), int(s[1])
elif n<1000:
return int(s[0] + '00'),int(s[1]),int(s[2])
assert round_down(5) == 5
assert round_down(55) == (50,5)
assert round_down(222) == (200,2,2)
def number_to_word... |
liufuyang/deep_learning_tutorial | course-deeplearning.ai/course5-rnn/Week 3/Machine Translation/Neural machine translation with attention - v3.ipynb | mit | from keras.layers import Bidirectional, Concatenate, Permute, Dot, Input, LSTM, Multiply
from keras.layers import RepeatVector, Dense, Activation, Lambda
from keras.optimizers import Adam
from keras.utils import to_categorical
from keras.models import load_model, Model
import keras.backend as K
import numpy as np
from... |
jerkos/cobrapy | documentation_builder/gapfilling.ipynb | lgpl-2.1 | import cobra.test
model = cobra.test.create_test_model("salmonella")
"""
Explanation: Gapfillling
GrowMatch and SMILEY are gap-filling algorithms, which try to to make the minimal number of changes to a model and allow it to simulate growth. For more information, see Kumar et al.. Please note that these algorithms ar... |
ES-DOC/esdoc-jupyterhub | notebooks/ipsl/cmip6/models/ipsl-cm6a-lr/land.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'ipsl', 'ipsl-cm6a-lr', 'land')
"""
Explanation: ES-DOC CMIP6 Model Properties - Land
MIP Era: CMIP6
Institute: IPSL
Source ID: IPSL-CM6A-LR
Topic: Land
Sub-Topics: Soil, Snow, Vegetation, Energy... |
QudevETH/PycQED_py3 | examples/IMLE and Pauli tomography examples.ipynb | mit | from pycqedscripts.init.xld.virtual_ATC75_M136_S17HW02_PQSC import *
import warnings
warnings.filterwarnings("ignore")
# If running into problems with the initalization, it could be the AWG wave loading lines at the end of the init file.
# Commenting out:
# for AWG in AWGs:
# pulsar.set(f'{AWG.name}_use_placeho... |
ledeprogram/algorithms | class5/donow/Lee_Dongjin_5_Donow.ipynb | gpl-3.0 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
plt.style.use('ggplot')
import dateutil.parser
import pg8000
conn = pg8000.connect(host='training.c1erymiua9dx.us-east-1.rds.amazonaws.com', database="training", port=5432, user='dot_student', password='qgis')
cursor = conn.curso... |
jsharpna/DavisSML | 2018_material/labs/2017-hw3.ipynb | mit | import pandas as pd
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import sklearn.linear_model as skl_lm
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
from sklearn.metrics import confusion_matrix, classification_report, precision_recall_curve, roc_curve
from sklearn ... |
agile-geoscience/xlines | notebooks/09_Code_golf_in_Bruges.ipynb | apache-2.0 | def r(l,d,f):import numpy as n;t=n.arange(-l/2,l/2,d);k=(n.pi*f*t)**2;return t,(1-2*k)/n.exp(k)
"""
Explanation: x lines of Python
Code golf: Let x = 1
Code golf... reducing functions to their smallest possible size. Like x lines of Python, but x = 1.
This notebook goes with a blog post of the same name.
Ricker wavele... |
statsmodels/statsmodels.github.io | v0.13.1/examples/notebooks/generated/statespace_sarimax_stata.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import pandas as pd
from scipy.stats import norm
import statsmodels.api as sm
import matplotlib.pyplot as plt
from datetime import datetime
import requests
from io import BytesIO
# Register converters to avoid warnings
pd.plotting.register_matplotlib_converters()
plt.rc("figure", ... |
bill9800/Udacity_ML | boston_housing/boston_housing.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... |
WNoxchi/Kaukasos | FAI_old/lesson2/lesson2_codealong.ipynb | mit | # This is to point Python to my utils folder
import sys; import os
# DIR = %pwd
sys.path.insert(1, os.path.join('../utils'))
# Rather than importing everything manually, we'll make things easy
# and load them all in utils.py, and just import them from there.
import utils; reload(utils)
from utils import *
%matplotli... |
harmsm/pythonic-science | chapters/00_inductive-python/key/07_tuples-and-dicts-and-strings_key.ipynb | unlicense | some_tuple = (10,20,30)
print(some_tuple[1])
some_tuple = (10,20,30)
print(some_tuple[:])
"""
Explanation: Tuples
Tuples are like lists, but are immutable, meaning that once you've made them they can't be changed.
Predict what this code will do.
End of explanation
"""
some_tuple = (10,20,30)
some_tuple[1] = 50
so... |
olivertso/ado | report.ipynb | mit | import numpy as np
from ic import ado
from ic import optim
"""
Explanation: Testes de Estimativas de Parâmetros em Transporte de Radiação
Dada a equação de transferência radiativa
$$\mu \frac{\partial}{\partial \tau} I(\tau,\mu) + I(\tau,\mu) = \frac{\varpi}{2} \sum^{L}{l=0}\beta_l P_l(\mu) \int^{1}{-1}P_l(\mu')I(\ta... |
uber/pyro | tutorial/source/tracking_1d.ipynb | apache-2.0 | import math
import os
import torch
from torch.distributions import constraints
from matplotlib import pyplot
import pyro
import pyro.distributions as dist
import pyro.poutine as poutine
from pyro.contrib.tracking.assignment import MarginalAssignmentPersistent
from pyro.distributions.util import gather
from pyro.infer ... |
sdpython/code_beatrix | _doc/notebooks/ai/image_segmentation.ipynb | mit | from jyquickhelper import add_notebook_menu
add_notebook_menu()
%matplotlib inline
"""
Explanation: Segmenter une image pixel à pixel
Il est aujourd'hui assez facile de construire une boîte englobante autour d'un visage dans une image. Le deep learning permet d'extraire précisément les pixels du visage.
End of explan... |
undercertainty/ou_nlp | 04_training_linear_models.ipynb | apache-2.0 | # To support both python 2 and python 3
from __future__ import division, print_function, unicode_literals
# Common imports
import numpy as np
import os
# to make this notebook's output stable across runs
np.random.seed(42)
# To plot pretty figures
%matplotlib inline
import matplotlib
import matplotlib.pyplot as plt
... |
Wx1ng/Python4DataScience.CH | Series_0_Python_Tutorials/S0EP3_Coding_Pythonically.ipynb | cc0-1.0 | #number = range(10)
size = 10
even_numbers = []
n = 0
while n < size:
if n % 2==0:
even_numbers.append(n)
n += 1
print even_numbers
"""
Explanation: Python范儿:Coding Pythonically
1 数学定义:解析(Comprehensions,或称推导式)
1.1 让代码飞
找到0-9之间的偶数
End of explanation
"""
{ x for x in range(10) if x % 2==0 }
"""
Expl... |
HazyResearch/metal | tutorials/MMTL_Basics.ipynb | apache-2.0 | # Confirm we can import from metal
import sys
sys.path.append('../../metal')
import metal
# Import other dependencies
import torch
import torch.nn as nn
import torch.nn.functional as F
# Set random seed for notebook
SEED = 123
%load_ext autoreload
%autoreload 2
%matplotlib inline
"""
Explanation: MMTL Basics Tutori... |
calico/basenji | manuscripts/akita/tutorial.ipynb | apache-2.0 | import json
import os
import shutil
import subprocess
if not os.path.isfile('./data/hg38.ml.fa'):
print('downloading hg38.ml.fa')
subprocess.call('curl -o ./data/hg38.ml.fa.gz https://storage.googleapis.com/basenji_barnyard/hg38.ml.fa.gz', shell=True)
subprocess.call('gunzip ./data/hg38.ml.fa.gz', shell=Tr... |
AtmaMani/pyChakras | udemy_ml_bootcamp/Python-for-Data-Visualization/Seaborn/Seaborn Exercises - Solutions.ipynb | mit | import seaborn as sns
import matplotlib.pyplot as plt
%matplotlib inline
sns.set_style('whitegrid')
titanic = sns.load_dataset('titanic')
titanic.head()
"""
Explanation: <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a>
Seaborn Exercises - Solutions
Time to practice your new seaborn ... |
GoogleCloudPlatform/asl-ml-immersion | notebooks/end-to-end-structured/solutions/1b_prepare_data_babyweight.ipynb | apache-2.0 | import os
from google.cloud import bigquery
"""
Explanation: LAB 1b: Prepare babyweight dataset.
Learning Objectives
Setup up the environment
Preprocess natality dataset
Augment natality dataset
Create the train and eval tables in BigQuery
Export data from BigQuery to GCS in CSV format
Introduction
In this noteboo... |
KaiSzuttor/espresso | doc/tutorials/02-charged_system/02-charged_system-1.ipynb | gpl-3.0 | from espressomd import System, electrostatics
from espressomd.minimize_energy import steepest_descent
import espressomd
import numpy
import matplotlib.pyplot as plt
plt.ion()
# Print enabled features
required_features = ["EXTERNAL_FORCES", "MASS", "ELECTROSTATICS", "WCA"]
espressomd.assert_features(required_features)
... |
michrawson/SVM_Implicit_Surface_Reconstruction | Linear-SVM.ipynb | mit | %matplotlib nbagg
import matplotlib.pyplot as plt
plt.clf()
plt.cla()
import numpy as np
ax = plt.subplot(1,1,1)
x_plot=np.linspace(-2,2,1000)
y_plot1=x_plot.copy()
y_plot1[x_plot < 0]=1
y_plot1[x_plot == 0]=0
y_plot1[x_plot > 0]=0
plot1 = ax.plot(x_plot,y_plot1, label='Classification Loss')
y_plot2=np.maximum(np.z... |
karlstroetmann/Artificial-Intelligence | Python/7 Neural Networks/NN-Architecture.ipynb | gpl-2.0 | import graphviz as gv
"""
Explanation: Visualize the Architecture of a Neural Network
End of explanation
"""
def generateNN(Topology):
L = len(Topology)
input_layer = ['i' + str(i) for i in range(1, Topology[0]+1)]
hidden_layers = [['h' + str(k+1) + ',' + str(i) for i in range(1, s+1)]
... |
aufziehvogel/kaggle | quora-question-pairs/notebooks/2.0-sk-feature-engineering.ipynb | mit | import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
%matplotlib inline
df = pd.read_csv('../data/raw/train.csv')
df['question1'] = df['question1'].apply(str)
df['question2'] = df['question2'].apply(str)
df2 = df.copy(deep=True)
df = df.rename(columns={'question1': 'question'... |
planet-os/notebooks | api-examples/era5-s3-via-boto.ipynb | mit | # Initialize notebook environment.
%matplotlib inline
import boto3
import botocore
import datetime
import matplotlib.pyplot as plt
import os.path
import xarray as xr
"""
Explanation: Accessing ERA5 Data on S3
This notebook explores how to access ERA5 data stored on a public S3 bucket as part of the AWS Public Dataset ... |
yedivanseven/bestPy | examples/02_TransactionData.ipynb | gpl-3.0 | import sys
sys.path.append('../..')
"""
Explanation: CHAPTER 2
Transaction Data
Havong gotten our feet wet, we now turn to the question of how data is fed into bestPy, how it is stored there, and how to access it.
Preliminaries
We only need this because the examples folder is a subdirectory of the bestPy package.
End ... |
OpenAstronomy/workshop_sunpy_astropy | 02-Python1/02-Python-1-Loops_Instructor.ipynb | mit | from __future__ import division, print_function
word = 'lead'
print(word[0])
print(word[1])
print(word[2])
print(word[3])
"""
Explanation: Repeating Actions with loops
<br/>
<section class="objectives panel panel-warning">
<div class="panel-heading">
<h2><span class="fa fa-certificate"></span> Learning Objectives </h... |
ES-DOC/esdoc-jupyterhub | notebooks/ncc/cmip6/models/noresm2-lm/land.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'ncc', 'noresm2-lm', 'land')
"""
Explanation: ES-DOC CMIP6 Model Properties - Land
MIP Era: CMIP6
Institute: NCC
Source ID: NORESM2-LM
Topic: Land
Sub-Topics: Soil, Snow, Vegetation, Energy Balan... |
kirbs-/hide_code | demo.ipynb | mit | print('Goodbye code')
print('Goodbye prompts')
print('Goodbye output')
"""
Explanation: Hide_code: Jupyter code, input and output hiding
To get started, select "View" -> "Cell Toolbar" -> "Hide code"
End of explanation
"""
print("Try hiding code by kitting the W key in command mode (blue bar highlight on this cell... |
elizabetht/deep-learning | dcgan-svhn/DCGAN.ipynb | mit | %matplotlib inline
import pickle as pkl
import matplotlib.pyplot as plt
import numpy as np
from scipy.io import loadmat
import tensorflow as tf
!mkdir data
"""
Explanation: Deep Convolutional GANs
In this notebook, you'll build a GAN using convolutional layers in the generator and discriminator. This is called a De... |
statsmodels/statsmodels.github.io | v0.12.1/examples/notebooks/generated/gee_nested_simulation.ipynb | bsd-3-clause | import numpy as np
import pandas as pd
import statsmodels.api as sm
"""
Explanation: GEE nested covariance structure simulation study
This notebook is a simulation study that illustrates and evaluates the performance of the GEE nested covariance structure.
A nested covariance structure is based on a nested sequence of... |
jeicher/cobrapy | documentation_builder/solvers.ipynb | lgpl-2.1 | import cobra.test
model = cobra.test.create_test_model("textbook")
solver = cobra.solvers.cglpk
"""
Explanation: Solver Interface
Each cobrapy solver must expose the following API. The solvers all will have their own distinct LP object types, but each can be manipulated by these functions. This API can be used direct... |
marcelomiky/PythonCodes | codes/back_to_basics/conceitos/Tuples.ipynb | mit | x = () # no-item tuple
len(x)
type(x)
y = (1,2,3) # three items
y[2]
y[-1]
y[0]
type(y)
z = 2, # single-item tuple
z
len(z)
list1 = [10, 20, 30]
a = tuple(list1) # tuple from list
a
"""
Explanation: Tuples
Support all operations for Sequences
Immutable, but member objects may be mutable
If the contents of... |
tensorflow/docs | site/en/guide/graph_optimization.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... |
minhhh/charts | scipy_numpy/Numpy-Scipy-Tutorial.ipynb | mit | import numpy as np
import scipy as cp
"""
Explanation: Numpy and Scipy Tutorial
Numpy and Scipy are the most common Python package for mathematical and numerical routines in precompiled, fast functions. The NumPy package provides basic routines for manipulating large arrays and matrices of numeric data.
The SciPy pack... |
ES-DOC/esdoc-jupyterhub | notebooks/niwa/cmip6/models/sandbox-3/toplevel.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'niwa', 'sandbox-3', 'toplevel')
"""
Explanation: ES-DOC CMIP6 Model Properties - Toplevel
MIP Era: CMIP6
Institute: NIWA
Source ID: SANDBOX-3
Sub-Topics: Radiative Forcings.
Properties: 85 (42 ... |
vicente-gonzalez-ruiz/YAPT | 02-basics/07-functions.ipynb | cc0-1.0 | def say_hello():
print('Hello world!')
"""
Explanation: [0] Functions
1 [0] Defining
End of explanation
"""
say_hello()
"""
Explanation: 2 [0] Running (calling)
End of explanation
"""
def max(a, b):
if a > b:
return a
else:
return b
max(1,2)
"""
Explanation: 3 [0] Using parameters
E... |
googleinterns/bizview-semi-supervised-learning | Mixmatch/streetview_dataset/parse_data_to_tfrecord_lib_test.ipynb | apache-2.0 | from parse_data_to_tfrecord_lib import img_to_example, read_tfrecord, generate_tfexamples_from_detections, batch_read_write_tfrecords
from PIL import Image # used to read images from directory
import tensorflow as tf
import os
import io
import IPython.display as display
import numpy as np
tf.enable_eager_execution()
... |
ES-DOC/esdoc-jupyterhub | notebooks/miroc/cmip6/models/miroc-es2h/aerosol.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'miroc', 'miroc-es2h', 'aerosol')
"""
Explanation: ES-DOC CMIP6 Model Properties - Aerosol
MIP Era: CMIP6
Institute: MIROC
Source ID: MIROC-ES2H
Topic: Aerosol
Sub-Topics: Transport, Emissions, C... |
PythonFreeCourse/Notebooks | week01/2_Arithmetics.ipynb | mit | # This will print "Hello World"
print("Hello World")
"""
Explanation: <img src="images/logo.jpg" style="display: block; margin-left: auto; margin-right: auto;" alt="לוגו של מיזם לימוד הפייתון. נחש מצויר בצבעי צהוב וכחול, הנע בין האותיות של שם הקורס: לומדים פייתון. הסלוגן המופיע מעל לשם הקורס הוא מיזם חינמי ללימוד תכנו... |
mne-tools/mne-tools.github.io | 0.16/_downloads/plot_elekta_epochs.ipynb | bsd-3-clause | # Author: Jussi Nurminen (jnu@iki.fi)
#
# License: BSD (3-clause)
import mne
import os
from mne.datasets import multimodal
fname_raw = os.path.join(multimodal.data_path(), 'multimodal_raw.fif')
print(__doc__)
"""
Explanation: ======================================
Getting averaging info from .fif files
==========... |
beyondvalence/biof509_wtl | Wk04-OOP_GUI/Wk04-OOP-Inheritance-abstraction_wl.ipynb | mit | class Item(object):
def __init__(self, name, description, location):
self.name = name
self.description = description
self.location = location
def update_location(self, new_location):
pass
class Equipment(Item):
pass
class Consumable(Item):
... |
sympy/scipy-2017-codegen-tutorial | notebooks/_30-chemical-kinetics-lambdify.ipynb | bsd-3-clause | import sympy as sym
sym.init_printing()
t = sym.symbols('t') # not used, only a placeholder
c = cA, cB, cC = sym.symbols('[A] [B] [C]') # concentrations
k = k1, k2, k3 = sym.symbols('k_1 k_2 k_3')
r1, r2, r3 = k1*cA, k2*cB*cC, k3*cB**2
ydot = r2 - r1, r1 - r2 - r3, r3
ydot
"""
Explanation: Chemical kinetics
As we s... |
marshal789/Lectures-On-Machine-Learning | LinearRegression/LinearRegression.ipynb | mit | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
"""
Explanation: Linear Regression with Python
We will apply Linear Regression on a fake housing dataset
The United States housing data contains the following columns:
'Avg. Area Income': Avg. Income of re... |
ES-DOC/esdoc-jupyterhub | notebooks/test-institute-1/cmip6/models/sandbox-3/ocean.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'test-institute-1', 'sandbox-3', 'ocean')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocean
MIP Era: CMIP6
Institute: TEST-INSTITUTE-1
Source ID: SANDBOX-3
Topic: Ocean
Sub-Topics: Timestepp... |
Kaggle/learntools | notebooks/computer_vision/raw/ex1.ipynb | apache-2.0 | # Setup feedback system
from learntools.core import binder
binder.bind(globals())
from learntools.computer_vision.ex1 import *
# Imports
import os, warnings
import matplotlib.pyplot as plt
from matplotlib import gridspec
import numpy as np
import tensorflow as tf
from tensorflow.keras.preprocessing import image_datas... |
bklooste/ANNe | advanced_rot.ipynb | mit | #@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... |
ioam/scipy-2017-holoviews-tutorial | solutions/03-exploration-with-containers-with-solutions.ipynb | bsd-3-clause | import numpy as np
import holoviews as hv
hv.extension('bokeh')
%opts Curve Area [width=600]
"""
Explanation: <a href='http://www.holoviews.org'><img src="assets/hv+bk.png" alt="HV+BK logos" width="40%;" align="left"/></a>
<div style="float:right;"><h2>03. Exploration with Containers</h2></div>
In the first two secti... |
tensorflow/docs-l10n | site/en-snapshot/tutorials/load_data/tfrecord.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... |
googleinterns/wss | third_party/slim/nets/mobilenet/mobilenet_example.ipynb | apache-2.0 | !git clone https://github.com/tensorflow/models
from __future__ import print_function
from IPython import display
checkpoint_name = 'mobilenet_v2_1.0_224' #@param
url = 'https://storage.googleapis.com/mobilenet_v2/checkpoints/' + checkpoint_name + '.tgz'
print('Downloading from ', url)
!wget {url}
print('Unpacking')
... |
datactive/bigbang | examples/name-and-gender/Working Group Emails and Drafts-hrpc.ipynb | mit | import bigbang.mailman as mailman
from bigbang.parse import get_date
#from bigbang.functions import *
from bigbang.archive import Archive
from ietfdata.datatracker import *
"""
Explanation: This notebook compares the email activities and draft activites of an IETF working group.
Import the BigBang modules as needed. ... |
bgroveben/python3_machine_learning_projects | ApacheMXNet/automatic_differentiation_with_autograd.ipynb | mit | import mxnet as mx
from mxnet import nd, autograd
mx.random.seed(1)
"""
Explanation: Automatic differentiation with autograd
In machine learning, we train models to get better and better as a function of experience.
Usually, getting better means minimizing a loss function, i.e. a score that answers -- how bad is our m... |
CSB-book/CSB | good_code/solutions/Lahti2014_solution.ipynb | gpl-3.0 | import csv # Import csv module for reading the file
"""
Explanation: Solution of 4.10.2, Lahti et al. 2014
Write a function that takes as input a dictionary of constraints (i.e., selecting a specific group of records) and returns a dictionary tabulating the BMI group for all the records matching the constraints. For e... |
tensorflow/docs-l10n | site/en-snapshot/lite/models/modify/model_maker/image_classification.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... |
walchko/soccer2 | docs/ipython/Gait.ipynb | mit | %matplotlib inline
from __future__ import print_function
from __future__ import division
import matplotlib.pyplot as plt
import numpy as np
from numpy.linalg import norm
from math import sin, cos, pi, sqrt
from math import radians as d2r
"""
Explanation: Quadruped Gait
Kevin Walchko, created 8 Nov 2016
End of expla... |
rflamary/POT | docs/source/auto_examples/plot_fgw.ipynb | mit | # Author: Titouan Vayer <titouan.vayer@irisa.fr>
#
# License: MIT License
import matplotlib.pyplot as pl
import numpy as np
import ot
from ot.gromov import gromov_wasserstein, fused_gromov_wasserstein
"""
Explanation: Plot Fused-gromov-Wasserstein
This example illustrates the computation of FGW for 1D measures[18].
.... |
probml/pyprobml | notebooks/book1/15/nmt_jax.ipynb | mit | import jax.numpy as jnp
import matplotlib.pyplot as plt
import pandas as pd
import math
from IPython import display
import jax
try:
import flax.linen as nn
except ModuleNotFoundError:
%pip install -qq flax
import flax.linen as nn
from flax.training import train_state
try:
import optax
except ModuleNo... |
munhyunsu/Hobby | TensorflowTutorials/AITensorflow/6th.ipynb | gpl-3.0 | # 도구 준비
import os
import random
import tensorflow as tf # 텐서플로우
import tensorflow_hub as hub
import matplotlib.pyplot as plt # 시각화 도구
%matplotlib inline
import numpy as np
import PIL.Image as Image
print(f'Tensorflow 버전을 확인합니다: {tf.__version__}')
"""
Explanation: 6차시: 텐서플로우 2.x 활용 전이 학습 이미지 분류
AI 맛보기 6주차: 2020. 08.... |
Eomys/MoSQITo | tutorials/tuto_TNR_PR.ipynb | apache-2.0 | # Add MOSQITO to the Python path
import sys
sys.path.append('..')
# Import numpy
import numpy as np
# Import plot function
import matplotlib.pyplot as plt
# Import multiple spectrum computation tool
from scipy.signal import stft
# Import mosqito functions
from mosqito.utils import load
from mosqito.sound_level_meter i... |
ankdesh/Udacity-MachineLearning-Nanodegree | projects/creating_customer_segments/customer_segments.ipynb | mit | # Import libraries necessary for this project
import numpy as np
import pandas as pd
import renders as rs
from IPython.display import display # Allows the use of display() for DataFrames
# Show matplotlib plots inline (nicely formatted in the notebook)
%matplotlib inline
# Load the wholesale customers dataset
try:
... |
jArumugam/python-notes | libraries/Viz01BasicMatlpotLib.ipynb | mit | # Note seaborn is importes.
# (So you get its basic theme)
import matplotlib.pyplot as plt
plt.plot([1,2,3,4])
plt.ylabel('some numbers')
plt.show()
plt.plot([1, 2, 3, 4], [1, 4, 9, 16])
plt.plot([1,2,3,4], [1,4,9,16], 'ro')
plt.axis([0, 6, 0, 20])
plt.show()
# evenly sampled time at 200ms intervals
t = np.arange(... |
FinTechies/HedgingRL | notebooks/TD Learning Black Scholes X.ipynb | mit | aapl = data.DataReader('AAPL', 'yahoo', '2000-01-01')
print(aapl.head())
"""
Explanation: Plan
Look at some stock price series
devise a model for stock price series
describe a call option
price a call option
Look at some stock prices
We import data from Yahoo finance: two examples are IBM and Apple
End of explanatio... |
ryneches/LinkChecker | example.ipynb | bsd-3-clause | urlre = re.compile( '(?P<url>https?://[^\s]+)' )
for page in doc :
print urlre.findall( page )
"""
Explanation: PDF is garbage
In this example, we are looking for a link to some source code :
http://prodege.jgi-psf.org//downloads/src
However, in the PDF, the URL is line wrapped, so the src is lost.
End of explana... |
dkirkby/astroml-study | Chapter5/IntroductionToBayesianStatistics.ipynb | mit | %pylab inline
"""
Explanation: Chapter 5: Introduction to Bayesian Statistics
Prepared by David Kirkby for the 11-Feb-2016 Study Group
End of explanation
"""
def bus_problem(n_obs, T_true=10., seed=1, bayes=False):
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 5))
gen = np.random.RandomState(seed)
t... |
GoogleCloudPlatform/ml-on-gcp | tutorials/pytorch/jasper/JasperTRT.ipynb | apache-2.0 | !nvidia-docker run -it -d --rm --name "JasperTRT" \
--runtime=nvidia \
--shm-size=4g \
--ulimit memlock=-1 \
--ulimit stack=67108864 \
-v $PWD/data:/datasets \
-v $PWD/checkpoint:/checkpoints/ \
-v $PWD/result:/results/ \
-v $PWD:/workspace/jasper/ \
jasper:trt6 bash
"""
Explanation: <img src=http://... |
cosmoscalibur/herramientas_computacionales | Presentaciones/Notas/04_Linux_bash.ipynb | mit | !ls -o /bin/*sh
"""
Explanation: Programación en Bash
Multiples actividades en nuestro sistema operativo pueden ser constituidas por elementos repetitivos o por largas secuencias de acciones, y además ser estas actividades de uso frecuente, por lo que resulta conveniente una forma de poder hacer esto con la menor inte... |
stijnvanhoey/EGU2015 | EGU2015_FOSS_notebooks.ipynb | bsd-2-clause | # %load PDM_HPC.py
pars =pd.read_csv('data/example2_PDM_parameters.txt',header=0, sep=',', index_col=0)
measured = pd.read_csv('data/example_PDM_measured.txt', header=0, sep='\t', decimal='.', index_col=0)
modelled = pd.read_csv('data/example2_PDM_outputs.txt',header=0, sep=',', index_col=0).T
modeloutput1 = pd.DataF... |
ES-DOC/esdoc-jupyterhub | notebooks/awi/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', 'awi', 'sandbox-2', 'ocnbgchem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem
MIP Era: CMIP6
Institute: AWI
Source ID: SANDBOX-2
Topic: Ocnbgchem
Sub-Topics: Tracers.
Properties: 6... |
alecbrooks/notebooks | notebooks/YouTube Age.ipynb | mit | def median(l):
l = sorted(l) #sort the list
if len(l) % 2 == 1: #Even number of items
return float(l[len(l)/2])
else:
return float(l[len(l)/2]+l[(len(l)/2)-1])/2
average_age = sum(top_users_ages)/len(top_users_ages)
median_age = median(top_users_ages)
print("Average (days): " + str(average_... |
a-mt/dev-roadmap | docs/!ml/notebooks/Bag Of Words.ipynb | mit | def text_to_bow(txt):
bow_dictionary = {}
tokens = preprocess_text(txt)
for token in tokens:
if token in bow_dictionary:
bow_dictionary[token] += 1
else:
bow_dictionary[token] = 1
return bow_dictionary
txt = "I love fantastic flying fish. These flying fish are ... |
csaladenes/csaladenes.github.io | present/mcc2/sklearn_tutorial/04.3-Density-GMM.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
plt.style.use('seaborn')
"""
Explanation: Dénes Csala
MCC, 2022
Based on Elements of Data Science (Allen B. Downey, 2021) and Python Data Science Handbook (Jake VanderPlas, 2018)
License: MIT
Density Estimation: Gaussian M... |
darko-itpro/training-python | demos/prog_fonctionnelle.ipynb | gpl-3.0 | def third_free(price, quantity=1):
"""
Le troisième gratuit
"""
return price * (quantity - quantity // 3)
def second_half_price(price, quantity=1):
"""
Le second à 50%
"""
return (price * (quantity // 2) * 1.5) + (price * (quantity % 2))
"""
Explanation: Lets do it the Python way
Jusqu... |
AllenDowney/ModSimPy | soln/jump2_soln.ipynb | mit | # If we're running on Colab, install modsimpy
# https://pypi.org/project/modsimpy/
import sys
IN_COLAB = 'google.colab' in sys.modules
if IN_COLAB:
!pip install pint==0.9
!pip install modsimpy
!mkdir figs
# Configure Jupyter so figures appear in the notebook
%matplotlib inline
# import functions from th... |
intel-analytics/analytics-zoo | apps/ray/parameter_server/sharded_parameter_server.ipynb | apache-2.0 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import ray
import time
"""
Explanation: This notebook is adapted from:
https://github.com/ray-project/tutorial/tree/master/examples/sharded_parameter_server.ipynb
Sharded Parameter Servers
G... |
google/jax-md | notebooks/nve_simulation.ipynb | apache-2.0 | #@title Imports & Utils
!pip install jax-md
import numpy as onp
from jax.config import config ; config.update('jax_enable_x64', True)
import jax.numpy as np
from jax import random
from jax import jit
from jax import lax
import time
from jax_md import space, smap, energy, minimize, quantity, simulate
import matplo... |
brettavedisian/phys202-2015-work | assignments/assignment05/InteractEx01.ipynb | mit | %matplotlib inline
from matplotlib import pyplot as plt
import numpy as np
from IPython.html.widgets import interact, interactive, fixed
from IPython.display import display
"""
Explanation: Interact Exercise 01
Import
End of explanation
"""
def print_sum(a, b):
"""Print the sum of the arguments a and b."""
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.