repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
cschnaars/intro-to-coding-in-python | notebooks/intro_to_coding_in_python_part_2_lists_and_dictionaries_no_code.ipynb | mit | my_friends
"""
Explanation: Introduction to Coding in Python, Part 2
Investigative Reporters and Editors Conference, New Orleans, June 2016<br />
By Aaron Kessler and Christopher Schnaars<br />
Lists
A list is a mutable (meaning it can be changed), ordered collection of objects. Everything in Python is an object, so a... |
coursemdetw/reveal2 | content/notebook/JSInteraction.ipynb | mit | from IPython.display import HTML
input_form = """
<div style="background-color:gainsboro; border:solid black; width:300px; padding:20px;">
Variable Name: <input type="text" id="var_name" value="foo"><br>
Variable Value: <input type="text" id="var_value" value="bar"><br>
<button onclick="set_value()">Set Value</button>... |
cwhanse/pvlib-python | docs/tutorials/tmy.ipynb | bsd-3-clause | # built in python modules
import datetime
import os
import inspect
# python add-ons
import numpy as np
import pandas as pd
# plotting libraries
%matplotlib inline
import matplotlib.pyplot as plt
try:
import seaborn as sns
except ImportError:
pass
import pvlib
"""
Explanation: TMY tutorial
This tutorial show... |
ClaudiaEsp/inet | Analysis/misc/How to use DataLoader.ipynb | gpl-2.0 | from __future__ import division
from terminaltables import AsciiTable
import inet
inet.__version__
from inet import DataLoader
"""
Explanation: <H1>How to use DataLoader</H1>
<P>This is an example on how to use a DataLoader object</P>
End of explanation
"""
mydataset = DataLoader('../../data/PV') # create an objec... |
deepchem/deepchem | examples/tutorials/Uncertainty_In_Deep_Learning.ipynb | mit | !pip install --pre deepchem
import deepchem
deepchem.__version__
"""
Explanation: Uncertainty in Deep Learning
A common criticism of deep learning models is that they tend to act as black boxes. A model produces outputs, but doesn't given enough context to interpret them properly. How reliable are the model's predic... |
ireapps/cfj-2017 | exercises/08. Working with APIs (Part 1)-working.ipynb | mit | # build a dictionary of payload data
# turn it into a string of JSON
"""
Explanation: Let's post a message to Slack
In this session, we're going to use Python to post a message to Slack. I set up a team for us so we can mess around with the Slack API.
We're going to use a simple incoming webhook to accomplish this.... |
reece/ga4gh-examples | nb/Plot SO with pivottablejs.ipynb | apache-2.0 | import pandas as pd
import ga4gh.client
print(ga4gh.__version__)
gc = ga4gh.client.HttpClient("http://localhost:8000")
region_constraints = dict(referenceName="1", start=0, end=int(1e10))
"""
Explanation: Method Overview
gc.searchDatasets() -- Returns an iterator over the Datasets on the server.
gc.searchVariant... |
Cushychicken/cushychicken.github.io | assets/lockin_amp_simulation.ipynb | mit | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
def sine_wave(freq, phase=0, Fs=10000):
ph_rad = (phase/360.0)*(2.0*np.pi)
return np.array([np.sin(((2 * np.pi * freq * a) / Fs) + ph_rad) for a in range(Fs)])
sine = sine_wave(100)
mean = np.array([np.mean(sine)] * len... |
irockafe/revo_healthcare | notebooks/Effects_of_retention_time_on_classification/mz_rt_grids.ipynb | mit | import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.colors as colors
import numpy as np
%matplotlib inline
"""
Explanation: <h2>Goal:</h2>
Write functions to subdivide an m/z : rt space into rt bins. See how this affects classification performance
End of explanation
"""
# Get ... |
turi-code/tutorials | strata-sj-2016/deep-learning/image_similarity.ipynb | apache-2.0 | ## Creating the SFrame with our path to the directory where it is saved.
image_sf = gl.SFrame(path_to_dir +
'sf_processed.sframe'
)
image_sf
image_sf.show() #Explore the data using Canvas visual explorer
pretrained_model = gl.load_model(path_to_dir +
... |
machinelearningnanodegree/stanford-cs231 | assignments/assignment2/ConvolutionalNetworks.ipynb | mit | # As usual, a bit of setup
import numpy as np
import matplotlib.pyplot as plt
from cs231n.classifiers.cnn import *
from cs231n.data_utils import get_CIFAR10_data
from cs231n.gradient_check import eval_numerical_gradient_array, eval_numerical_gradient
from cs231n.layers import *
from cs231n.fast_layers import *
from cs... |
shngli/Data-Mining-Python | Mining massive datasets/recommendation systems.ipynb | gpl-3.0 | %matplotlib inline
import numpy as np
from scipy import spatial
import pickle
"""
Explanation: Recommendation Systems
In this question you will apply these methods to a real dataset. The data contains information about TV shows. More precisely, for 9985 users and 563 popular TV shows, we know if a given user watched a... |
GoogleCloudPlatform/vertex-ai-samples | notebooks/community/gapic/custom/showcase_custom_tabular_regression_batch.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 batch prediction
<table... |
geoneill12/phys202-2015-work | assignments/assignment04/MatplotlibEx02.ipynb | mit | import math
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
"""
Explanation: Matplotlib Exercise 2
Imports
End of explanation
"""
!head -n 30 open_exoplanet_catalogue.txt
"""
Explanation: Exoplanet properties
Over the past few decades, astronomers have discovered thousands of extrasolar planet... |
VectorBlox/PYNQ | Pynq-Z1/notebooks/examples/tracebuffer_spi.ipynb | bsd-3-clause | from pprint import pprint
from time import sleep
from pynq import PL
from pynq import Overlay
from pynq.drivers import Trace_Buffer
from pynq.iop import Pmod_OLED
from pynq.iop import PMODA
from pynq.iop import PMODB
from pynq.iop import ARDUINO
ol = Overlay("base.bit")
ol.download()
"""
Explanation: Trace Buffer - T... |
scientific-visualization-2016/ClassMaterials | Week-02/03_intro_matplotlib.ipynb | cc0-1.0 | #inline to use with notebook (from pylab import *)
%pylab inline
"""
Explanation: <img src='https://www.rc.colorado.edu/sites/all/themes/research/logo.png'>
Introduction to Data Visualization with matplotlib
Thomas Hauser
<img src='https://s3.amazonaws.com/research_computing_tutorials/mpl-overview.png'>
Objectives
... |
INGEOTEC/CursoCategorizacionTexto | 02_representacion_vectorial_de_texto.ipynb | apache-2.0 | from microtc.textmodel import norm_chars
text = "Autoridades de la Ciudad de México aclaran que el equipo del cineasta mexicano no fue asaltado, pero sí una riña ahhh."
"""
Explanation: Aprendizaje computacional en grandes volúmenes de texto
Mario Graff (mgraffg@ieee.org, mario.graff@infotec.mx)
Sabino Miranda (sabin... |
kubeflow/examples | house-prices-kaggle-competition/house-prices-orig.ipynb | apache-2.0 |
import os
import warnings
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from IPython.display import display
from pandas.api.types import CategoricalDtype
from category_encoders import MEstimateEncoder
from sklearn.cluster import KMeans
from skle... |
suriyan/ethnicolr | ethnicolr/examples/ethnicolr_app_contrib20xx.ipynb | mit | import pandas as pd
df = pd.read_csv('/opt/names/fec_contrib/contribDB_2000.csv', nrows=100)
df.columns
from ethnicolr import census_ln, pred_census_ln
"""
Explanation: Application: 2000/2010 Political Campaign Contributions by Race
Using ethnicolr, we look to answer three basic questions:
<ol>
<li>What proportion o... |
jason-neal/eniric | docs/Notebooks/Split_verse_Weighted_masking.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
from eniric.atmosphere import Atmosphere
from eniric.legacy import mask_clumping, RVprec_calc_masked
from scripts.phoenix_precision import convolve_and_resample
from eniric.snr_normalization import snr_constant_band
from eniric.precision import pixel_weights, rv_preci... |
miaecle/deepchem | examples/tutorials/07_Uncertainty_In_Deep_Learning.ipynb | mit | %tensorflow_version 1.x
!curl -Lo deepchem_installer.py https://raw.githubusercontent.com/deepchem/deepchem/master/scripts/colab_install.py
import deepchem_installer
%time deepchem_installer.install(version='2.3.0')
"""
Explanation: Tutorial Part 7: Uncertainty in Deep Learning
A common criticism of deep learning mode... |
eshlykov/mipt-day-after-day | labs/term-4/lab-1-1.ipynb | unlicense | import numpy as np
import scipy as ps
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Работа 1.1. Определение скорости полета пули при помощи баллистического маятника
Цель работы: определить скорость полёта пули, применяя законы сохранения и используя баллистический маятник; поз... |
tuanavu/coursera-university-of-washington | machine_learning/1_machine_learning_foundations/assignment/week6/Deep Features for Image Classification.ipynb | mit | import graphlab
"""
Explanation: Using deep features to build an image classifier
Fire up GraphLab Create
End of explanation
"""
image_train = graphlab.SFrame('image_train_data/')
image_test = graphlab.SFrame('image_test_data/')
"""
Explanation: Load a common image analysis dataset
We will use a popular benchmark d... |
JuBra/cobrapy | documentation_builder/qp.ipynb | lgpl-2.1 | %matplotlib inline
import plot_helper
plot_helper.plot_qp1()
"""
Explanation: Quadratic Programming
Suppose we want to minimize the Euclidean distance of the solution to the origin while subject to linear constraints. This will require a quadratic objective function. Consider this example problem:
min $\frac{1}{2}\l... |
tensorflow/docs-l10n | site/ja/agents/tutorials/2_environments_tutorial.ipynb | apache-2.0 | #@title Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under... |
Soil-Carbon-Coalition/atlasdata | Combining rows w groupby, transform, or multiIndex.ipynb | mit | %matplotlib inline
import sys
import numpy as np
import pandas as pd
import json
import matplotlib.pyplot as plt
from io import StringIO
print(sys.version)
print("Pandas:", pd.__version__)
df = pd.read_csv('C:/Users/Peter/Documents/atlas/atlasdata/obs_types/transect.csv', parse_dates=['date'])
df = df.astype(dtype='st... |
dataplumber/nexus | esip-workshop/student-material/workshop1/3 - Python Basics.ipynb | apache-2.0 | 1+2
1+1
1+2
"""
Explanation: Tutorial Brief
This tutorial is an introduction to Python 3. This should give you the set of pythonic skills that you will need to proceed with this tutorial series.
If you don't have the Jupyter installed, shame on you. No just kidding you can follow this tutorial using an online jupyter... |
ICL-SML/Doubly-Stochastic-DGP | demos/demo_mnist.ipynb | apache-2.0 | import matplotlib.pyplot as plt
%matplotlib inline
import numpy as np
import tensorflow as tf
from gpflow.likelihoods import MultiClass
from gpflow.kernels import RBF, White
from gpflow.models.svgp import SVGP
from gpflow.training import AdamOptimizer
from scipy.stats import mode
from scipy.cluster.vq import kmeans2... |
mathias-gibson/ps239t-final-project | 01_collect-data.ipynb | mit | # Import required libraries
import requests
import urllib
import json
from __future__ import division
import math
import time
"""
Explanation: To collect my data I used get requests to retrieve information from two ProPublica APIs in .json format, and exported the data into two separate .csv files.
End of explanation
... |
khalido/nd101 | siraj math for deep learning.ipynb | gpl-3.0 | X = np.array([[0,0,1],
[0,1,1],
[1,0,1],
[1,1,1]])
Y = np.array([[0],
[1],
[1],
[0]])
X
Y
"""
Explanation: Step 1: Collect Data
End of explanation
"""
num_epochs = 60000
#initialize weights
syn0 = 2*np.random.random((3,4)) - ... |
tensorflow/docs-l10n | site/ja/guide/keras/save_and_serialize.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... |
QuantScientist/Deep-Learning-Boot-Camp | day03/additional materials/1.1.1 Perceptron and Adaline.ipynb | mit | # Display plots in notebook
%matplotlib inline
# Define plot's default figure size
import matplotlib
"""
Explanation: (exceprt from Python Machine Learning Essentials, Supplementary Materials)
Sections
Implementing a perceptron learning algorithm in Python
Training a perceptron model on the Iris dataset
Adaptive l... |
rubensfernando/mba-analytics-big-data | Python/2016-07-22/aula2-parte1-funcoes.ipynb | mit | def maximo(x, y):
if x > y:
z = x
else:
z = y
"""
Explanation: Funções
Até agora, vimos diversos tipos de dados, atribuições, comparações e estruturas de controle.
A ideia da função é dividir para conquistar, onde:
Um problema é dividido em diversos subproblemas
As soluções dos subproblemas sã... |
lily-tian/fanfictionstatistics | jupyter_notebooks/.ipynb_checkpoints/story_analysis-checkpoint.ipynb | mit | # examines state of stories
state = df['state'].value_counts()
# plots chart
(state/np.sum(state)).plot.bar()
plt.xticks(rotation=0)
plt.show()
"""
Explanation: Story Analysis
In this section, we take a sample of ~5000 stories from fanfiction.net and break down some of their characteristics.
Activity and volume
Let's... |
google/jax-md | notebooks/implicit_differentiation.ipynb | apache-2.0 | #@title Import & Util
!pip install -q git+https://www.github.com/google/jax-md
!pip install -q jaxopt
import jax
import jax.numpy as jnp
from jax.config import config
config.update("jax_enable_x64", True)
from jax import random, jit, lax
from jax_md import space, energy, minimize, quantity
from jaxopt.implicit_dif... |
leriomaggio/python-in-a-notebook | 05 While Loops and User input.ipynb | mit | # Set an initial condition.
game_active = True
# Set up the while loop.
while game_active:
# Run the game.
# At some point, the game ends and game_active will be set to False.
# When that happens, the loop will stop executing.
# Do anything else you want done after the loop runs.
"""
Explanation: L... |
mne-tools/mne-tools.github.io | 0.19/_downloads/69a53f341b5a9d09407d309924aa4d14/plot_source_power_spectrum.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.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: ===============================... |
jpn--/larch | book/user-guide/data-fundamentals.ipynb | gpl-3.0 | import numpy as np
import pandas as pd
import xarray as xr
import sharrow as sh
import larch.numba as lx
"""
Explanation: (data-fundamentals)=
Data for Discrete Choice
End of explanation
"""
data_co = pd.read_csv("example-data/tiny_idco.csv", index_col="caseid")
data_co
"""
Explanation: Fundamental Data Formats
Wh... |
Cyb3rWard0g/ThreatHunter-Playbook | docs/notebooks/windows/03_persistence/WIN-190810170510.ipynb | gpl-3.0 | from openhunt.mordorutils import *
spark = get_spark()
"""
Explanation: WMI Eventing
Metadata
| | |
|:------------------|:---|
| collaborators | ['@Cyb3rWard0g', '@Cyb3rPandaH'] |
| creation date | 2019/08/10 |
| modification date | 2020/09/20 |
| playbook related | [] |
Hypothesis
Advers... |
Luke035/dlnd-lessons | into-to-tflearn/TFLearn_Sentiment_Analysis_Solution.ipynb | mit | import pandas as pd
import numpy as np
import tensorflow as tf
import tflearn
from tflearn.data_utils import to_categorical
"""
Explanation: Sentiment analysis with TFLearn
In this notebook, we'll continue Andrew Trask's work by building a network for sentiment analysis on the movie review data. Instead of a network w... |
GoogleCloudPlatform/training-data-analyst | blogs/rl-on-gcp/DQN_Breakout/RL_on_GCP.ipynb | apache-2.0 | %%bash
# Install packages to test model locally.
apt-get update
apt-get install -y python-numpy python-dev cmake zlib1g-dev libjpeg-dev xvfb libav-tools xorg-dev python-opengl libboost-all-dev libsdl2-dev swig libffi-dev
pip install gym
pip install gym[atari]
pip install opencv-python
apt update && apt install -y libs... |
opesci/devito | examples/userapi/05_conditional_dimension.ipynb | mit | from devito import Dimension, Function, Grid
import numpy as np
# We define a 10x10 grid, dimensions are x, y
shape = (10, 10)
grid = Grid(shape = shape)
x, y = grid.dimensions
# Define function 𝑓. We will initialize f's data with ones on its diagonal.
f = Function(name='f', grid=grid)
f.data[:] = np.eye(10)
f.data... |
ES-DOC/esdoc-jupyterhub | notebooks/inm/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', 'inm', 'sandbox-1', 'seaice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Seaice
MIP Era: CMIP6
Institute: INM
Source ID: SANDBOX-1
Topic: Seaice
Sub-Topics: Dynamics, Thermodynamics, Radiat... |
karlnapf/shogun | doc/ipython-notebooks/evaluation/xval_modelselection.ipynb | bsd-3-clause | %pylab inline
%matplotlib inline
# include all Shogun classes
import os
SHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data')
from shogun import *
import shogun as sg
# 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((... |
jss367/assemble | exploratory_notebooks/comm_detect/parse_py.ipynb | mit | import gensim
import os
import numpy as np
import itertools
import json
import re
import pymoji
import importlib
from nltk.tokenize import TweetTokenizer
from gensim import corpora
import string
from nltk.corpus import stopwords
from six import iteritems
import csv
tokenizer = TweetTokenizer()
def keep_retweets(tweet... |
rahulremanan/python_tutorial | NLP/04-Character_embedding/src/04_Char_embedding.ipynb | mit | from __future__ import print_function
from keras.models import Model
from keras.layers import Dense, Activation, Embedding
from keras.layers import LSTM, Input
from keras.layers.merge import concatenate
from keras.optimizers import RMSprop, Adam
from keras.utils.data_utils import get_file
from keras.layers.normalizatio... |
turbomanage/training-data-analyst | blogs/bigquery_datascience/bigquery_tensorflow.ipynb | apache-2.0 | %%bash
# create output dataset
bq mk advdata
%%bigquery
CREATE OR REPLACE MODEL advdata.ulb_fraud_detection
TRANSFORM(
* EXCEPT(Amount),
SAFE.LOG(Amount) AS log_amount
)
OPTIONS(
INPUT_LABEL_COLS=['class'],
AUTO_CLASS_WEIGHTS = TRUE,
DATA_SPLIT_METHOD='seq',
DATA_SPLIT_COL='Time',
MODEL_TY... |
landlab/landlab | notebooks/tutorials/hillslope_geomorphology/transport-length_hillslope_diffuser/TLHDiff_tutorial.ipynb | mit | import numpy as np
from matplotlib.pyplot import figure, plot, show, title, xlabel, ylabel
from landlab import RasterModelGrid
from landlab.components import FlowDirectorSteepest, TransportLengthHillslopeDiffuser
from landlab.plot import imshow_grid
# to plot figures in the notebook:
%matplotlib inline
"""
Explanati... |
lucasb-eyer/BiternionNet | Experiments - Tosato.ipynb | mit | import numpy as np
import pickle, gzip
from ipywidgets import IntProgress
from IPython.display import display
%matplotlib inline
# Font which got unicode math stuff.
import matplotlib as mpl
mpl.rcParams['font.family'] = 'DejaVu Sans'
# Much more readable plots
import matplotlib.pyplot as plt
plt.style.use('ggplot')... |
Vvkmnn/books | AutomateTheBoringStuffWithPython/lesson38.ipynb | gpl-3.0 | import webbrowser
webbrowser.open('https://automatetheboringstuff.com')
"""
Explanation: Lesson 38:
The Webbrowser Module
The webbrowser module has tools to manage a webbrowser from Python.
webbrowser.open() opens a new browser window at a url:
End of explanation
"""
import webbrowser, sys, pyperclip
sys.argv # Pa... |
Olsthoorn/TransientGroundwaterFlow | Syllabus_in_notebooks/Sec5_5_5_two_sides_equal_sudden_change.ipynb | gpl-3.0 | import numpy as np
import matplotlib.pyplot as plt
import scipy.special as sp
"""
Explanation: Section 5.5.5
Superposition in space and time with the erfc function
IHE, Delft, 2010-01-06
@T.N.Olsthoorn
Two sides of strip of land with equal sudden change of surface-water stage on both sides.
See page 63 of the syllabus... |
opengeostat/pygslib | pygslib/Ipython_templates/.ipynb_checkpoints/qqplt_html-checkpoint.ipynb | mit | #general imports
import pygslib
"""
Explanation: PyGSLIB
QQ and PP plots
End of explanation
"""
#get the data in gslib format into a pandas Dataframe
cluster= pygslib.gslib.read_gslib_file('../datasets/cluster.dat')
true= pygslib.gslib.read_gslib_file('../datasets/true.dat')
true['Declustering Weight'] = 1
... |
mdenker/elephant | doc/tutorials/statistics.ipynb | bsd-3-clause | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
from quantities import ms, s, Hz
from elephant.spike_train_generation import homogeneous_poisson_process, homogeneous_gamma_process
help(homogeneous_poisson_process)
"""
Explanation: Statistics
The executed version of this tutorial is at https://e... |
quoniammm/happy-machine-learning | Udacity-ML/boston_housing-master_2/boston_housing.ipynb | mit | # Import libraries necessary for this project
# 载入此项目所需要的库
import numpy as np
import pandas as pd
import visuals as vs # Supplementary code
from sklearn.model_selection import ShuffleSplit
# Pretty display for notebooks
# 让结果在notebook中显示
%matplotlib inline
# Load the Boston housing dataset
# 载入波士顿房屋的数据集
data = pd.rea... |
molgor/spystats | notebooks/.ipynb_checkpoints/model_by_chunks-checkpoint.ipynb | bsd-2-clause | # Load Biospytial modules and etc.
%matplotlib inline
import sys
sys.path.append('/apps')
import django
django.setup()
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
## Use the ggplot style
plt.style.use('ggplot')
from external_plugins.spystats import tools
%run ../testvariogram.py
section.sha... |
metpy/MetPy | v0.10/_downloads/8b48dbfbd7332023b4aeb5274ed5d62e/Point_Interpolation.ipynb | bsd-3-clause | import cartopy.crs as ccrs
import cartopy.feature as cfeature
from matplotlib.colors import BoundaryNorm
import matplotlib.pyplot as plt
import numpy as np
from metpy.cbook import get_test_data
from metpy.interpolate import (interpolate_to_grid, remove_nan_observations,
remove_repeat_coo... |
Bihaqo/t3f | docs/tutorials/riemannian.ipynb | mit | # Import TF 2.
%tensorflow_version 2.x
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
# Fix seed so that the results are reproducable.
tf.random.set_seed(0)
np.random.seed(0)
try:
import t3f
except ImportError:
# Install T3F if it's not already installed.
!git clone https://git... |
GoogleCloudPlatform/practical-ml-vision-book | 06_preprocessing/06h_tftransform.ipynb | apache-2.0 | import tensorflow as tf
print(tf.version.VERSION)
device_name = tf.test.gpu_device_name()
if device_name != '/device:GPU:0':
raise SystemError('GPU device not found')
print('Found GPU at: {}'.format(device_name))
"""
Explanation: Avoid training-serving skew using TensorFlow Transform
In this notebook, we show how to... |
linkmax91/bitquant | web/home/ipython/examples/r.ipynb | apache-2.0 | %pylab inline
"""
Explanation: Rmagic Functions Extension
End of explanation
"""
%load_ext rpy2.ipython
"""
Explanation: Line magics
IPython has an rmagic extension that contains a some magic functions for working with R via rpy2. This extension can be loaded using the %load_ext magic as follows:
End of explanatio... |
rsterbentz/phys202-2015-work | assignments/assignment04/MatplotlibEx01.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
"""
Explanation: Matplotlib Exercise 1
Imports
End of explanation
"""
import os
assert os.path.isfile('yearssn.dat')
"""
Explanation: Line plot of sunspot data
Download the .txt data for the "Yearly mean total sunspot number [1700 - now]" from th... |
aliojjati/aliojjati.github.io | Other_files/DEMO_tSZXlensing_stripped.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches
import astropy.io.fits
import healpy as hp
import scipy.special
import scipy.interpolate
import os
import collections
pi = np.pi
def create_tSZ_catalog(fields, y_map_file, y_map_mask_file, shear_path, pad, output_path, su... |
maojrs/riemann_book | Pressureless_flow.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from exact_solvers import shallow_water
from collections import namedtuple
from utils import riemann_tools
from ipywidgets import interact
from ipywidgets import widgets, Checkbox, IntSlider, FloatSlider
State = namedtuple('State', shallow_water.cons... |
jserenson/Python_Bootcamp | Sets and Booleans.ipynb | gpl-3.0 | x = set()
# We add to sets with the add() method
x.add(1)
#Show
x
"""
Explanation: Set and Booleans
There are two other object types in Python that we should quickly cover. Sets and Booleans.
Sets
Sets are an unordered collection of unique elements. We can construct them by using the set() function. Let's go ahead ... |
timothyb0912/pylogit | examples/notebooks/Mixed Logit Example--mlogit Benchmark--Electricity.ipynb | bsd-3-clause | from collections import OrderedDict # For recording the model specification
import pandas as pd # For file input/output
import numpy as np # For vectorized math operations
import pylogit as pl # For choice model estimation
"""
Explanation: The purpose of t... |
ES-DOC/esdoc-jupyterhub | notebooks/test-institute-3/cmip6/models/sandbox-2/ocean.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'test-institute-3', 'sandbox-2', 'ocean')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocean
MIP Era: CMIP6
Institute: TEST-INSTITUTE-3
Source ID: SANDBOX-2
Topic: Ocean
Sub-Topics: Timestepp... |
karthikrangarajan/intro-to-sklearn | 05.Unsupervised Learning.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
"""
Explanation: Learning Algorithms - Unsupervised Learning
Reminder: In machine learning, the problem of unsupervised learning is that of trying to find hidden structure in unlabeled data. Since the training set given to the learner is unlabeled... |
ericmjl/Network-Analysis-Made-Simple | archive/7-game-of-thrones-case-study-student.ipynb | mit | import pandas as pd
import networkx as nx
import matplotlib.pyplot as plt
import community
import numpy as np
import warnings
warnings.filterwarnings('ignore')
%matplotlib inline
"""
Explanation: Let's change gears and talk about Game of thrones or shall I say Network of Thrones.
It is suprising right? What is the re... |
Bio204-class/bio204-notebooks | 2016-04-20-MultipleRegression.ipynb | cc0-1.0 | # if we use %matplotlib notebook we get embedded plots
# we can interact with!
%matplotlib notebook
import numpy as np
import scipy.stats as stats
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sbn
"""
Explanation: Bio 204: Multiple Regression
End of explanation
"""
# generate example data
np... |
PythonFreeCourse/Notebooks | week06/3_Comprehensions.ipynb | mit | names = ['Yam', 'Gal', 'Orpaz', 'Aviram']
"""
Explanation: <img src="images/logo.jpg" style="display: block; margin-left: auto; margin-right: auto;" alt="לוגו של מיזם לימוד הפייתון. נחש מצויר בצבעי צהוב וכחול, הנע בין האותיות של שם הקורס: לומדים פייתון. הסלוגן המופיע מעל לשם הקורס הוא מיזם חינמי ללימוד תכנות בעברית.">... |
wehlutyk/brainscopypaste | notebooks/distance.ipynb | gpl-3.0 | SAVE_FIGURES = False
"""
Explanation: Distance travelled by substitutions
1 Setup
Flags and settings.
End of explanation
"""
from itertools import product
import pandas as pd
import seaborn as sb
import numpy as np
import networkx as nx
from nltk.corpus import wordnet as wn
from nltk.corpus import wordnet_ic as wn_... |
bw4sz/DeepMeerkat | training/Detection/object_detection/object_detection_tutorial.ipynb | gpl-3.0 | import numpy as np
import os
import six.moves.urllib as urllib
import sys
import tarfile
import tensorflow as tf
import zipfile
from collections import defaultdict
from io import StringIO
from matplotlib import pyplot as plt
from PIL import Image
"""
Explanation: Object Detection Demo
Welcome to the object detection ... |
rawrgulmuffins/presentation_notes | pycon2016/tutorials/computation_statistics/effect_size_soln.ipynb | mit | %matplotlib inline
from __future__ import print_function, division
import numpy
import scipy.stats
import matplotlib.pyplot as pyplot
from ipywidgets import interact, interactive, fixed
import ipywidgets as widgets
# seed the random number generator so we all get the same results
numpy.random.seed(17)
# some nice ... |
hglanz/phys202-2015-work | assignments/assignment10/ODEsEx02.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
from scipy.integrate import odeint
from IPython.html.widgets import interact, fixed
"""
Explanation: Ordinary Differential Equations Exercise 1
Imports
End of explanation
"""
def lorentz_derivs(yvec, t, sigma, rho, beta):
"""Compute the the de... |
mgalardini/2017_python_course | notebooks/[6a]-Exercises-solutions.ipynb | gpl-2.0 | from Bio import SeqIO
counter = 0
for seq in SeqIO.parse('../data/proteome.faa', 'fasta'):
counter += 1
counter
"""
Explanation: Useful third-party libraries: exercises
Biopython
Can you count the number of sequences in the data/proteome.faa file?
End of explanation
"""
%matplotlib inline
import matplotl... |
ernestyalumni/CompPhys | partiald_sympy.ipynb | apache-2.0 | import sympy
x, u = sympy.symbols('x u', real=True)
U = sympy.Function('U')(x,u)
U
"""
Explanation: Partial Derivatives in sympy
End of explanation
"""
x = sympy.Symbol('x',real=True)
y = sympy.Function('y')(x)
U = sympy.Function('U')(x,y)
X = sympy.Function('X')(x,y)
Y = sympy.Function('Y')(X)
sympy.pprint(sy... |
quantopian/research_public | notebooks/tutorials/2_pipeline_lesson3/notebook.ipynb | apache-2.0 | from quantopian.pipeline import Pipeline
from quantopian.research import run_pipeline
# New from the last lesson, import the USEquityPricing dataset.
from quantopian.pipeline.data.builtin import USEquityPricing
# New from the last lesson, import the built-in SimpleMovingAverage factor.
from quantopian.pipeline.factor... |
pxcandeias/py-notebooks | decades_octaves_fractions.ipynb | mit | # Ipython 'magic' commands
%matplotlib inline
# Python standard library
import sys
# 3rd party modules
import numpy as np
import scipy as sp
import matplotlib as mpl
import pandas as pd
import matplotlib.pyplot as plt
# Computational lab set up
print(sys.version)
for package in (np, sp, mpl, pd):
print('{:.<15}... |
quantumlib/Cirq | docs/interop.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... |
jungmannlab/picasso | samples/SampleNotebook2.ipynb | mit | from picasso import io
path = 'testdata_locs.hdf5'
locs, info = io.load_locs(path)
print('Loaded {} locs.'.format(len(locs)))
"""
Explanation: Sample Notebook 2 for Picasso
This notebook shows some basic interaction with the picasso library. It assumes to have a working picasso installation. To install jupyter notebo... |
eshlykov/mipt-day-after-day | ml/shlykov_596_task8.ipynb | unlicense | # additional packages for this notebook
! pip install faker tqdm babel
"""
Explanation: <h1 align="center">Organization Info</h1>
Дедлайн DD MM 2018 23:59 для всех групп.
В качестве решения задания нужно прислать ноутбук с подробными комментариями (<span style='color:red'> без присланного решения результат контеста... |
pfschus/fission_bicorrelation | methods/implement_sparse_matrix.ipynb | mit | import numpy as np
import scipy.io as sio
import os
import sys
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.colors
import inspect
from tqdm import tqdm
sys.path.append('../scripts/')
import bicorr as bicorr
%load_ext autoreload
%autoreload 2
"""
Explanation: Goal
My bicorr_hist_master matrix ... |
quantumlib/ReCirq | docs/qaoa/precomputed_analysis.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... |
nordam/PyPPT | Notebooks/Code examples for exam - optimized.ipynb | mit | def grid_of_particles(N, w):
# Create a grid of N evenly spaced particles
# covering a square patch of width and height w
# centered on the region 0 < x < 2, 0 < y < 1
x = np.linspace(1.0-w/2, 1.0+w/2, int(np.sqrt(N)))
y = np.linspace(0.5-w/2, 0.5+w/2, int(np.sqrt(N)))
x, y = np.meshgrid(x, y)... |
leopardbruce/FileFun | Course_2_Part_2_Lesson_3_Notebook.ipynb | mit | !wget --no-check-certificate \
https://storage.googleapis.com/laurencemoroney-blog.appspot.com/horse-or-human.zip \
-O /tmp/horse-or-human.zip
!wget --no-check-certificate \
https://storage.googleapis.com/laurencemoroney-blog.appspot.com/validation-horse-or-human.zip \
-O /tmp/validation-horse-or-human... |
folivetti/BIGDATA | Spark/.ipynb_checkpoints/Lab04-Resposta-checkpoint.ipynb | mit | import os
import numpy as np
def parseRDD(point):
""" Parser for the current dataset. It receives a data point and return
a sentence (third field).
Args:
point (str): input data point
Returns:
str: a string
"""
data = point.split('\t')
return (int(data[0]),data[2])
... |
aaronta/illinois | MachineLearning/scikit-learn/sklearn_overview.ipynb | bsd-3-clause | import numpy as np
import matplotlib.pylab as plt
%matplotlib inline
from sklearn.datasets import load_boston
boston = load_boston()
boston.keys()
print(boston.DESCR)
print(boston.feature_names)
print(boston.data.dtype)
print(boston.target.dtype)
train = boston.data
test = boston.target
"""
Explanation: Machin... |
emptymalei/emptymalei.github.io | _til/programming/assets/programming/python_list_comprehensions.ipynb | mit | list_with_for_loop = [x for x in range(10)]
print list_with_for_loop
"""
Explanation: Python List Comprehensions
Notes for the article Python List Comprehensions: Explained Visually by Trey Hunner
Making a List
Integrated with loops
End of explanation
"""
list_with_for_loop_conditional = [x for x in range(10) if x%2... |
tuanavu/coursera-university-of-washington | machine_learning/4_clustering_and_retrieval/lecture/week3/.ipynb_checkpoints/quiz-Decision Trees-checkpoint.ipynb | mit | import graphlab
graphlab.canvas.set_target('ipynb')
x = graphlab.SFrame({'x1':[1,0,1,0],'x2':['1','1','0','0'],'x3':['1','0','1','1'],'y':['1','-1','-1','1']})
x
features = ['x1','x2','x3']
target = 'y'
decision_tree_model = graphlab.decision_tree_classifier.create(x, validation_set=None,
... |
arnaldog12/Manual-Pratico-Deep-Learning | Neurônio Sigmoid.ipynb | mit | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.linear_model import LogisticRegression
from sklearn.preprocessing import MinMaxScaler
from sklearn.metrics import accuracy_score
from mpl_toolkits.mplot3d import Axes3D
%matplotlib inline
"""
Explanation: Sumário
Introdução
Função de ... |
sdpython/ensae_teaching_cs | _doc/notebooks/td1a_soft/td1a_unit_test_ci.ipynb | mit | from jyquickhelper import add_notebook_menu
add_notebook_menu()
from pyensae.graphhelper import draw_diagram
"""
Explanation: 1A.soft - Tests unitaires, setup et ingéniérie logicielle
On vérifie toujours qu'un code fonctionne quand on l'écrit mais cela ne veut pas dire qu'il continuera à fonctionner à l'avenir. La ro... |
BjornFJohansson/pydna-examples | notebooks/simple_examples/pGUP1.ipynb | bsd-3-clause | # NBVAL_SKIP
from IPython.display import IFrame
IFrame('https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1474799', width="100%", height=500)
"""
Explanation: Cloning by homologous recombination: construction of pGUP1
The construction of the vector pGUP1 was described in the publication below:
End of explanation
"""
from... |
terrydolan/lfcmanagers | lfcmanagers.ipynb | mit | import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import sys
import collections
from datetime import datetime
from __future__ import division
# enable inline plotting
%matplotlib inline
"""
Explanation: LFC Data Analysis: LFC Managers
See Terry's blog Being Liverpool Mana... |
jasontlam/snorkel | tutorials/workshop/Workshop_6_Advanced_Grid_Search.ipynb | apache-2.0 | %load_ext autoreload
%autoreload 2
%matplotlib inline
import os
import numpy as np
# Connect to the database backend and initalize a Snorkel session
from lib.init import *
"""
Explanation: <img align="left" src="imgs/logo.jpg" width="50px" style="margin-right:10px">
Snorkel Workshop: Extracting Spouse Relations <br> ... |
Hyperparticle/deep-learning-foundation | lessons/transfer-learning/Transfer_Learning_Solution.ipynb | mit | from urllib.request import urlretrieve
from os.path import isfile, isdir
from tqdm import tqdm
vgg_dir = 'tensorflow_vgg/'
# Make sure vgg exists
if not isdir(vgg_dir):
raise Exception("VGG directory doesn't exist!")
class DLProgress(tqdm):
last_block = 0
def hook(self, block_num=1, block_size=1, total_s... |
majtotim/portfolio | Post_1.ipynb | mit | from fuzzywuzzy import fuzz, StringMatcher
import difflib
import pandas as pd
### loading partially cleaned csvs containing place names and dictionary
kbbi = pd.read_csv("/Users/admin/Desktop/loanwords/clean.kbbi.csv")
places = pd.read_csv("/Users/admin/Desktop/loanwords/concat_places.csv")
kbbi.columns = ['old_index... |
tsarouch/data_science_references_python | clustering/A story of clustering bananas.ipynb | gpl-2.0 | %matplotlib inline
import matplotlib.pyplot as plt
# Lets assume our dealer lies and indeed bananas come from elsewhere
from sklearn.datasets.samples_generator import make_blobs
bananas_dimentions = \
[[10, 3], # long - thin
[5, 2], # short - thin
[7.5, 5]] # middle -thick
bananas_dimentions_std =... |
tensorflow/docs-l10n | site/en-snapshot/lattice/tutorials/shape_constraints.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... |
rdhyee/CommonCrawlTutorials | Experiments/IPython-notebook-docker/2014_08_Crawl.ipynb | apache-2.0 | def key_for_new_crawl(crawl_name, file_type='all', return_name=False, plural=True):
suffix = "s" if plural else ""
if file_type.upper() == 'WARC':
file_name = "warc.path{suffix}.gz".format(suffix=suffix)
elif file_type.upper() == 'WAT':
file_name = "wat.path{suffix}.gz".format(suff... |
srcole/qwm | burrito/.ipynb_checkpoints/Burrito_correlations-checkpoint.ipynb | mit | %config InlineBackend.figure_format = 'retina'
%matplotlib inline
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
sns.set_style("white")
"""
Explanation: San Diego Burrito Analytics: Correlations
Scott Cole
21 May 2016
This notebook investigates the cor... |
kimkipyo/dss_git_kkp | 통계, 머신러닝 복습/160607화_12일차_(확률론적)선형 회귀 분석 Linear Regression Analysis/4.분산 분석 기반의 카테고리 분석.ipynb | mit | from sklearn.preprocessing import OneHotEncoder
encoder = OneHotEncoder()
x0 = np.random.choice(3, 10)
x0
encoder.fit(x0[:, np.newaxis])
X = encoder.transform(x0[:, np.newaxis]).toarray()
X
dfX = pd.DataFrame(X, columns=encoder.active_features_)
dfX
"""
Explanation: 분산 분석 기반의 카테고리 분석
회귀 분석 대상이 되는 독립 변수가 카테고리 값을 가지는... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.