repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
molgor/spystats
notebooks/Sandboxes/MCMC/.ipynb_checkpoints/SpatialGaussianProcess inference in PyMC3-Copy1-checkpoint.ipynb
bsd-2-clause
# Load Biospytial modules and etc. %matplotlib inline import sys sys.path.append('/apps/external_plugins/spystats/') #import django #django.setup() import pandas as pd import matplotlib.pyplot as plt ## Use the ggplot style plt.style.use('ggplot') import numpy as np ## Model Specification import pymc3 as pm from spyst...
mne-tools/mne-tools.github.io
0.15/_downloads/plot_decoding_spatio_temporal_source.ipynb
bsd-3-clause
# Author: Denis A. Engemann <denis.engemann@gmail.com> # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Jean-Remi King <jeanremi.king@gmail.com> # # License: BSD (3-clause) import os import numpy as np import matplotlib.pyplot as plt from sklearn.pipeline import make_pipeline from sklear...
UltronAI/Deep-Learning
CS231n/assignment3/LSTM_Captioning.ipynb
mit
# As usual, a bit of setup from __future__ import print_function import time, os, json import numpy as np import matplotlib.pyplot as plt from cs231n.gradient_check import eval_numerical_gradient, eval_numerical_gradient_array from cs231n.rnn_layers import * from cs231n.captioning_solver import CaptioningSolver from c...
mne-tools/mne-tools.github.io
0.13/_downloads/plot_source_power_spectrum.ipynb
bsd-3-clause
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # # License: BSD (3-clause) import matplotlib.pyplot as plt import mne from mne import io from mne.datasets import sample from mne.minimum_norm import read_inverse_operator, compute_source_psd print(__doc__) """ Explanation: Compute power spect...
Qumulo/python-notebooks
notebooks/Quickstart guide for Qumulo python API.ipynb
gpl-3.0
import os from qumulo.rest_client import RestClient # set your environment variables or fill in the variables below API_HOSTNAME = os.environ['API_HOSTNAME'] if 'API_HOSTNAME' in os.environ else '{your-cluster-hostname}' API_USER = os.environ['API_USER'] if 'API_USER' in os.environ else '{api-cluster-user}...
liufuyang/ManagingBigData_MySQL_DukeUniv
notebooks/MySQL_Exercise_02_Selecting_Data_Subsets_using_WHERE.ipynb
mit
%load_ext sql %sql mysql://studentuser:studentpw@mysqlserver/dognitiondb %sql USE dognitiondb %config SqlMagic.displaylimit=25 """ Explanation: Copyright Jana Schaich Borg/Attribution-NonCommercial 4.0 International (CC BY-NC 4.0) MySQL Exercise 2: Using WHERE to select specific data When you are querying a business-...
mne-tools/mne-tools.github.io
0.18/_downloads/846c9103e2de535e71d8b76a75654d36/plot_background_statistics.ipynb
bsd-3-clause
# Authors: Eric Larson <larson.eric.d@gmail.com> # License: BSD (3-clause) from functools import partial import numpy as np from scipy import stats import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D # noqa, analysis:ignore import mne from mne.stats import (ttest_1samp_no_p, bonferroni_correctio...
usantamaria/iwi131
ipynb/02-DiagramaDeFlujo/DiagramaDeFlujo.ipynb
cc0-1.0
def es_magico(N): suma_divisores = 1 for m in range(2,N): if N%m==0: suma_divisores = suma_divisores + m if suma_divisores==N: print N, "es mágico" else: print N, "no es mágico" mi_numero = int(raw_input("Ingrese un número: ")) es_magico(mi_numero) """ Explanation: ...
VVard0g/ThreatHunter-Playbook
docs/notebooks/windows/07_discovery/WIN-190725024610.ipynb
mit
from openhunt.mordorutils import * spark = get_spark() """ Explanation: SAM Registry Hive Handle Request Metadata | Metadata | Value | |:------------------|:---| | collaborators | ['@Cyb3rWard0g', '@Cyb3rPandaH'] | | creation date | 2019/07/25 | | modification date | 2020/09/20 | | playbook related ...
karlstroetmann/Formal-Languages
Python/FixedPoint.ipynb
gpl-2.0
def fixpoint(S0, f): Result = S0.copy() # don't change S0 while True: NewElements = { x for o in Result for x in f(o) } if NewElements.issubset(Result): return Result Result |= NewElements """ Explanation: Fixed-Point Iterati...
stevenbergner/stevenbergner.github.io
Teaching/cmpt767/graph-tool-tutorial-todo.ipynb
mit
import graph_tool.all as gt import pandas as pd import numpy as np from IPython.display import display %matplotlib inline print("graph-tool version: {}".format(gt.__version__.split(' ')[0])) """ Explanation: Graph-tool tutorial The following tutorial demonstrates working with graphs using the graph-tool python module....
McIntyre-Lab/papers
fear_ase_2016/scripts/cis_summary/maren_equations_summary.ipynb
lgpl-3.0
# Set-up default environment %run '../ipython_startup.py' # Import additional libraries import sas7bdat as sas import cPickle as pickle import statsmodels.formula.api as smf from ase_cisEq import marenEq from ase_cisEq import marenPrintTable from ase_normalization import meanCenter from ase_normalization import q3No...
haltaro/predicting-comic-end
1_analyze_comic_data_j.ipynb
mit
%matplotlib inline import json import numpy as np import matplotlib.pyplot as plt import seaborn as sns import pandas as pd sns.set(style='ticks') import matplotlib from matplotlib.font_manager import FontProperties font_path = '/usr/share/fonts/truetype/takao-gothic/TakaoPGothic.ttf' font_prop = FontProperties(fnam...
ES-DOC/esdoc-jupyterhub
notebooks/test-institute-1/cmip6/models/sandbox-2/landice.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'test-institute-1', 'sandbox-2', 'landice') """ Explanation: ES-DOC CMIP6 Model Properties - Landice MIP Era: CMIP6 Institute: TEST-INSTITUTE-1 Source ID: SANDBOX-2 Topic: Landice Sub-Topics: Gla...
adityaka/misc_scripts
python-scripts/data_analytics_learn/link_pandas/Ex_Files_Pandas_Data/Exercise Files/04_04/Begin/Universal.ipynb
bsd-3-clause
import pandas as pd import numpy as np df = pd.DataFrame(np.random.randn(10, 4), columns=['A', 'B', 'C', 'D']) df2 = pd.DataFrame(np.random.randn(7, 3), columns=['A', 'B', 'C']) sum_df = df + df2 sum_df """ Explanation: NumPy Universal Functions If the data within a DataFrame are numeric, NumPy's universal functions ...
ES-DOC/esdoc-jupyterhub
notebooks/mri/cmip6/models/sandbox-3/atmoschem.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'mri', 'sandbox-3', 'atmoschem') """ Explanation: ES-DOC CMIP6 Model Properties - Atmoschem MIP Era: CMIP6 Institute: MRI Source ID: SANDBOX-3 Topic: Atmoschem Sub-Topics: Transport, Emissions Co...
kadamkaustubh/project-Goldilocks
pymc proof of concept-final.ipynb
mit
import pymc as pm import numpy as np from scipy.integrate import odeint import matplotlib.pyplot as plt %matplotlib inline #importing experimental data timedata=np.genfromtxt("data/timedata.txt", delimiter=',') glc_concentration=np.genfromtxt("data/GLCexconc.txt", delimiter=',') """ Explanation: Using PyMC for parame...
nishadsingh1/clipper
examples/tutorial/tutorial_part_two.ipynb
apache-2.0
import sys import os from clipper_admin import Clipper # Change the username if necessary user = "" # Set the path to the SSH key key = "" # Set the SSH host host = "" clipper = Clipper(host, user, key) """ Explanation: Clipper Tutorial: Part 2 In this part of the tutorial, you will put on your data scientist hat and ...
mjlong/openmc
docs/source/pythonapi/examples/mgxs-part-iii.ipynb
mit
import math import pickle from IPython.display import Image import matplotlib.pylab as pylab import numpy as np import openmc import openmc.mgxs from openmc.statepoint import StatePoint from openmc.summary import Summary import openmoc import openmoc.process from openmoc.compatible import get_openmoc_geometry from op...
egentry/lamat-2016-solutions
day2/equilibrium_temperatures.ipynb
mit
def equilibrium_temperature(luminosity, distance, albedo=0): """ Calculates the equilibrium temperature of a planet, assuming blackbody radiation and thermodynamic equilibrium. Parameters ---------- luminosity : float luminosity of the host star [ergs s**-1] distance : ...
atulsingh0/MachineLearning
python_DC/LP_Hierarchical_Indexing_#4.ipynb
gpl-3.0
data = pd.Series(np.random.randn(10), index=[['a', 'a', 'a', 'b', 'b', 'b', 'c', 'c', 'd', 'd'], [1, 2, 3, 1, 2, 3, 1, 2, 2, 3]]) data # getting the index data.index data['b'] data['b'][1] data['b', 1] data['b':'c'] data.ix['b':'d'] data[:, 2] # Hierarchical indexing plays a c...
mne-tools/mne-tools.github.io
dev/_downloads/8fdd7a9ad9a4bab4331f7c5da5e3bb1a/define_target_events.ipynb
bsd-3-clause
# Authors: Denis Engemann <denis.engemann@gmail.com> # # License: BSD-3-Clause import mne from mne import io from mne.event import define_target_events from mne.datasets import sample import matplotlib.pyplot as plt print(__doc__) data_path = sample.data_path() """ Explanation: Define target events based on time la...
jserenson/Python_Bootcamp
While loops.ipynb
gpl-3.0
x = 0 while x < 10: print 'x is currently: ',x print ' x is still less than 10, adding 1 to x' x+=1 """ Explanation: while loops The while statement in Python is one of most general ways to perform iteration. A while statement will repeatedly execute a single statement or group of statements as long as th...
ernestyalumni/Propulsion
Physique.ipynb
gpl-2.0
import os print(os.getcwd()) os.chdir(os.getcwd() + "/Physique/") # change current working directory print(os.getcwd()) %run -i ./Scripts/Refresh.py # this is the main, important, command to run import Physique import sys sys.executable # Check which Python you are running in case you have ImportError's print(di...
mne-tools/mne-tools.github.io
0.14/_downloads/plot_stats_cluster_methods.ipynb
bsd-3-clause
# Authors: Eric Larson <larson.eric.d@gmail.com> # License: BSD (3-clause) import numpy as np from scipy import stats from functools import partial import matplotlib.pyplot as plt # this changes hidden MPL vars: from mpl_toolkits.mplot3d import Axes3D # noqa from mne.stats import (spatio_temporal_cluster_1samp_test,...
carltoews/tennis
.ipynb_checkpoints/tennis_predictions-checkpoint.ipynb
gpl-3.0
import setup_mysql_database """ Explanation: <p style="text-align: center"> Predicting Professional Tennis Match Outcomes</p> Author: Carl Toews Date: August 8, 2017 Project Description: This project explores various machine learning techniques on professional tennis data. The data set was compiled by Jeff Sackm...
regardscitoyens/consultation_an
exploitation/analyse_quanti_theme4.ipynb
agpl-3.0
def loadContributions(file, withsexe=False): contributions = pd.read_json(path_or_buf=file, orient="columns") rows = []; rindex = []; for i in range(0, contributions.shape[0]): row = {}; row['id'] = contributions['id'][i] rindex.append(contributions['id'][i]) if (withsexe...
robertoalotufo/ia898
2S2018/07 Filtragem no dominio espacial.ipynb
mit
from IPython.display import Image from IPython.display import display display(Image(url='../data/convrect.gif')) """ Explanation: Filtragem no domínio espacial A convolução discreta é uma ferramenta para construir qualquer filtro linear ou de deslocamento. A equação da convolução, g(x), da sequência f(x) com o nucleo ...
computational-class/cjc2016
code/10.word2vec.ipynb
mit
# Personality Embeddings: What are you like? jay = [-0.4, 0.8, 0.5, -0.2, 0.3] john = [-0.3, 0.2, 0.3, -0.4, 0.9] mike = [-0.5, -0.4, -0.2, 0.7, -0.1] """ Explanation: Introduction to Word Embeddings Analyzing Meaning through Word Embeddings Using vectors to represent things - one of the most fascinating ideas in ma...
DBWangGroupUNSW/COMP9318
L1 - Pandas-2.ipynb
mit
import pandas as pd import numpy as np import plotly.plotly as py import plotly.graph_objs as go """ Explanation: Pivot Table on Pandas In this notebook, we focus on the pivot_table feature of pandas. Import Modules End of explanation """ df = pd.read_csv('./asset/sydney_housing_market.txt', sep='\t') df.head() """...
fastai/fastai
dev_nbs/course/lesson3-imdb.ipynb
apache-2.0
%matplotlib inline from fastai.text.all import * from nbdev.showdoc import * """ Explanation: IMDB End of explanation """ path = untar_data(URLs.IMDB_SAMPLE) path.ls() """ Explanation: Preparing the data First let's download the dataset we are going to study. The dataset has been curated by Andrew Maas et al. and ...
malogrisard/NTDScourse
toolkit/01_ex_acquisition_exploration.ipynb
mit
# Number of posts / tweets to retrieve. # Small value for development, then increase to collect final data. n = 20 # 4000 """ Explanation: A Python Tour of Data Science: Data Acquisition & Exploration Michaël Defferrard, PhD student, EPFL LTS2 1 Exercise: problem definition Theme of the exercise: understand the impac...
CamDavidsonPilon/lifelines
examples/SaaS churn and piecewise regression models.ipynb
mit
kmf = KaplanMeierFitter().fit(df['T'], df['E']) kmf.plot(figsize=(11,6)); """ Explanation: Empircally observed SaaS churn A subscribtion-as-a-service company has a typical customer churn pattern. During periods of no billing, the churn is relatively low compared to periods of billing (typically every 30 or 365 days). ...
gutouyu/cs231n
cs231n/assignment/assignment2/Dropout.ipynb
mit
# As usual, a bit of setup from __future__ import print_function import time import numpy as np import matplotlib.pyplot as plt from cs231n.classifiers.fc_net import * from cs231n.data_utils import get_CIFAR10_data from cs231n.gradient_check import eval_numerical_gradient, eval_numerical_gradient_array from cs231n.solv...
beangoben/HistoriaDatos_Higgs
Dia4/.ipynb_checkpoints/6_Arboles_de_decisión-Lleno-checkpoint.ipynb
gpl-2.0
from IPython.core.display import HTML import os def css_styling(): """Load default custom.css file from ipython profile""" base = os.getcwd() styles = "<style>\n%s\n</style>" % (open(os.path.join(base,'files/custom.css'),'r').read()) return HTML(styles) css_styling() """ Explanation: <i class="fa fa-di...
qutip/qutip-notebooks
docs/guide/TensorPtrace.ipynb
lgpl-3.0
import numpy as np from qutip import * """ Explanation: Tensor Products & Partial Traces Contents Tensor Products Partial Trace Super Operators & Tensor Manipulations End of explanation """ tensor(basis(2, 0), basis(2, 0)) """ Explanation: <a id='tensor'></a> Tensor Products To describe the states of multipartite ...
nickmo464/ml-dress-patterns
ComputerVisionPatterns-Copy1.ipynb
mit
# re-load the saved data if needed A = np.load('/home/nick/Documents/LewisUniversity/MachineLearning/Project/visionmatrix.npy') #Let's start with the model parameters defined in the Week6 notebook for this data, changing the input shape as appropriate. from keras.models import Sequential from keras.layers import Dense...
dfm/emcee3
docs/user/parallel.ipynb
mit
import emcee3 import numpy as np def log_prob(x): return -0.5 * np.sum(x ** 2) ndim, nwalkers = 10, 100 with emcee3.pools.InterruptiblePool() as pool: ensemble = emcee3.Ensemble(log_prob, np.random.randn(nwalkers, ndim), pool=pool) sampler = emcee3.Sampler() sampler.run(ensemble, 1000) """ Explanatio...
jnarhan/Breast_Cancer
src/models/JN_BC_Threshold_Diagnosis.ipynb
mit
import os import sys import time import numpy as np from tqdm import tqdm import sklearn.metrics as skm from sklearn import metrics from sklearn.svm import SVC from sklearn.model_selection import train_test_split from skimage import color import keras.callbacks as cb import keras.utils.np_utils as np_utils from ker...
mlund/openmm-examples
qpotential/qpotential.ipynb
mit
%matplotlib inline from simtk.openmm.app import * from simtk.openmm import * from simtk.unit import * from sys import stdout import matplotlib, matplotlib.pyplot as plt import pandas as pd from io import StringIO import numpy as np, os matplotlib.rcParams.update({'font.size': 12}) # simulation parameters nsteps =...
facemelters/data-science
Atlas/Publishing Volume.ipynb
gpl-2.0
import pandas as pd import numpy as np import matplotlib.pyplot as plt %matplotlib inline df = pd.read_csv('All content.csv', index_col='Published',parse_dates=True) df['count']=1 df = df[(df['Page Views'] > 200)] df_resampled = df.resample('D',how ='sum') """ Explanation: Here we examine whether publishing volume h...
geoscixyz/computation
notebooks/fundamentals/pixels_and_neighbors/weakformulation.ipynb
mit
%matplotlib inline from SimPEG import Mesh import numpy as np import matplotlib.pyplot as plt fig, ax = plt.subplots(1) mesh = Mesh.TensorMesh([1,1]) mesh.plotGrid(ax=ax,centers=True,faces=True) ax.set_xlim(-0.5,1.5) ax.set_ylim(-0.5,1.5); """ Explanation: Weak Formulation Equation (b) is a vector equation, so really...
amitkaps/hackermath
Module_1c_linear_regression_ridge.ipynb
mit
import numpy as np import pandas as pd import matplotlib.pyplot as plt %matplotlib inline plt.style.use('fivethirtyeight') plt.rcParams['figure.figsize'] = (10, 6) pop = pd.read_csv('data/cars_small.csv') pop.shape pop.head() sample_rows = [35,17,11,25,12,22,13] sample = pop.loc[sample_rows,:] sample """ Explan...
liangjg/openmc
examples/jupyter/search.ipynb
mit
# Initialize third-party libraries and the OpenMC Python API import matplotlib.pyplot as plt import numpy as np import openmc import openmc.model %matplotlib inline """ Explanation: This Notebook illustrates the usage of the OpenMC Python API's generic eigenvalue search capability. In this Notebook, we will do a cr...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/feateng/labs/asl_2.0_bqml_feateng.ipynb
apache-2.0
%%bash export PROJECT=$(gcloud config list project --format "value(core.project)") echo "Your current GCP Project Name is: "$PROJECT import os PROJECT = "cloud-training-demos" # REPLACE WITH YOUR PROJECT NAME REGION = "us-west1-b" # REPLACE WITH YOUR BUCKET REGION e.g. us-central1 # Do not change these os.environ["P...
samirma/deep-learning
language-translation/dlnd_language_translation.ipynb
mit
""" DON'T MODIFY ANYTHING IN THIS CELL """ import helper import problem_unittests as tests source_path = 'data/small_vocab_en' target_path = 'data/small_vocab_fr' source_text = helper.load_data(source_path) target_text = helper.load_data(target_path) """ Explanation: Language Translation In this project, you’re going...
krischer/pyadjoint
doc/index.ipynb
bsd-3-clause
import obspy import pyadjoint """ Explanation: Pyadjoint Pyadjoint is a Python package to measure misfits and calculate adjoint sources. It aims to provide a comprehensive package and incorporate various types of measurements and associated adjoint sources. Installation Pyadjoint utilizes ObsPy (and some of its depend...
211217613/python_meetup
Intro to Jupyter Notebooks.ipynb
unlicense
%%%timeit maths = list() for x in range(10): maths.append(x**x) %%%timeit maths = [x**x for x in range(10)] # maths """ Explanation: Jupyter Notebooks Share the compute process with everyone How to Install pip3 install jupyter How to Run jupyter notebook Uses PDF books Blog posts Inline graphics Multiple langua...
thiagoqd/queirozdias-deep-learning
language-translation/dlnd_language_translation.ipynb
mit
""" DON'T MODIFY ANYTHING IN THIS CELL """ import helper import problem_unittests as tests source_path = 'data/small_vocab_en' target_path = 'data/small_vocab_fr' source_text = helper.load_data(source_path) target_text = helper.load_data(target_path) """ Explanation: Language Translation In this project, you’re going...
tcmoore3/mbuild
docs/tutorials/tutorial_simple_LJ.ipynb
mit
import mbuild as mb class MonoLJ(mb.Compound): def __init__(self): super(MonoLJ, self).__init__() lj_particle1 = mb.Particle(name='LJ', pos=[0, 0, 0]) self.add(lj_particle1) lj_particle2 = mb.Particle(name='LJ', pos=[1, 0, 0]) self.add(lj_particle2) lj_particle3 = ...
BioDocker/containers
pymol-jupiter/1.0.0/ipymol/iPyMol_example.ipynb
apache-2.0
%pylab inline from ipymol import viewer as pymol """ Explanation: Interacting with PyMol via iPyMol (example from http://pymolwiki.org/index.php/Gallery ) Initialize Jupyter needs the %pylab inline directive for showing plots within a notebook End of explanation """ pymol.start() """ Explanation: Start the PyMol se...
ALEXKIRNAS/DataScience
CS231n/assignment1/features.ipynb
mit
import random import numpy as np from cs231n.data_utils import load_CIFAR10 import matplotlib.pyplot as plt from __future__ import print_function %matplotlib inline plt.rcParams['figure.figsize'] = (10.0, 8.0) # set default size of plots plt.rcParams['image.interpolation'] = 'nearest' plt.rcParams['image.cmap'] = 'gr...
bgruening/EDeN
examples/RNA_example.ipynb
gpl-3.0
%matplotlib inline """ Explanation: RNA example We take a fasta file in input and write utility functions to build a graph representation based on the structure computed by RNAfold. Finally we use the EDeN vectorizer to perform clustering or build a predictive model. End of explanation """ def rfam_uri(family_id): ...
JarnoRFB/qtpyvis
notebooks/keras/introspection.ipynb
mit
model.get_config() """ Explanation: Keras model are serialzed in a JSON format. End of explanation """ # Weights and biases of the entire model. model.get_weights() # Weights and bias for a single layer. conv_layer = model.get_layer('conv2d_1') conv_layer.get_weights() """ Explanation: Getting the weights Weights ...
AdriaanRol/AutoDepGraph
examples/Example notebook.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import networkx as nx from importlib import reload import os import autodepgraph as adg from autodepgraph import AutoDepGraph_DAG """ Explanation: Example notebook This example will contain the following examples - Creating and saving a graph - Plotting the graph -...
rnder/data-science-from-scratch
notebook/ch20_natural_language_processing.ipynb
unlicense
import math, random, re from collections import defaultdict, Counter from bs4 import BeautifulSoup import requests import matplotlib.pyplot as plt #데이터 과학 관련 키워드목록, 빈도 0~100 data = [ ("big data", 100, 15), ("Hadoop", 95, 25), ("Python", 75, 50), ("R", 50, 40), ("machine learning", 80, 20), ("statistics", 20, ...
mne-tools/mne-tools.github.io
0.22/_downloads/3ca4dabff6bcea5b8da3afc9052669d2/plot_45_projectors_background.ipynb
bsd-3-clause
import os import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D # noqa from scipy.linalg import svd import mne def setup_3d_axes(): ax = plt.axes(projection='3d') ax.view_init(azim=-105, elev=20) ax.set_xlabel('x') ax.set_ylabel('y') ax.set_zlabel('z') ax....
OSGeoLabBp/tutorials
english/data_processing/lessons/ransac_sphere.ipynb
cc0-1.0
import numpy as np from math import sin, cos, pi, sqrt from random import random, seed import plotly.graph_objects as go """ Explanation: <a href="https://colab.research.google.com/github/OSGeoLabBp/tutorials/blob/master/english/data_processing/lessons/ransac_sphere.ipynb" target="_parent"><img src="https://colab.rese...
probml/pyprobml
notebooks/book2/17/gp_kernel_opt.ipynb
mit
try: import tinygp except ImportError: !pip install -q tinygp try: import numpyro except ImportError: !pip uninstall -y jax jaxlib !pip install -q numpyro jax jaxlib try: import arviz except ImportError: !pip install arviz try: import flax except ImportError: !pip install -q flax ...
royalosyin/Python-Practical-Application-on-Climate-Variability-Studies
ex19-EOF analysis in central pacific ocean.ipynb
mit
% matplotlib inline import numpy as np from scipy import signal import numpy.polynomial.polynomial as poly from netCDF4 import Dataset import matplotlib.pyplot as plt from mpl_toolkits.basemap import Basemap from eofs.standard import Eof """ Explanation: EOF analysis in central pacific ocean In statistics and signal...
openai/openai-python
examples/finetuning/olympics-1-collect-data.ipynb
mit
import pandas as pd import wikipedia def filter_olympic_2020_titles(titles): """ Get the titles which are related to Olympic games hosted in 2020, given a list of titles """ titles = [title for title in titles if '2020' in title and 'olympi' in title.lower()] return titles def get_wiki_page(...
ssunkara1/bqplot
examples/Interactions/Interaction Layer.ipynb
apache-2.0
## First we define a Figure dt_x_fast = DateScale() lin_y = LinearScale() x_ax = Axis(label='Index', scale=dt_x_fast) x_ay = Axis(label=(symbol + ' Price'), scale=lin_y, orientation='vertical') lc = Lines(x=dates_actual, y=prices, scales={'x': dt_x_fast, 'y': lin_y}, colors=['orange']) lc_2 = Lines(x=dates_actual[50:]...
jmschrei/pomegranate
tutorials/old/Tutorial_7_Parallelization.ipynb
mit
%pylab inline from sklearn.mixture import GaussianMixture from pomegranate import * import seaborn, time seaborn.set_style('whitegrid') def create_dataset(n_samples, n_dim, n_classes, alpha=1): """Create a random dataset with n_samples in each class.""" X = numpy.concatenate([numpy.random.normal(i*alpha, ...
ubcgif/gpgTutorials
notebooks/em/FDEM_ThreeLoopModel.ipynb
mit
%matplotlib inline from geoscilabs.em.FDEM3loop import interactfem3loop from geoscilabs.em.FDEMpipe import interact_femPipe from matplotlib import rcParams rcParams['font.size'] = 14 """ Explanation: Electromagnetics: 3-loop model In the first part of this notebook, we consider a 3 loop system, consisting of a transm...
dchandan/rebound
ipython_examples/PoincareMap.ipynb
gpl-3.0
import rebound import numpy as np """ Explanation: Poincare Map This example shows how to calculate a simple Poincare Map with REBOUND. A Poincare Map (or sometimes calles Poincare Section) can be helpful to understand dynamical systems. End of explanation """ sim = rebound.Simulation() sim.add(m=1.) sim.add(m=1e-3,...
paolorivas/homeworkfoundations
14/14 - TF-IDF Homework.ipynb
mit
# If you'd like to download it through the command line... !curl -O http://www.cs.cornell.edu/home/llee/data/convote/convote_v1.1.tar.gz # And then extract it through the command line... !tar -zxf convote_v1.1.tar.gz """ Explanation: Homework 14 (or so): TF-IDF text analysis and clustering Hooray, we kind of figured ...
rbiswas4/simlib
example/UsingOpSimSummary.ipynb
mit
import numpy as np %matplotlib inline import matplotlib.pyplot as plt # Required packages sqlachemy, pandas (both are part of anaconda distribution, or can be installed with a python installer) # One step requires the LSST stack, can be skipped for a particular OPSIM database in question import OpSimSummary.summarize...
mbonix/finance-notebooks
Volatility.ipynb
mit
import pandas as pd import pandas_datareader.data as web import matplotlib.pyplot as plt # Defines the chart color scheme using Tableu's Tableau10 plt.style.use('https://gist.githubusercontent.com/mbonix/8478091db6a2e6836341c2bb3f55b9fc/raw/7155235ed03e235c38b66c160d402192ad4d94d9/tableau10.mplstyle') %matplotlib in...
qkitgroup/qkit
qkit/doc/notebooks/measurement_class_basics.ipynb
gpl-2.0
## start qkit and import the necessary classes; here we assume a already configured qkit environment import qkit qkit.start() from qkit.measure.measurement_class import Measurement """ Explanation: Measurement class basics Objects of the measurement class are used to save all the information for one single measureme...
tylere/earthengine-api
python/examples/ipynb/EarthEngineColabInstall.ipynb
apache-2.0
!pip install earthengine-api """ Explanation: Copyright 2018 Google LLC. SPDX-License-Identifier: Apache-2.0 Earth Engine Colab installation This notebook demonstrates a simple installation of Earth Engine to a Colab notebook. Colab setup This notebook section installs the Earth Engine Python API on your Colab virtual...
ajrichards/phylogenetic-models
lda/simon-high-low-example.ipynb
bsd-3-clause
from IPython.display import Image Image(filename='lda_plate.png') """ Explanation: LDA on simon's example The LDA is a well-known probabilistic model to handle mixtures of topics in an unsupervised way. It has been applied to a large number of problems (Blei, 2012). The original paper has over 10000 citations (Blei...
andreyf/machine-learning-examples
numpy_and_pandas/habr_pandas.ipynb
gpl-3.0
import numpy as np import pandas as pd """ Explanation: <center> <img src="../img/ods_stickers.jpg"> Открытый курс по машинному обучению Авторы материала: программист-исследователь Mail.ru Group, старший преподаватель Факультета Компьютерных Наук ВШЭ Юрий Кашницкий и Data Scientist в Segmento Екатерина Демидова. Матер...
mediagit2016/workcamp-maschinelles-lernen-grundlagen
20-10-14-ml-workcamp/wc-arbeiten-tf-10-aufgabe-loes.ipynb
gpl-3.0
#importieren sie die Bibliothek pandas import pandas as pd #importieren sie matplotlib.pyplot as plt import matplotlib.pyplot as plt %matplotlib inline #laden Sie die Datei "daten.csv" auf Ihren Hub #laden Sie die Datei "daten.csv" in einen Datframe df #Einlesen der Dateien df=pd.read_csv("daten.csv") #Betrachten Si...
madmax983/h2o-3
h2o-py/demos/H2O_tutorial_medium.ipynb
apache-2.0
import pandas as pd import numpy from numpy.random import choice from sklearn.datasets import load_boston from h2o.estimators.random_forest import H2ORandomForestEstimator import h2o h2o.init() # transfer the boston data from pandas to H2O boston_data = load_boston() X = pd.DataFrame(data=boston_data.data, columns=b...
ES-DOC/esdoc-jupyterhub
notebooks/noaa-gfdl/cmip6/models/gfdl-esm4/seaice.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'noaa-gfdl', 'gfdl-esm4', 'seaice') """ Explanation: ES-DOC CMIP6 Model Properties - Seaice MIP Era: CMIP6 Institute: NOAA-GFDL Source ID: GFDL-ESM4 Topic: Seaice Sub-Topics: Dynamics, Thermodyna...
Py101/py101-assignments-marcosco
02/homework_day2.ipynb
mit
for x in range(13): if x==0: fact = 1 else: fact = fact * x fact """ Explanation: <center> <hr> <h1>Python Crash Course</h1> <h2>Master in Data Science - Sapienza University</h2> <h2>Homework 2: Python Challenges</h2> <h3>A.A. 2017/18</h3> <h3>Tutor: Francesco Fabbri</h3> <hr> </center> Instru...
fsilva/deputado-histogramado
notebooks/Deputado-Histogramado-1.ipynb
gpl-3.0
from urllib import request import zlib import pandas from bs4 import BeautifulSoup #para processar o HTML import re #para processar o html lista_datas = [] lista_sessoes = [] bytesTransferidos = 0 i = 0 for ano in range(1976,2016): for mes in range(1,13): print("Processando %04d/%02d - bytes transferid...
jastarex/DeepLearningCourseCodes
05_Image_recognition_and_classification/cnn.ipynb
apache-2.0
import time import math import random import pandas as pd import numpy as np import matplotlib.pyplot as plt import tensorflow as tf import dataset import cv2 from sklearn.metrics import confusion_matrix from datetime import timedelta %matplotlib inline """ Explanation: 卷积神经网络 - 图像分类与识别 - TensorFlow实现 需要Anaconda3-1...
oseledets/fastpde2017
lectures/laplace_interior_dirichlet_original.ipynb
mit
import bempp.api import numpy as np """ Explanation: Solving a Laplace problem with Dirichlet boundary conditions Background Laplace problem inside the unit sphere with Dirichlet boundary conditions. Let $\Omega$ be the unit sphere with boundary $\Gamma$. Let $\nu$ be the outward pointing normal on $\Gamma$. The PDE ...
Jackporter415/phys202-2015-work
days/day11/Interpolation.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np import seaborn as sns """ Explanation: Interpolation Learning Objective: Learn to interpolate 1d and 2d datasets of structured and unstructured points using SciPy. End of explanation """ x = np.linspace(0,4*np.pi,10) x """ Explanation: Overview W...
40323150/2016springcd_aG9
static/plugin/liquid_tags/test_data/content/notebooks/test_nbformat4.ipynb
agpl-3.0
# <!-- collapse=True --> a = 1 b = 1.0 print(a, type(a), b, type(b)) """ Explanation: Il s’agit de repérer les données nécessaires voire indispensables à la résolution. Ces données peuvent être: numériques, ou sous forme de textes (on dit souvent chaînes de caractères), ou de type logique (à deux valeurs possibles, ...
smorton2/think-stats
code/chap12soln.ipynb
gpl-3.0
from __future__ import print_function, division %matplotlib inline import warnings warnings.filterwarnings('ignore', category=FutureWarning) import numpy as np import pandas as pd import random import thinkstats2 import thinkplot """ Explanation: Examples and Exercises from Think Stats, 2nd Edition http://thinkst...
kinverarity1/lasio
notebooks/build LAS file from scratch.ipynb
mit
import lasio import datetime import numpy import os import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Building a LAS file from scratch End of explanation """ depths = numpy.arange(10, 50, 0.5) fake_curve = numpy.random.random(len(depths)) fake_curve[-10:] = numpy.nan # Add some null values at th...
sk-rai/Network-Analysis_made-Simple
7. Bipartite Graphs (Student).ipynb
mit
import networkx as nx from networkx.algorithms import bipartite # Initialize the city/person bipartite graph. B = nx.Graph() cities = [] # populate a list of cities people = [] # populate a list of people's names B.add_nodes_from(cities, bipartite='cities') B.add_nodes_from(people, bipartite='people') edges = [] #...
hail-is/hail
notebook/images/hail/resources/Hail-Workshop-Notebook.ipynb
mit
print('Hello, world') """ Explanation: Hail workshop This notebook will introduce the following concepts: Using Jupyter notebooks effectively Loading genetic data into Hail General-purpose data exploration functionality Plotting functionality Quality control of sequencing data Running a Genome-Wide Association Study ...
millernj/phys202-project
[1]Making Perceptrons.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np """ Explanation: Perceptrons Here we will create a functions the make Peceptrons, the processors that make up a Neural Network. End of explanation """ step_function = lambda x: 1 if not x < 0 else 0 # The step function will be used to output the n...
WomensCodingCircle/CodingCirclePython
Lesson05_Strings/Strings.ipynb
mit
chinese_zodiac = "Rat Ox Tiger Rabbit Dragon Snake Horse Goat Monkey Rooster Dog Pig" print(chinese_zodiac[0]) print(chinese_zodiac[1]) """ Explanation: Strings A sting is a sequence of characters. A string's characters can be treated similarly to a list. Each character has an index starting at 0 and can be accessed j...
azhurb/deep-learning
first-neural-network/Your_first_neural_network.ipynb
mit
%matplotlib inline %config InlineBackend.figure_format = 'retina' import numpy as np import pandas as pd import matplotlib.pyplot as plt """ Explanation: Your first neural network In this project, you'll build your first neural network and use it to predict daily bike rental ridership. We've provided some of the code...
rochefort-lab/fissa
examples/cNMF example.ipynb
gpl-3.0
# FISSA package import fissa # For plotting our results, import numpy and matplotlib import matplotlib.pyplot as plt import numpy as np # Need this utility from scipy to load data from matfiles from scipy.io import loadmat """ Explanation: Using FISSA with CNMF from MATLAB CNMF is blind source separation toolbox for...
cdt15/lingam
examples/LongitudinalLiNGAM.ipynb
mit
import numpy as np import pandas as pd import matplotlib.pyplot as plt import graphviz import lingam from lingam.utils import print_causal_directions, print_dagc, make_dot import warnings warnings.filterwarnings('ignore') print([np.__version__, pd.__version__, graphviz.__version__, lingam.__version__]) np.set_printo...
ibm-cds-labs/simple-data-pipe-connector-flightstats
notebook/Flight Predict PyCon 2016.ipynb
apache-2.0
sc.addPyFile("https://github.com/ibm-watson-data-lab/simple-data-pipe-connector-flightstats/raw/master/flightPredict/training.py") sc.addPyFile("https://github.com/ibm-watson-data-lab/simple-data-pipe-connector-flightstats/raw/master/flightPredict/run.py") import training import run %matplotlib inline from pyspark.mll...
ioos/notebooks_demos
notebooks/2016-11-15-glider_data_example.ipynb
mit
# See https://github.com/Unidata/netcdf-c/issues/1299 for the explanation of `#fillmismatch`. url = ( "https://data.ioos.us/thredds/dodsC/deployments/rutgers/" "ru29-20150623T1046/ru29-20150623T1046.nc3.nc#fillmismatch" ) import iris iris.FUTURE.netcdf_promote = True glider = iris.load(url) print(glider) ...
GoogleCloudPlatform/ai-notebooks-extended
dataproc-hub-example/build/infrastructure-builder/mig/files/gcs_working_folder/examples/Python/bigquery/BigQuery query magic.ipynb
apache-2.0
%%bigquery SELECT name, SUM(number) as count FROM `bigquery-public-data.usa_names.usa_1910_current` GROUP BY name ORDER BY count DESC LIMIT 10 """ Explanation: BigQuery query magic Jupyter magics are notebook-specific shortcuts that allow you to run commands with minimal syntax. Jupyter notebooks come with many built-...
ozorich/phys202-2015-work
assignments/midterm/AlgorithmsEx03.ipynb
mit
%matplotlib inline from matplotlib import pyplot as plt import numpy as np from IPython.html.widgets import interact """ Explanation: Algorithms Exercise 3 Imports End of explanation """ def char_probs(s): """Find the probabilities of the unique characters in the string s. Parameters ---------- ...
astroumd/GradMap
notebooks/Lectures2017/Lecture3/Lecture 3 - Answer Key.ipynb
gpl-3.0
np.random.rand(5) """ Explanation: Random Numbers Documentation: https://docs.scipy.org/doc/numpy/reference/routines.random.html Numpy gives us the ability to select random numbers from a variety of different distribution functions (see the np.random documentation for a full list). However, the two most frequently use...
quantopian/research_public
notebooks/lectures/Violations_of_Regression_Models/notebook.ipynb
apache-2.0
# Import all the libraries we'll be using import numpy as np import statsmodels.api as sm from statsmodels import regression, stats import statsmodels import matplotlib.pyplot as plt residuals = np.random.normal(0, 1, 100) _, pvalue, _, _ = statsmodels.stats.stattools.jarque_bera(residuals) print pvalue residuals = ...
AlphaGit/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...
mne-tools/mne-tools.github.io
0.23/_downloads/7b89f7dac105a44e25d2fbdd898b911f/vector_mne_solution.ipynb
bsd-3-clause
# Author: Marijn van Vliet <w.m.vanvliet@gmail.com> # # License: BSD (3-clause) import numpy as np import mne from mne.datasets import sample from mne.minimum_norm import read_inverse_operator, apply_inverse print(__doc__) data_path = sample.data_path() subjects_dir = data_path + '/subjects' # Read evoked data fnam...
jklynch/mr-fitty
notebooks/sample_data_clustering.ipynb
mit
import glob import itertools import logging from operator import attrgetter import os import pprint import sys import time import matplotlib.pyplot as plt %matplotlib inline import scipy.misc import numpy as np import pandas as pd import scipy.cluster.hierarchy as hc from scipy.spatial.distance import pdist import s...
gaufung/PythonStandardLibrary
cryptography/hmac.ipynb
mit
import hmac digest_maker = hmac.new(b'secret-shared-key-goes-here') with open('hmac.ipynb', 'rb') as f: while True: block = f.read(1024) if not block: break digest_maker.update(block) digest = digest_maker.hexdigest() print(digest) """ Explanation: The HMAC algorithm can be u...