repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
EducationalTestingService/rsmtool | rsmtool/notebooks/comparison/feature_descriptives.ipynb | apache-2.0 | if not out_dfs['descriptives'].empty:
display(HTML(out_dfs['descriptives'].to_html(index=True, classes=['alternate_colors3_groups'], float_format=float_format_func)))
else:
display(Markdown(no_info_str))
"""
Explanation: Overall descriptive feature statistics
End of explanation
"""
if not out_dfs['outliers']... |
Yu-Group/scikit-learn-sandbox | jupyter/backup_deprecated_nbs/16_Combined_utils_RIT.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
from sklearn.datasets import load_iris
from sklearn.datasets import load_breast_cancer
import numpy as np
from functools import reduce
# Import our custom utilities
from imp import reload
from utils import irf_jupyter_utils
from utils import irf_utils
reload(irf_jupy... |
mne-tools/mne-tools.github.io | 0.23/_downloads/d5a59f5536154816047f788dc4573ab4/60_sleep.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Stanislas Chambon <stan.chambon@gmail.com>
# Joan Massich <mailsik@gmail.com>
#
# License: BSD Style.
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne.datasets.sleep_physionet.age import fetch_data
from mne.time_freq... |
TheAstroFactory/transit-network | code/scratch/beacon_scratch.ipynb | mit | %matplotlib inline
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import matplotlib.cm as cm
import matplotlib
matplotlib.rcParams.update({'font.size':18})
matplotlib.rcParams.update({'font.family':'serif'})
"""
Explanation: Transit-Network
Making plots f... |
canismarko/xanespy | tests/View_TXM_Data.ipynb | gpl-3.0 | %load_ext autoreload
%autoreload 2
%matplotlib inline
from matplotlib import pyplot as plt
plt.xkcd()
import pandas as pd
import os
import xanespy as xp
import numpy as np
from skimage import transform
# Set some directories
SSRL_DIR = 'txm-data-ssrl'
# APS_DIR = os.path.join(TEST_DIR, 'txm-data-aps')
# PTYCHO_DIR = ... |
KasperPRasmussen/bokeh | examples/howto/charts/scatter.ipynb | bsd-3-clause | df2 = df_from_json(data)
df2 = df2.sort('total', ascending=False)
df2 = df2.head(10)
df2 = pd.melt(df2, id_vars=['abbr', 'name'])
scatter5 = Scatter(
df2, x='value', y='name', color='variable', title="x='value', y='name', color='variable'",
xlabel="Medals", ylabel="Top 10 Countries", legend='bottom_right')
sho... |
y2ee201/Deep-Learning-Nanodegree | gan_mnist/Intro_to_GANs_Exercises.ipynb | mit | %matplotlib inline
import pickle as pkl
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('MNIST_data')
"""
Explanation: Generative Adversarial Network
In this notebook, we'll be building a generativ... |
ledrui/Regression | week2/.ipynb_checkpoints/week-2-multiple-regression-assignment-1-blank-checkpoint.ipynb | mit | import graphlab
"""
Explanation: Regression Week 2: Multiple Regression (Interpretation)
The goal of this first notebook is to explore multiple regression and feature engineering with existing graphlab functions.
In this notebook you will use data on house sales in King County to predict prices using multiple regressi... |
UWSEDS/LectureNotes | Autumn2017/02-Python-and-Data/Lecture-Python-And-Data-Completed.ipynb | bsd-2-clause | !ls
"""
Explanation: Software Engineering for Data Scientists
Manipulating Data with Python
CSE 583
Today's Objectives
1. Opening & Navigating the Jupyter Notebook
2. Simple Math in the Jupyter Notebook
3. Loading data with pandas
4. Cleaning and Manipulating data with pandas
5. Visualizing data with pandas & matplotl... |
LSSTC-DSFP/LSSTC-DSFP-Sessions | Sessions/Session01/Day4/IntroToMachLearnSolutions.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Introduction to Machine Learning:
Examples of Unsupervised and Supervised Machine-Learning Algorithms
Version 0.1
Broadly speaking, machine-learning methods constitute a diverse collection of data-driven algorithms designed to class... |
usantamaria/ipynb_para_docencia | 09_libreria_pandas/pandas.ipynb | mit | """
IPython Notebook v4.0 para python 3.0
Librerías adicionales: numpy, scipy, matplotlib. (EDITAR EN FUNCION DEL NOTEBOOK!!!)
Contenido bajo licencia CC-BY 4.0. Código bajo licencia MIT.
(c) Sebastian Flores, Christopher Cooper, Alberto Rubio, Pablo Bunout.
"""
# Configuración para recargar módulos y librerías dinámi... |
donaghhorgan/COMP9033 | labs/06 - Linear regression.ipynb | gpl-3.0 | %matplotlib inline
import numpy as np
import pandas as pd
from sklearn.dummy import DummyRegressor
from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_absolute_error
from sklearn.model_selection import GridSearchCV, KFold, cross_val_predict
"""
Explanation: Lab 06: Linear regression
Int... |
vorth/ipython | heptagons/DrawingTheHeptagon.ipynb | apache-2.0 | # load the definitions from the previous notebook
%run HeptagonNumbers.py
# represent points or vertices as pairs of heptagon numbers
p0 = ( zero, zero )
p1 = ( sigma, zero )
p2 = ( sigma+1, rho )
p3 = ( sigma, rho*sigma )
p4 = ( zero, sigma*sigma )
p5 = ( -rho, rho*sigma )
p6 = ( -rho, rho )
heptagon = [ p0, p1, p2... |
ES-DOC/esdoc-jupyterhub | notebooks/bcc/cmip6/models/sandbox-1/atmoschem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'bcc', 'sandbox-1', 'atmoschem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmoschem
MIP Era: CMIP6
Institute: BCC
Source ID: SANDBOX-1
Topic: Atmoschem
Sub-Topics: Transport, Emissions Co... |
machinelearningnanodegree/stanford-cs231 | solutions/pranay/assignment1/knn.ipynb | mit | # Run some setup code for this notebook.
import random
import numpy as np
from cs231n.data_utils import load_CIFAR10
import matplotlib.pyplot as plt
# This is a bit of magic to make matplotlib figures appear inline in the notebook
# rather than in a new window.
%matplotlib inline
plt.rcParams['figure.figsize'] = (10.... |
shareactorIO/pipeline | source.ml/jupyterhub.ml/notebooks/spark/Deploy_SparkML_Airbnb_LinearRegression.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... |
liganega/Gongsu-DataSci | previous/notes2017/old/NB-11-Printing_techniques.ipynb | gpl-3.0 | a = "string"
b = "string1"
print a, b
print "The return value is", a
"""
Explanation: 문자열을 인쇄하는 다양한 방법 활용
파이썬 2.x에서는 print 함수의 경우 인자들이 굳이 괄호 안에 들어 있어야 할 필요는 없다. 또한 여러 개의 값을 동시에 인쇄할 수도 있다. 이때 인자들은 콤마로 구분지어진다.
End of explanation
"""
print(a, b)
print("The return value is", a)
"""
Explanation: 주의: 아래와 같이 하면 모양이 기대와... |
tensorflow/docs | tools/templates/notebook.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... |
robertoalotufo/ia898 | master/tutorial_python_1_1.ipynb | mit | a = 3
print(type(a))
b = 3.14
print(type(b))
c = 3 + 4j
print(type(c))
d = False
print(type(d))
print(a + b)
print(b * c)
print(c / a)
"""
Explanation: Table of Contents
<p><div class="lev1 toc-item"><a href="#Introdução-ao-Python-no-ambiente-Adessowiki" data-toc-modified-id="Introdução-ao-Python-no-ambiente-Adesso... |
steinam/teacher | jup_notebooks/datenbanken/.ipynb_checkpoints/12FI1_Abschlusstest-checkpoint.ipynb | mit | %load_ext sql
"""
Explanation: Unterricht zur Kammerprüfung
End of explanation
"""
%sql mysql://steinam:steinam@localhost/sommer_2014
"""
Explanation: Sommer_2014
End of explanation
"""
%%sql
select * from artikel
where Art_Bezeichnung like '%Schmerzmittel%' or
Art_Bezeichnung like '%schmerzmittel%';
... |
gojomo/gensim | docs/notebooks/WordRank_wrapper_quickstart.ipynb | lgpl-2.1 | from gensim.models.wrappers import Wordrank
wr_path = 'wordrank' # path to Wordrank directory
out_dir = 'model' # name of output directory to save data to
data = '../../gensim/test/test_data/lee.cor' # sample corpus
model = Wordrank.train(wr_path, data, out_dir, iter=11, dump_period=5)
"""
Explanation: WordRank wrap... |
peakrisk/peakrisk | posts/comparing-pressure-data-from-two-sensors.ipynb | gpl-3.0 | # Tell matplotlib to plot in line
%matplotlib inline
import datetime
# import pandas
import pandas
# seaborn magically adds a layer of goodness on top of Matplotlib
# mostly this is just changing matplotlib defaults, but it does also
# provide some higher level plotting methods.
import seaborn
# Tell seaborn to set... |
DJCordhose/speed-limit-signs | notebooks/cnn-train-augmented.ipynb | apache-2.0 | import warnings
warnings.filterwarnings('ignore')
%matplotlib inline
%pylab inline
import matplotlib.pylab as plt
import numpy as np
from distutils.version import StrictVersion
import sklearn
print(sklearn.__version__)
assert StrictVersion(sklearn.__version__ ) >= StrictVersion('0.18.1')
import tensorflow as tf
t... |
RTHMaK/RPGOne | scipy-2017-sklearn-master/notebooks/23 Out-of-core Learning Large Scale Text Classification.ipynb | apache-2.0 | from sklearn.feature_extraction.text import CountVectorizer
vectorizer = CountVectorizer(min_df=1)
vectorizer.fit([
"The cat sat on the mat.",
])
vectorizer.vocabulary_
"""
Explanation: SciPy 2016 Scikit-learn Tutorial
Out-of-core Learning - Large Scale Text Classification for Sentiment Analysis
Scalability Issu... |
theavey/ParaTemp | examples/paratemp_setup_example.ipynb | apache-2.0 | import re, os, sys, shutil
import shlex, subprocess
import glob
import pandas as pd
import panedr
import numpy as np
import MDAnalysis as mda
import nglview
import matplotlib.pyplot as plt
import parmed as pmd
import py
import scipy
from scipy import stats
from importlib import reload
from thtools import cd
from parate... |
opencb/opencga | opencga-client/src/main/python/notebooks/user-training/pyopencga_first_steps.ipynb | apache-2.0 | from pyopencga.opencga_config import ClientConfiguration # import configuration module
from pyopencga.opencga_client import OpencgaClient # import client module
from pprint import pprint
from IPython.display import JSON
import matplotlib.pyplot as plt
import datetime
"""
Explanation: First Steps with pyopencga; the Py... |
mne-tools/mne-tools.github.io | 0.13/_downloads/plot_read_and_write_raw_data.ipynb | bsd-3-clause | # Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: BSD (3-clause)
import mne
from mne.datasets import sample
print(__doc__)
data_path = sample.data_path()
fname = data_path + '/MEG/sample/sample_audvis_raw.fif'
raw = mne.io.read_raw_fif(fname)
# Set up pick list: MEG + STI 014 - b... |
ComputationalModeling/spring-2017-danielak | past-semesters/fall_2016/day-by-day/day12-exploratory-data-analysis-day1/Data_Exploration_Plotting.ipynb | agpl-3.0 | # put your code here, and add additional cells as necessary.
"""
Explanation: Exploring data
Names of group members
// Put your names here!
Goals of this assignment
The purpose of this assignment is to explore data using visualization and statistics.
Section 1
The file datafile_1.csv contains a three-dimensional d... |
hongguangguo/shogun | doc/ipython-notebooks/evaluation/xval_modelselection.ipynb | gpl-3.0 | %pylab inline
%matplotlib inline
# include all Shogun classes
from modshogun import *
# generate some ultra easy training data
gray()
n=20
title('Toy data for binary classification')
X=hstack((randn(2,n), randn(2,n)+1))
Y=hstack((-ones(n), ones(n)))
_=scatter(X[0], X[1], c=Y , s=100)
p1 = Rectangle((0, 0), 1, 1, fc="w"... |
flowersteam/naminggamesal | notebooks/2_Intro_Strategy.ipynb | agpl-3.0 | import naminggamesal.ngstrat as ngstrat
import naminggamesal.ngvoc as ngvoc
"""
Explanation: Strategies
The strategy object describes the behaviour of an agent, given its vocabulary. The main algorithms that vary among strategies are:
* how to choose a link (meaning-word) to enact,
* how to guess a meaning from a wor... |
jinntrance/MOOC | coursera/ml-foundations/week6/Deep Features for Image Retrieval.ipynb | cc0-1.0 | import graphlab
"""
Explanation: Building an image retrieval system with deep features
Fire up GraphLab Create
End of explanation
"""
image_train = graphlab.SFrame('image_train_data/')
image_test = graphlab.SFrame('image_test_data/')
"""
Explanation: Load the CIFAR-10 dataset
We will use a popular benchmark datase... |
marcus-nystrom/python_course | Week2_lecture.ipynb | gpl-3.0 | # This is a sentence
sentence = 'This is a rather long sentence. I want to find the number of words with two letters'
# This is the code you need to find the number of words of length 2 (e.g., is, to, and of)
words = sentence.split(' ') # Split the sentence string into a list of words, the space between the
... |
google/eng-edu | ml/cc/prework/zh-CN/creating_and_manipulating_tensors.ipynb | apache-2.0 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the L... |
mne-tools/mne-tools.github.io | stable/_downloads/499a81f33500445fc2e1eac0be346d47/temporal_whitening.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License: BSD-3-Clause
import numpy as np
from scipy import signal
import matplotlib.pyplot as plt
import mne
from mne.time_frequency import fit_iir_model_raw
from mne.datasets import sample
print(__doc__)
data_path = sample.data_path()
meg_path = data_... |
pombredanne/https-gitlab.lrde.epita.fr-vcsn-vcsn | doc/notebooks/automaton.push_weights.ipynb | gpl-3.0 | import vcsn
"""
Explanation: automaton.push_weights
Push the weights towards in the initial states.
Preconditions:
- None
Postconditions:
- The Result is equivalent to the input automaton.
Examples
End of explanation
"""
%%automaton --strip a
context = "lal_char, zmin"
$ -> 0
0 -> 1 <0>a, <1>b, <5>c
0 -> 2 <0>d, <1>... |
mrustl/flopy | examples/Notebooks/flopy3_LoadSWRBinaryData.ipynb | bsd-3-clause | %matplotlib inline
from IPython.display import Image
import os
import numpy as np
import matplotlib.pyplot as plt
import flopy
#Set the paths
datapth = os.path.join('..', 'data', 'swr_test')
# SWR Process binary files
files = ('SWR004.obs', 'SWR004.vel', 'SWR004.str', 'SWR004.stg', 'SWR004.flow')
"""
Explanati... |
GPflow/GPflowOpt | doc/source/notebooks/structure.ipynb | apache-2.0 | import numpy as np
def fx(X):
X = np.atleast_2d(X)
# Return objective & gradient
return np.sum(np.square(X), axis=1)[:,None], 2*X
"""
Explanation: The structure of GPflowOpt
Joachim van der Herten
In this document, the structure of the GPflowOpt library is explained, including some small examples. First t... |
rice-solar-physics/hot_plasma_single_nanoflares | notebooks/plot_nei_results.ipynb | bsd-2-clause | import os
import sys
import pickle
import numpy as np
import seaborn.apionly as sns
import matplotlib.pyplot as plt
from matplotlib import ticker
sys.path.append(os.path.join(os.environ['EXP_DIR'],'EBTEL_analysis/src'))
import em_binner as emb
%matplotlib inline
plt.rcParams.update({'figure.figsize' : [16,5]})
"""
... |
baifan-wang/structural-bioinformatics_in_python | docs/Introduction.ipynb | gpl-3.0 | from SBio import *
mol = create_molecule('test.pdb')
mol
"""
Explanation: Overall layout of a Molecule object.
The Molecule object has the following architecture:
* A Molecule is composed of Models (conformations)
* A Model is composed of Residues
* A Residue is composed of Atoms
Atom object is the basic componen... |
Olsthoorn/TransientGroundwaterFlow | Syllabus_in_notebooks/Sec5_4_2_Questions_starting_with_A_canal_in_a_dune_area.ipynb | gpl-3.0 | # import required modules / functionality
import numpy as np # for numerical stuff and arrays
import matplotlib.pyplot as plt # for visualization
import scipy.special as sp # scipy.special hold the less usual mathematical functions
def newfig(title='?', xlabel='?', ylabel='?', xlim=None, ylim=None,
... |
kevroy314/msl-iposition-pipeline | examples/iTouch Analyses.ipynb | gpl-3.0 | import os
data_directory = r'C:\Users\Kevin\Documents\GitHub\msl-iposition-pipeline\examples'
touch_tbt_false_path = os.path.join(data_directory, '2018-04-24_11-35-39_touch_tbt_false.csv')
touch_tbt_true_path = os.path.join(data_directory, '2018-04-24_11-35-03_touch_tbt_true.csv')
desktop_tbt_false_path = os.path.join... |
Mithrillion/pokemon-go-simulator-solver | pokemon_location_simulator.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
import random
import matplotlib.patches as patches
from scipy.stats import gennorm
from scipy.stats import gamma
%matplotlib inline
def generate_initial_coordinates(side_length=2000, n_pokemon=9):
pokemons = {}
for i in range(n_pokemon):
pokemons[i] = ... |
probml/pyprobml | deprecated/flow_2d_mlp.ipynb | mit | from typing import Sequence
import distrax
import haiku as hk
import jax
import jax.numpy as jnp
import matplotlib.pyplot as plt
import optax
Array = jnp.ndarray
PRNGKey = Array
prng = hk.PRNGSequence(42)
"""
Explanation: <a href="https://colab.research.google.com/github/probml/probml-notebooks/blob/main/flow_2d_ml... |
cjdrake/pyeda | ipynb/SAT_Demo.ipynb | bsd-2-clause | %dotobjs S_rca[2].simplify(), S_ksa[2].simplify()
"""
Explanation: The expression tree is very different:
End of explanation
"""
f = Xor(S_rca[9], S_ksa[9])
%timeit f.satisfy_one()
"""
Explanation: If XOR(f, g) is UNSAT, functions f and g are equivalent.
But sum bit 9 is a deep expression.
Converting to CNF is imp... |
barjacks/foundations-homework | 07/.ipynb_checkpoints/07 - Introduction to Pandas-checkpoint.ipynb | mit | # import pandas, but call it pd. Why? Because that's What People Do.
import pandas as pd
"""
Explanation: An Introduction to pandas
Pandas! They are adorable animals. You might think they are the worst animal ever but that is not true. You might sometimes think pandas is the worst library every, and that is only kind... |
ES-DOC/esdoc-jupyterhub | notebooks/nims-kma/cmip6/models/sandbox-2/seaice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'nims-kma', 'sandbox-2', 'seaice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Seaice
MIP Era: CMIP6
Institute: NIMS-KMA
Source ID: SANDBOX-2
Topic: Seaice
Sub-Topics: Dynamics, Thermodynami... |
diging/tethne-notebooks | .ipynb_checkpoints/1. Working with data from the Web of Science-checkpoint.ipynb | gpl-3.0 | print "This is a code cell!"
"""
Explanation: Introduction to Tethne: Loading Data, part 1
In this notebook we will take our first steps with the Tethne Python package. We'll parse some bibliographic records from the ISI Web of Science, and take a look at the Corpus class and its various features. We'll then use some ... |
eds-uga/csci1360-fa16 | assignments/A9/A9_Q1.ipynb | mit | def read_book(f):
return open(f, "r").read()
try:
read_book
except:
assert False
else:
assert True
assert read_book("complete_shakspeare.txt") is None
assert read_book("queen_jean_bible.txt") is None
book1 = read_book("moby_dick.txt")
assert len(book1) == 1238567
book2 = read_book("war_and_peace.tx... |
dmytroKarataiev/MachineLearning | student_intervention/student_intervention.ipynb | mit | # Import libraries
import numpy as np
import pandas as pd
from time import time
from sklearn.metrics import f1_score
# Read student data
student_data = pd.read_csv("student-data.csv")
print "Student data read successfully!"
"""
Explanation: Machine Learning Engineer Nanodegree
Supervised Learning
Project 2: Building ... |
DJCordhose/ai | notebooks/rl/berater-v11.ipynb | mit | !pip install git+https://github.com/openai/baselines >/dev/null
!pip install gym >/dev/null
"""
Explanation: <a href="https://colab.research.google.com/github/DJCordhose/ai/blob/master/notebooks/rl/berater-v11.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Cola... |
wesleybeckner/salty | scripts/molecular_dynamics/salty_traj_analysis.ipynb | mit | import numpy as np
import MDAnalysis
import sympy as sp
"""
Explanation:
End of explanation
"""
def gk_heat_current(kb, volume, temperature, integrated_heat_current):
gk_hc = 1 / (3 * volume * kb * temperature**2) * integrated_heat_current
return gk_hc
"""
Explanation: Micro to macroscopic heat transfer
Fo... |
amccaugh/phidl | docs/tutorials/routing.ipynb | mit | from phidl import Device, quickplot as qp
import phidl.geometry as pg
import phidl.routing as pr
# Use pg.compass() to make 2 boxes with North/South/East/West ports
D = Device()
c1 = D << pg.compass()
c2 = D << pg.compass().move([10,5]).rotate(15)
# Connect the East port of one box to the West port of the other
R = p... |
fastai/course-v3 | nbs/dl2/09_optimizers.ipynb | apache-2.0 | %load_ext autoreload
%autoreload 2
%matplotlib inline
#export
from exp.nb_08 import *
"""
Explanation: Optimizer tweaks
End of explanation
"""
path = datasets.untar_data(datasets.URLs.IMAGENETTE_160)
tfms = [make_rgb, ResizeFixed(128), to_byte_tensor, to_float_tensor]
bs=128
il = ImageList.from_files(path, tfms=... |
ehongdata/Network-Analysis-Made-Simple | 4. Cliques, Triangles and Squares (Student).ipynb | mit | G = nx.Graph()
G.add_nodes_from(['a', 'b', 'c'])
G.add_edges_from([('a','b'), ('b', 'c')])
nx.draw(G, with_labels=True)
"""
Explanation: Cliques, Triangles and Squares
Let's pose a problem: If A knows B and B knows C, would it be probable that A knows C as well? In a graph involving just these three individuals, it ma... |
shashank14/Asterix | 1-Python Crash course/Python-Crash-Course/Python Crash Course Exercises .ipynb | apache-2.0 | 7**4
"""
Explanation: Python Crash Course Exercises
This is an optional exercise to test your understanding of Python Basics. If you find this extremely challenging, then you probably are not ready for the rest of this course yet and don't have enough programming experience to continue. I would suggest you take anothe... |
GoogleCloudPlatform/dataflow-sample-applications | timeseries-streaming/timeseries-python-applications/notebooks/Comparing_metrics_with_Pandas.ipynb | apache-2.0 | !conda install -c conda-forge google-cloud-bigquery google-cloud-bigquery-storage pyarrow pandas numpy matplotlib bokeh -y
"""
Explanation: Copyright 2020 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License").
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contribu... |
uber/pyro | tutorial/source/gplvm.ipynb | apache-2.0 | import os
import matplotlib.pyplot as plt
import pandas as pd
import torch
from torch.nn import Parameter
import pyro
import pyro.contrib.gp as gp
import pyro.distributions as dist
import pyro.ops.stats as stats
smoke_test = ('CI' in os.environ) # ignore; used to check code integrity in the Pyro repo
assert pyro.__v... |
RaoUmer/lightning-example-notebooks | plots/histogram.ipynb | mit | import os
from lightning import Lightning
from numpy import random
"""
Explanation: <img style='float: left' src="http://lightning-viz.github.io/images/logo.png"> <br> <br> Histogram plots in <a href='http://lightning-viz.github.io/'><font color='#9175f0'>Lightning</font></a>
<hr> Setup
... |
eds-uga/cbio4835-sp17 | lectures/Lecture19.ipynb | mit | # Preliminary imports
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import scipy.integrate as sig # Here's the critical module!
import seaborn as sns
"""
Explanation: Lecture 19: Computational Modeling
CBIO (CSCI) 4835/6835: Introduction to Computational Biology
Overview and Objectives
So far,... |
compsocialscience/summer-institute | 2018/materials/boulder/day5-causal-inference/Day 5 - Case Study.ipynb | mit | sb.factorplot(x='HOUR',y='ST_CASE',hue='WEEKDAY',data=counts_df,
aspect=2,order=range(24),palette='nipy_spectral',dodge=.5)
sb.factorplot(x='MONTH',y='ST_CASE',hue='WEEKDAY',data=counts_df,
aspect=2,order=range(1,13),palette='nipy_spectral',dodge=.5)
"""
Explanation: Exploratory data analy... |
googledatalab/notebooks | samples/Conversion Analysis with Google Analytics Data.ipynb | apache-2.0 | import google.datalab.bigquery as bq
"""
Explanation: Conversion Analysis with Google Analytics Data
This sample notebook demonstrates working with Google Analytics page views and session data exported to Google BigQuery.
Google Analytics offers BigQuery export as part of its premium offering. If you're a premium user... |
bakanchevn/DBCourseMirea2017 | Неделя 3/Работа в классе/Лабораторная 3-1-Решение.ipynb | gpl-3.0 | def task1():
cursor = db.cursor()
cursor.execute('''
select distinct ar.Name
from tracks t
inner join albums al
on t.albumid = al.albumid
inner join artists ar
on al.artistid = ar.artistid
inner join genres g
on t.genreid = g.genreid
where g.name = 'Rock'
''')
ar = cursor.fetchal... |
analysiscenter/dataset | examples/experiments/squeeze_and_excitation/squeeze_and_excitation.ipynb | apache-2.0 | import sys
import numpy as np
import tensorflow as tf
from tqdm import tqdm_notebook as tqn
import matplotlib.pyplot as plt
%matplotlib inline
plt.style.use('seaborn-poster')
plt.style.use('ggplot')
sys.path.append('../../..')
from batchflow import B, V
from batchflow.opensets import MNIST
from batchflow.models.tf i... |
Kaggle/learntools | notebooks/feature_engineering/raw/tut1.ipynb | apache-2.0 | #$HIDE_INPUT$
import pandas as pd
ks = pd.read_csv('../input/kickstarter-projects/ks-projects-201801.csv',
parse_dates=['deadline', 'launched'])
ks.head(6)
"""
Explanation: Introduction
In this course, you will learn a practical approach to feature engineering. You'll be able to apply what you learn t... |
dalek7/umbrella | Python/randomtest.ipynb | mit | np.random.seed(0)
p = np.array([0.1, 0.0, 0.6, 0.3])
print(p)
print(p.ravel())
v =[0,0,0,0]
ntest = 1000
for i in range(ntest):
idx = np.random.choice([0, 1, 2, 3], p = p.ravel())
v[idx] += 1
#print(i, idx)
print(v)
v = np.array(v)
print(v / float(ntest))
"""
Explanation: np.random.choice
python
np.rand... |
ES-DOC/esdoc-jupyterhub | notebooks/nuist/cmip6/models/sandbox-1/ocnbgchem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'nuist', 'sandbox-1', 'ocnbgchem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem
MIP Era: CMIP6
Institute: NUIST
Source ID: SANDBOX-1
Topic: Ocnbgchem
Sub-Topics: Tracers.
Propertie... |
GEMScienceTools/rmtk | notebooks/vulnerability/model_generator/DBELA_approach/DBELA.ipynb | agpl-3.0 | from rmtk.vulnerability.model_generator.DBELA_approach import DBELA
from rmtk.vulnerability.common import utils
%matplotlib inline
"""
Explanation: Generation of capacity curves using DBELA
This notebook enables the user to generate capacity curves (in terms of spectral acceleration vs. spectral displacement) using th... |
cosmostatschool/MACSS2017 | Projects/mcmc/first_day.ipynb | mit | import numpy as np
import scipy.integrate as integrate
"""
Explanation: MCMC from scratch
Here we will write a simple python program that will perform the Metropolis algorithm. In order to sample the posterior of the probability function given supernovae data.
Loglike computation
First we need to be able to compute th... |
sdpython/ensae_teaching_cs | _doc/notebooks/notebook_eleves/2018-2019/2018-10-09_ensemble_gradient_boosting.ipynb | mit | from jyquickhelper import add_notebook_menu
add_notebook_menu()
%matplotlib inline
"""
Explanation: 2018-10-09 Ensemble, Gradient, Boosting...
Le noteboook explore quelques particularités des algorithmes d'apprentissage pour expliquer certains résultats numériques. L'algoithme AdaBoost surpondère les exemples sur leq... |
tritemio/multispot_paper | out_notebooks/usALEX-5samples-PR-raw-dir_ex_aa-fit-out-all-ph-12d.ipynb | mit | ph_sel_name = "all-ph"
data_id = "12d"
# ph_sel_name = "all-ph"
# data_id = "7d"
"""
Explanation: Executed: Mon Mar 27 11:37:14 2017
Duration: 9 seconds.
usALEX-5samples - Template
This notebook is executed through 8-spots paper analysis.
For a direct execution, uncomment the cell below.
End of explanation
"""
fr... |
zizouvb/deeplearning | tv-script-generation/dlnd_tv_script_generation.ipynb | mit | """
DON'T MODIFY ANYTHING IN THIS CELL
"""
import helper
data_dir = './data/simpsons/moes_tavern_lines.txt'
text = helper.load_data(data_dir)
# Ignore notice, since we don't use it for analysing the data
text = text[81:]
"""
Explanation: TV Script Generation
In this project, you'll generate your own Simpsons TV scrip... |
mne-tools/mne-tools.github.io | 0.15/_downloads/plot_brainstorm_phantom_elekta.ipynb | bsd-3-clause | # Authors: Eric Larson <larson.eric.d@gmail.com>
#
# License: BSD (3-clause)
import os.path as op
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne import find_events, fit_dipole
from mne.datasets.brainstorm import bst_phantom_elekta
from mne.io import read_raw_fif
from mayavi import mlab
print(... |
hparik11/Deep-Learning-Nanodegree-Foundation-Repository | Project1/first-neural-network/dlnd-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... |
rusucosmin/courses | ml/ex01/template/taskB.ipynb | mit | np.random.seed(10)
p, q = (np.random.rand(i, 2) for i in (4, 5))
p_big, q_big = (np.random.rand(i, 80) for i in (100, 120))
print(p, "\n\n", q)
"""
Explanation: Data Generation
End of explanation
"""
def naive(p, q):
x = []
for i in range(len(p)):
x.append([])
for j in range(len(q)):
... |
ES-DOC/esdoc-jupyterhub | notebooks/inm/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', 'inm', 'sandbox-3', 'toplevel')
"""
Explanation: ES-DOC CMIP6 Model Properties - Toplevel
MIP Era: CMIP6
Institute: INM
Source ID: SANDBOX-3
Sub-Topics: Radiative Forcings.
Properties: 85 (42 re... |
astroumd/GradMap | notebooks/Lectures2018/Lecture4/.ipynb_checkpoints/Lecture4-2BodyProblem-Student-NEW-checkpoint.ipynb | gpl-3.0 | #Physical Constants (SI units)
G=6.67e-11
AU=1.5e11 #meters. Distance between sun and earth.
daysec=24.0*60*60 #seconds in a day
"""
Explanation: Welcome to your first numerical simulation! The 2 Body Problem
Many problems in statistical physics and astrophysics requiring solving problems consisting of many particles ... |
ptosco/rdkit | Docs/Notebooks/RGroupDecomposition-DummyCores.ipynb | bsd-3-clause | from rdkit import Chem
from rdkit.Chem.Draw import IPythonConsole
IPythonConsole.ipython_useSVG=True
from rdkit.Chem import rdRGroupDecomposition
from IPython.display import HTML
from rdkit import rdBase
rdBase.DisableLog("rdApp.debug")
from rdkit.Chem import PandasTools
import pandas as pd
from rdkit.Chem import Pan... |
Vettejeep/Data-Analysis-and-Data-Science-Projects | ROC Curve and the UCI German Credit Data Set.ipynb | gpl-3.0 | %matplotlib inline
import pandas as pd
import numpy as np
import itertools
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from sklearn import metrics
from sklearn.preprocessing import label_binarize
from sklearn.metrics import roc_curve, auc
import matplotlib... |
johntfoster/1DPDpy | PD1D.ipynb | mit | from PD1D import PD_Problem
"""
Explanation: Everything needed to reproduce this work including this file itself and the 1-dimensional peridynamics code (which can be run in stand-alone mode as well) can be found in my Github repository. To clone:
bash
git clone git@github.com:johntfoster/1DPDpy.git
The user will nee... |
WNoxchi/Kaukasos | misc/cuda-tensor-validate-issue.ipynb | mit | import torch
from fastai.conv_learner import *
x = torch.FloatTensor([[[1,1,],[1,1]]]); x
VV(x)
VV(VV(x))
torch.equal(VV(x), VV(VV(x)))
"""
Explanation: FastAI models.validate CUDA Tensor Issue
WNixalo – 2018/6/11
I ran into trouble trying to reimplement a CIFAR-10 baseline notebook. The notebook used PyTorch dat... |
Santana9937/Classification_ML_Specialization | Week_2_Learning_Linear_Classifiers/week_2_assign_2_lin_reg_L2_reg.ipynb | mit | import os
import zipfile
import string
import numpy as np
import pandas as pd
from sklearn import linear_model
from sklearn.feature_extraction.text import CountVectorizer
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Logistic Regression with L2 regularization
In this notebook, you will implement ... |
jrkerns/pylinac | docs/source/pylinac_core_hacking.ipynb | mit | %matplotlib inline
from urllib.request import urlretrieve
import matplotlib.pyplot as plt
import numpy as np
from pylinac.core import image
# pylinac demo images' URL
PF_URL = 'https://s3.amazonaws.com/pylinac/EPID-PF-LR.dcm'
STAR_URL = 'https://s3.amazonaws.com/pylinac/starshot.tif'
# local downloaded images
PF_F... |
Danghor/Formal-Languages | ANTLR4-Python/Interpreter/Interpreter.ipynb | gpl-2.0 | !cat -n Pure.g4
"""
Explanation: An Interpreter for a Simple Programming Language
In this notebook we develop an interpreter for a small programming language.
The grammar for this language is stored in the file Pure.g4.
End of explanation
"""
!cat sum.sl
"""
Explanation: The grammar shown above does only contain sk... |
LxMLS/lxmls-toolkit | labs/notebooks/basic_tutorials/Exercises_0.10_to_0.14.ipynb | mit | %load_ext autoreload
%autoreload 2
from lxmls.readers import galton
galton_data = galton.load()
print(galton_data.mean(0))
print(galton_data.std(0))
import matplotlib.pyplot as plt
%matplotlib inline
plt.hist(galton_data)
plt.plot(galton_data[:,0], galton_data[:,1], '.')
import numpy as np
np.random.randn?
ga... |
ThyrixYang/LearningNotes | MOOC/stanford_cnn_cs231n/assignment2/.ipynb_checkpoints/FullyConnectedNets-checkpoint.ipynb | gpl-3.0 | # 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... |
lewisamarshall/ionize | tutorial.ipynb | gpl-2.0 | from __future__ import print_function, absolute_import, division
import ionize
# We'll also import numpy to set up some of our inputs.
# And pprint to prettily print some lists.
import numpy
import pprint
# And set up inline plotting.
from matplotlib.pyplot import *
%matplotlib inline
# Prettify numpy printing
nump... |
jskksj/cv2stuff | cv2stuff/notebooks/pathlib.ipynb | isc | p = Path('.')
[x for x in p.iterdir() if x.is_dir()]
list(p.glob('**/*.py'))
p = Path('/etc')
p
q = p / 'init.d' / 'reboot'
q
q.resolve()
q.exists()
q.is_dir()
with q.open() as f:
print(f.readline())
"""
Explanation: Path is the basic operator for portability.
End of explanation
"""
PurePosixPath('foo') ... |
JerryKurata/MachineLearningWithPython | Notebooks/.ipynb_checkpoints/Pima-Prediction-checkpoint.ipynb | gpl-3.0 | import pandas as pd # pandas is a dataframe library
import matplotlib.pyplot as plt # matplotlib.pyplot plots data
import numpy as np # numpy provides N-dim object support
# do ploting inline instead of in a separate window
%matplotlib inline
"""
Explanation: Predi... |
davewsmith/notebooks | temperature/InitialTemperatureValues.ipynb | mit | !head -5 temps.csv
"""
Explanation: A preliminary look at sensor data
The general idea of the project is to get a handle on how the house heats and cools so that we can better program the thermostat.
To gather data, I've assembled and programmed 5 probes using inexpensive hardware (Wemos D1 Mini ESP8266 Wifi boards an... |
aidiary/notebooks | keras/180103-stacked-lstm.ipynb | mit | from math import sin
from math import pi
import matplotlib.pyplot as plt
%matplotlib inline
length = 100
freq = 5
sequence = [sin(2 * pi * freq * (i / length)) for i in range(length)]
plt.plot(sequence)
from math import sin, pi, exp
import matplotlib.pyplot as plt
length = 100
period = 10
decay = 0.05
sequence = [0... |
caisq/tensorflow | tensorflow/contrib/eager/python/examples/notebooks/automatic_differentiation.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... |
opesci/notebooks | AcousticFWI/Acoustic3D.ipynb | bsd-3-clause | p=Function('p')
m,s,h = symbols('m s h')
m=M(x,y,z)
q=Q(x,y,z,t)
d=D(x,y,z,t)
e=E(x,y,z)
# Choose dimension (2 or 3)
dim = 3
# Choose order
time_order = 2
space_order = 2
# half width for indexes, goes from -half to half
width_t = int(time_order/2)
width_h = int(space_order/2)
solvep = p(x,y,z,t+width_t*s)
solvepa = ... |
heatseeknyc/data-science | src/bryan analyses/Hack for Heat #4.ipynb | mit | connection = psycopg2.connect('dbname = threeoneone user=threeoneoneadmin password=threeoneoneadmin')
cursor = connection.cursor()
"""
Explanation: Hack for Heat #4: Number of complaints over time pt.2
In this post, we're going to look at the number of complaints each borough received for the last five or so years. Fi... |
kit-cel/wt | sigNT/tutorial/ls_polynomial.ipynb | gpl-2.0 | # importing
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
# showing figures inline
%matplotlib inline
# plotting options
font = {'size' : 30}
plt.rc('font', **font)
plt.rc('text', usetex=True)
matplotlib.rc('figure', figsize=(30, 15) )
"""
Explanation: Content and Objective
Show result ... |
IRC-SPHERE/HyperStream | examples/tutorial_03.ipynb | mit | %load_ext watermark
import sys
from datetime import datetime
sys.path.append("../") # Add parent dir in the Path
from hyperstream import HyperStream
from hyperstream import TimeInterval
from hyperstream.utils import UTC
from utils import plot_high_chart
%watermark -v -m -p hyperstream -g
hs = HyperStream(loglevel... |
matthewzhenggong/fiwt | workspace_py/.ipynb_checkpoints/RigStaticRollId-Exp36-Copy1-checkpoint.ipynb | lgpl-3.0 | %run matt_startup
%run -i matt_utils
button_qtconsole()
#import other needed modules in all used engines
#with dview.sync_imports():
# import os
"""
Explanation: Parameter Estimation of RIG Roll Experiments
Setup and descriptions
Without ACM model
Turn on wind tunnel
Only 1DoF for RIG roll movement
Use small-ampl... |
newlawrence/poliastro | docs/source/examples/Catch that asteroid!.ipynb | mit | import matplotlib.pyplot as plt
plt.ion()
from astropy import units as u
from astropy.time import Time
from astropy.utils.data import conf
conf.dataurl
conf.remote_timeout
"""
Explanation: Catch that asteroid!
End of explanation
"""
conf.remote_timeout = 10000
"""
Explanation: First, we need to increase the tim... |
ryan-leung/SolvingProjectEuler | Q021-Q030.ipynb | bsd-3-clause | def d(n):
if n==2:
return 1
result=0
for i in xrange(1,n/2+1):
if n % i == 0:
result=i+result
return result
amicable=[]
for a in xrange(2,10000):
b=d(a)
if d(b) == a and a<>b:
amicable.append(a)
amicable.append(b)
#print a,b
print sum(set(amic... |
atulsingh0/MachineLearning | python_DC/IntoductionToDataBase_#1.4.ipynb | gpl-3.0 | # import
"""
Explanation: Creating and Manipulating DataBase
End of explanation
"""
# # Import Table, Column, String, Integer, Float, Boolean from sqlalchemy
# from sqlalchemy import Table, Column, String, Integer, Float, Boolean
# # Define a new table with a name, count, amount, and valid column: data
# data = Tab... |
mne-tools/mne-tools.github.io | 0.23/_downloads/00ac060e49528fd74fda09b97366af98/3d_to_2d.ipynb | bsd-3-clause | # Authors: Christopher Holdgraf <choldgraf@berkeley.edu>
#
# License: BSD (3-clause)
from scipy.io import loadmat
import numpy as np
from matplotlib import pyplot as plt
from os import path as op
import mne
from mne.viz import ClickableImage # noqa
from mne.viz import (plot_alignment, snapshot_brain_montage,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.