repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
ES-DOC/esdoc-jupyterhub
notebooks/ncc/cmip6/models/noresm2-mm/seaice.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'ncc', 'noresm2-mm', 'seaice') """ Explanation: ES-DOC CMIP6 Model Properties - Seaice MIP Era: CMIP6 Institute: NCC Source ID: NORESM2-MM Topic: Seaice Sub-Topics: Dynamics, Thermodynamics, Radi...
xpharry/Udacity-DLFoudation
tutorials/sentiment_network/.ipynb_checkpoints/Sentiment Classification - Project 1 Solution-checkpoint.ipynb
mit
def pretty_print_review_and_label(i): print(labels[i] + "\t:\t" + reviews[i][:80] + "...") g = open('reviews.txt','r') # What we know! reviews = list(map(lambda x:x[:-1],g.readlines())) g.close() g = open('labels.txt','r') # What we WANT to know! labels = list(map(lambda x:x[:-1].upper(),g.readlines())) g.close()...
quietcoolwu/python-playground
notebooks/Module_Inspect.ipynb
mit
#coding: UTF-8 import sys # 模块,sys指向这个模块对象 def foo(): pass # 函数,foo指向这个函数对象 class Cat(object): # 类,Cat指向这个类对象 def __init__(self, name='kitty'): self.name = name def sayHi(self): # 实例方法,sayHi指向这个方法对象,使用类或实例.sayHi访问 print self.name, 'says Hi!' # 访问名为name的字段,使用实例.name访问 cat = Cat() # cat是Cat类...
gururajl/deep-learning
language-translation/dlnd_language_translation.ipynb
mit
""" DON'T MODIFY ANYTHING IN THIS CELL """ import helper import problem_unittests as tests source_path = 'data/small_vocab_en' target_path = 'data/small_vocab_fr' source_text = helper.load_data(source_path) target_text = helper.load_data(target_path) len(source_text) """ Explanation: Language Translation In this pro...
AllenDowney/ThinkStats2
code/chap13ex.ipynb
gpl-3.0
from os.path import basename, exists def download(url): filename = basename(url) if not exists(filename): from urllib.request import urlretrieve local, _ = urlretrieve(url, filename) print("Downloaded " + local) download("https://github.com/AllenDowney/ThinkStats2/raw/master/code/th...
antoniomezzacapo/qiskit-tutorial
qiskit/ignis/relaxation_and_decoherence.ipynb
apache-2.0
import qiskit as qk import numpy as np from scipy.optimize import curve_fit from qiskit.tools.qcvv.fitters import exp_fit_fun, osc_fit_fun, plot_coherence from qiskit.wrapper.jupyter import * # Load saved IBMQ accounts qk.IBMQ.load_accounts() # backend and token settings backend = qk.IBMQ.get_backend('ibmq_16_melbour...
GoogleCloudPlatform/mlops-with-vertex-ai
07-prediction-serving.ipynb
apache-2.0
import os from datetime import datetime import tensorflow as tf from google.cloud import aiplatform as vertex_ai """ Explanation: 07 - Prediction Serving The purpose of the notebook is to show how to use the deployed model for online and batch prediction. The notebook covers the following tasks: 1. Test the endpoints...
IS-ENES-Data/submission_forms
test/Templates/DKRZ_CDP_submission_form.ipynb
apache-2.0
from dkrz_forms import form_widgets form_widgets.show_status('form-submission') """ Explanation: Generic DKRZ CMIP Data Pool (CDP) ingest form This form is intended to request data to be made locally available in the DKRZ national data archive. If the requested data is available via ESGF please use the specific ESGF r...
abhishekraok/GraphMap
notebook/Getting_Started.ipynb
apache-2.0
%pylab inline import sys import os sys.path.insert(0,'..') import graphmap """ Explanation: GraphMap Getting Started This notebook shows how to get started using GraphMap End of explanation """ from graphmap.graphmap_main import GraphMap from graphmap.memory_persistence import MemoryPersistence G = GraphMap(MemoryPe...
pfschus/fission_bicorrelation
methods/build_det_df_angles_pairs.ipynb
mit
%%javascript $.getScript('https://kmahelona.github.io/ipython_notebook_goodies/ipython_notebook_toc.js') """ Explanation: <h1 id="tocheading">Table of Contents</h1> <div id="toc"></div> End of explanation """ %%html <img src="fig/setup.png",width=80%,height=80%> """ Explanation: Chi-Nu Array Detector Angles Author:...
transcranial/keras-js
notebooks/layers/convolutional/UpSampling3D.ipynb
mit
data_in_shape = (2, 2, 2, 3) L = UpSampling3D(size=(2, 2, 2), data_format='channels_last') layer_0 = Input(shape=data_in_shape) layer_1 = L(layer_0) model = Model(inputs=layer_0, outputs=layer_1) # set weights to random (use seed for reproducibility) np.random.seed(260) data_in = 2 * np.random.random(data_in_shape) -...
gkvoelkl/python-sonic
python-sonic.ipynb
mit
from psonic import * """ Explanation: python-sonic - Programming Music with Python, Sonic Pi or Supercollider Python-Sonic is a simple Python interface for Sonic Pi, which is a real great music software created by Sam Aaron (http://sonic-pi.net). At the moment Python-Sonic works with Sonic Pi. It is planned, that it ...
sarvex/PythonMachineLearning
Chapter 2/EstimatorCV Objects.ipynb
isc
from sklearn.datasets import load_iris from sklearn.cross_validation import train_test_split iris = load_iris() X_train, X_test, y_train, y_test = train_test_split(iris.data, iris.target, random_state=0) from sklearn.feature_selection import RFE from sklearn.linear_model import LogisticRegression feature_elimination...
pycomlink/pycomlink
notebooks/Blackout gap detection examples.ipynb
bsd-3-clause
import matplotlib.pyplot as plt import numpy as np import pycomlink as pycml import xarray as xr from tqdm import tqdm import urllib.request import io import pycomlink.processing.blackout_gap_detection as blackout_detection # Do show xarray.Dataset representation as text because gitlab/github # do not (yet) render the...
vzg100/Post-Translational-Modification-Prediction
.ipynb_checkpoints/Phosphorylation Chemical Tests - MLP-checkpoint.ipynb
mit
from pred import Predictor from pred import sequence_vector from pred import chemical_vector """ Explanation: Template for test End of explanation """ par = ["pass", "ADASYN", "SMOTEENN", "random_under_sample", "ncl", "near_miss"] for i in par: print("y", i) y = Predictor() y.load_data(file="Data/Trainin...
privong/pythonclub
sessions/01-introduction/Software I.ipynb
gpl-3.0
import numpy as np x = np.array([1, 5, 3, 4, 2]) x """ Explanation: Software I : Anaconda, AstroPy, and libraries We will make extensive use of Python and various associated libraries and so the first thing we need to ensure is that we all have a common setup and are using the same software. The Python distribution th...
PyDataMadrid2016/Conference-Info
talks_materials/20160410_1215_Whoosh_a_fast_pure_Python_search_engine_library/whooshNotebook.ipynb
mit
from IPython.display import Image Image(filename='files/screenshot.png') from IPython.display import Image Image(filename='files/whoosh.jpg') """ Explanation: Whoosh: a fast pure-Python search engine library Pydata Madrid 2016.04.10 Who am I? Claudia Guirao Fernández @claudiaguirao Background: Double degree in L...
vzg100/Post-Translational-Modification-Prediction
.ipynb_checkpoints/Phosphorylation Sequence Tests -MLP -dbptm+ELM-checkpoint.ipynb
mit
from pred import Predictor from pred import sequence_vector from pred import chemical_vector """ Explanation: Template for test End of explanation """ par = ["pass", "ADASYN", "SMOTEENN", "random_under_sample", "ncl", "near_miss"] for i in par: print("y", i) y = Predictor() y.load_data(file="Data/Trainin...
roatienza/Deep-Learning-Experiments
versions/2020/cnn/code/cnn-functional.ipynb
mit
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import tensorflow from tensorflow.keras.layers import Dense, Dropout, Input from tensorflow.keras.layers import Conv2D, MaxPooling2D, Flatten from tensorflow.keras.models import Model from te...
newsapps/public-notebooks
Monthly homicides and shootings report.ipynb
mit
import os import requests def get_table_data(table_name): url = '%stable/json/%s' % (os.environ['NEWSROOMDB_URL'], table_name) try: r = requests.get(url) return r.json() except: print 'doh' return get_table_data(table_name) homicides = get_table_data('homicides') shootings ...
lfsimoes/beam_paco__gtoc5
usage_demos.ipynb
mit
# https://esa.github.io/pykep/ # https://github.com/esa/pykep # https://pypi.python.org/pypi/pykep/ import PyKEP as pk import numpy as np from tqdm import tqdm, trange import matplotlib.pylab as plt %matplotlib inline import seaborn as sns plt.rcParams['figure.figsize'] = 10, 8 from gtoc5 import * from gtoc5.multio...
PollyP/CAPE-ratios
notebooks/Using CAPE ratios to make investment decisions.ipynb
mit
%matplotlib inline import IPython.html.widgets as widgets import IPython.display as display import matplotlib.pyplot as plt import matplotlib.pylab as pylab import pandas as pd pd.set_option('display.float_format', lambda x: '%.4f' % x) pylab.rcParams['figure.figsize'] = 14, 8 pd.set_option('display.width', 400) # lo...
phoebe-project/phoebe2-docs
2.3/tutorials/nelder_mead.ipynb
gpl-3.0
#!pip install -I "phoebe>=2.3,<2.4" import phoebe from phoebe import u # units import numpy as np logger = phoebe.logger('error') """ Explanation: Advanced: Nelder-Mead Optimizer Setup Let's first make sure we have the latest version of PHOEBE 2.3 installed (uncomment this line if running in an online notebook sessi...
wcmckee/signinlca
.ipynb_checkpoints/pggNumAdd-checkpoint.ipynb
mit
#for ronum in ranumlis: # print ronum randict = dict() othgues = [] othlow = 0 othhigh = 9 for ranez in range(10): randxz = random.randint(othlow, othhigh) othgues.append(randxz) othlow = (othlow + 10) othhigh = (othhigh + 10) #print othgues tenlis = ['zero', 'ten', 'twenty', 'thirty',...
AndysDeepAbstractions/deep-learning
image-classification/dlnd_image_classification.ipynb
mit
""" DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE """ from urllib.request import urlretrieve from os.path import isfile, isdir from tqdm import tqdm import problem_unittests as tests import tarfile cifar10_dataset_folder_path = 'cifar-10-batches-py' # Use Floyd's cifar-10 dataset if present floyd_cifar10...
highb/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...
mne-tools/mne-tools.github.io
0.24/_downloads/548b4fc45f1ed79527138879cd79d3c8/muscle_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 matplotlib.pyplot as plt import numpy as np from mne.datasets.brainstorm import bst_auditory from mne.io import read_raw_ctf from mne.preprocessing import annotate_muscle_zs...
vinutah/UGAN
02_code/Warmup To GANs.ipynb
mit
import numpy as np a = np.zeros((2,2)) a a.shape np.reshape(a, (1,4)) b = np.ones((2,2)) b np.sum(b, axis=1) """ Explanation: Thinking Axes for ML-Packages Model Specification or Writing a configuration file Choice of Grammer JSON Caffe Google DistBelief CNTK Programmatic generation Writing Code Choi...
ampl/amplpy
notebooks/gspread.ipynb
bsd-3-clause
from google.colab import auth auth.authenticate_user() """ Explanation: AMPLPY: Using Google Sheets Documentation: http://amplpy.readthedocs.io GitHub Repository: https://github.com/ampl/amplpy PyPI Repository: https://pypi.python.org/pypi/amplpy Jupyter Notebooks: https://github.com/ampl/amplpy/tree/master/notebooks...
mne-tools/mne-tools.github.io
0.20/_downloads/aa221dc65413caee3ba4b18802f88d21/plot_topo_compare_conditions.ipynb
bsd-3-clause
# Authors: Denis Engemann <denis.engemann@gmail.com> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # License: BSD (3-clause) import matplotlib.pyplot as plt import mne from mne.viz import plot_evoked_topo from mne.datasets import sample print(__doc__) data_path = sample.data_path() """ Explanation:...
JustinShenk/genre-melodies
create_dataset.ipynb
mit
import os import shutil import spotipy import pickle import pandas as pd import numpy as np %matplotlib notebook import matplotlib.pyplot as plt import seaborn as sns from sklearn.manifold import TSNE from sklearn.decomposition import PCA from collections import Counter if not os.path.exists('clean_midi'): # Dow...
SJSlavin/phys202-2015-work
assignments/assignment05/InteractEx02.ipynb
mit
%matplotlib inline from matplotlib import pyplot as plt import numpy as np from IPython.html.widgets import interact, interactive, fixed from IPython.display import display """ Explanation: Interact Exercise 2 Imports End of explanation """ # YOUR CODE HERE def plot_sin1(a, b): x = np.linspace(0, 4*np.pi, 200) ...
tensorflow/docs-l10n
site/ja/guide/migrate.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...
lalonica/PhD
vehicles/VehiclesTimeCycles-sample.ipynb
gpl-3.0
%matplotlib inline from pandas import Series, DataFrame import pandas as pd from itertools import * import itertools import numpy as np import csv import math import matplotlib.pyplot as plt from matplotlib import pylab from scipy.signal import hilbert, chirp import scipy import networkx as nx """ Explanation: Loadin...
econ-ark/HARK
examples/HowWeSolveIndShockConsumerType/HowWeSolveIndShockConsumerType.ipynb
apache-2.0
from HARK.ConsumptionSaving.ConsIndShockModel import IndShockConsumerType, init_lifecycle import numpy as np import matplotlib.pyplot as plt LifecycleExample = IndShockConsumerType(**init_lifecycle) LifecycleExample.cycles = 1 # Make this consumer live a sequence of periods exactly once LifecycleExample.solve() """ Ex...
ES-DOC/esdoc-jupyterhub
notebooks/pcmdi/cmip6/models/pcmdi-test-1-0/seaice.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'pcmdi', 'pcmdi-test-1-0', 'seaice') """ Explanation: ES-DOC CMIP6 Model Properties - Seaice MIP Era: CMIP6 Institute: PCMDI Source ID: PCMDI-TEST-1-0 Topic: Seaice Sub-Topics: Dynamics, Thermody...
amkatrutsa/MIPT-Opt
Spring2022/hb_acc_grad.ipynb
mit
import liboptpy.base_optimizer as base import numpy as np import liboptpy.unconstr_solvers.fo as fo import liboptpy.step_size as ss import matplotlib.pyplot as plt %matplotlib inline plt.rc("text", usetex=True) class HeavyBall(base.LineSearchOptimizer): def __init__(self, f, grad, step_size, beta, **kwargs): ...
mne-tools/mne-tools.github.io
0.20/_downloads/eea7e38645d4176f944e2f8d02a34fde/plot_run_ica.ipynb
bsd-3-clause
# Authors: Denis Engemann <denis.engemann@gmail.com> # # License: BSD (3-clause) import mne from mne.preprocessing import ICA, create_ecg_epochs from mne.datasets import sample print(__doc__) """ Explanation: Compute ICA components on epochs ICA is fit to MEG raw data. We assume that the non-stationary EOG artifacts...
phoebe-project/phoebe2-docs
2.2/tutorials/ecc.ipynb
gpl-3.0
!pip install -I "phoebe>=2.2,<2.3" """ Explanation: Eccentricity (Volume Conservation) Setup Let's first make sure we have the latest version of PHOEBE 2.2 installed. (You can comment out this line if you don't use pip for your installation or don't want to update to the latest release). End of explanation """ %matp...
yashdeeph709/Algorithms
PythonBootCamp/Complete-Python-Bootcamp-master/.ipynb_checkpoints/Statements Assessment Test - Solutions-checkpoint.ipynb
apache-2.0
st = 'Print only the words that start with s in this sentence' for word in st.split(): if word[0] == 's': print word """ Explanation: Statements Assessment Solutions Use for, split(), and if to create a Statement that will print out words that start with 's': End of explanation """ range(0,11,2) """ E...
samuelsinayoko/kaggle-housing-prices
ols/regression_full.ipynb
mit
dfnum = pd.read_csv('transformed_numerical_dataset_imputed.csv', index_col=['Dataset','Id']) dfnum.head() dfcat = pd.read_csv('cleaned_categorical_vars_with_colz_sorted_by_goodness.csv', index_col=['Dataset','Id']) dfcat.head() dfcat.head() df = pd.concat([dfnum, dfcat.iloc[:, :ncat]], axis=1) df.shape """ Explana...
mne-tools/mne-tools.github.io
0.16/_downloads/plot_lcmv_beamformer_volume.ipynb
bsd-3-clause
# Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # # License: BSD (3-clause) import numpy as np import matplotlib.pyplot as plt import mne from mne.datasets import sample from mne.beamformer import make_lcmv, apply_lcmv from nilearn.plotting import plot_stat_map from nilearn.image import index_...
eneskemalergin/OldBlog
_oldnotebooks/Introduction_to_Pandas-2.ipynb
mit
import pandas as pd SpotCrudePrices_2013_Data= { 'U.K. Brent' : {'2013-Q1':112.9, '2013-Q2':103.0, '2013-Q3':110.1, '2013-Q4':109.4}, 'Dubai': {'2013-Q1':108.1, '2013-Q2':100.8, ...
biof-309-python/BIOF309-2016-Fall
Week_02/Week 2 - 04 - Homework.ipynb
mit
# This sequence is the first 100 nucleotides of the Influenza H1N1 Virus segment 8 flu_ns1_seq = 'GTGACAAAGACATAATGGATCCAAACACTGTGTCAAGCTTTCAGGTAGATTGCTTTCTTTGGCATGTCCGCAAACGAGTTGCAGACCAAGAACTAGGTGA' """ Explanation: Week 2 Homework We have seen this week how to print and manipulate text string in python. Lets use th...
Naereen/notebooks
Février 2021 un mini challenge arithmético-algorithmique.ipynb
mit
// ceci est du code Java 9 et pas Python ! // On a besoin des dépendances suivantes : import java.util.Calendar; // pour Calendar.FEBRUARY, .YEAR, .MONDAY import java.util.GregorianCalendar; // pour import java.util.stream.IntStream; // pour cet IntStream // ceci est du code Java 9 et pas Python ! IntStr...
mne-tools/mne-tools.github.io
stable/_downloads/1537c1215a3e40187a4513e0b5f1d03d/eeg_csd.ipynb
bsd-3-clause
# Authors: Alex Rockhill <aprockhill@mailbox.org> # # License: BSD-3-Clause import numpy as np import matplotlib.pyplot as plt import mne from mne.datasets import sample print(__doc__) data_path = sample.data_path() """ Explanation: Transform EEG data using current source density (CSD) This script shows an example...
ppham27/MLaPP-solutions
chap04/17.ipynb
mit
%matplotlib inline import numpy as np import pandas as pd import matplotlib.pyplot as plt from matplotlib.colors import ListedColormap # benchmark sklearn implementations, these are much faster from sklearn.discriminant_analysis import LinearDiscriminantAnalysis from sklearn.discriminant_analysis import QuadraticDiscr...
ernestyalumni/CompPhys
crack/crack.ipynb
apache-2.0
def fibonacci(n): if (n == 0): return 0 elif (n == 1): return 1 elif (n==2): return 1 return fibonacci(n-1) + fibonacci(n-2) [fibonacci(n) for n in range(15)] """ Explanation: cf. Gayle Laakmann McDowell. Cracking the Coding Interview: 189 Programming Questions and Solutions....
rochelleterman/scrape-interwebz
3_Beautiful_Soup/1_bs_workbook.ipynb
mit
# import required modules import requests from bs4 import BeautifulSoup from datetime import datetime import time import re import sys """ Explanation: Webscraping with Beautiful Soup Intro In this tutorial, we'll be scraping information on the state senators of Illinois, available here, as well as the list of bills ...
vikashvverma/machine-learning
mlbasic/UnSupervised/Project/customer_segments.ipynb
mit
# Import libraries necessary for this project import numpy as np import pandas as pd from IPython.display import display # Allows the use of display() for DataFrames # Import supplementary visualizations code visuals.py import visuals as vs # Pretty display for notebooks %matplotlib inline # Load the wholesale custo...
jealdana/Open-Notebooks
PythonWars/Python Wars.ipynb
gpl-3.0
import webbrowser import requests import bs4 import csv import pandas as pd res = requests.get('http://mytowntutors.com/2014/04/star-wars-the-clone-wars/') print(res.status_code == requests.codes.ok) print("Number of lines in te downloaded page: %i"%len(res.text)) print("The first 20 thousand lines for a quick assesme...
cslab-org/cslab
static/teaching/pattern/PR_Your_Name.ipynb
mit
%matplotlib inline # code to sample a random number between 0 & 1 # Try running this multiple times by pressing Ctrl-Enter import numpy as np import matplotlib.pyplot as plt print np.random.random() """ Explanation: Your Name: Roll Number: 1. Linear Discriminant Analysis In this part, we will do lda on a synthetic d...
mtasende/Machine-Learning-Nanodegree-Capstone
notebooks/prod/n09_dyna_q_learner.ipynb
mit
# Basic imports import os import pandas as pd import matplotlib.pyplot as plt import numpy as np import datetime as dt import scipy.optimize as spo import sys from time import time from sklearn.metrics import r2_score, median_absolute_error from multiprocessing import Pool %matplotlib inline %pylab inline pylab.rcPar...
amolsharma99/UdacityDeepLearningClass
1_notmnist.ipynb
mit
# These are all the modules we'll be using later. Make sure you can import them # before proceeding further. from __future__ import print_function import matplotlib.pyplot as plt import numpy as np import os import sys import tarfile from IPython.display import display, Image from scipy import ndimage from sklearn.line...
ES-DOC/esdoc-jupyterhub
notebooks/dwd/cmip6/models/sandbox-3/atmos.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'dwd', 'sandbox-3', 'atmos') """ Explanation: ES-DOC CMIP6 Model Properties - Atmos MIP Era: CMIP6 Institute: DWD Source ID: SANDBOX-3 Topic: Atmos Sub-Topics: Dynamical Core, Radiation, Turbulen...
jArumugam/python-notes
P11Iterators and Generators Homework.ipynb
mit
def gensquares(N): for num in xrange(1,N): yield num**2 for x in gensquares(10): print x """ Explanation: Iterators and Generators Homework Problem 1 Create a generator that generates the squares of numbers up to some number N. End of explanation """ import random random.randint(1,10) def rand_num...
clumdee/clumdee.github.io
assets/img/twitterBNK48/code_with_pyspark.ipynb
mit
from pyspark.sql import SparkSession from pyspark.sql.functions import lower, split, explode, substring, count from datetime import datetime # create SparkSession spark = SparkSession.builder.appName('streamTwitterTags').getOrCreate() # connect and get tweets tweets = spark.readStream.format("socket").option("host", ...
computational-class/cjc2016
code/tba/Introduction-to-Non-Personalized-Recommenders.ipynb
mit
from IPython.core.display import Image Image(filename='/Users/chengjun/GitHub/cjc2016/figure/recsys_arch.png') """ Explanation: Introduction to Non-Personalized Recommenders The recommendation problem Recommenders have been around since at least 1992. Today we see different flavours of recommenders, deployed across d...
flohorovicic/pynoddy
docs/notebooks/1-Simulation.ipynb
gpl-2.0
from IPython.core.display import HTML css_file = 'pynoddy.css' HTML(open(css_file, "r").read()) %matplotlib inline # Basic settings import sys, os import subprocess sys.path.append("../..") # Now import pynoddy import pynoddy import importlib importlib.reload(pynoddy) import pynoddy.output import pynoddy.history #...
NekuSakuraba/my_capstone_research
subjects/diffusion maps/Diffusion Maps 02.ipynb
mit
n = 3 X, y = make_blobs(n_samples=n, cluster_std=.1, centers=[[1,1]]) X """ Explanation: Diffusion Distance <br /> A distance function between any two points based on the random walk on the graph [1]. Diffusion map <br /> Low dimensional description of the data by the first few eigenvectors [1]. End of explanation ""...
mayank-johri/LearnSeleniumUsingPython
Section 2 - Advance Python/Chapter S2.01 - Functional Programming/04_functools.ipynb
gpl-3.0
def power(base, exponent): return base ** exponent def square(base): return power(base, 2) def cube(base): return power(base, 3) """ Explanation: functools The functools module is for higher-order functions: functions that act on or return other functions. In general, any callable object can be treated ...
Imperial-College-Data-Science-Society/Scientific-Python
notebooks/Scientific-Python.ipynb
mit
import numpy as np """ Explanation: Introduction to scientific Python Numpy Exercise difficulty rating: [1] easy. ~1 min [2] medium. ~2-3 minutes [3] difficult. Suitable for a standalone project. Numpy is imported and aliased to np by convention End of explanation """ a = np.array([0, 1, 2]) # a rank 1 array of int...
dietmarw/EK5312_ElectricalMachines
Chapman/Ch6-Example_6-06.ipynb
unlicense
%pylab notebook """ Explanation: Electric Machinery Fundamentals 5th edition Chapter 6 (Code examples) Example 6-6: Creates and plot of the torque-speed curve of an induction motor with a double-cage rotor design as depicted in Figure 6-29. Note: You should first click on "Cell &rarr; Run All" in order that the plots...
gwsb-istm-6212-fall-2016/syllabus-and-schedule
lectures/week-11/20161122-lecture-notes.ipynb
cc0-1.0
sc """ Explanation: A brief tour of Spark Apache Spark is "a fast and general engine for large-scale data processing." It comes from the broader Hadoop ecosystem but can be used in a near-standalone mode, which we'll use here. This is a Jupyter notebook with PySpark enabled. To enable PySpark, you need to have Spark...
musketeer191/job_analytics
parse_title.ipynb
gpl-3.0
df = pd.read_csv(DATA_DIR + 'doc_index_filter.csv') titles = list(df['title'].unique()) n_title = len(titles) print('# unique titles: %d' % n_title) title_stats = pd.read_csv(DATA_DIR + 'stats_job_titles.csv') """ Explanation: Data loading: End of explanation """ def parseBatch(b, start=None, end=None): ''' ...
intel-analytics/analytics-zoo
apps/tfnet/image_classification_inference.ipynb
apache-2.0
from zoo.common.nncontext import * sc = init_nncontext("Tfnet Example") import sys import tensorflow as tf sys.path slim_path = "/path/to/yourdownload/models/research/slim" # Please set this to the directory where you clone the tensorflow models repository sys.path.append(slim_path) """ Explanation: Image classificati...
quantopian/research_public
notebooks/lectures/Estimating_Covariance_Matrices/notebook.ipynb
apache-2.0
import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import scipy.stats as stats from sklearn import covariance """ Explanation: Estimation of Covariance Matrices By Christopher van Hoecke and Max Margenot Part of the Quantopian Lecture Series: www.quantopian.com/lectures gith...
mne-tools/mne-tools.github.io
0.23/_downloads/4a4a8e5bd5ae7cafea93a04d8c0a0d00/psf_ctf_vertices_lcmv.ipynb
bsd-3-clause
# Author: Olaf Hauk <olaf.hauk@mrc-cbu.cam.ac.uk> # # License: BSD (3-clause) import mne from mne.datasets import sample from mne.beamformer import make_lcmv, make_lcmv_resolution_matrix from mne.minimum_norm import get_cross_talk print(__doc__) data_path = sample.data_path() subjects_dir = data_path + '/subjects/' ...
feststelltaste/software-analytics
notebooks/Mining performance HotSpots with JProfiler, jQAssistant, Neo4j and Pandas.ipynb
gpl-3.0
with open (r'input/spring-petclinic/JDBC_Probe_Hot_Spots_jmeter_test.xml') as log: [print(line[:97] + "...") for line in log.readlines()[:10]] """ Explanation: Mining performance hotspots with JProfiler, jQAssistant, Neo4j and Pandas TL;DR I show how I determine the parts of an application that trigger unnecessary...
shirishr/My-Progress-at-Machine-Learning
Udacity_Machine_Learning/finding_donors/finding_donors.ipynb
mit
# Import libraries necessary for this project import numpy as np import pandas as pd from time import time from IPython.display import display # Allows the use of display() for DataFrames # Import supplementary visualization code visuals.py import visuals as vs # Pretty display for notebooks %matplotlib inline # Loa...
julienchastang/unidata-python-workshop
notebooks/MetPy_Advanced/Isentropic Analysis.ipynb
mit
from siphon.catalog import TDSCatalog cat = TDSCatalog('http://thredds.ucar.edu/thredds/catalog/grib/' 'NCEP/GFS/Global_0p5deg/catalog.xml') best = cat.datasets['Best GFS Half Degree Forecast Time Series'] """ Explanation: <a name="top"></a> <div style="width:1000 px"> <div style="float:right; width...
brian-rose/env-415-site
notes/TransientWarming.ipynb
mit
%matplotlib notebook import numpy as np import matplotlib.pyplot as plt import climlab import netCDF4 as nc """ Explanation: ENV / ATM 415: Climate Laboratory Exploring the rate of climate change Tuesday April 11, 2016 End of explanation """ # Need the ozone data again for our Radiative-Convective model ozone_filen...
aaai2018-paperid-62/aaai2018-paperid-62
parameter_figures.ipynb
mit
import pandas as pd file = 'data/evaluations.csv' conversion_dict = {'research_type': lambda x: int(x == 'E')} evaluation_data = pd.read_csv(file, sep=',', header=0, index_col=0, converters=conversion_dict) print('Samples per conference\n{}'.format(evaluation_data.groupby('conference').size())) """ Explanation: Figu...
DJCordhose/ai
notebooks/tensorflow/fashion_mnist_tpu.ipynb
mit
import tensorflow as tf import numpy as np (x_train, y_train), (x_test, y_test) = tf.keras.datasets.fashion_mnist.load_data() # add empty color dimension x_train = np.expand_dims(x_train, -1) x_test = np.expand_dims(x_test, -1) """ Explanation: View in Colaboratory Fashion MNIST with Keras and TPUs Let's try out usi...
anhaidgroup/py_entitymatching
notebooks/guides/end_to_end_em_guides/Basic EM Workflow.ipynb
bsd-3-clause
import sys sys.path.append('/Users/pradap/Documents/Research/Python-Package/anhaid/py_entitymatching/') import py_entitymatching as em import pandas as pd import os # Display the versions print('python version: ' + sys.version ) print('pandas version: ' + pd.__version__ ) print('magellan version: ' + em.__version__ )...
ihmeuw/dismod_mr
examples/consistent_data_from_vivarium_artifact.ipynb
agpl-3.0
np.random.seed(123456) # if dismod_mr is not installed, it should possible to use # !conda install --yes pymc # !pip install dismod_mr import dismod_mr # you also need one more pip installable package # !pip install vivarium_public_health import vivarium_public_health """ Explanation: Consistent models in DisMod-M...
Olsthoorn/IHE-python-course-2017
exercises/Apr18/TimeSeriesSampling.ipynb
gpl-2.0
import pandas as pd import matplotlib.pyplot as plt import numpy as np """ Explanation: <figure> <IMG SRC="../../logo/logo.png" WIDTH=250 ALIGN="right"> </figure> IHE Python course, 2017 Time series manipulation T.N.Olsthoorn, April 18, 2017 Most scientists and engineers, including hydrologists, physisists, electr...
ctralie/TUMTopoTimeSeries2016
Image Patches.ipynb
apache-2.0
import numpy as np %matplotlib notebook import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from matplotlib.offsetbox import OffsetImage, AnnotationBbox from ripser import ripser from persim import plot_diagrams from GeomUtils import getGreedyPerm import sys sys.path.append("DREiMac/dreimac") from P...
mtat76/atm-py
examples/instruments_POPS_housekeeping.ipynb
mit
from atmPy.instruments.POPS import housekeeping %matplotlib inline """ Explanation: Introduction This module is in charge of reading the POPS housekeeping file and converting it to a TimeSeries instance. Imports End of explanation """ filename = './data/POPS_housekeeping.csv' hk = housekeeping.read_csv(filename) ""...
milancurcic/lunch-bytes
Fall_2018/LB22/NeuralNetDemo.ipynb
cc0-1.0
import numpy as np import pandas as pd from sklearn import model_selection def xfer(wsum): out = 1.0 / (1.0 + np.exp(-wsum)) return out def ErrHid(output, weights, outerr): dt = np.dot(weights, outerr) ErrorHid = output * (1.0 - output) * dt return ErrorHid def ErrOut(output, targets): ErrorO...
AllenDowney/ThinkStats2
workshop/effect_size.ipynb
gpl-3.0
%matplotlib inline import numpy import scipy.stats import matplotlib.pyplot as plt 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) """ Explanation: Effect Size Examples and exercises for a tutor...
astrojhgu/mcupy
example/bimodal/README.ipynb
bsd-3-clause
%matplotlib inline from mcupy.graph import * from mcupy.utils import * from mcupy.nodes import * from mcupy.jagsparser import * import scipy import seaborn import pylab """ Explanation: A bimodal example This is a sample to infer the parameters of a bimodal model, which is a mixture of two Normal distribution componen...
hktxt/MachineLearning
Backpropagation.ipynb
gpl-3.0
%run "readonly/BackpropModule.ipynb" # PACKAGE import numpy as np import matplotlib.pyplot as plt # PACKAGE # First load the worksheet dependencies. # Here is the activation function and its derivative. sigma = lambda z : 1 / (1 + np.exp(-z)) d_sigma = lambda z : np.cosh(z/2)**(-2) / 4 # This function initialises t...
turbomanage/training-data-analyst
quests/serverlessml/07_caip/solution/export_data.ipynb
apache-2.0
%%bash export PROJECT=$(gcloud config list project --format "value(core.project)") echo "Your current GCP Project Name is: "$PROJECT import os PROJECT = "your-gcp-project-here" # REPLACE WITH YOUR PROJECT NAME REGION = "us-central1" # REPLACE WITH YOUR BUCKET REGION e.g. us-central1 # Do not change these os.environ[...
ThomasProctor/Slide-Rule-Data-Intensive
UdacityMachineLearning/Lessons 1-3 mini-projects.ipynb
mit
import sklearn.naive_bayes as nb """ Explanation: Naive Bayes End of explanation """ alabels_test=np.array(labels_test) alabels_test.shape features_test.shape """ Explanation: My own exploration of the data End of explanation """ features_test[:10].sum(axis=1) features_test.sum()/features_test.shape[0] """ E...
lithiumdenis/MLSchool
3. Гоблины, гули и призраки.ipynb
mit
train, test = pd.read_csv( 'data/HelloKaggle/train.csv' # путь к вашему файлу train ), pd.read_csv( 'data/HelloKaggle/test.csv' # путь к вашему файлу test ) train.head() X = train.drop(['id', 'type'], axis=1) y = train['type'] """ Explanation: Зайдите на http://www.kaggle.com и зарегистрируйтесь. Д...
dietmarw/EK5312_ElectricalMachines
Chapman/Ch1-Problem_1-12.ipynb
unlicense
%pylab notebook %precision 4 from scipy import constants as c # we like to use some constants """ Explanation: Excercises Electric Machinery Fundamentals Chapter 1 Problem 1-12 End of explanation """ N1 = 600 N2 = 200 i1 = 0.5 # A i2 = 1.0 # A """ Explanation: Description The core shown in Fig...
paulovn/ml-vm-notebook
vmfiles/IPNB/Examples/g Misc/10 ipywidgets.ipynb
bsd-3-clause
from __future__ import print_function from ipywidgets import widgets """ Explanation: Ipywidgets ipywidgets is a Python package providing interactive widgets for Jupyter notebooks. * ipywidgets installation * A small tutorial: interactive dashboards on Jupyter End of explanation """ from IPython.display import displ...
arcyfelix/Courses
18-05-28-Complete-Guide-to-Tensorflow-for-Deep-Learning-with-Python/01-Introduction-to-Neural-Networks/01_Neural Network From Scratch.ipynb
apache-2.0
class SimpleClass(): def __init__(self, str_input): print("SIMPLE" + str_input) class ExtendedClass(SimpleClass): def __init__(self): print('EXTENDED') """ Explanation: Manual Neural Network In this notebook we will manually build out a neural network that mimics the TensorFlow API. This will ...
ethen8181/machine-learning
networkx/page_rank.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(plot_style=False) os.chdir(path) # 1. magic for inline plot # 2. magic to print version # ...
ES-DOC/esdoc-jupyterhub
notebooks/test-institute-1/cmip6/models/sandbox-2/toplevel.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'test-institute-1', 'sandbox-2', 'toplevel') """ Explanation: ES-DOC CMIP6 Model Properties - Toplevel MIP Era: CMIP6 Institute: TEST-INSTITUTE-1 Source ID: SANDBOX-2 Sub-Topics: Radiative Forcin...
jvbalen/cover_id
learn.ipynb
mit
n_patches, patch_len = 8, 64 # train, test, validation split ratio = (50,20,30) clique_dict, _ = SHS_data.read_cliques() train_cliques, test_cliques_big, _ = util.split_train_test_validation(clique_dict, ratio=ratio) # preload training data to memory (just about doable) print('Preloading training data...') train_uris...
BrainIntensive/OnlineBrainIntensive
resources/nipype/nipype_tutorial/notebooks/basic_joinnodes.ipynb
mit
from nipype import Node, JoinNode, Workflow # Specify fake input node A a = Node(interface=A(), name="a") # Iterate over fake node B's input 'in_file? b = Node(interface=B(), name="b") b.iterables = ('in_file', [file1, file2]) # Pass results on to fake node C c = Node(interface=C(), name="c") # Join forked executio...
gfeiden/Notebook
Daily/20150820_A_star_models.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np """ Explanation: Surface Boundary Conditions on the Sub-Giant Branch In particular, exploring how surface boundary conditions can affect the morphology of the sub-giant branch in relation to the "retired A-star" debate in the literature. End of expl...
CommonClimate/teaching_notebooks
research/SEA_high_internal_variability.ipynb
mit
%load_ext autoreload %autoreload 2 %matplotlib inline import LMRt import os import numpy as np import seaborn as sns import matplotlib.pyplot as plt from scipy.stats.mstats import mquantiles import xarray as xr from matplotlib import gridspec from scipy.signal import find_peaks import pandas as pd import pickle from t...
sidazhang/udacity-dlnd
sentiment-network/Sentiment_Classification_Projects.ipynb
mit
def pretty_print_review_and_label(i): print(labels[i] + "\t:\t" + reviews[i][:80] + "...") g = open('reviews.txt','r') # What we know! reviews = list(map(lambda x:x[:-1],g.readlines())) g.close() g = open('labels.txt','r') # What we WANT to know! labels = list(map(lambda x:x[:-1].upper(),g.readlines())) g.close()...
recepkabatas/Spark
1_notmnist.ipynb
apache-2.0
# These are all the modules we'll be using later. Make sure you can import them # before proceeding further. import matplotlib.pyplot as plt import numpy as np import os import tarfile import urllib from urllib.request import urlretrieve from IPython.display import display, Image from scipy import ndimage from sklearn...
YuriyGuts/kaggle-quora-question-pairs
notebooks/feature-3rdparty-dasolmar-whq.ipynb
mit
from pygoose import * """ Explanation: Feature: "Jaccard with WHQ" (@dasolmar) Based on the kernel XGB with whq jaccard by David Solis. Imports This utility package imports numpy, pandas, matplotlib and a helper kg module into the root namespace. End of explanation """ import nltk from collections import Counter fr...
Aggieyixin/cjc2016
code/16&17networkx.ipynb
mit
%matplotlib inline import networkx as nx import matplotlib.cm as cm import matplotlib.pyplot as plt import networkx as nx G=nx.Graph() # G = nx.DiGraph() # 有向网络 # 添加(孤立)节点 G.add_node("spam") # 添加节点和链接 G.add_edge(1,2) print(G.nodes()) print(G.edges()) # 绘制网络 nx.draw(G, with_labels = True) """ Explanation: 网络科学理论简介...
npo-poms/pyapi
changes_demo.ipynb
gpl-3.0
objects = ijson.items(client.changes(stream=True, limit=100000), 'changes.item') data = {} """ Explanation: Receive (streamingly) the latest 100000 changes. End of explanation """ count = 0 print("Iterating all results, and collecting some data") for o in objects: if count % 20000 == 0: sys.stdout.w...