repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
1200wd/bitcoinlib
docs/bitcoinlib-10-minutes.ipynb
gpl-3.0
from bitcoinlib.keys import Key k = Key() k.info() """ Explanation: Learn BitcoinLib in 10 minutes A short walk through all the important BitcionLib classes: create keys, transactions and wallets using this library. You can run and experiment with the code examples if you have installed Jupyter Keys With the Key class...
milancurcic/lunch-bytes
Spring_2019/LB29/GettingData_XR.ipynb
cc0-1.0
import xarray as xr import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl import netCDF4 as nc from mpl_toolkits.basemap import Basemap """ Explanation: <a name="top"></a> <div style="width:1000 px"> <div style="float:right; width:98 px; height:98px;"> <img src="https://cdn.miami.edu/_assets-co...
yala/introdeeplearning
Lab2.ipynb
mit
import math import pickle as p import tensorflow as tf import numpy as np import utils import json """ Explanation: Lab Part II: RNN Sentiment Classifier In the previous lab, you built a tweet sentiment classifier with a simple feedforward neural network. Now we ask you to improve this model by representing it as a se...
jinntrance/MOOC
coursera/ml-foundations/week6/Deep Features for Image Classification.ipynb
cc0-1.0
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...
johnpfay/environ859
06_WebGIS/Notebooks/12-Exploring-the-BISON-API.ipynb
gpl-3.0
#First, import the wonderful requests module import requests #Now, we'll deconstruct the example URL into the service URL and parameters, saving the paramters as a dictionary url = 'http://bison.usgs.gov/api/search.json' params = {'species':'Bison bison', 'type':'scientific_name', 'start':'0', ...
samejack/blog-content
keras-ml/mnist-neural-network.ipynb
apache-2.0
from keras.datasets import mnist (train_images, train_labels), (test_images, test_labels) = mnist.load_data() """ Explanation: Python Keras MNIST 手寫辨識 這是一個神經網路的範例,利用了 Python Keras 來訓練一個手寫辨識分類 Model。 我們要的問題是將手寫數字的灰度圖像(28x28 Pixel)分類為 10 類(0至9)。使用的數據集是 MNIST 典數據集,它是由國家標準技術研究所(MNIST 的 NIST)在1980年代組裝而成的,包含 60,000 張訓練圖像和 ...
ethen8181/machine-learning
deep_learning/rnn/1_pytorch_rnn.ipynb
mit
# code for loading the format for the notebook import os # path : store the current path to convert back to it later path = os.getcwd() os.chdir(os.path.join('..', '..', 'notebook_format')) from formats import load_style load_style(css_style='custom2.css', plot_style=False) os.chdir(path) # 1. magic for inline plot...
ML4DS/ML4all
U1.KMeans/.ipynb_checkpoints/Python_intro-checkpoint.ipynb
mit
str1 = '"Hola" is how we say "hello" in Spanish.' str2 = "Strings can also be defined with quotes; try to be sistematic." """ Explanation: A brief tutorial of basic python From the wikipedia: "Python is a widely used general-purpose, high-level programming language. Its design philosophy emphasizes code readability, a...
sjchoi86/Tensorflow-101
notebooks/char_rnn_train_tutorial.ipynb
mit
# Now convert all text to index using vocab! corpus = np.array(list(map(vocab.get, data))) print ("Type of 'corpus' is %s, shape is %s, and length is %d" % (type(corpus), corpus.shape, len(corpus))) check_len = 10 print ("\n'corpus' looks like %s" % (corpus[0:check_len])) for i in range(check_len): _wordidx ...
tuchandra/sleep-analysis
spring-sleep-analysis.ipynb
mit
%matplotlib inline import matplotlib from matplotlib import pyplot as plt import numpy as np import pandas as pd import json import datetime import scipy.stats matplotlib.style.use('ggplot') plt.rcParams['figure.figsize'] = [12.0, 8.0] """ Explanation: Spring Sleep Analysis Studying springtime sleep habits though an...
elleros/spoofed-speech-detection
gmm_ml_synthetic_speech_detection.ipynb
mit
import os import time import numpy as np import pandas as pd from bob.bio.spear import preprocessor, extractor from bob.bio.gmm import algorithm from bob.io.base import HDF5File from bob.learn import em from sklearn.metrics import classification_report, roc_curve, roc_auc_score WAV_FOLDER = 'Wav/' #'ASV2015dataset/wav...
dblyon/PandasIntro
Exercises_part_A_with_Solutions.ipynb
mit
%%javascript $.getScript('misc/kmahelona_ipython_notebook_toc.js') """ Explanation: <h1 id="tocheading">Table of Contents</h1> <div id="toc"></div> End of explanation """ data = {'animal': ['cat', 'cat', 'snake', 'dog', 'dog', 'cat', 'snake', 'cat', 'dog', 'dog'], 'age': [2.5, 3, 0.5, np.nan, 5, 2, 4.5, np.n...
ktaneishi/deepchem
examples/notebooks/pong.ipynb
mit
import deepchem as dc import numpy as np class PongEnv(dc.rl.GymEnvironment): def __init__(self): super(PongEnv, self).__init__('Pong-v0') self._state_shape = (80, 80) @property def state(self): # Crop everything outside the play area, reduce the image size, # and convert it to black and white...
turbomanage/training-data-analyst
courses/machine_learning/deepdive/06_structured/1_explore.ipynb
apache-2.0
# change these to try this notebook out BUCKET = 'cloud-training-demos-ml' PROJECT = 'cloud-training-demos' REGION = 'us-central1' import os os.environ['BUCKET'] = BUCKET os.environ['PROJECT'] = PROJECT os.environ['REGION'] = REGION %%bash if ! gsutil ls | grep -q gs://${BUCKET}/; then gsutil mb -l ${REGION} gs://$...
keras-team/keras-io
examples/vision/ipynb/vivit.ipynb
apache-2.0
!pip install -qq medmnist """ Explanation: Video Vision Transformer Author: Aritra Roy Gosthipaty, Ayush Thakur (equal contribution)<br> Date created: 2022/01/12<br> Last modified: 2022/01/12<br> Description: A Transformer-based architecture for video classification. Introduction Videos are sequences of images. Let's...
oxy-cms/cms-tours
tours/2016-F_COMP-131_Li,J/RasPi-SimpleCV/DemoCV-orig-Copy0.ipynb
gpl-3.0
from SimpleCV import * from time import sleep #import pytesseract from bs4 import BeautifulSoup """ Explanation: The beginning of a demo End of explanation """ cam = Camera() """ Explanation: Here we set up the camera End of explanation """ img = cam.getImage() """ Explanation: Now we also get a single image fr...
GraysonR/titanic-data-analysis
2015-12-23-titanic-initial-exploration.ipynb
mit
# Import magic %matplotlib inline # More imports import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns # Set up Seaborn sns.set() # matplotlib defaults # Load and show CSV data titanic_data = pd.read_csv('titanic_data.csv') titanic_data.head() """ Explanation: Exploring Titani...
bharat-b7/NN_glimpse
2.2 CNN HandsOn - MNIST Dataset.ipynb
unlicense
import numpy as np import keras from keras.datasets import mnist import os os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" # see issue #152 os.environ["CUDA_VISIBLE_DEVICES"] = "" # Load the datasets (X_train, y_train), (X_test, y_test) = mnist.load_data() """ Explanation: CNN HandsOn with Keras Problem Definition ...
ernestyalumni/CompPhys
Cpp/Integrate.ipynb
apache-2.0
from itertools import combinations import sympy from sympy import Function, integrate, Product, Sum, Symbol, symbols from sympy.abc import a,b,h,i,k,m,n,x from sympy import Rational as Rat def lagrange_basis_polys(N,x,xpts=None): """ lagrange_basis_polynomials(N,x,xpts) returns the Lagrange basis polynomi...
AnasFullStack/Awesome-Full-Stack-Web-Developer
algorithms/algorithm_analyisis.ipynb
mit
import time def sumOfN(n): start = time.time() theSum = 0 for i in range(1,n+1): theSum = theSum + i end = time.time() return theSum,end-start for i in range(5): print("Sum is %d required %10.7f seconds"%sumOfN(1000000)) """ Explanation: 2. Algorithm Analysis Book URL 2.2. What Is Algo...
tensorflow/docs-l10n
site/en-snapshot/io/tutorials/prometheus.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...
dvirsamuel/MachineLearningCourses
Visual Recognision - Stanford/assignment2/BatchNormalization.ipynb
gpl-3.0
# As usual, a bit of setup 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.solver import Solver %matplotlib inline ...
tensorflow/cloud
g3doc/tutorials/hp_tuning_cifar10_using_google_cloud.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...
LSSTC-DSFP/LSSTC-DSFP-Sessions
Sessions/Session05/Day4/stackdiff_Narayan/01_Registration/Register_images_exercise.ipynb
mit
!ls *fits """ Explanation: Image Registration Exercise Written by Gautham Narayan (gnarayan@stsci.edu) for LSST DSFP #5 In this directory, you should be able to find two fits file from one of the projects I worked on End of explanation """ import astropy.io.fits as afits from astropy.wcs import WCS from astropy.visu...
gilmana/Cu_transition_time_course-
data_explore_failed_clstr_mthds/Data_exploring_post_clustering_failure.ipynb
mit
%matplotlib inline df2_TPM_values = df2_TPM.loc[:,"5GB1_FM40_T0m_TR2":"5GB1_FM40_T180m_TR1"] df2_TPM_values df2_TPM_values.describe() df2_TPM.idxmax? index = df2_TPM_values.sort("5GB1_FM40_T0m_TR2", ascending = False).index.tolist() top_expressed = df2_TPM.loc[index].iloc[:20,:] top_expressed.to_csv("top_expressed....
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive/03_tensorflow/labs/b_estimator.ipynb
apache-2.0
!sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst # Ensure the right version of Tensorflow is installed. !pip freeze | grep tensorflow==2.6 import tensorflow as tf import pandas as pd import numpy as np import shutil print(tf.__version__) """ Explanation: <h1>2b. Machine Learning using tf.estimator...
tbarrongh/cosc-learning-labs
src/notebook/Interface.ipynb
apache-2.0
import learning_lab """ Explanation: Learning Lab: Interface This Learning Lab explores the network interfaces of a network device. Pre-requisite Learning Lab: Inventory |Keyword|Definition| |--|--| |Network Interface|Connector from one network device to a network interface on one or more other network devices.| |Netw...
statsmodels/statsmodels.github.io
v0.12.2/examples/notebooks/generated/distributed_estimation.ipynb
bsd-3-clause
import numpy as np from scipy.stats.distributions import norm from statsmodels.base.distributed_estimation import DistributedModel def _exog_gen(exog, partitions): """partitions exog data""" n_exog = exog.shape[0] n_part = np.ceil(n_exog / partitions) ii = 0 while ii < n_exog: jj = int(mi...
GoogleCloudPlatform/mlops-with-vertex-ai
06-model-deployment.ipynb
apache-2.0
import os import logging logging.getLogger().setLevel(logging.INFO) """ Explanation: 06 - Model Deployment The purpose of this notebook is to execute a CI/CD routine to test and deploy the trained model to Vertex AI as an Endpoint for online prediction serving. The notebook covers the following steps: 1. Run the test...
dschick/udkm1Dsim
docs/source/examples/m3tm.ipynb
mit
import udkm1Dsim as ud u = ud.u # import the pint unit registry from udkm1Dsim import scipy.constants as constants import numpy as np import matplotlib.pyplot as plt %matplotlib inline u.setup_matplotlib() # use matplotlib with pint units """ Explanation: Microscopic 3-Temperature-Model Here we adapt the NTM from th...
macks22/gensim
docs/notebooks/ldaseqmodel.ipynb
lgpl-2.1
# setting up our imports from gensim.models import ldaseqmodel from gensim.corpora import Dictionary, bleicorpus import numpy from gensim.matutils import hellinger """ Explanation: Dynamic Topic Models Tutorial What is this tutorial about? This tutorial will exaplin what Dynamic Topic Models are, and how to use them ...
philippgrafendorfe/stackedautoencoders
MNIST_Autoencoder.ipynb
mit
from keras.layers import Input, Dense, Dropout from keras.models import Model from keras.datasets import mnist from keras.models import Sequential, load_model from keras.optimizers import RMSprop from keras.callbacks import TensorBoard from __future__ import print_function from IPython.display import SVG, Image from ke...
tclaudioe/Scientific-Computing
SC1v2/02_floating_point_arithmetic.ipynb
bsd-3-clause
import numpy as np import matplotlib.pyplot as plt %matplotlib inline """ Explanation: <center> <img src="http://sct.inf.utfsm.cl/wp-content/uploads/2020/04/logo_di.png" style="width:60%"> <h1> INF-285 - Computación Científica </h1> <h2> Floating Point Arithmetic </h2> <h2> <a href="#acknowledgements">...
harpolea/pyro2
multigrid/variable_coeff_elliptic.ipynb
bsd-3-clause
%pylab inline from sympy import init_session init_session() alpha = 2.0 + cos(2*pi*x)*cos(2*pi*y) phi = sin(2*pi*x)*sin(2*pi*y) """ Explanation: Variable Coefficient Poisson Derive the form of a test variable-coefficient elliptic equation with periodic boundary conditions for testing the variable-coefficient multig...
tensorflow/docs-l10n
site/ja/tensorboard/tensorboard_projector_plugin.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...
scikit-optimize/scikit-optimize.github.io
0.8/notebooks/auto_examples/hyperparameter-optimization.ipynb
bsd-3-clause
print(__doc__) import numpy as np """ Explanation: Tuning a scikit-learn estimator with skopt Gilles Louppe, July 2016 Katie Malone, August 2016 Reformatted by Holger Nahrstaedt 2020 .. currentmodule:: skopt If you are looking for a :obj:sklearn.model_selection.GridSearchCV replacement checkout sphx_glr_auto_examples_...
ysh329/Homework
CS100.1x Introduction to Big Data with Apache Spark/lab2_apache_log_student.ipynb
mit
from pyspark.sql import Row Person = Row("name", "age") print Person ali = Person("Alice", 11) print ali help(Row) import re import datetime from pyspark.sql import Row month_map = {'Jan': 1, 'Feb': 2, 'Mar':3, 'Apr':4, 'May':5, 'Jun':6, 'Jul':7, 'Aug':8, 'Sep': 9, 'Oct':10, 'Nov': 11, 'Dec': 12} def parse_ap...
f-guitart/data_mining
notes/97 - Approaximate String Matching.ipynb
gpl-3.0
import pandas as pd names = pd.DataFrame({"name" : ["Alice","Bob","Charlie","Dennis"], "surname" : ["Doe","Smith","Sheen","Quaid"]}) names names.name.str.match("A\w+") debts = pd.DataFrame({"debtor":["D.Quaid","C.Sheen"], "amount":[100,10000]}) debts """ Explanation: String...
liganega/Gongsu-DataSci
ref_materials/exams/2017/A01/finalexam_20171215.ipynb
gpl-3.0
a = np.arange(6) + np.arange(0, 51, 10)[:, np.newaxis] a """ Explanation: 2017년 2학기 공학수학 기말고사 이름 : 학번 : 시험에서 사용하는 모듈 임포트 하기 import __future__ import division, print_function import numpy as np import pandas as pd from datetime import datetime as dt 넘파이 어레이 인덱싱과 슬라이싱 아래 코드로 생성된 어레이를 이용하는 문제이다. End of explanation """ ...
tensorflow/docs-l10n
site/ko/probability/examples/Gaussian_Process_Regression_In_TFP.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License"); { display-mode: "form" } # 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, sof...
buguen/pylayers
pylayers/notebooks/Simultraj_and_CorSer.ipynb
lgpl-3.0
m for k,lk in enumerate(llinks): print k,lk """ Explanation: Set links Simulation has an object network which contains a links dictionnary. This dictionnary has wireless standard as key, and list of links with their type as value. End of explanation """ link={'ieee802154':[]} link['ieee802154'].append(S.N.links[...
shuaiyuancn/commercial-science-taster
notebooks/00 Ta-feng dataset.ipynb
apache-2.0
import os import pandas as pd import numpy as np import scipy as sp import matplotlib.pyplot as plt import seaborn %matplotlib inline font = {'family' : 'monospace', 'weight' : 'bold', 'size' : 14} plt.rc('font', **font) plt.rc('figure', figsize=(18, 6)) os.chdir('../datasets/ta-feng/') """ Exp...
shareactorIO/pipeline
source.ml/jupyterhub.ml/notebooks/zz_old/TensorFlow/Fundamentals/Basic-ConvolutionNeuralNetworks-ImageProcessing.ipynb
apache-2.0
# TODO: @Sam, please fill this in... import tensorflow as tf import numpy as np from IPython.display import clear_output, Image, display, HTML # Note: All datasets are available here: /root/pipeline/datasets/... # Modules required for file download and extraction import os import sys import tarfile from six.moves...
VVard0g/ThreatHunter-Playbook
docs/notebooks/windows/02_execution/WIN-190813181020.ipynb
mit
from openhunt.mordorutils import * spark = get_spark() """ Explanation: Service Creation Metadata | Metadata | Value | |:------------------|:---| | collaborators | ['@Cyb3rWard0g', '@Cyb3rPandaH'] | | creation date | 2019/08/13 | | modification date | 2020/09/20 | | playbook related | [] | Hypothes...
patrick-kidger/diffrax
examples/continuous_normalising_flow.ipynb
apache-2.0
import math import os import pathlib import time from typing import List, Tuple import diffrax import equinox as eqx # https://github.com/patrick-kidger/equinox import imageio import jax import jax.lax as lax import jax.nn as jnn import jax.numpy as jnp import jax.random as jrandom import matplotlib.pyplot as plt imp...
ajayrfhp/dvd
examples/MNIST.ipynb
mit
import tensorflow as tf import numpy as np import matplotlib.pyplot as plt from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets('MNIST_data', one_hot=False) img = mnist.train.images[123] img = np.reshape(img,(28,28)) plt.imshow(img, cmap = 'gray') plt.show() img = np.reshape...
JasonSanchez/w261
week3/MIDS-W261-HW-03-Sanchez.ipynb
mit
%%writefile ComplaintDistribution.py from mrjob.job import MRJob class ComplaintDistribution(MRJob): def mapper(self, _, lines): line = lines[:30] if "Debt collection" in line: self.increment_counter('Complaint', 'Debt collection', 1) elif "Mortgage" in line: self.in...
googledatalab/notebooks
samples/ML Toolbox/Regression/Census/4 Service Evaluate.ipynb
apache-2.0
import google.datalab as datalab import google.datalab.ml as ml import mltoolbox.regression.dnn as regression import os """ Explanation: Evaluating a Model with Dataflow and BigQuery This notebook is the third in the set of steps to run machine learning on the cloud. In this step, we will use the model training in the...
AntArch/Presentations_Github
20150916_OGC_Reuse_under_licence/20150916_OGC_Reuse_under_licence.ipynb
cc0-1.0
from IPython.display import YouTubeVideo YouTubeVideo('F4rFuIb1Ie4') ## PDF output using pandoc import os ### Export this notebook as markdown commandLineSyntax = 'ipython nbconvert --to markdown 20150916_OGC_Reuse_under_licence.ipynb' print (commandLineSyntax) os.system(commandLineSyntax) ### Export this noteboo...
egentry/dwarf_photo-z
dwarfz/data/get_training_galaxy_images.ipynb
mit
# give access to importing dwarfz import os, sys dwarfz_package_dir = os.getcwd().split("dwarfz")[0] if dwarfz_package_dir not in sys.path: sys.path.insert(0, dwarfz_package_dir) import dwarfz # back to regular import statements %matplotlib inline from matplotlib import pyplot as plt import seaborn as sns s...
danielfather7/teach_Python
SEDS_Hw/seds-hw4-coding-and-testing-big-league-danielfather7/SEDS-HW4.ipynb
gpl-3.0
import knn import pandas as pd test = pd.read_csv('testing.csv') data = pd.read_csv('atomsradii.csv') test data """ Explanation: K-NN Classifier Import packages and data: End of explanation """ """ def dist(vec1,vec2): #Use scipy package to calculate Euclidean distance. from scipy.spatial import distance ...
mfouesneau/pyphot
examples/QuickStart.ipynb
mit
%matplotlib inline import pylab as plt import numpy as np import sys sys.path.append('../') import pyphot """ Explanation: pyphot - A tool for computing photometry from spectra Some examples are provided in this notebook Full documentation available at http://mfouesneau.github.io/docs/pyphot/ End of explanation """ ...
karlstroetmann/Artificial-Intelligence
Python/4 Automatic Theorem Proving/Parser.ipynb
gpl-2.0
import ply.lex as lex tokens = [ 'NUMBER', 'VAR', 'FCT', 'BACKSLASH' ] """ Explanation: A Simple Parser for Term Rewriting This file implements a parser for terms and equations. It uses the parser generator Ply. To install Ply, change the cell below into a code cell and execute it. If the package ply is already in...
jenshnielsen/HJCFIT
exploration/OpenMP_example.ipynb
gpl-3.0
import os os.environ['OMP_NUM_THREADS'] = '4' """ Explanation: OpenMP example In this example we illustrate how OpenMP can be used to speedup the calculation of the likelihood. First we set the number of openmp threads. This is done via an environmental variable called OMP_NUM_THREADS. In this example we set the value...
manipopopo/tensorflow
tensorflow/contrib/eager/python/examples/generative_examples/text_generation.ipynb
apache-2.0
!pip install unidecode """ Explanation: Copyright 2018 The TensorFlow Authors. Licensed under the Apache License, Version 2.0 (the "License"). Text Generation using a RNN <table class="tfo-notebook-buttons" align="left"><td> <a target="_blank" href="https://colab.research.google.com/github/tensorflow/tensorflow/blob/...
jmfranck/pyspecdata
docs/_downloads/871a80cfd7a71c1edf9cefede4305190/matrix_mult.ipynb
bsd-3-clause
# -*- coding: utf-8 -*- from pylab import * from pyspecdata import * from numpy.random import random import time init_logging('debug') """ Explanation: Matrix Multiplication Various ways of implementing different matrix multiplications. Read the documentation embedded in the code. End of explanation """ a_nd = nddat...
computational-class/cjc2016
code/sympy.ipynb
mit
sy.integrate(6*x**5, x) sy.integrate(x**3, (x, 0, 10)) #定积分 sy.integrate(6*x**5+y, x,y) #双重不定积分 sy.integrate(x**3+y, (x, -1, 1),(y,1,3) ) #双重定积分 """ Explanation: 表达式变换 sy.exp(sy.I*x).expand(complex=True) # 展开为复数, 可理解为将x当作复数处理 表达式展开 sy.cos(x).series(x, 0, 10) # .series(var, point, orde...
ageron/tensorflow-safari-course
01_basics_phases_ex1.ipynb
apache-2.0
from __future__ import absolute_import, division, print_function, unicode_literals """ Explanation: Try not to peek at the solutions when you go through the exercises. ;-) First let's make sure this notebook works well in both Python 2 and Python 3: End of explanation """ import tensorflow as tf tf.__version__ """ ...
omaraltaher/kaggle-pizza-project
Random_Acts_of_Pizza_Kaggle_Competition_Project.ipynb
mit
# This tells matplotlib not to try opening a new window for each plot. %matplotlib inline import warnings warnings.filterwarnings('ignore') # General libraries. import json import re import pandas as pd import numpy as np import matplotlib.pyplot as plt import datetime # SK-learn libraries for learning. from sklearn....
h-mayorquin/time_series_basic
presentations/2016-01-25(Wall-Street-Letters-Visualizations-Of-The-Spatio-Temporal-Clusters).ipynb
bsd-3-clause
import numpy as np import h5py import matplotlib.pyplot as plt %matplotlib inline # Now nexa modules| import sys sys.path.append("../") from visualization.sensor_clustering import visualize_clusters_text_to_image """ Explanation: Visualization of the Spatiotemporal clusters. Here we present a visualization of how th...
Soil-Carbon-Coalition/atlasdata
Challenge observations -- cleanup and classification.ipynb
mit
# The preamble import pandas as pd #pd.set_option('mode.sim_interactive', True) import matplotlib.pyplot as plt %matplotlib inline import numpy as np #from collections import OrderedDict import json, csv import re df """ Explanation: This notebook is about classifying Challenge data according to type, and some clean...
tensorflow/docs-l10n
site/en-snapshot/tfx/tutorials/tfx/template.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...
astroumd/GradMap
notebooks/Lectures2021/Lecture1/GradMap_L1_Student.ipynb
gpl-3.0
## You can use Python as a calculator: 5*7 #This is a comment and does not affect your code. #You can have as many as you want. #Comments help explain your code to others and yourself. #No worries. 5+7 5-7 5/7 """ Explanation: Introduction to "Doing Science" in Python for REAL Beginners Python is one of many lan...
google/earthengine-community
tutorials/sentinel-2-s2cloudless/index.ipynb
apache-2.0
import ee # Trigger the authentication flow. ee.Authenticate() # Initialize the library. ee.Initialize() """ Explanation: Sentinel-2 Cloud Masking with s2cloudless Author: jdbcode This tutorial is an introduction to masking clouds and cloud shadows in Sentinel-2 (S2) surface reflectance (SR) data using Earth Engine....
kgrodzicki/machine-learning-specialization
course-3-classification/module-4-linear-classifier-regularization-assignment-blank.ipynb
mit
from __future__ import division import graphlab """ Explanation: Logistic Regression with L2 regularization The goal of this second notebook is to implement your own logistic regression classifier with L2 regularization. You will do the following: Extract features from Amazon product reviews. Convert an SFrame into a...
ethen8181/machine-learning
python/algorithms/basic_data_structure.ipynb
mit
from jupyterthemes import get_themes from jupyterthemes.stylefx import set_nb_theme themes = get_themes() set_nb_theme(themes[1]) %load_ext watermark %watermark -a 'Ethen' -d -t -v -p jupyterthemes """ Explanation: <h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span...
WNoxchi/Kaukasos
FADL1/L3CA2_rossmann-Copy1.ipynb
mit
%matplotlib inline %reload_ext autoreload %autoreload 2 # from fastai.imports import * # from fastai.torch_imports import * from fastai.structured import * # non-PyTorch specfc Machine-Learning tools; indep lib # from fastai.dataset import * # lets us do fastai PyTorch stuff w/ structured columnar data from fastai.col...
atavory/ibex
examples/in_prog/movielens_simple_row_aggregating_features_with_stacking.ipynb
bsd-3-clause
from sklearn import datasets print(datasets.load_boston()['DESCR']) import os from sklearn import base from scipy import stats import pandas as pd import seaborn as sns sns.set_style('whitegrid') sns.despine() import ibex from ibex.sklearn import model_selection as pd_model_selection from ibex.sklearn import linear...
kylepjohnson/notebooks
skflow/tensorflow, misc.ipynb
mit
import tensorflow.contrib.learn as skflow from sklearn.datasets import load_iris from sklearn import metrics iris = load_iris() iris.keys() iris.feature_names iris.target_names # Withhold 3 for testing test_idx = [0, 50, 100] train_data = np.delete(iris.data, test_idx, axis=0) train_target = np.delete(iris.target...
tensorflow/probability
tensorflow_probability/examples/jupyter_notebooks/STS_approximate_inference_for_models_with_non_Gaussian_observations.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License"); { display-mode: "form" } # 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, sof...
BadWizard/intro_programming
notebooks/classes.ipynb
mit
class Rocket(): # Rocket simulates a rocket ship for a game, # or a physics simulation. def __init__(self): # Each rocket has an (x,y) position. self.x = 0 self.y = 0 """ Explanation: Classes So far you have learned about Python's core data types: strings, numbers, lists, tupl...
emiliom/stuff
DRB_vizer_json_services.ipynb
cc0-1.0
import json import requests import pandas as pd import seaborn as sns import matplotlib.pyplot as plt %matplotlib inline import datetime import time import calendar import pytz #from matplotlib.dates import date2num, num2date utc_tz = pytz.utc def epochsec_to_dt(epochsec): """ Return the datetime object for epoc...
strandbygaard/deep-learning
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...
turbomanage/training-data-analyst
courses/fast-and-lean-data-science/06_MNIST_Estimator_to_TPUEstimator.ipynb
apache-2.0
import os, re, math, json, shutil, pprint, datetime import PIL.Image, PIL.ImageFont, PIL.ImageDraw # "pip3 install Pillow" or "pip install Pillow" if needed import numpy as np import tensorflow as tf from matplotlib import pyplot as plt from tensorflow.python.platform import tf_logging print("Tensorflow version " + tf...
joseerlang/PySpark_docker
notebook/Contador de palabras.ipynb
apache-2.0
fileName='book.txt' """ Explanation: Leer texto Lo primero que tenemos que hacer es cargar el texto. Para nuestro ejemplo, cargaremos una obra del proyecto Gutenberg. End of explanation """ import re def removePunctuation(text): return re.sub('[^a-z| |0-9]', '', text.strip().lower()) """ Explanation: Ahora vam...
thomasantony/CarND-Projects
Exercises/Term1/TensorFlow-L2/lab.ipynb
mit
import hashlib import os import pickle from urllib.request import urlretrieve import numpy as np from PIL import Image from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelBinarizer from sklearn.utils import resample from tqdm import tqdm from zipfile import ZipFile print('All m...
gregunz/ada2017
01 - Pandas and Data Wrangling/Homework 1.ipynb
mit
# all imports here import pandas as pd import seaborn as sns import numpy as np import matplotlib.pyplot as plt import os import glob import re import math import calendar import datetime import random from calendar import monthrange from sklearn import datasets, linear_model, ensemble from sklearn.model_selection i...
mne-tools/mne-tools.github.io
dev/_downloads/7119b87595b4873e173edd147fee099b/dics_source_power.ipynb
bsd-3-clause
# Author: Marijn van Vliet <w.m.vanvliet@gmail.com> # Roman Goj <roman.goj@gmail.com> # Denis Engemann <denis.engemann@gmail.com> # Stefan Appelhoff <stefan.appelhoff@mailbox.org> # # License: BSD-3-Clause import os.path as op import numpy as np import mne from mne.datasets import somato from ...
StingraySoftware/notebooks
Transfer Functions/Data Preparation.ipynb
mit
from PIL import Image im = Image.open('2d.png') width, height = im.size """ Explanation: Setting Up Data We use Image module from Python Imaging library to digitize 2-d plot from Uttley et al. (2014) End of explanation """ intensity = np.array([[1 for j in range(width)] for i in range(height)]) """ Explanation: In...
hcorona/recsys-101-workshop
notebooks/notebook-2-toy-example.ipynb
mit
import os os.chdir('..') # Import all the packages we need to generate recommendations import numpy as np import pandas as pd import src.utils as utils import src.recommenders as recommenders import src.similarity as similarity # Enable logging on Jupyter notebook import logging logger = logging.getLogger() logger.se...
TheMitchWorksPro/DataTech_Playground
PY_Basics/TMWP_PY_Recursion_Factorial_Example.ipynb
mit
# some may find this code more readable ... single line solutions to the function are provided immediately below it. import sys n = int(input()) def factorial(n): if n <= 1: return n else: return n*factorial(n-1) factorial(n) # this cell explores creating a function that solves the problem with...
ganguli-lab/twpca
notebooks/demo-crossval.ipynb
mit
from twpca.datasets import jittered_population from scipy.ndimage import gaussian_filter1d rates, spikes = jittered_population() smooth_std = 1.0 data = gaussian_filter1d(spikes, smooth_std, axis=1) fig, axes = plt.subplots(1, 3, sharex=True, sharey=True, figsize=(9,3)) for ax, trial in zip(axes, data): ax.imshow(...
fancompute/ceviche
examples/simulate_splitter_fdtd.ipynb
mit
def reshape_arr(arr, Nx, Ny): return arr.reshape((Nx, Ny, 1)) eps_r = np.load('data/eps_r_splitter4.npy') eps_wg = np.load('data/eps_waveguide.npy') plt.imshow(eps_r.T, cmap='gist_earth_r') plt.show() Nx, Ny = eps_r.shape J_in = np.load('data/J_in.npy') J_outs = np.load('data/J_list.npy') J_wg = np.flipud(J_in.c...
statsmaths/stat665
lectures/lec18/notebook18.ipynb
gpl-2.0
%pylab inline import copy import numpy as np import pandas as pd import matplotlib.pyplot as plt from keras.datasets import mnist, cifar10 from keras.models import Sequential, Graph from keras.layers.core import Dense, Dropout, Activation, Flatten, Reshape from keras.optimizers import SGD, RMSprop from keras.utils i...
mne-tools/mne-tools.github.io
0.24/_downloads/f398f296c84e53a14339d2c3c36e91a4/movement_detection.ipynb
bsd-3-clause
# Authors: Adonay Nunes <adonay.s.nunes@gmail.com> # Luke Bloy <luke.bloy@gmail.com> # License: BSD-3-Clause import os.path as op import mne from mne.datasets.brainstorm import bst_auditory from mne.io import read_raw_ctf from mne.preprocessing import annotate_movement, compute_average_dev_head_t # Load dat...
davidgutierrez/HeartRatePatterns
Jupyter/LoadDataMimic-II.ipynb
gpl-3.0
import sys sys.version_info """ Explanation: Cargue de datos s SciDB 1) Verificar Prerequisitos Python SciDB-Py requires Python 2.6-2.7 or 3.3 End of explanation """ import numpy as np np.__version__ """ Explanation: NumPy tested with version 1.9 (1.13.1) End of explanation """ import requests requests.__version_...
jonathansick/androcmd
notebooks/Brick 23 IR V2.ipynb
mit
%matplotlib inline %config InlineBackend.figure_format='retina' # %config InlineBackend.figure_format='svg' import os import time from glob import glob import numpy as np brick = 23 STARFISH = os.getenv("STARFISH") isoc_dir = "b23ir2_isoc" lib_dir = "b23ir2_lib" synth_dir = "b23ir2_synth" fit_dir = "b23ir2_fit" wfc3_...
random-forests/tensorflow-workshop
archive/zurich/01_tensorflow_warmup.ipynb
apache-2.0
import numpy as np import tensorflow as tf """ Explanation: TensorFlow warmup This is a notebook to get you started with TensorFlow. End of explanation """ # This is for graph visualization. from IPython.display import clear_output, Image, display, HTML def strip_consts(graph_def, max_const_size=32): """Strip ...
DiXiT-eu/collatex-tutorial
unit8/unit8-collatex-and-XML/Read files.ipynb
gpl-3.0
import os os.listdir('partonopeus') """ Explanation: Loading and parsing XML files from the file system Our XML files are in a subdirectory called 'partonopeus'. We load the os library and use its listdir() method to verify the contents of that directory. End of explanation """ inputFiles = {} for inputFile in os.li...
lionell/laboratories
eco_systems/dima4.ipynb
mit
from scipy.integrate import ode birth_rate = 128 death_rate = 90 intraspecific_competition = 2 ps = [birth_rate, death_rate, intraspecific_competition] def f(t, N, ps): return ps[0] * (N ** 2) / (N + 1) - ps[1] * N - ps[2] * (N ** 2) def solve(N0, t0=0, t1=1, h=0.05): r = ode(f).set_integrator('dopri5') ...
jeffzhengye/pylearn
tensorflow_learning/tf2/notebooks/transfer_learning-中文-checkpoint.ipynb
unlicense
import numpy as np import tensorflow as tf from tensorflow import keras """ Explanation: 迁移学习与微调,Transfer learning & fine-tuning Author: fchollet<br> Date created: 2020/04/15<br> Last modified: 2020/05/12<br> Description: Complete guide to transfer learning & fine-tuning in Keras. <br> 翻译: 叶正 设置,Setup End of explanati...
turbomanage/training-data-analyst
courses/machine_learning/deepdive/09_sequence/labs/sinewaves.ipynb
apache-2.0
# You must update BUCKET, PROJECT, and REGION to proceed with the lab BUCKET = 'cloud-training-demos-ml' PROJECT = 'cloud-training-demos' REGION = 'us-central1' SEQ_LEN = 50 import os os.environ['BUCKET'] = BUCKET os.environ['PROJECT'] = PROJECT os.environ['REGION'] = REGION os.environ['SEQ_LEN'] = str(SEQ_LEN) os.env...
KJE2001/seminars
02_linear_algebra.ipynb
mit
import numpy as np a = np.array([1, 2, 3]) # Create a rank 1 array print(type(a)) # Prints "<type 'numpy.ndarray'>" print(a.shape) # Prints "(3,)" """ Explanation: <figure> <IMG SRC="gfx/Logo_norsk_pos.png" WIDTH=100 ALIGN="right"> </figure> Linear algebra crash course Roberto Di Remigio, Luc...
rafburzy/Statistics
05_hypothesis_testing.ipynb
mit
# importing required modules import pandas as pd import seaborn as sns import matplotlib.pyplot as plt %matplotlib inline import numpy as np # runing the functions script %run stats_func.py # loading the iris dataset df = pd.read_csv('iris.csv') df.head() # for further analysis sepal length and sepal width will be u...
ShubhamDebnath/Coursera-Machine-Learning
Course 5/Neural machine translation with attention v4.ipynb
mit
from keras.layers import Bidirectional, Concatenate, Permute, Dot, Input, LSTM, Multiply from keras.layers import RepeatVector, Dense, Activation, Lambda from keras.optimizers import Adam from keras.utils import to_categorical from keras.models import load_model, Model import keras.backend as K import numpy as np from...
learn1do1/learn1do1.github.io
python_notebooks/Watershed Problem.ipynb
mit
heights = [[1,2,3,4],[1,2,1,0],[1,0,1,0],[0,0,1,4]] class position(): def __init__(self, coordinates, height): self.coordinates = coordinates self.height = height def __repr__(self): return ','.join([str(self.coordinates), str(self.height)]) """ Explanation: Watershed Problem ...
qutip/qutip-notebooks
examples/smesolve-jc-photocurrent.ipynb
lgpl-3.0
%matplotlib inline import matplotlib.pyplot as plt import numpy as np import qutip.settings from qutip import * from qutip.ipynbtools import HTMLProgressBar from matplotlib import rcParams rcParams['font.family'] = 'STIXGeneral' rcParams['mathtext.fontset'] = 'stix' rcParams['font.size'] = '14' N = 15 w0 = 1.0 * 2...
hawkdidy/Southwest_Report
Exploring_Domestic_Flights.ipynb
mit
df_flights_2008 = pd.read_csv('/home/hakim/Documents/Airline_delays-/flight_data_historical/2008.csv') print(df_flights_2008.tail()) df_flights_2008.shape df_flights_2008.isnull().sum(axis=0) """ Explanation: This notebook will be describing an analysis of US domestic flight data. We will first take a dive into a s...
srcole/qwm
misc/Power spectra of nonstationary rhythms.ipynb
mit
import numpy as np import neurodsp %matplotlib inline import matplotlib.pyplot as plt np.random.seed(0) """ Explanation: It was once claimed Alpha rhythms have nonzero power only at an alpha-band frequency and its higher harmonics However, this assumes the alpha rhythm is stationary, which is often not true in neur...
vpoggi/catalogue_toolkit
notebooks/Homogenisation.ipynb
agpl-3.0
parser = ISFReader("inputs/isc_test_catalogue_isf.txt", selected_origin_agencies=["ISC", "GCMT", "HRVD", "NEIC", "EHB", "BJI"], selected_magnitude_agencies=["ISC", "GCMT", "HRVD", "NEIC", "BJI"]) catalogue = parser.read_file("ISC_DB1", "ISC Global M >= 5") print "Catalogue contains...