repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
theamazingfedex/ml-project-4
language-translation/dlnd_language_translation.ipynb
mit
""" DON'T MODIFY ANYTHING IN THIS CELL """ import helper import problem_unittests as tests source_path = 'data/small_vocab_en' target_path = 'data/small_vocab_fr' source_text = helper.load_data(source_path) target_text = helper.load_data(target_path) """ Explanation: Language Translation In this project, you’re going...
bpgc-cte/python2017
Week 3/Lecture_5_Introdution_to_Functions.ipynb
mit
#Example_1: return keyword def straight_line(slope,intercept,x): "Computes straight line y value" y = slope*x + intercept return y print("y =",straight_line(1,0,5)) #Actual Parameters print("y =",straight_line(0,3,10)) #By default, arguments have a positional behaviour #Each of the parameters here is call...
cirla/tulipy
README.ipynb
lgpl-3.0
import numpy as np import tulipy as ti ti.TI_VERSION DATA = np.array([81.59, 81.06, 82.87, 83, 83.61, 83.15, 82.84, 83.99, 84.55, 84.36, 85.53, 86.54, 86.89, 87.77, 87.29]) """ Explanation: tulipy Python bindings for Tulip Indicators Tulipy requires numpy as all inputs and output...
hunterowens/machine-learning-in-edu
EduMLvsRuleBased.ipynb
cc0-1.0
## Imports import pandas as pd import seaborn as sns sns.set(color_codes=True) import matplotlib.pyplot as plt """ Explanation: Comparision of Machine Learning Methods vs Rule Based Traditionally, Educational Institutions use rule based models to generate risk score which then informs resource allocation. For examp...
albertfxwang/grizli
examples/Fit-with-Photometry.ipynb
mit
%matplotlib inline import os import numpy as np import matplotlib.pyplot as plt import astropy.io.fits as pyfits import drizzlepac import grizli from grizli.pipeline import photoz from grizli import utils, prep, multifit, fitting utils.set_warnings() print('\n Grizli version: ', grizli.__version__) # Requires eazy...
rsterbentz/phys202-2015-work
assignments/assignment11/OptimizationEx01.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np import scipy.optimize as opt """ Explanation: Optimization Exercise 1 Imports End of explanation """ def hat(x,a,b): potential = -a*x**2 + b*x**4 return potential assert hat(0.0, 1.0, 1.0)==0.0 assert hat(0.0, 1.0, 1.0)==0.0 assert hat(1....
tkphd/pycalphad
examples/EquilibriumWithOrdering.ipynb
mit
# Only needed in a Jupyter Notebook %matplotlib inline # Optional plot styling import matplotlib matplotlib.style.use('bmh') import matplotlib.pyplot as plt from pycalphad import equilibrium from pycalphad import Database, Model import pycalphad.variables as v import numpy as np """ Explanation: Equilibrium Propertie...
nholtz/structural-analysis
matrix-methods/frame2d/AA-3203-2019-hw6.ipynb
cc0-1.0
from Frame2D import Frame2D theframe = Frame2D('3203/2019/hw-6') """ Explanation: CIVE 3203 2019 HW-6 Compare the results here with those given be the slope-deflection method in the solution of HW-6, CIVE3203, Fall 2019. End of explanation """ %%Table nodes NODEID,X,Y,Z a,0,5000 b,8000,5000 c,14000,5000 d,8000,0 "...
Featuretools/featuretools
docs/source/getting_started/woodwork_types.ipynb
bsd-3-clause
import featuretools as ft ft.list_logical_types() """ Explanation: Woodwork Typing in Featuretools Featuretools relies on having consistent typing across the creation of EntitySets, Primitives, Features, and feature matrices. Previously, Featuretools used its own type system that contained objects called Variables. N...
IBMStreams/streamsx.topology
samples/python/topology/notebooks/ViewDemo/ViewDemo.ipynb
apache-2.0
from streamsx.topology.topology import Topology from streamsx.topology import context from some_module import jsonRandomWalk #from streamsx import rest import json import logging # Define topology & submit rw = jsonRandomWalk() top = Topology("myTop") stock_data = top.source(rw) # The view object can be used to retri...
jarrison/trEFM-learn
Examples/.ipynb_checkpoints/demo-checkpoint.ipynb
mit
import numpy as np import matplotlib.pyplot as plt from trEFMlearn import data_sim %matplotlib inline """ Explanation: Welcome! Let's start by assuming you have downloaded the code, and ran the setup.py . This demonstration will show the user how predict the time constant of their trEFM data using the methods of stati...
bird-house/birdy
birdy/ipyleafletwfs/examples/ipyleafletwfs_guide.ipynb
apache-2.0
from birdy import IpyleafletWFS from ipyleaflet import Map url = 'http://boreas.ouranos.ca/geoserver/wfs' version = '2.0.0' wfs_connection = IpyleafletWFS(url, version) demo_map = Map(center=(46.42, -64.14), zoom=8) demo_map """ Explanation: How to use the WFSGeojsonLayer class This class provides WFS layers for ip...
ctralie/TUMTopoTimeSeries2016
SlidingWindow2-PersistentHomology.ipynb
apache-2.0
# Do all of the imports and setup inline plotting import numpy as np %matplotlib notebook import matplotlib.pyplot as plt from matplotlib import gridspec from mpl_toolkits.mplot3d import Axes3D from sklearn.decomposition import PCA from scipy.interpolate import InterpolatedUnivariateSpline import ipywidgets as widg...
machinelearningdeveloper/lc101-kc
November 28, 2016/Covered in class 11-28-2016.ipynb
unlicense
"""Assignment between variables creates aliases.""" animal = "giraffe" creature = animal print("Is creature an alias of animal?", creature is animal) """Assignment of the same value to different variables does not necessarily create aliases.""" weather_next_5_days = ["Sunny", "Partly sunny", "Cloudy", "Sunny", ...
GoogleCloudPlatform/asl-ml-immersion
notebooks/introduction_to_tensorflow/solutions/2a_dataset_api.ipynb
apache-2.0
import json import math import os from pprint import pprint import numpy as np import tensorflow as tf print(tf.version.VERSION) """ Explanation: TensorFlow Dataset API Learning Objectives 1. Learn how use tf.data to read data from memory 1. Learn how to use tf.data in a training loop 1. Learn how use tf.data to rea...
juancarlosqr/datascience
python/playground/jupyter/keyboard-shortcuts.ipynb
mit
# mode practice """ Explanation: Keyboard shortcuts In this notebook, you'll get some practice using keyboard shortcuts. These are key to becoming proficient at using notebooks and will greatly increase your work speed. First up, switching between edit mode and command mode. Edit mode allows you to type into cells whi...
ivergara/science_notebooks
Two levels, two electrons.ipynb
gpl-3.0
import numpy as np import itertools from operator import add from functools import reduce #from itertools import combinations, permutations """ Explanation: Transitions for a two level system with an electron End of explanation """ initial = [1, 0, 0, 0, 1, 0, 0, 0] final = [0, 0, 0, 0, 1, 0, 1, 0] """ Explanation...
voyageth/udacity-Deep_Learning_Foundations_Nanodegree
language-translation/dlnd_language_translation.ipynb
mit
""" DON'T MODIFY ANYTHING IN THIS CELL """ import helper import problem_unittests as tests source_path = 'data/small_vocab_en' target_path = 'data/small_vocab_fr' source_text = helper.load_data(source_path) target_text = helper.load_data(target_path) """ Explanation: Language Translation In this project, you’re going...
Milad7m/motion
DM_05_04.ipynb
mit
%matplotlib inline import pylab import numpy as np import pandas as pd from sklearn.svm import OneClassSVM from sklearn.covariance import EllipticEnvelope pylab.rcParams.update({'font.size': 14}) """ Explanation: DM_05_04 Import Libraries End of explanation """ df = pd.read_csv("AnomalyData.csv") df.head() """ Exp...
Kaggle/learntools
notebooks/data_cleaning/raw/ex4.ipynb
apache-2.0
from learntools.core import binder binder.bind(globals()) from learntools.data_cleaning.ex4 import * print("Setup Complete") """ Explanation: In this exercise, you'll apply what you learned in the Character encodings tutorial. Setup The questions below will give you feedback on your work. Run the following cell to set...
turbomanage/training-data-analyst
courses/machine_learning/deepdive2/feature_engineering/labs/3_keras_basic_feat_eng-lab.ipynb
apache-2.0
# Install Sklearn !python3 -m pip install --user sklearn # Ensure the right version of Tensorflow is installed. !pip3 freeze | grep 'tensorflow==2\|tensorflow-gpu==2' || \ !python3 -m pip install --user tensorflow==2 import os import tensorflow.keras import matplotlib.pyplot as plt import pandas as pd import tensorf...
mcleonard/sampyl
examples/Abalone Model.ipynb
mit
%matplotlib inline %config InlineBackend.figure_format = 'retina' import matplotlib.pyplot as plt import sampyl as smp from sampyl import np import pandas as pd plt.style.use('seaborn') plt.rcParams['font.size'] = 14. plt.rcParams['legend.fontsize'] = 14.0 plt.rcParams['axes.titlesize'] = 16.0 plt.rcParams['axes.lab...
prashanti/similarity-experiment
src/Notebooks/MetricComparison.ipynb
mit
import matplotlib.lines as mlines import os import pandas as pd import matplotlib.pyplot as plt import numpy as np import math import json %matplotlib inline """ Explanation: Parameters used Query profile size: 10 Number of query profiles: 5 Information Content: Annotation IC Profile aggregation: Best Pairs Direction...
SlipknotTN/udacity-deeplearning-nanodegree
gan_mnist/Intro_to_GANs_Exercises.ipynb
mit
%matplotlib inline import pickle as pkl import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets('MNIST_data') """ Explanation: Generative Adversarial Network In this notebook, we'll be building a generativ...
sbenthall/bigbang
examples/experimental_notebooks/Show Interaction Graph.ipynb
agpl-3.0
%matplotlib inline """ Explanation: This notebook shows how BigBang can be used to display a graph of interactions in the mailing list over some period of time. First we'll make the I Python notebook display computed visualizations inline. End of explanation """ from bigbang.archive import Archive import bigbang.par...
mne-tools/mne-tools.github.io
0.23/_downloads/efd09079125b2bd222e2dd62aaaccfa4/source_space_snr.ipynb
bsd-3-clause
# Author: Padma Sundaram <tottochan@gmail.com> # Kaisu Lankinen <klankinen@mgh.harvard.edu> # # License: BSD (3-clause) import mne from mne.datasets import sample from mne.minimum_norm import make_inverse_operator, apply_inverse import numpy as np import matplotlib.pyplot as plt print(__doc__) data_path = s...
franzpl/StableGrid
jupyter_notebooks/clock_frequency_accuracy.ipynb
mit
import numpy as np import matplotlib.pyplot as plt """ Explanation: On the influence of temperature in 16 MHz clock frequency measurement This notebook discusses the behaviour of accuracy and stability of 2 types of clock generators (ceramic resonator & quartz) under influence of temperature for highly precision frequ...
hpparvi/ldtk
notebooks/A2_redifining_stellar_edge.ipynb
gpl-2.0
%pylab inline from scipy.interpolate import interp1d from os.path import join import seaborn as sb sb.set_style('white') from ldtk.core import SIS, ldtk_root sis = SIS(join(ldtk_root,'cache_lowres','Z-0.0','lte05800-5.50-0.0.PHOENIX-ACES-AGSS-COND-SPECINT-2011.fits')) mu_o, z_o, ip_o = sis.mu, sis.z, sis.intensity_p...
mikelseverson/Udacity-Deep_Learning-Nanodegree
tv-script-generation/.ipynb_checkpoints/dlnd_tv_script_generation-checkpoint.ipynb
mit
""" DON'T MODIFY ANYTHING IN THIS CELL """ import helper data_dir = './data/simpsons/moes_tavern_lines.txt' text = helper.load_data(data_dir) # Ignore notice, since we don't use it for analysing the data text = text[81:] """ Explanation: TV Script Generation In this project, you'll generate your own Simpsons TV scrip...
usantamaria/ipynb_para_docencia
05_python_errores/errores.ipynb
mit
""" IPython Notebook v4.0 para python 3.0 Librerías adicionales: IPython, pdb Contenido bajo licencia CC-BY 4.0. Código bajo licencia MIT. (c) Sebastian Flores, Christopher Cooper, Alberto Rubio, Pablo Bunout. """ # Configuración para recargar módulos y librerías dinámicamente %reload_ext autoreload %autoreload 2 # C...
mliu49/RMG-stuff
Thermo/sdata134k_small_polycyclic.ipynb
mit
from rmgpy.data.rmg import RMGDatabase from rmgpy import settings from rmgpy.species import Species from rmgpy.molecule import Group from rmgpy.rmg.main import RMG from IPython.display import display import numpy as np import os import pandas as pd from pymongo import MongoClient import logging logging.disable(logging....
kmunve/APS
aps/notebooks/aps_terrain_analysis.ipynb
mit
# -*- coding: utf-8 -*- %matplotlib inline from __future__ import print_function import pylab as plt import datetime import netCDF4 import numpy as np import numpy.ma as ma from linecache import getline plt.rcParams['figure.figsize'] = (14, 6) """ Explanation: APS terrain analysis Imports End of explanation """ ##...
NifTK/NiftyNet
demos/Learning_Rate_Decay/Demo_for_learning_rate_decay_application.ipynb
apache-2.0
import os,sys import matplotlib.pyplot as plt import numpy as np niftynet_path='your/niftynet/path' # Set your NiftyNet root path here os.environ['niftynet_config_home'] = niftynet_path os.chdir(niftynet_path) """ Explanation: Demo for Learning Rate Decay Application This demo will address how to make use of the lear...
tensorflow/docs-l10n
site/zh-cn/hub/tutorials/retrieval_with_tf_hub_universal_encoder_qa.ipynb
apache-2.0
# Copyright 2019 The TensorFlow Hub Authors. All Rights Reserved. # # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
mne-tools/mne-tools.github.io
0.22/_downloads/2e7ef25ccf0fd2af7902f12debe11fc1/plot_stats_cluster_1samp_test_time_frequency.ipynb
bsd-3-clause
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # # License: BSD (3-clause) import numpy as np import matplotlib.pyplot as plt import mne from mne.time_frequency import tfr_morlet from mne.stats import permutation_cluster_1samp_test from mne.datasets import sample print(__doc__) """ Explanation: Non-par...
amueller/scipy-2017-sklearn
notebooks/04.Training_and_Testing_Data.ipynb
cc0-1.0
from sklearn.datasets import load_iris from sklearn.neighbors import KNeighborsClassifier iris = load_iris() X, y = iris.data, iris.target classifier = KNeighborsClassifier() """ Explanation: Training and Testing Data To evaluate how well our supervised models generalize, we can split our data into a training and a ...
RainFool/Udacity_Anwser_RainFool
Project1/boston_housing.ipynb
mit
# 载入此项目所需要的库 import numpy as np import pandas as pd import visuals as vs # Supplementary code # 检查你的Python版本 from sys import version_info if version_info.major != 2 and version_info.minor != 7: raise Exception('请使用Python 2.7来完成此项目') # 让结果在notebook中显示 %matplotlib inline # 载入波士顿房屋的数据集 data = pd.read_csv('housi...
oscarmore2/deep-learning-study
tflearn-digit-recognition/TFLearn_Digit_Recognition.ipynb
mit
# Import Numpy, TensorFlow, TFLearn, and MNIST data import numpy as np import tensorflow as tf import tflearn import tflearn.datasets.mnist as mnist """ Explanation: Handwritten Number Recognition with TFLearn and MNIST In this notebook, we'll be building a neural network that recognizes handwritten numbers 0-9. This...
junhwanjang/DataSchool
Lecture/09. 기초 확률론 3 - 확률모형/3) 가우시안 정규 분포.ipynb
mit
mu = 0 std = 1 rv = sp.stats.norm(mu, std) rv """ Explanation: 가우시안 정규 분포 가우시안 정규 분포(Gaussian normal distribution), 혹은 그냥 간단히 정규 분포라고 부르는 분포는 자연 현상에서 나타나는 숫자를 확률 모형으로 모형화할 때 가장 많이 사용되는 확률 모형이다. 정규 분포는 평균 $\mu$와 분산 $\sigma^2$ 이라는 두 개의 모수만으로 정의되며 확률 밀도 함수(pdf: probability density function)는 다음과 같은 수식을 가진다. $$ \mathcal{N...
wgong/open_source_learning
projects/Open_Food/open-food-100k.ipynb
apache-2.0
from jyquickhelper import add_notebook_menu add_notebook_menu() """ Explanation: Data Incubator Fellowship Semifinalist Challenge <a href="mailto:wen.g.gong@gmail.com">Wen Gong</a> Motivation <br> <font color=red size=+3>Know what you eat, </font> <font color=green size=+3> Gain insight into food.</font> <a href=https...
daniel-koehn/Theory-of-seismic-waves-II
07_SH_waves_in_moons_and_planets/4_2D_SHaxi_FD_modelling_ganymede.ipynb
gpl-3.0
# Execute this cell to load the notebook's style sheet, then ignore it from IPython.core.display import HTML css_file = '../style/custom.css' HTML(open(css_file, "r").read()) """ Explanation: Content under Creative Commons Attribution license CC-BY 4.0, code under BSD 3-Clause License © 2018 by D. Koehn, notebook styl...
hamnonlineng/hamnonlineng
examples/Example_7th_order_Hamiltonian-no_solutions.ipynb
bsd-3-clause
import hamnonlineng as hnle letters = 'abcde' resonant = [hnle.Monomial(1, 'aabbEEC'), hnle.Monomial(1,'abddEEC')] op_sum = hnle.operator_sum(letters) sine_exp = ( hnle.sin_terms(op_sum, 3) +hnle.sin_terms(op_sum, 5) +hnle.sin_terms(op_sum, 7) ) off_resonant = hnle.drop_sin...
sympy/scipy-2017-codegen-tutorial
notebooks/23-lambdify-Tc99m.ipynb
bsd-3-clause
import sympy as sym sym.init_printing() symbs = t, l1, l2, x0, y0, z0 = sym.symbols('t lambda_1 lambda_2 x0 y0 z0', real=True, nonnegative=True) funcs = x, y, z = [sym.Function(s)(t) for s in 'xyz'] inits = [f.subs(t, 0) for f in funcs] diffs = [f.diff(t) for f in funcs] exprs = -l1*x, l1*x - l2*y, l2*y eqs = [sym.Eq(...
owenjhwilliams/ASIIT
FindSwirlLocs.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np import h5py from importlib import reload import PIVutils #PIVutils = reload(PIVutils) X, Y, Swirl, Cond, Prof = PIVutils.importMatlabPIVdata2D('/Users/Owen/Dropbox/Data/ABL/SBL PIV data/RNV45-RI2.mat',['X','Y','Swirl'],['Cond','Prof']) NanLocs = np...
ES-DOC/esdoc-jupyterhub
notebooks/cnrm-cerfacs/cmip6/models/sandbox-3/aerosol.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'cnrm-cerfacs', 'sandbox-3', 'aerosol') """ Explanation: ES-DOC CMIP6 Model Properties - Aerosol MIP Era: CMIP6 Institute: CNRM-CERFACS Source ID: SANDBOX-3 Topic: Aerosol Sub-Topics: Transport, ...
diging/methods
2.1. Co-citation networks/2.1. Co-citation analysis.ipynb
gpl-3.0
metadata = wos.read('../data/Baldwin/PlantPhysiology', streaming=True, index_fields=['date', 'abstract'], index_features=['citations']) len(metadata) """ Explanation: 2.1. Co-citation Analysis In this workbook we will conduct a co-citation analysis using the approach outlined in Chen (2009). If y...
ecervera/mindstorms-nb
task/light_teacher.ipynb
mit
from functions import connect, light, forward, stop connect() """ Explanation: Sensor de llum <img src="http://www.nxtprograms.com/line_follower/DCP_2945.JPG" align="right"> Aquest sensor té dos parts: un diode emissor de llum roja un transistor detector de llum, que dóna un valor proporcional a la intensitat de llu...
tensorflow/probability
discussion/examples/cross_gpu_logprob.ipynb
apache-2.0
%tensorflow_version 2.x import numpy as np import tensorflow as tf import tensorflow_probability as tfp tfb, tfd = tfp.bijectors, tfp.distributions physical_gpus = tf.config.experimental.list_physical_devices('GPU') print(physical_gpus) tf.config.experimental.set_virtual_device_configuration( physical_gpus[0], ...
mjones01/NEON-Data-Skills
code/Python/remote-sensing/hyperspectral-data/NEON_AOP_Hyperspectral_Functions_Tiles_py.ipynb
agpl-3.0
import matplotlib.pyplot as plt import numpy as np import h5py, os, osr, copy %matplotlib inline import warnings warnings.filterwarnings('ignore') """ Explanation: syncID: e046a83d83f2042d8b40dea1b20fd6779 title: "Band Stacking, RGB & False Color Images, and Interactive Widgets in Python - Tiled Data" description: "Le...
Bowenislandsong/Distributivecom
Archive/Hyperparameter Optimization.ipynb
gpl-3.0
import numpy as np import ray @ray.remote def train_cnn_and_compute_accuracy(hyperparameters, train_images, train_labels, validation_images, validation_labels): # Construct a deep...
SylvainCorlay/bqplot
examples/Marks/Pyplot/Bins.ipynb
apache-2.0
# Create a sample of Gaussian draws np.random.seed(0) x_data = np.random.randn(1000) """ Explanation: Bins Mark This Mark is essentially the same as the Hist Mark from a user point of view, but is actually a Bars instance that bins sample data. The difference with Hist is that the binning is done in the backend, so it...
cathywu/flow
tutorials/tutorial04_rllab.ipynb
mit
# ring road scenario class from flow.scenarios.loop import LoopScenario # input parameter classes to the scenario class from flow.core.params import NetParams, InitialConfig # name of the scenario name = "training_example" # network-specific parameters from flow.scenarios.loop import ADDITIONAL_NET_PARAMS net_params...
rsterbentz/phys202-2015-work
assignments/assignment06/DisplayEx01.ipynb
mit
from IPython.display import Image, HTML, display assert True # leave this to grade the import statements """ Explanation: Display Exercise 1 Imports Put any needed imports needed to display rich output the following cell: End of explanation """ Image(url='http://www.elevationnetworks.org/wp-content/uploads/2013/05/...
dacr26/CompPhys
00_02_numbers_in_python.ipynb
mit
import sys sys.float_info """ Explanation: Manipulating numbers in Python Disclaimer: Much of this section has been transcribed from <a href="https://pymotw.com/2/math/">https://pymotw.com/2/math/</a> Every computer represents numbers using the <a href="https://en.wikipedia.org/wiki/IEEE_floating_point">IEEE floati...
turbomanage/training-data-analyst
courses/machine_learning/deepdive/06_structured/3_keras_dnn.ipynb
apache-2.0
# change these to try this notebook out BUCKET = 'cloud-training-demos-ml' PROJECT = 'cloud-training-demos' REGION = 'us-east1' #'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 ${RE...
rkastilani/PowerOutagePredictor
PowerOutagePredictor/Linear/Ridge.ipynb
mit
import numpy as np import pandas as pd from sklearn import linear_model from sklearn.metrics import mean_squared_error import matplotlib.pyplot as plt data = pd.read_csv("../../Data/2014outagesJerry.csv") data.head() """ Explanation: Ridge Regression: Ridge regression performs ‘L2 regularization‘, i.e. it adds a f...
radhikapc/foundation-homework
homework05/Homework05_Spotify_radhika.ipynb
mit
#With "Lil Wayne" and "Lil Kim" there are a lot of "Lil" musicians. Do a search and print a list of 50 #that are playable in the USA (or the country of your choice), along with their popularity score. count =0 for artist in Lil_artists: count += 1 print(count,".", artist['name'],"has the popularity of", artis...
michaelaye/iuvs
notebooks/L1A_darks_mean_value_dataframe_analysis.ipynb
isc
%matplotlib inline plt.rcParams['figure.figsize'] = (10,10) from matplotlib.pyplot import subplots """ Explanation: Inital setup End of explanation """ import pandas as pd df = pd.read_hdf('/home/klay6683/l1a_dark_stats.h5','df') """ Explanation: loading summary file that I previously created by scanning through L1...
gprakhar/sifar
document_clustering.ipynb
gpl-3.0
# Author: Peter Prettenhofer <peter.prettenhofer@gmail.com> # Lars Buitinck # License: BSD 3 clause from __future__ import print_function from sklearn.datasets import fetch_20newsgroups from sklearn.decomposition import TruncatedSVD from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.feat...
softEcon/talks
intro_scientific_python/talk.ipynb
mit
import this """ Explanation: Python for Scientific Computing in Economics <font size="3"> ... background material available at <a href="https://github.com/softecon/talks">https://github.com/softecon/talks</a> </font> Why Python? <style> table,td,tr,th {border:none!important} </style> <table style="width:90%"> <tbod...
jinzishuai/learn2deeplearn
deeplearning.ai/C1.NN_DL/week4/Building your Deep Neural Network - Step by Step/Building+your+Deep+Neural+Network+-+Step+by+Step+v5.ipynb
gpl-3.0
import numpy as np import h5py import matplotlib.pyplot as plt from testCases_v3 import * from dnn_utils_v2 import sigmoid, sigmoid_backward, relu, relu_backward %matplotlib inline plt.rcParams['figure.figsize'] = (5.0, 4.0) # set default size of plots plt.rcParams['image.interpolation'] = 'nearest' plt.rcParams['imag...
Erhil/PythonNpCourse
materials/week 2/numpy.ipynb
mit
%pylab inline import this """ Explanation: Программирование на Python Дзен Python End of explanation """ import numpy as np np.array([1,2,3]) a = np.array([[1,2,3], [4,5,6]]) a = np.array([1,2,3]) b = np.array([4,5,6]) a+b a*b a/b a**b """ Explanation: Красивое лучше, чем уродливое.<br> Явное лучше, чем нея...
3DGenomes/tadbit
doc/notebooks/tutorial_1-Retrieve_published_HiC_datasets.ipynb
gpl-3.0
%%bash mkdir -p FASTQs fastq-dump SRR5344921 --defline-seq '@$ac.$si' -X 100000000 --split-files --outdir FASTQs/ mv FASTQs/SRR5344921_1.fastq FASTQs/mouse_B_rep1_1.fastq mv FASTQs/SRR5344921_2.fastq FASTQs/mouse_B_rep1_2.fastq fastq-dump SRR5344925 --defline-seq '@$ac.$si' -X 100000000 --split-files --outdir FASTQs...
Xilinx/PYNQ
boards/Pynq-Z1/logictools/notebooks/fsm_generator.ipynb
bsd-3-clause
from pynq.overlays.logictools import LogicToolsOverlay logictools_olay = LogicToolsOverlay('logictools.bit') """ Explanation: Finite State Machine Generator This notebook will show how to use the Finite State Machine (FSM) Generator to generate a state machine. The FSM we will build is a Gray code counter. The count...
ernestyalumni/servetheloop
servetheloop.ipynb
mit
import sympy from sympy import Eq, solve, Symbol, symbols, pi from sympy import Rational as Rat from sympy.abc import tau,l,F """ Explanation: Start with the Final Design Report - SpaceX Hyperloop Competition II for high level view. SpaceX Hyperloop Track Specification End of explanation """ eta_1 = Symbol('eta...
molpopgen/fwdpy
docs/examples/BGS.ipynb
gpl-3.0
#Use Python 3's print a a function. #This future-proofs the code in the notebook from __future__ import print_function #Import fwdpy. Give it a shorter name import fwdpy as fp ##Other libs we need import numpy as np import pandas as pd import math """ Explanation: Example: background selection Setting up the simulati...
pligor/predicting-future-product-prices
04_time_series_prediction/20_price_history_seq2seq-L2reg.ipynb
agpl-3.0
from __future__ import division import tensorflow as tf from os import path, remove import numpy as np import pandas as pd import csv from sklearn.model_selection import StratifiedShuffleSplit from time import time from matplotlib import pyplot as plt import seaborn as sns from mylibs.jupyter_notebook_helper import sho...
ogaway/Econometrics
MultiCollinearity.ipynb
gpl-3.0
%matplotlib inline # -*- coding:utf-8 -*- from __future__ import print_function import numpy as np import pandas as pd import statsmodels.api as sm import matplotlib.pyplot as plt import warnings warnings.filterwarnings('ignore') # データ読み込み data = pd.read_csv('example/k0801.csv') data # 説明変数設定 X = data[['X', 'Z']] X ...
zzsza/Datascience_School
10. 기초 확률론3 - 확률 분포 모형/02. 베르누이 확률 분포 (파이썬 버전).ipynb
mit
theta = 0.6 rv = sp.stats.bernoulli(theta) rv """ Explanation: 베르누이 확률 분포 베르누이 시도 결과가 성공(Success) 혹은 실패(Fail) 두 가지 중 하나로만 나오는 것을 베르누이 시도(Bernoulli trial)라고 한다. 예를 들어 동전을 한 번 던져 앞면(H:Head)이 나오거나 뒷면(T:Tail)이 나오게 하는 것은 베르누이 시도의 일종이다. 베르누이 시도의 결과를 확률 변수(random variable) $X$ 로 나타낼 때는 일반적으로 성공을 정수 1 ($X=1$), 실패를 정수 0 ($X=0$...
mne-tools/mne-tools.github.io
0.23/_downloads/5b9edf9c05aec2b9bb1f128f174ca0f3/40_cluster_1samp_time_freq.ipynb
bsd-3-clause
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # # License: BSD (3-clause) import numpy as np import matplotlib.pyplot as plt import mne from mne.time_frequency import tfr_morlet from mne.stats import permutation_cluster_1samp_test from mne.datasets import sample print(__doc__) """ Explanation: Non-par...
mne-tools/mne-tools.github.io
0.19/_downloads/c569084177bc9cce4e0419ab10cfd45d/plot_dipole_fit.ipynb
bsd-3-clause
from os import path as op import numpy as np import matplotlib.pyplot as plt import mne from mne.forward import make_forward_dipole from mne.evoked import combine_evoked from mne.simulation import simulate_evoked from nilearn.plotting import plot_anat from nilearn.datasets import load_mni152_template data_path = mne...
rubensfernando/mba-analytics-big-data
Python/2016-08-08/aula7-parte2-web-scraping.ipynb
mit
import requests req = requests.get("http://pythonscraping.com/pages/page1.html") print(req.text) from bs4 import BeautifulSoup bs = BeautifulSoup(req.text, "html.parser") print(bs) type(bs.h1) bs.h1 bs.h1.string req = requests.get("http://pythonscraping.com/pages/page1.html") req.status_code """ Explanation:...
ES-DOC/esdoc-jupyterhub
notebooks/nerc/cmip6/models/sandbox-1/atmoschem.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'nerc', 'sandbox-1', 'atmoschem') """ Explanation: ES-DOC CMIP6 Model Properties - Atmoschem MIP Era: CMIP6 Institute: NERC Source ID: SANDBOX-1 Topic: Atmoschem Sub-Topics: Transport, Emissions ...
shikhar413/openmc
examples/jupyter/mgxs-part-ii.ipynb
mit
import numpy as np import matplotlib.pyplot as plt plt.style.use('seaborn-dark') import openmoc import openmc import openmc.mgxs as mgxs import openmc.data from openmc.openmoc_compatible import get_openmoc_geometry %matplotlib inline """ Explanation: Multigroup Cross Section Generation Part II: Advanced Features Th...
bkoz37/labutil
samples/lab5_samples/Lab_5_Handout.ipynb
mit
from ase.calculators.eam import EAM """ Explanation: NEB using ASE 1. Setting up an EAM calculator. Suppose we want to calculate the minimum energy path of adatom diffusion on a (100) surface. We first need to choose an energy model, and in ASE, this is done by defining a "calculator". Let's choose our calculator to b...
oditorium/blog
iPython/Error-Estimation-for-Survey-Data.ipynb
agpl-3.0
N_people = 500 ratio_female = 0.30 proba = 0.40 """ Explanation: Error Estimation for Survey Data the issue we have is the following: we are drawing indendent random numbers from a binary distribution of probability $p$ (think: the probability of a certain person liking the color blue) and we have two groups (think: m...
karlnapf/shogun
doc/ipython-notebooks/clustering/GMM.ipynb
bsd-3-clause
%pylab inline %matplotlib inline import os SHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data') # import all Shogun classes from shogun import * from matplotlib.patches import Ellipse # a tool for visualisation def get_gaussian_ellipse_artist(mean, cov, nstd=1.96, color="red", linewidth=3): """ Retur...
clazaro/elastica
2DRodFF_1.ipynb
gpl-3.0
import numpy as np import matplotlib import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D %matplotlib inline """ Explanation: &copy; C. Lázaro, Universidad Politécnica de Valencia, 2015 Form finding of planar flexible rods (1) 1 Motivation Schek, 1973 & Linkwitz - Force denisty method 1. Define net...
martinjrobins/hobo
examples/toy/model-simple-harmonic-oscillator.ipynb
bsd-3-clause
import pints import pints.toy import matplotlib.pyplot as plt import numpy as np model = pints.toy.SimpleHarmonicOscillatorModel() """ Explanation: Simple Harmonic Oscillator model This example shows how the Simple Harmonic Oscillator model can be used. A model for a particle undergoing Newtonian dynamics that experi...
mtasende/Machine-Learning-Nanodegree-Capstone
notebooks/prod/.ipynb_checkpoints/n09_dyna_10000_states_full_training-checkpoint.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...
Featuretools/featuretools
docs/source/getting_started/afe.ipynb
bsd-3-clause
import featuretools as ft es = ft.demo.load_mock_customer(return_entityset=True) es """ Explanation: Deep Feature Synthesis Deep Feature Synthesis (DFS) is an automated method for performing feature engineering on relational and temporal data. Input Data Deep Feature Synthesis requires structured datasets in order to ...
caromedellin/Python-notes
exploratory-data-analysis/state example.ipynb
mit
import pandas as pd import numpy as np my_data = pd.DataFrame([1,2,3]) """ Explanation: Example for dimensionnality reduction End of explanation """ def to_binary(value): return "{0:b}".format(value) to_binary(5) unique_values = my_data.thrid.unique() """ Explanation: convert integer in to binary string End...
gfeiden/Notebook
Projects/senap/real_variables.ipynb
mit
import fileinput as fi """ Explanation: Identifying Hard Coded Single Precision Variables In looking to merge MARCS with DSEP, it is immediately clear that the two codes are incompatible when it comes to passing variables. MARCS is written with single precision declarations for real variables and DSEP is written with ...
aaronmckinstry706/twitter-crime-prediction
notebooks/New Pipeline.ipynb
gpl-3.0
import pyspark.sql as sql ss = sql.SparkSession.builder.appName("TwitterTokenizing")\ .getOrCreate() """ Explanation: The New Pipeline This is a rough draft of our new code. We're using PySpark's DataFrame and Pipeline API (for the most part) to re-implement what we've already done, and t...
simonsfoundation/CaImAn
demos/notebooks/demo_pipeline_cnmfE.ipynb
gpl-2.0
try: get_ipython().magic(u'load_ext autoreload') get_ipython().magic(u'autoreload 2') get_ipython().magic(u'matplotlib qt') except: pass import logging import matplotlib.pyplot as plt import numpy as np logging.basicConfig(format= "%(relativeCreated)12d [%(filename)s:%(funcNa...
IST256/learn-python
content/lessons/09-Dictionaries/HW-Dictionaries.ipynb
mit
import requests import json file='US-Senators.json' senators = requests.get('https://www.govtrack.us/api/v2/role?current=true&role_type=senator').json()['objects'] with open(file,'w') as f: f.write(json.dumps(senators)) print(f"Saved: {file}") """ Explanation: Homework: US Senator Lookup The Problem Let's wri...
alexandrnikitin/algorithm-sandbox
courses/DAT256x/Module03/03-03-Matrices.ipynb
mit
import numpy as np A = np.array([[1,2,3], [4,5,6]]) print (A) """ Explanation: Introduction to Matrices In general terms, a matrix is an array of numbers that are arranged into rows and columns. Matrices and Matrix Notation A matrix arranges numbers into rows and columns, like this: \begin{equation}A = ...
gunan/tensorflow
tensorflow/lite/micro/examples/hello_world/create_sine_model.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...
ml4a/ml4a-guides
examples/fundamentals/math_review_numpy.ipynb
gpl-2.0
import numpy as np """ Explanation: Review of numpy and basic mathematics written by Gene Kogan Before learning about what regression and classification are, we will do a review of key mathematical concepts from linear algebra and calculus, as well as an introduction to the numpy package. These fundamentals will be h...
tensorflow/docs-l10n
site/ko/r1/tutorials/eager/custom_training.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...
tensorflow/docs-l10n
site/ja/tensorboard/scalars_and_keras.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...
nntisapeh/intro_programming
notebooks/while_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: W...
ireapps/cfj-2017
completed/08. Working with APIs (Part 1).ipynb
mit
from os import environ slack_hook = environ.get('IRE_CFJ_2017_SLACK_HOOK', None) """ 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 accomp...
necromuralist/necromuralist.github.io
posts/baysian-spam-detector.ipynb
mit
# python standard library from fractions import Fraction import sys # it turns out 'reduce' is no longer a built-in function in python 3 if sys.version_info.major >= 3: from functools import reduce spam = 'offer is secret, click secret link, secret sports link'.split(',') print(len(spam)) ham = 'play sports toda...
ledrui/cat-vs-dogs-deeplearning
vgg16/lesson1.ipynb
mit
%matplotlib inline """ Explanation: Using Convolutional Neural Networks Welcome to the first week of the first deep learning certificate! We're going to use convolutional neural networks (CNNs) to allow our computer to see - something that is only possible thanks to deep learning. Introduction to this week's task: 'Do...
tensorflow/docs-l10n
site/ko/guide/keras/sequential_model.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...
mehmetcanbudak/JupyterWorkflow
JupyterWorkflow4.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt plt.style.use("seaborn") from jupyterworkflow.data import get_fremont_data data = get_fremont_data() data.head() data.resample("W").sum().plot() data.groupby(data.index.time).mean().plot() pivoted = data.pivot_table("Total", index=data.index.time, columns=data.ind...
cranmer/look-elsewhere-2d
examples_from_paper.ipynb
mit
%pylab inline --no-import-all from lee2d import * """ Explanation: Look Elsewhere Effect in 2-d Kyle Cranmer, Nov 19, 2015 Based on Estimating the significance of a signal in a multi-dimensional search by Ofer Vitells and Eilam Gross http://arxiv.org/pdf/1105.4355v1.pdf This is for the special case of a likelihood ...
thempel/adaptivemd
examples/tutorial/3_example_adaptive.ipynb
lgpl-2.1
import sys, os from adaptivemd import ( Project, Event, FunctionalEvent, File ) # We need this to be part of the imports. You can only restore known objects # Once these are imported you can load these objects. from adaptivemd.engine.openmm import OpenMMEngine from adaptivemd.analysis.pyemma import PyEMMA...
oroszl/szamprob
notebooks/Package04/3D.ipynb
gpl-3.0
%pylab inline from mpl_toolkits.mplot3d import * #3D-s ábrák alcsomagja from ipywidgets import * #interaktivitáshoz szükséges függvények """ Explanation: 3D ábrák A matplotlib csomag elsősorban 2D ábrák gyártására lett kitalálva. Ennek ellenére rendelkezik néhány 3D-s ábrakészítési függvénnyel is. Vizsgáljunk me...