repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
sympy/scipy-2017-codegen-tutorial | notebooks/40-chemical-kinetics-cython.ipynb | bsd-3-clause | import json
import numpy as np
from scipy2017codegen.odesys import ODEsys
from scipy2017codegen.chem import mk_rsys
"""
Explanation: In this notebook we will look how we can use Cython to generate a faster callback and hopefully shave off some running time from our integration.
End of explanation
"""
watrad_data = j... |
mne-tools/mne-tools.github.io | dev/_downloads/c1dad3cf15579a4724c19d6df916b111/mixed_norm_inverse.ipynb | bsd-3-clause | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Daniel Strohmeier <daniel.strohmeier@tu-ilmenau.de>
#
# License: BSD-3-Clause
import numpy as np
import mne
from mne.datasets import sample
from mne.inverse_sparse import mixed_norm, make_stc_from_dipoles
from mne.minimum_norm import make_inverse_op... |
pyrdr/charlas | intro_eda_python_pt_02/intro_pypands_pt02.ipynb | mit | import pandas as pd
from matplotlib import pyplot as plt
import seaborn as sns
import numpy as np
%matplotlib inline
df = pd.read_csv('dgii_clean.csv',sep=',', encoding="ISO-8859-1")
ene = df[df.mes == 'ene-16']
ene.genero.value_counts()
spg = ene.groupby(by=['puesto_clean']).filter(lambda x: (len(x[x.genero == 'F'])... |
nfaggian/notebooks | Introductions/Tutorial - 1.2 - Matplotlib.ipynb | apache-2.0 | import matplotlib.pyplot as plt
import numpy as np
%matplotlib inline
"""
Explanation: Matplotlib
http://matplotlib.org/
A graphics library that can be used to form publication quality figures.
For a comprehensive set of examples, refer to this material:
http://matplotlib.org/gallery.html
End of explanation
"""
dat... |
katyhuff/berkeley | scraping/webscraping_tutorial.ipynb | bsd-3-clause | import requests
r = requests.get("http://berkeley.edu")
r
dir(r)
r.encoding
"""
Explanation: Scraping the web is fun:
Do-goodery
Making much money
Amusing much people
End of explanation
"""
import lxml.html as LH
url = "http://www.cambridgema.gov/cpd/newsandalerts/Archives/detail.aspx?path=%2fsitecore%2fcontent%... |
keras-team/keras-io | examples/vision/ipynb/adamatch.ipynb | apache-2.0 | !pip install -q tf-models-official
"""
Explanation: Semi-supervision and domain adaptation with AdaMatch
Author: Sayak Paul<br>
Date created: 2021/06/19<br>
Last modified: 2021/06/19<br>
Description: Unifying semi-supervised learning and unsupervised domain adaptation with AdaMatch.
Introduction
In this example, we wi... |
li-yuntao/SiliconLives | PytorchModels/tutorials/neural_networks_tutorial.ipynb | gpl-3.0 | import torch
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
class Net(nn.Module):
def __init__(self):
super(Net, self).__init__()
# 1 input image channel, 6 output channels, 5x5 square convolution
# kernel
self.conv1 = nn.Conv2d(1, 6, 5)
... |
GoogleCloudPlatform/vertex-ai-samples | notebooks/community/sdk/sdk_custom_image_classification_batch.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: Custom training image classification model for batch prediction
<table align="left"... |
MarsUniversity/ece387 | website/block_3_vision/misc/histogram/histogram_tracking.ipynb | mit | %matplotlib inline
from __future__ import print_function
from __future__ import division
import numpy as np
from matplotlib import pyplot as plt
import cv2
import time
"""
Explanation: Histogram Detection
Kevin J. Walchko, created 5 Dec 2016
Although color detection is simple and works pretty good, the world tends t... |
junhwanjang/DataSchool | Lecture/16. 로지스틱 회귀분석/1) 로지스틱 회귀 분석.ipynb | mit | xx = np.linspace(-10, 10, 1000)
plt.plot(xx, (1/(1+np.exp(-xx)))*2-1, label="logistic (scaled)")
plt.plot(xx, sp.special.erf(0.5*np.sqrt(np.pi)*xx), label="erf (scaled)")
plt.plot(xx, np.tanh(xx), label="tanh")
plt.ylim([-1.1, 1.1])
plt.legend(loc=2)
plt.show()
"""
Explanation: 로지스틱 회귀 분석
로지스틱 회귀(Logistic Regression) ... |
ioshchepkov/SHTOOLS | examples/notebooks/tutorial_1.ipynb | bsd-3-clause | %matplotlib inline
from __future__ import print_function # only necessary if using Python 2.x
import matplotlib.pyplot as plt
import numpy as np
from pyshtools.shio.shread import shread
from pyshtools.expand import MakeGridDH
from pyshtools.expand import SHExpandDH
from pyshtools.spectralanalysis import spectrum
"""... |
msadegh97/machine-learning-course | 04-evaluation-metrics.ipynb | gpl-3.0 | from sklearn.model_selection import train_test_split
from sklearn.datasets import load_iris
X, y = load_iris(return_X_y=True)
print('X.shape =', X.shape)
print('y.shape =', y.shape)
print()
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, shuffle=True)
print('X_train.shape =', X_train.shape)
pr... |
tensorflow/docs-l10n | site/ko/hub/tutorials/semantic_approximate_nearest_neighbors.ipynb | apache-2.0 | # Copyright 2018 The TensorFlow Hub Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
ericmjl/Network-Analysis-Made-Simple | archive/bonus-1-network-statistical-inference-student.ipynb | mit | # Read in the data.
# Note from above that we have to skip the first two rows, and that there's no header column,and that the edges are
# delimited by spaces in between the nodes. Hence the syntax below:
G = cf.load_propro_network()
"""
Explanation: Introduction
In this notebook, we will walk through a hacker's approa... |
sraejones/Phys202-project | Progress/.ipynb_checkpoints/Progress Report-checkpoint.ipynb | mit | import numpy as np
import math
import random
import string
from scipy import optimize
%matplotlib inline
import matplotlib.pyplot as plt
from IPython.html.widgets import interact
from sklearn.datasets import load_digits
digits = load_digits()
print(digits.data.shape)
"""
Explanation: Progress report
Neural Networks
... |
hungiyang/StatisticalMethods | notes/DifficultDensities.ipynb | gpl-2.0 | from IPython.display import Image
Image(filename="DifficultDensities_banana_eg.png", width=350)
"""
Explanation: Breaking MCMC: difficult densities
We're fortunate that much of the time the posterior functions we care about are relatively simple, i.e. unimodal and roughly Gaussian shaped. But not always! So, let's hav... |
khufkens/daymetpy | examples/daymetpy_demo.ipynb | agpl-3.0 | import sys
sys.path.append(r"..")
import daymetpy
ornl_lat, ornl_long = 35.9313167, -84.3104124
df = daymetpy.daymet_timeseries(lon=ornl_long, lat=ornl_lat, start_year=2012, end_year=2013)
"""
Explanation: Using Daymet data from ORNL webservice
Daymet is a a daily gridded weather dataset distributed through the ORNL... |
ES-DOC/esdoc-jupyterhub | notebooks/nasa-giss/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', 'nasa-giss', 'sandbox-3', 'ocean')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocean
MIP Era: CMIP6
Institute: NASA-GISS
Source ID: SANDBOX-3
Topic: Ocean
Sub-Topics: Timestepping Framework,... |
aerospace-notebook/aerospace-notebook | Segway-sysid.ipynb | bsd-3-clause | import sympy
import sympy.physics.mechanics as mech
sympy.init_printing(use_latex='mathjax')
from IPython.display import display
%matplotlib inline
%load_ext autoreload
%autoreload 2
import px4_logutil
import pylab as pl
from px4_logutil import savitzky_golay
import numpy as np
import scipy.integrate
"""
Explanation: ... |
tsarouch/data_science_references_python | core/logistic_regression_basics.ipynb | gpl-2.0 | import pandas as pd
url = 'http://archive.ics.uci.edu/ml/machine-learning-databases/glass/glass.data'
col_names = ['id','ri','na','mg','al','si','k','ca','ba','fe','glass_type']
glass = pd.read_csv(url, names=col_names, index_col='id')
glass.sort_values(by='al', inplace=True)
glass.head()
glass['household'] = glass.gla... |
KIPAC/StatisticalMethods | tutorials/working_with_samples.ipynb | gpl-2.0 | exec(open('tbc.py').read()) # define TBC and TBC_above
import numpy as np
import scipy.stats as st
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Tutorial: Working with Samples
In practice, we almost always work with samples from probability distributions ... |
crscardellino/theano_rnn | MultiLayerPerceptron.ipynb | mit | import numpy as np
import re
import theano
import theano.tensor as T
from nltk import corpus
from sklearn.metrics import accuracy_score, classification_report
from sklearn.cross_validation import train_test_split
from sklearn.datasets import fetch_20newsgroups
from sklearn.feature_extraction import text
np.random.see... |
wmvanvliet/neuroscience_tutorials | eeg-bci/3. Imagined movement.ipynb | bsd-2-clause | %pylab inline
"""
Explanation: 3. Imagined movement
In this tutorial we will look at imagined movement. Our movement is controlled in the motor cortex where there is an increased level of mu activity (8–12 Hz) when we perform movements. This is accompanied by a reduction of this mu activity in specific regions that de... |
boffi/boffi.github.io | dati_2016/05/2DOF_Problem.ipynb | mit | M = np.array(((2.0, 0.0), ( 0.0, 1.0)))
K = np.array(((3.0,-2.0), (-2.0, 2.0)))
p = np.array(( 0.0, 1.0))
w = 2.0
"""
Explanation: 2 DOF System
The data that describes our system and its loading,
$$\boldsymbol p(t) = p_0\,\begin{Bmatrix}0\1\end{Bmatrix}\sin 2\omega_0\,t$$
End of explanation
"""
evals, Psi = eigh(K, ... |
yjzhang/uncurl_python | notebooks/Imputation.ipynb | mit | %matplotlib inline
import random
import numpy as np
import matplotlib.pyplot as plt
import scipy
import scipy.io
from scipy import sparse
import uncurl
"""
Explanation: Imputation using UNCURL
Here, we will test imputation of missing data.
End of explanation
"""
data_z = scipy.io.loadmat('../data/GSE60361_dat.mat')... |
turbomanage/training-data-analyst | courses/machine_learning/deepdive/03_tensorflow/b_estimator.ipynb | apache-2.0 | import tensorflow as tf
import pandas as pd
import numpy as np
import shutil
print(tf.__version__)
"""
Explanation: <h1>2b. Machine Learning using tf.estimator </h1>
In this notebook, we will create a machine learning model using tf.estimator and evaluate its performance. The dataset is rather small (7700 samples),... |
ES-DOC/esdoc-jupyterhub | notebooks/pcmdi/cmip6/models/sandbox-2/aerosol.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'pcmdi', 'sandbox-2', 'aerosol')
"""
Explanation: ES-DOC CMIP6 Model Properties - Aerosol
MIP Era: CMIP6
Institute: PCMDI
Source ID: SANDBOX-2
Topic: Aerosol
Sub-Topics: Transport, Emissions, Con... |
Justin-Tan/hep-analysis | notebooks/data_processing/Postprocessor.ipynb | gpl-3.0 | import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
def output_probs(network_output, y):
# Break network output down into signal and background components
labels = np.argmax(y, 1)
sig_indices = np.where(labels == 1)
bkg_indices = np.where(labels == 0)
sig_ou... |
mne-tools/mne-tools.github.io | dev/_downloads/bdc8ac519d8f54d70a73a5e0de598566/50_background_freesurfer_mne.ipynb | bsd-3-clause | import os
import numpy as np
import nibabel
import matplotlib.pyplot as plt
import matplotlib.patheffects as path_effects
import mne
from mne.transforms import apply_trans
from mne.io.constants import FIFF
"""
Explanation: How MNE uses FreeSurfer's outputs
This tutorial explains how MRI coordinate frames are handled... |
eshlykov/mipt-day-after-day | statistics/hw-13/hw-13.3.ipynb | unlicense | import numpy
import scipy
from scipy.linalg import inv
import matplotlib.pyplot
%matplotlib inline
"""
Explanation: Теоретическое домашнее задание 13
Задача 3
Используя метод линейной регрессии, постройте приближение функции $f$ многочленом третьей степени по следующим данным:
|$f$|3.9|5.0|5.7|6.5|7.1|7.6|7.8|8.1|8.4|... |
linsalrob/PyFBA | iPythonNotebooks/Reconstruct SBML From Scratch.ipynb | mit | import sys
import os
import copy
import PyFBA
import re
import pickle
import inspect
inspect.getfile(PyFBA)
"""
Explanation: Reconstruct the SBML from a set of reactions
This is to test the FBA toolchain
End of explanation
"""
modeldata = PyFBA.parse.model_seed.parse_model_seed_data('gramnegative', verbose=True)
pr... |
microscopium/microscopium-scripts | zscore_regression_plots.ipynb | bsd-3-clause | %matplotlib inline
import pandas as pd
from sklearn.preprocessing import StandardScaler
from sklearn.manifold import TSNE
from sklearn.decomposition import PCA
from sklearn.linear_model import LinearRegression
from pymongo import MongoClient
import pymongo
import matplotlib.pyplot as plt
import matplotlib.pylab as p... |
ljchang/psyc63 | Notebooks/Old/phacking.ipynb | mit | np.random.seed(12345678)
maxrep = 100
n = 2
stop,ps = 0,[]
while stop==0:
rvs1 = stats.norm.rvs(loc=5,scale=10,size=n)
rvs2 = stats.norm.rvs(loc=5,scale=10,size=n)
t,p = stats.ttest_ind(rvs1,rvs2) # ttest1.
ps.append(p)
# print "n = %i, mdiff = %.2f, t = %.2f, p = %.5f" % (n,rvs1.mean()-rvs2.mean()... |
jtleider/censusdata | docs/notebooks/example3.ipynb | mit | import pandas as pd
import censusdata
pd.set_option('display.expand_frame_repr', False)
pd.set_option('display.precision', 2)
import statsmodels.formula.api as sm
"""
Explanation: Example 3: Downloading State Data
For this example, we will be running a simple linear regression model,
so we need an additional import:
E... |
GoogleCloudPlatform/vertex-ai-samples | notebooks/community/gapic/custom/showcase_custom_tabular_regression_online.ipynb | apache-2.0 | import os
import sys
# Google Cloud Notebook
if os.path.exists("/opt/deeplearning/metadata/env_version"):
USER_FLAG = "--user"
else:
USER_FLAG = ""
! pip3 install -U google-cloud-aiplatform $USER_FLAG
"""
Explanation: Vertex client library: Custom training tabular regression model for online prediction
<tabl... |
davicsilva/dsintensive | jobs/statistic/human_temp/exercice_1_inferential_statistics_human_temperature.ipynb | apache-2.0 | import pandas as pd
df = pd.read_csv('data/human_body_temperature.csv')
# Your work here.
# Load Matplotlib + Seaborn and SciPy libraries
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
from scipy import stats
%matplotlib inline
df.head(5)
"""
Explanation: What is the True Normal Human Bod... |
mayankjohri/LetsExplorePython | Section 1 - Core Python/Chapter 03 - Loops/Loops.ipynb | gpl-3.0 | for x in "Manish Gupta":
print(x, end="^~", flush=True)
"""
Explanation: Loops
During the course of solving client requirements, comes across situations where group of some data needs to be processed against a defined set of instructions.
Loops help in resolving situations where a piece of code needs to be execu... |
Resly/pipeline | jupyterhub.ml/notebooks/spark/.ipynb_checkpoints/Deploy_SparkML_Airbnb_LinearRegression-checkpoint.ipynb | apache-2.0 | # You may need to Reconnect (more than Restart) the Kernel to pick up changes to these sett
import os
master = '--master spark://127.0.0.1:47077'
conf = '--conf spark.cores.max=1 --conf spark.executor.memory=512m'
packages = '--packages com.amazonaws:aws-java-sdk:1.7.4,org.apache.hadoop:hadoop-aws:2.7.1'
jars = '--jar... |
antoinecarme/pyaf | docs/PyAF_Exogenous.ipynb | bsd-3-clause | import numpy as np
import pandas as pd
import datetime
csvfile_link = "https://raw.githubusercontent.com/antoinecarme/pyaf/master/data/ozone-la-exogenous-2.csv"
exog_dataframe = pd.read_csv(csvfile_link);
exog_dataframe['Date'] = exog_dataframe['Date'].astype(np.datetime64);
print(exog_dataframe.info())
exog_datafram... |
dynaryu/rmtk | rmtk/vulnerability/derivation_fragility/NLTHA_on_SDOF/2MSA_on_SDOF.ipynb | agpl-3.0 | from rmtk.vulnerability.common import utils
import double_MSA_on_SDOF
import numpy
from rmtk.vulnerability.derivation_fragility.NLTHA_on_SDOF.read_pinching_parameters import read_parameters
import MSA_utils
%matplotlib inline
"""
Explanation: Double Multiple Stripe Analysis (2MSA) for Single Degree of Freedom (SDOF) O... |
danielc2112/notebooks | KNN.ipynb | mit | import math
#####################################################################################
# d = sqrt((a1-b1)^2 + (a2-b2)^2+(a3-b3)^2+(a4-b4)^2)
#####################################################################################
def euclidean_dist(data1, data2):
# transformo [a1,a2,...,an] e [b1,b2,..... |
TheOregonian/long-term-care-db | notebooks/transformation/mung-3-25-scrape.ipynb | mit | #Five years of detailed complaint data for all four kinds of facilities (Residential Care, Assisted Living, Nursing, and Adult Foster Home)
detailed = pd.read_excel('../../data/raw/Oregonian Abuse records 5 years May 2016.xlsx', header=3)
#Ten years of non-detailed complaints for Nursing Facilities
NF_complaints = pd.r... |
rajeshb/SelfDrivingCar | CarND-LeNet-Lab/LeNet-Lab.ipynb | mit | from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", reshape=False)
X_train, y_train = mnist.train.images, mnist.train.labels
X_validation, y_validation = mnist.validation.images, mnist.validation.labels
X_test, y_test = mnist.test.images, mn... |
liufuyang/deep_learning_tutorial | course-deeplearning.ai/course4-cnn/week3-car-detection/Autonomous+driving+application+-+Car+detection+-+v1.ipynb | mit | import argparse
import os
import matplotlib.pyplot as plt
from matplotlib.pyplot import imshow
import scipy.io
import scipy.misc
import numpy as np
import pandas as pd
import PIL
import tensorflow as tf
from keras import backend as K
from keras.layers import Input, Lambda, Conv2D
from keras.models import load_model, Mo... |
ES-DOC/esdoc-jupyterhub | notebooks/fio-ronm/cmip6/models/sandbox-1/seaice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'fio-ronm', 'sandbox-1', 'seaice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Seaice
MIP Era: CMIP6
Institute: FIO-RONM
Source ID: SANDBOX-1
Topic: Seaice
Sub-Topics: Dynamics, Thermodynami... |
ComputationalModeling/spring-2017-danielak | past-semesters/fall_2016/day-by-day/day08-modeling-viral-load-day1/Day_8_Pre_Class_Notebook_SOLUTIONS.ipynb | agpl-3.0 | # Imports the functionality that we need to display YouTube videos in a Jupyter Notebook.
# You need to run this cell before you run ANY of the YouTube videos.
from IPython.display import YouTubeVideo
# WATCH THE VIDEO IN FULL-SCREEN MODE
YouTubeVideo("8_wSb927nH0",width=640,height=360) # Complex 'if' statements... |
open-forcefield-group/openforcefield | examples/swap_amber_parameters/swap_existing_ligand_parameters.ipynb | mit | # Retrieve protein and ligand files for BRD4 and a docked inhibitor from the benchmark systems GitHub repository
# https://github.com/MobleyLab/benchmarksets
import requests
repo_url = 'https://raw.githubusercontent.com/MobleyLab/benchmarksets/master/input_files/'
sources = {
'system.prmtop' : repo_url + 'BRD4/prmt... |
rishuatgithub/MLPy | torch/PYTORCH_NOTEBOOKS/03-CNN-Convolutional-Neural-Networks/05-CNN-Exercises.ipynb | apache-2.0 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import DataLoader
from torchvision import datasets, transforms
from torchvision.utils import make_grid
import numpy as np
import pandas as pd
from sklearn.metrics import confusion_matrix
import matplotlib.pyplot as plt
%matplotlib... |
noogel/xyzStudyPython | xyzpw/.ipynb_checkpoints/Peewee源码解读-checkpoint.ipynb | apache-2.0 | from model.db.tb_raw import TbRaw
query = TbRaw.select().where(TbRaw.id > 0)
print "select query:", query.sql()[0] % tuple(query.sql()[1])
print "query result:"
for item in query.dicts().execute():
print item
"""
Explanation: 通过select查询语句引入
End of explanation
"""
# UNION查询
query = TbRaw.select().where(TbRaw.id >... |
maojrs/riemann_book | dev/riemann_interactive.ipynb | bsd-3-clause | import mpld3
import numpy as np
from clawpack.riemann import riemann_interactive
"""
Explanation: Riemann interactive
In this notebook, we show interactive solutions of two Riemann problems for shallow water equations and acoustics. The user can interactively modify the phase planes and x-t planes and see its correspo... |
mayankjohri/LetsExplorePython | Section 1 - Core Python/Chapter 07 - Scope/Scope_of_names.ipynb | gpl-3.0 | a = 10
def test():
a = 12
print(a)
test()
print(a)
a = 10
def test():
print(a)
a = 12
try:
test()
print(a)
except Exception as e:
print("error:", e)
a = 10
def test():
"""
- Only for viewing value of Global Variable
- Cannot change the global variable
"""
print(a)... |
EducationalTestingService/rsmtool | tests/data/experiments/lr-with-warnings/custom1.ipynb | apache-2.0 | import warnings
"""
Explanation: This is a custom section
This is part of a functional test for rsmtool(or rsmeval) on including custom sections in reports.
Below we have some random stuff.
End of explanation
"""
warnings.warn("This is a deprecation warning", DeprecationWarning)
"""
Explanation: A header
End of ex... |
wtbarnes/aia_response | notebooks/response_function_comparison.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
import sunpy.instr.aia
%matplotlib inline
"""
Explanation: Comparing SDO/AIA Response Functions: SSW and SunPy
This notebook runs comparisons between the results of SSW and SunPy in calculating the wavelength and temperature response functions of the AIA instrument on... |
Naereen/notebooks | Oraux_CentraleSupelec_PSI__Juin_2018.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
from scipy import integrate
import numpy.random as rd
"""
Explanation: Table of Contents
<p><div class="lev1 toc-item"><a href="#Oraux-CentraleSupélec-PSI---Juin-2018" data-toc-modified-id="Oraux-CentraleSupélec-PSI---Juin-2018-1"><span class="toc-item-num">1 &nb... |
wilomaku/IA369Z | dev/mean-WJGH.ipynb | gpl-3.0 | ## Functions
import sys,os
path = os.path.abspath('../dev/')
if path not in sys.path:
sys.path.append(path)
import bib_mri as FW
import numpy as np
import scipy as scipy
import scipy.misc as misc
import matplotlib as mpl
import matplotlib.pyplot as plt
from numpy import genfromtxt
import platform
%matplotlib in... |
google-research/google-research | protseq/simulation_of_barcode_reads_to_match_proteome.ipynb | apache-2.0 | import collections
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import numpy as np
"""
Explanation: Licensed under the Apache License, Version 2.0 (the "License");
End of explanation
"""
# Download from uniprot: https://www.uniprot.org/help/human_proteome
!wget -O uniprot.fasta "https://... |
sloanesturz/cs224u-final-project | sippycup-unit-2.ipynb | gpl-2.0 | class Grammar:
def __init__(self, rules=[], annotators=[], start_symbol='$ROOT'):
self.categories = set()
self.lexical_rules = defaultdict(list)
self.unary_rules = defaultdict(list)
self.binary_rules = defaultdict(list)
self.annotators = annotators
self.start_symbol =... |
BoasWhip/Black | Notebook/NumPy Basics.ipynb | mit | import math
import numpy as np
''' Display Precicion Settings '''
np.set_printoptions(formatter={'float': '{: 0.4f}'.format})
"""
Explanation: NumPy
<b>Numpy</b> is the core library for scientific computing in Python. It provides a high-performance multidimensional array object, and tools for working with these arra... |
ES-DOC/esdoc-jupyterhub | notebooks/bcc/cmip6/models/sandbox-3/land.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'bcc', 'sandbox-3', 'land')
"""
Explanation: ES-DOC CMIP6 Model Properties - Land
MIP Era: CMIP6
Institute: BCC
Source ID: SANDBOX-3
Topic: Land
Sub-Topics: Soil, Snow, Vegetation, Energy Balance... |
rnwatanabe/projectPR | ExampleNotebooks/IsometricClosedLoop.ipynb | gpl-3.0 | import sys
sys.path.insert(0, '..')
import time
import matplotlib.pyplot as plt
%matplotlib notebook
from IPython.display import set_matplotlib_formats
set_matplotlib_formats('pdf', 'png')
plt.rcParams['savefig.dpi'] = 75
plt.rcParams['figure.autolayout'] = False
plt.rcParams['figure.figsize'] = 10, 6
plt.rcParams['a... |
deflaux/linkage-disequilibrium | datalab/LD_decay.ipynb | apache-2.0 | import gcp.bigquery as bq
import matplotlib
import matplotlib.pyplot as plt
import pandas as pd
"""
Explanation: <!-- Copyright 2015 Google Inc. 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. -->
<... |
gmonce/datascience | src/Sobreajustando.ipynb | gpl-3.0 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
plt.style.use('seaborn-whitegrid')
from sklearn.linear_model import Ridge
from sklearn.preprocessing import PolynomialFeatures
from sklearn.pipeline import make_pipeline
"""
Explanation: Sobreajuste
Les voy a mostrar algo mágico. Y después les vo... |
abhi1509/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.13.2/examples/notebooks/generated/tsa_filters.ipynb | bsd-3-clause | %matplotlib inline
import pandas as pd
import matplotlib.pyplot as plt
import statsmodels.api as sm
dta = sm.datasets.macrodata.load_pandas().data
index = pd.Index(sm.tsa.datetools.dates_from_range("1959Q1", "2009Q3"))
print(index)
dta.index = index
del dta["year"]
del dta["quarter"]
print(sm.datasets.macrodata.N... |
patonelli/map2110-modelagem | conicas2.ipynb | cc0-1.0 | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
theta = np.arange(-1.7,1.7,0.1)
r = lambda x: 2.0/(1+np.cos(x))
theta
rho =r(theta)
rho
## primeiro vou tentar um grafico polar
ax=plt.subplot(111,projection='polar')
ax.plot(theta,rho)
ponto = lambda x: [r(x)*np.cos(x) , r(x)*np.sin(x)]
par = ... |
madHatter106/DataScienceCorner | posts/relating-principle-components-to-the-data-whence-they-came.ipynb | mit | import netCDF4 as nc
import sys
from sklearn.preprocessing import StandardScaler
from sklearn.decomposition import PCA
import xarray as xr
import pandas as pd
import os
import matplotlib.pyplot as pl
from matplotlib import rcParams
import numpy as np
from seaborn import heatmap, axes_style
import cmocean as cm
print("... |
craffel/pretty-midi | Tutorial.ipynb | mit | # For Python2.6 compatibility
from __future__ import print_function
import pretty_midi
import numpy as np
# For plotting
import mir_eval.display
import librosa.display
import matplotlib.pyplot as plt
%matplotlib inline
# For putting audio in the notebook
import IPython.display
"""
Explanation: pretty_midi tutorial
T... |
ES-DOC/esdoc-jupyterhub | notebooks/ec-earth-consortium/cmip6/models/ec-earth3-cc/atmos.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'ec-earth-consortium', 'ec-earth3-cc', 'atmos')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmos
MIP Era: CMIP6
Institute: EC-EARTH-CONSORTIUM
Source ID: EC-EARTH3-CC
Topic: Atmos
Sub-Topic... |
AllenDowney/ModSimPy | soln/chap25soln.ipynb | mit | # Configure Jupyter so figures appear in the notebook
%matplotlib inline
# Configure Jupyter to display the assigned value after an assignment
%config InteractiveShell.ast_node_interactivity='last_expr_or_assign'
# import functions from the modsim.py module
from modsim import *
"""
Explanation: Modeling and Simulati... |
planetlabs/notebooks | jupyter-notebooks/in-class-exercises/convert-radiance-to-reflectance/convert-radiance-to-reflectance-key.ipynb | apache-2.0 | # To use Planet's CLI from this Notebook, begin your line as follows:
!planet data
# Here is an example of using Planet's CLI to search for a known item id:
# !planet data download --item-type PSScene --asset-type ortho_analytic_4b,ortho_analytic_4b_xml --string-in id 20170623_180038_0f34
"""
Explanation: Converting ... |
xboard/xboard.github.io | ipynb/Inflation vs Economic Growth vs Interest Rates.ipynb | mpl-2.0 | df = pd.read_csv("../data/brazil_gdp_inflation_ir.csv", dtype={'Time':np.float64, 'GDP':np.float64, 'Inflation':np.float64, 'Interest':np.float64}, index_col="Time")
"""
Explanation: Carrega dados do FMI referentes ao Brasil
End of explanation
"""
df['RInterest'] = df.Interest - df.Inflation
brazil = df.sort()
brazi... |
DaveBackus/Data_Bootcamp | Code/IPython/bootcamp_pandas-summarize.ipynb | mit | import sys # system module
import pandas as pd # data package
import matplotlib.pyplot as plt # graphics module
import datetime as dt # date and time module
import numpy as np # foundation for Pandas
%matplotlib inline ... |
cmawer/pycon-2017-eda-tutorial | notebooks/1-RedCard-EDA/3-Redcard-Dyads.ipynb | mit | %matplotlib inline
%config InlineBackend.figure_format='retina'
from __future__ import absolute_import, division, print_function
import matplotlib as mpl
from matplotlib import pyplot as plt
from matplotlib.pyplot import GridSpec
import seaborn as sns
import numpy as np
import pandas as pd
import os, sys
from tqdm imp... |
computational-class/cjc2016 | code/13.recsys_intro.ipynb | mit | # A dictionary of movie critics and their ratings of a small
# set of movies
critics={'Lisa Rose': {'Lady in the Water': 2.5, 'Snakes on a Plane': 3.5,
'Just My Luck': 3.0, 'Superman Returns': 3.5, 'You, Me and Dupree': 2.5,
'The Night Listener': 3.0},
'Gene Seymour': {'Lady in the Water': 3.0, 'Snakes... |
therealAJ/python-sandbox | data-science/learning/ud2/Part 1 Exercise Solutions/Choropleth Maps Exercise .ipynb | gpl-3.0 | import plotly.graph_objs as go
from plotly.offline import init_notebook_mode,iplot
init_notebook_mode(connected=True)
"""
Explanation: <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a>
Choropleth Maps Exercise
Welcome to the Choropleth Maps Exercise! In this exercise we will give you ... |
ellisonbg/leafletwidget | examples/Image_slider.ipynb | mit | import ftplib
import os
from tqdm import tqdm
import rasterio
from rasterio.warp import reproject, Resampling
from affine import Affine
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import subprocess
import datetime
import asyncio
from time import time
from base64 import b64encode
from ipyleafl... |
appleby/fastai-courses | deeplearning1/nbs/lesson5-ma.ipynb | apache-2.0 | from keras.datasets import imdb
idx = imdb.get_word_index()
"""
Explanation: Setup data
We're going to look at the IMDB dataset, which contains movie reviews from IMDB, along with their sentiment. Keras comes with some helpers for this dataset.
End of explanation
"""
idx
idx_arr = sorted(idx, key=idx.get)
idx_arr[:... |
ttsuchi/ttsuchi.github.io | notebooks/GaborFilters.ipynb | mit | xs=linspace(-3, 3, 1000)
gaussian=exp(-xs**2/2)
sinusoid=exp(1j*2*pi*xs/0.5) # 1j is "i"
plt.plot(xs, gaussian, '--')
plt.plot(xs, real(sinusoid), '--')
plt.plot(xs, gaussian*real(sinusoid))
"""
Explanation: <style>
.center-image { display: block; margin: auto; }
</style>
Gabor Filters
In this notebook, I will de... |
jepegit/cellpy | dev_utils/ica_notebooks/fitting/fitting_with_widgets.ipynb | mit | %load_ext autoreload
%autoreload 2
import os
import copy
import logging
import bokeh
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from cellpy import cellreader
from cellpy.utils import ica
import holoviews as hv
import ipywidgets as widgets
from ipywidgets import interact, interact_manual
%... |
naokishibuya/deep-learning | python/autoencoder_noise_reduction.ipynb | mit | import numpy as np
import keras
from keras.layers import Input, Dense, Conv2D, MaxPooling2D, UpSampling2D
from keras.models import Model
from sklearn.model_selection import train_test_split
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Autoencoder for Noise Reduction
The idea of encoding is to re... |
dipanjanS/text-analytics-with-python | New-Second-Edition/Ch08 - Semantic Analysis/Ch08c - Building NER Taggers.ipynb | apache-2.0 | import pandas as pd
df = pd.read_csv('ner_dataset.csv.gz', compression='gzip', encoding='ISO-8859-1')
df.info()
df.T
df = df.fillna(method='ffill')
df.info()
df.T
df['Sentence #'].nunique(), df.Word.nunique(), df.POS.nunique(), df.Tag.nunique()
"""
Explanation: Build your own NER Tagger
Named Entity Recognition (... |
jamesfolberth/NGC_STEM_camp_AWS | notebooks/ML_morning_JTN/02_Logistic_Regression_and_Text_Models.ipynb | bsd-3-clause | import matplotlib.pyplot as plt
%matplotlib inline
from sklearn import datasets
iris = datasets.load_iris()
X_train = iris.data[iris.target != 2, :2] # first two features and
y_train = iris.target[iris.target != 2] # first two labels only
fig = plt.figure(figsize=(8,8))
mycolors = {"blue": "steelblue", "red": "#... |
450586509/DLNLP | src/CNN_word_multi_channel.ipynb | apache-2.0 | import keras
from os.path import join
from keras.preprocessing import sequence
from keras.models import Sequential
from keras.layers import Dense, Dropout,Activation, Lambda,Input
from keras.layers import Embedding
from keras.layers import Convolution1D
from keras.datasets import imdb
from keras import backend as K
f... |
mne-tools/mne-tools.github.io | stable/_downloads/c69e0120935518121b8298ecac72eed8/35_dipole_orientations.ipynb | bsd-3-clause | import mne
import numpy as np
from mne.datasets import sample
from mne.minimum_norm import make_inverse_operator, apply_inverse
data_path = sample.data_path()
meg_path = data_path / 'MEG' / 'sample'
evokeds = mne.read_evokeds(meg_path / 'sample_audvis-ave.fif')
left_auditory = evokeds[0].apply_baseline()
fwd = mne.rea... |
superbobry/pymc3 | pymc3/examples/stochastic_volatility.ipynb | apache-2.0 | import numpy as np
import pymc3 as pm
from pymc3.distributions.timeseries import GaussianRandomWalk
from scipy.sparse import csc_matrix
from scipy import optimize
%pylab inline
"""
Explanation: Stochastic Volatility model
End of explanation
"""
n = 400
returns = np.genfromtxt("data/SP500.csv")[-n:]
returns[:5]
pl... |
cmshobe/landlab | notebooks/tutorials/boundary_conds/set_BCs_on_voronoi.ipynb | mit | from landlab import VoronoiDelaunayGrid
from landlab.plot.imshow import imshow_grid
import numpy as np
%matplotlib inline
"""
Explanation: <a href="http://landlab.github.io"><img style="float: left" src="../../landlab_header.png"></a>
Setting Boundary Conditions on a Voronoi.
<hr>
<small>For more Landlab tutorials, cl... |
drvinceknight/cfm | assets/assessment/mock/assignment.ipynb | mit | ### BEGIN SOLUTION
### END SOLUTION
"""
Explanation: Computing for Mathematics - Mock individual coursework
This jupyter notebook contains questions that will resemble the questions in your individual coursework.
Important Do not delete the cells containing:
```
BEGIN SOLUTION
END SOLUTION
```
write your solution a... |
muatik/dm | Trueskill.ipynb | mit | import numpy as np
from matplotlib import pyplot as plt
import seaborn as sns
sns.set(color_codes=True)
%matplotlib inline
N = 10000
mean = 0
std_dev = 1
samples1 = np.random.normal(mean, std_dev, N)
sns.distplot(samples,norm_hist=True)
n, bins, patches = plt.hist(samples1, bins=30, normed=True)
"""
Explanation: ht... |
jrieke/machine-intelligence-2 | sheet03/documentation.ipynb | mit | from __future__ import division, print_function
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Machine Intelligence II (week 3) - Team MensaNord
Nikolai Zaki
Alexander Moore
Johannes Rieke
Georg Hoelger
Oliver Atanaszov
End of explanation
"""
data1 = pd.re... |
ledeprogram/algorithms | class6/donow/born_mathias_6_DoNow.ipynb | gpl-3.0 | import pandas as pd
import pandas as pd
import matplotlib.pyplot as plt # package for doing plotting (necessary for adding the line)
import statsmodels.formula.api as smf # package we'll be using for linear regression
%matplotlib inline
"""
Explanation: 1. Import the necessary packages to read in the data, plot, and c... |
mclaughlin6464/pearce | notebooks/Pearce Delta Sigma test.ipynb | mit | from pearce.mocks import cat_dict
import numpy as np
from os import path
from astropy.io import fits
import matplotlib
#matplotlib.use('Agg')
from matplotlib import pyplot as plt
%matplotlib inline
import seaborn as sns
sns.set()
z_bins = np.array([0.15, 0.3, 0.45, 0.6, 0.75, 0.9])
zbin=1
a = 0.81120
z = 1.0/a - 1.0... |
AllenDowney/ModSimPy | notebooks/chap07.ipynb | mit | # Configure Jupyter so figures appear in the notebook
%matplotlib inline
# Configure Jupyter to display the assigned value after an assignment
%config InteractiveShell.ast_node_interactivity='last_expr_or_assign'
# import functions from the modsim.py module
from modsim import *
from pandas import read_html
"""
Expl... |
johnnyliu27/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
"""... |
kpeeters/cadabra2 | examples/schwarzschild.ipynb | gpl-3.0 | {r,t,\phi,\theta}::Coordinate;
{\mu,\nu,\rho,\sigma,\lambda,\kappa,\chi,\gamma}::Indices(values={t,r,\phi,\theta}, position=fixed);
\partial{#}::PartialDerivative;
g_{\mu\nu}::Metric.
g^{\mu\nu}::InverseMetric.
"""
Explanation: The Schwarzschild spacetime
This notebook shows how you can do component computations in Ca... |
barbagroup/JITcode-MechE | module00_Introduction_to_Python/01_Lesson01_Playing_with_data.ipynb | mit | from IPython.display import YouTubeVideo
YouTubeVideo('lyb4gau3LyI')
"""
Explanation: Version 0.1 -- February 2014
JITcode 1, lesson 1
This is lesson 1 of the first Just-in-Time (JIT) module for teaching computing to engineers, in context. The first module lays the foundations for building computational skills. It is ... |
ES-DOC/esdoc-jupyterhub | notebooks/miroc/cmip6/models/miroc-es2h/toplevel.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'miroc', 'miroc-es2h', 'toplevel')
"""
Explanation: ES-DOC CMIP6 Model Properties - Toplevel
MIP Era: CMIP6
Institute: MIROC
Source ID: MIROC-ES2H
Sub-Topics: Radiative Forcings.
Properties: 85 ... |
kastnerkyle/kastnerkyle.github.io-nikola | blogsite/posts/introduction-to-page-rank.ipynb | bsd-3-clause | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
from utils import progress_bar_downloader
import os
pages_link = 'http://www.cs.ubc.ca/~nando/340-2009/lectures/pages.zip'
dlname = 'pages.zip'
#This will unzip into a directory called pages
if not os.path.exists('./%s' % dlname):
progress_bar_... |
matsaleh13/courses | deeplearning1/nbs/lesson3.ipynb | apache-2.0 | from theano.sandbox import cuda
%matplotlib inline
import utils; reload(utils)
from utils import *
from __future__ import division, print_function
#path = "data/dogscats/sample/"
path = "data/dogscats/"
model_path = path + 'models/'
if not os.path.exists(model_path): os.mkdir(model_path)
batch_size=64
"""
Explanati... |
mne-tools/mne-tools.github.io | stable/_downloads/029173f022506572bcefa009b440732f/evoked_arrowmap.ipynb | bsd-3-clause | # Authors: Sheraz Khan <sheraz@khansheraz.com>
#
# License: BSD-3-Clause
import numpy as np
import mne
from mne.datasets import sample
from mne.datasets.brainstorm import bst_raw
from mne import read_evokeds
from mne.viz import plot_arrowmap
print(__doc__)
path = sample.data_path()
fname = path / 'MEG' / 'sample' / ... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive/supplemental_gradient_boosting/labs/a_boosting_from_scratch.ipynb | apache-2.0 | from __future__ import print_function
import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib import pyplot as plt
from sklearn.tree import DecisionTreeRegressor
from tensorflow.keras.datasets import boston_housing
np.random.seed(0)
plt.rcParams['figure.figsize'] = (8.0, 5.0)
plt.rcParams['axes... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.