repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
ceholden/ceholden.github.io
_drafts/2016-09-09-Landsat-Metadata-Dask.ipynb
mit
import dask.dataframe as ddf columns = { 'sceneID': str, 'sensor': str, 'path': int, 'row': int, 'acquisitionDate': str, 'cloudCover': float, 'cloudCoverFull': float, 'sunElevation': float, 'sunAzimuth': float, 'DATA_TYPE_L1': str, 'GEOMETRIC_RMSE_MODEL': float, 'GEOMETR...
Jackporter415/phys202-2015-work
assignments/assignment03/NumpyEx03.ipynb
mit
import numpy as np %matplotlib inline import matplotlib.pyplot as plt import seaborn as sns import antipackage import github.ellisonbg.misc.vizarray as va """ Explanation: Numpy Exercise 3 Imports End of explanation """ def brownian(maxt, n): """Return one realization of a Brownian (Wiener) process with n steps...
pierre-rouanet/aupyom
examples/Live modification of the pitch and time-scale of sounds.ipynb
gpl-3.0
from aupyom import Sampler, Sound from aupyom.util import example_audio_file sampler = Sampler() audio_file = example_audio_file() s1 = Sound.from_file(audio_file) """ Explanation: Live modification of the pitch and time-scale of sounds Aupyom was mainly designed so it is really easily to modify the pitch ant time-s...
karlstroetmann/Formal-Languages
ANTLR4-Python/Earley-Parser/Earley-Parser.ipynb
gpl-2.0
!type simple.g !cat simple.g """ Explanation: Implementing an Earley Parser A Grammar for Grammars Earley's algorithm has two inputs: - a grammar $G$ and - a string $s$. It then checks whether the string $s$ can be parsed with the given grammar. In order to input the grammar in a natural way, we first have to develop...
nholtz/structural-analysis
Devel/Old/v04-old/Milestones/Frame2D-v04-Milestone1.ipynb
cc0-1.0
from __future__ import print_function import salib as sl sl.import_notebooks() from Tables import Table from Nodes import Node from Members import Member from LoadSets import LoadSet, LoadCombination from NodeLoads import makeNodeLoad from FixedEndForces import makeMemberLoad from collections import OrderedDict, defau...
Olsthoorn/TransientGroundwaterFlow
exercises_notebooks/Sudden_head_ change_section_54.ipynb
gpl-3.0
import numpy as np import matplotlib.pyplot as plt from scipy.special import erfc # scipy.special has numerous special mathematical functions """ Explanation: Sudden head change at $x=0$ IHE, Delft, Transient Groundwater Exercises in class, 2012-01-07 @T.N.Olsthoorn dddk Loading modules End of explanation """ x = n...
rlopc/datcom-labs
ugr-datcom-ncc_ni-labs/ugr-datcom-ncc_ni-lab_00/ex_06-numerical_integration_hh_squid_axon.ipynb
gpl-3.0
%matplotlib inline import brian2 as b2 import matplotlib.pyplot as plt from neurodynex.hodgkin_huxley import HH from neurodynex.tools import input_factory import jupyterthemes as jt jt.get_themes() jt. HH.getting_started() """ Explanation: Adaptative Integrate And Fire Model End of explanation """ I_min = 2.30 cu...
harpolea/r3d2
docs/states.ipynb
mit
from r3d2 import eos_defns, State eos = eos_defns.eos_gamma_law(5.0/3.0) U = State(1.0, 0.1, 0.0, 2.0, eos) """ Explanation: States A Riemann Problem is specified by the state of the material to the left and right of the interface. In this hydrodynamic problem, the state is fully determined by an equation of state an...
zzsza/Datascience_School
30. 딥러닝/07. RNN 기본 구조와 Keras를 사용한 RNN 구현.ipynb
mit
s = np.sin(2 * np.pi * 0.125 * np.arange(20)) plt.plot(s, 'ro-') plt.xlim(-0.5, 20.5) plt.ylim(-1.1, 1.1) plt.show() """ Explanation: RNN 기본 구조와 Keras를 사용한 RNN 구현 신경망을 사용하여 문장(sentence)이나 시계열(time series) 데이터와 같은 순서열(sequence)를 예측하는 문제를 푸는 경우, 예측하고자 하는 값이 더 오랜 과거의 데이터에 의존하게 하려면 시퀀스를 나타내는 벡터의 크기를 증가시켜야 한다. 예를 들어 10,000...
plipp/informatica-pfr-2017
nbs/2/2-Numerical-Data-Pandas-Self-Employment-Rates-DF-Exercise.ipynb
mit
countries = ['AUS', 'AUT', 'BEL', 'CAN', 'CZE', 'FIN', 'DEU', 'GRC', 'HUN', 'ISL', 'IRL', 'ITA', 'JPN', 'KOR', 'MEX', 'NLD', 'NZL', 'NOR', 'POL', 'PRT', 'SVK', 'ESP', 'SWE', 'CHE', 'TUR', 'GBR', 'USA', 'CHL', 'COL', 'EST', 'ISR', 'RUS', 'SVN', 'EU28', 'EA19', 'LVA'] male_selfemployment_rate...
Housebeer/Natural-Gas-Model
backup/Matching Market v1.ipynb
mit
import random as rnd class Supplier(): def __init__(self): self.wta = [] # the supplier has n quantities that they can sell # they may be willing to sell this quantity anywhere from a lower price of l # to a higher price of u def set_quantity(self,n,l,u): for i in range(n): ...
bjornaa/ladim
examples/line/holoviews.ipynb
mit
import numpy as np from netCDF4 import Dataset import holoviews as hv from postladim import ParticleFile hv.extension('bokeh') """ Explanation: Plotting particle distributions with holoviews End of explanation """ # Read bathymetry and land mask with Dataset('../data/ocean_avg_0014.nc') as ncid: H = ncid.variabl...
ComputationalModeling/spring-2017-danielak
past-semesters/spring_2016/day-by-day/day08-modeling-viral-load-2/Day_8_Pre_Class_Notebook_SOLUTIONS.ipynb
agpl-3.0
# Imports the functionality that we need to display YouTube videos in a Jupyter Notebook. # You need to run this cell before you run ANY of the YouTube videos. from IPython.display import YouTubeVideo # WATCH THE VIDEO IN FULL-SCREEN MODE YouTubeVideo("8_wSb927nH0",width=640,height=360) # Complex 'if' statements...
GoogleCloudPlatform/asl-ml-immersion
notebooks/building_production_ml_systems/solutions/0_export_data_from_bq_to_gcs.ipynb
apache-2.0
from google import api_core from google.cloud import bigquery """ Explanation: Exporting data from BigQuery to Google Cloud Storage In this notebook, we export BigQuery data to GCS so that we can reuse our Keras model that was developed on CSV data. End of explanation """ # Change below if necessary PROJECT = !gclou...
chesters99/ghpages
content/loan-default-prediction.ipynb
gpl-3.0
%%time print('Reading: loan_stat542.csv into loans dataframe...') loans = pd.read_csv('loan_stat542.csv') print('Loans dataframe:', loans.shape) test_ids = pd.read_csv('Project3_test_id.csv', dtype={'test1':int,'test2':int, 'test3':int,}) print('ids dataframe:', test_ids.shape) trains = [] tests = [] labels = [] for...
SylvainCorlay/bqplot
examples/Applications/Visualizing the US Elections.ipynb
apache-2.0
from __future__ import print_function import pandas as pd import numpy as np from ipywidgets import VBox, HBox import os codes = pd.read_csv(os.path.abspath('../data_files/state_codes.csv')) try: from pollster import Pollster except ImportError: print('Pollster not found. Installing Pollster..') try: ...
metpy/MetPy
v0.8/_downloads/Skew-T_Layout.ipynb
bsd-3-clause
import matplotlib.gridspec as gridspec import matplotlib.pyplot as plt import numpy as np import pandas as pd import metpy.calc as mpcalc from metpy.cbook import get_test_data from metpy.plots import add_metpy_logo, Hodograph, SkewT from metpy.units import units """ Explanation: Skew-T with Complex Layout Combine a S...
4DGenome/Chromosomal-Conformation-Course
Notebooks/A5-Modeling_-_analysis_of_3D_models.ipynb
gpl-3.0
from pytadbit import load_structuralmodels models_t0 = load_structuralmodels('T0.models') model= models_t0[0] """ Explanation: Descriptive statisitcs on a sinlge model End of explanation """ print model.radius_of_gyration() """ Explanation: Calculate the radius of gyration of a model (median distance of all part...
drericstrong/Blog
20161220_Dice Advantage and Disadvantage.ipynb
agpl-3.0
import numpy as np import seaborn as sns from scipy import stats import matplotlib.pyplot as plt %matplotlib inline #Remember that Python is zero-indexed, and the range function will return #up to one value less than the second parameter roll1poss = list(range(1,21)) roll2poss = list(range(1,21)) #This next line might...
ilogue/pyrsa
demos/exercise_all.ipynb
lgpl-3.0
import numpy as np from scipy import io import matplotlib.pyplot as plt import pyrsa """ Explanation: Getting started exercise for RSA3.0 Introduction In these three exercises you will get an introduction to the functionality of the new pyRSA-toolbox for inferring the underlying model representation based on measured ...
rmenegaux/bqplot
examples/Mark Interactions.ipynb
apache-2.0
x_sc = LinearScale() y_sc = LinearScale() x_data = np.arange(20) y_data = np.random.randn(20) scatter_chart = Scatter(x=x_data, y=y_data, scales= {'x': x_sc, 'y': y_sc}, default_colors=['dodgerblue'], interactions={'click': 'select'}, selected_style={'opacity': 1.0, 'fil...
abevieiramota/data-science-cookbook
2017/07-decision-tree/decision_tree.ipynb
mit
import os import pandas as pd import math import numpy as np from sklearn.tree import DecisionTreeClassifier headers = ["buying", "maint", "doors", "persons","lug_boot", "safety", "class"] data = pd.read_csv("car_data.csv", header=None, names=headers) data = data.sample(frac=1).reset_index(drop=True) # shuffle """ E...
badlands-model/BayesLands
Examples/mountain/Hydrometrics.ipynb
gpl-3.0
%matplotlib inline from matplotlib import cm # Import badlands grid generation toolbox import pybadlands_companion.hydroGrid as hydr # display plots in SVG format %config InlineBackend.figure_format = 'svg' """ Explanation: Hydrometrics In this notebook, we show how to compute several hydrometics parameters based ...
arne-cl/alt-mulig
python/pocores-vs-markus-conll-scoring.ipynb
gpl-3.0
import sys def has_valid_annotation(mmax_file, scorer_path, metric, verbose=False): """ Parameters ---------- metric : str muc, bcub, ceafm, ceafe, blanc verbose : bool or str True, False or 'very' """ scorer = sh.Command(scorer_path) mdg = MMAXDocumentGraph(mmax_file) ...
SJSlavin/phys202-2015-work
assignments/midterm/AlgorithmsEx03.ipynb
mit
%matplotlib inline from matplotlib import pyplot as plt import numpy as np from IPython.html.widgets import interact """ Explanation: Algorithms Exercise 3 Imports End of explanation """ def char_probs(s): """Find the probabilities of the unique characters in the string s. Parameters ---------- ...
flsantos/startup_acquisition_forecast
modelling.ipynb
mit
#All imports here import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from IPython.display import display, HTML from sklearn.model_selection import train_test_split from sklearn.tree import DecisionTreeClassifier from sklearn.ensemble import RandomForestClassifier from sklearn....
paris-saclay-cds/ramp-workflow
rampwf/tests/kits/titanic_no_test_old/titanic_no_test_old_starting_kit.ipynb
bsd-3-clause
%matplotlib inline import os import glob import numpy as np from scipy import io import matplotlib.pyplot as plt import pandas as pd from rampwf.utils.importing import import_module_from_source """ Explanation: Paris Saclay Center for Data Science Titanic RAMP: survival prediction of Titanic passengers Benoit Playe (I...
JakeColtman/BayesianSurvivalAnalysis
.ipynb_checkpoints/Full done-checkpoint.ipynb
mit
running_id = 0 output = [[0]] with open("E:/output.txt") as file_open: for row in file_open.read().split("\n"): cols = row.split(",") if cols[0] == output[-1][0]: output[-1].append(cols[1]) output[-1].append(True) else: output.append(cols) output = out...
Almaz-KG/MachineLearning
ml-for-finance/python-for-financial-analysis-and-algorithmic-trading/01-Python-Crash-Course/Python Crash Course Exercises - Solutions.ipynb
apache-2.0
price = 300 price**0.5 import math math.sqrt(price) """ Explanation: Python Crash Course Exercises - Solutions This is an optional exercise to test your understanding of Python Basics. The questions tend to have a financial theme to them, but don't look to deeply into these tasks themselves, many of them don't hold ...
tanmay987/deepLearning
sentiment-rnn/Sentiment_RNN_Solution.ipynb
mit
import numpy as np import tensorflow as tf with open('../sentiment-network/reviews.txt', 'r') as f: reviews = f.read() with open('../sentiment-network/labels.txt', 'r') as f: labels = f.read() reviews[:2000] """ Explanation: Sentiment Analysis with an RNN In this notebook, you'll implement a recurrent neural...
post2web/nbloader
.ipynb_checkpoints/tutorial-checkpoint.ipynb
mit
from nbloader import Notebook loaded_notebook = Notebook('test.ipynb') """ Explanation: Importing Jupyter Notebooks as "Objects" Jupyter Notebooks are great for data exploration, visualizing, documenting, prototyping and iteracting with the code, but when it comes to creating an actual program out of a notebook they ...
radu941208/DeepLearning
Hyperparameter_Tuning_Regularization_Optimization/Regularization.ipynb
mit
# import packages import numpy as np import matplotlib.pyplot as plt from reg_utils import sigmoid, relu, plot_decision_boundary, initialize_parameters, load_2D_dataset, predict_dec from reg_utils import compute_cost, predict, forward_propagation, backward_propagation, update_parameters import sklearn import sklearn.da...
CNS-OIST/STEPS_Example
user_manual/source/diffusion_boundary.ipynb
gpl-2.0
import steps.model as smodel import steps.geom as sgeom import steps.rng as srng import steps.solver as solvmod import steps.utilities.meshio as meshio import numpy import pylab """ Explanation: Diffusion Boundary The simulation script described in this chapter is available at STEPS_Example repository. In some systems...
xtr33me/deep-learning
autoencoder/Simple_Autoencoder.ipynb
mit
img = mnist.train.images[2] plt.imshow(img.reshape((28, 28)), cmap='Greys_r') """ Explanation: Below I'm plotting an example image from the MNIST dataset. These are 28x28 grayscale images of handwritten digits. End of explanation """ # Size of the encoding layer (the hidden layer) encoding_dim = 32 # feel free to ch...
lowRISC/ot-sca
jupyter/otbn_attack_100M.ipynb
apache-2.0
import numpy as np wave = np.load('waves_p256_100M_2s.npy') #wave = np.load('waves_p256_100M_2s_12bits.npy') #wave = np.load('waves_p256_100M_2s_12bits830.npy') #wave = np.load('waves_p256_100M_2s_12bitsf0c.npy') import numpy as np import pandas as pd from scipy import signal def butter_highpass(cutoff, fs, order=5):...
mne-tools/mne-tools.github.io
0.23/_downloads/9bd293f49554a21d68d4f2a842cc6cc2/59_head_positions.ipynb
bsd-3-clause
# Authors: Eric Larson <larson.eric.d@gmail.com> # # License: BSD (3-clause) from os import path as op import mne print(__doc__) data_path = op.join(mne.datasets.testing.data_path(verbose=True), 'SSS') fname_raw = op.join(data_path, 'test_move_anon_raw.fif') raw = mne.io.read_raw_fif(fname_raw, allow_maxshield='yes...
brclark-usgs/flopy
examples/Notebooks/flopy3_gridgen.ipynb
bsd-3-clause
%matplotlib inline import os import sys import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import flopy from flopy.utils.gridgen import Gridgen print(sys.version) print('numpy version: {}'.format(np.__version__)) print('matplotlib version: {}'.format(mpl.__version__)) print('flopy version: {...
sudhanshuptl/Machine-Learning
Data Analysis learning/Data_Analysis_2(Numpy Pandas).ipynb
gpl-2.0
import numpy as np """ Explanation: Basics of NUmpy & Pandas Numpy Numpy uses array whereas pandas used scaler <br /> End of explanation """ num = np.array([3,4,2,5,7,23,56,23,7,23,89,43,676,43]) num """ Explanation: Array are similar to python list , but it all element must be of same data type, and it faster than...
jrrembert/cybernetic-organism
dato/recommendations/Analyzing product sentiment.ipynb
gpl-2.0
import graphlab """ Explanation: Predicting sentiment from product reviews Fire up GraphLab Create End of explanation """ products = graphlab.SFrame('amazon_baby.gl/') """ Explanation: Read some product review data Loading reviews for a set of baby products. End of explanation """ products.head() """ Explanation...
AbhilashReddyM/GeometricMultigrid
notebooks/Making_a_Preconditioner-vectorized.ipynb
mit
import numpy as np """ Explanation: This is functionally similar to the the other notebook. All the operations here have been vectorized. This results in much much faster code, but is also much unreadable. The vectorization also necessitated the replacement of the Gauss-Seidel smoother with under-relaxed Jacobi. That ...
walkon302/CDIPS_Recommender
notebooks/Create_Datasets_for_Evaluation.ipynb
apache-2.0
import pandas as pd import numpy as np import matplotlib.pyplot as plt %matplotlib inline # get data user_profile = pd.read_csv('../data_user_view_buy/user_profile.csv',sep='\t',header=None) user_profile.columns = ['user_id','buy_spu','buy_sn','buy_ct3','view_spu','view_sn','view_ct3','time_interval','view_cnt','view_...
dereneaton/ipyrad
tests/cookbook-quartet-species-tree.ipynb
gpl-3.0
## conda install ipyrad -c ipyrad ## conda install toytree -c eaton-lab import ipyrad.analysis as ipa import ipyparallel as ipp import toytree """ Explanation: Inferring species trees with tetrad When you install ipyrad a number of analysis tools are installed as well. This includes the program tetrad, which applies ...
kimkipyo/dss_git_kkp
Python 복습/05일차.화_디버깅,예외,예외처리,우분투,숙제_하노이의탑/5일차_디버깅,예외,예외처리,우분투.ipynb
mit
for i in range(3): a = i * 7 #0, 7, 14 b = i + 2 #2, 3, 4 c = a * b # 0, 21, 56 #만약 이 range값이 3017, 5033일 경우에는 무슨 값인지 알 수 없다. 이 때 쉽게 a,b,c값이 무엇인지 찾는 방법을 소개 """ Explanation: 1T_디버깅(Debugging), 오류(errors), 예외(Exceptions)처리(Handling) End of explanation """ name = "KiPyo Kim" age = 29 from IPython import em...
jalabort/templatetracker
notebooks/KCF Tracker.ipynb
bsd-3-clause
video_path = '../data/video.mp4' cam = cv2.VideoCapture(video_path) print 'Is video capture opened?', cam.isOpened() n_frames = 1000 resolution = (640, 360) frames = [] for _ in range(n_frames): # read frame frame = cam.read()[1] # scale down frame = cv2.resize(frame, resolution) # bgr to rgb ...
yunqu/PYNQ
boards/Pynq-Z1/base/notebooks/board/asyncio_buttons.ipynb
bsd-3-clause
from pynq import PL from pynq.overlays.base import BaseOverlay base = BaseOverlay("base.bit") """ Explanation: Using Interrupts and asyncio for Buttons and Switches This notebook provides a simple example for using asyncio I/O to interact asynchronously with multiple input devices. A task is created for each input de...
ES-DOC/esdoc-jupyterhub
notebooks/ipsl/cmip6/models/sandbox-2/ocnbgchem.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'ipsl', 'sandbox-2', 'ocnbgchem') """ Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem MIP Era: CMIP6 Institute: IPSL Source ID: SANDBOX-2 Topic: Ocnbgchem Sub-Topics: Tracers. Properties:...
tkzeng/molecular-design-toolkit
moldesign/_notebooks/Example 4. HIV Protease bound to an inhibitor.ipynb
apache-2.0
import moldesign as mdt import moldesign.units as u """ Explanation: <span style="float:right"><a href="http://moldesign.bionano.autodesk.com/" target="_blank" title="About">About</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://forum.bionano.autodesk.com/c/Molecular-Design-Toolkit" target="_blank" title="Forum...
myfunprograms/machine-learning
finding_donors/finding_donors_original.ipynb
apache-2.0
# 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...
ES-DOC/esdoc-jupyterhub
notebooks/hammoz-consortium/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', 'hammoz-consortium', 'sandbox-3', 'aerosol') """ Explanation: ES-DOC CMIP6 Model Properties - Aerosol MIP Era: CMIP6 Institute: HAMMOZ-CONSORTIUM Source ID: SANDBOX-3 Topic: Aerosol Sub-Topics: T...
gdsfactory/gdsfactory
docs/notebooks/06_yaml_component.ipynb
mit
# %matplotlib widget import ipywidgets from IPython.display import clear_output import matplotlib.pyplot as plt import gdsfactory as gf x = ipywidgets.Textarea(rows=20, columns=480) x.value = """ name: sample_different_factory instances: bl: component: pad tl: component: pad br: compon...
maxrose61/GA_DS
FInal_Project/.ipynb_checkpoints/Quantifying_Influence_Analysis_maxrose_DSFinal-checkpoint.ipynb
gpl-3.0
### Import as many items as possible to have available. ### Import data from CSV %matplotlib inline import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt from sklearn import metrics from sklearn.linear_model import LinearRegression from sklearn.linear_model import LogisticRegres...
tensorflow/workshops
tfx_labs/Lab_6_Model_Analysis.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under...
dataworkshop/titanic
vladimir/src/Titanic.ipynb
mit
train_df = pd.read_csv('../input/train.csv') test_df = pd.read_csv('../input/test.csv') all_df = train_df.append(test_df) all_df['is_test'] = all_df.Survived.isnull() all_df.index = all_df.Survived del all_df['Survived'] all_df.head() """ Explanation: Read data End of explanation """ train_df.describe() """ Expla...
Neuroglycerin/neukrill-net-work
notebooks/model_run_and_result_analyses/Analyse alexnet_learning_rate model.ipynb
mit
cd .. %run check_test_score.py -v run_settings/alexnet_based_norm_global.json """ Explanation: This notebook investigates alexnet-based model with normalisation and a new learning rate schedule. The changes made include: increasing the number of epochs on which learning rate and momentum saturate to 250 (instead of o...
google-research/google-research
domain_conditional_predictors/validation_experiment.ipynb
apache-2.0
#@test {"skip": true} !pip install dm-sonnet==2.0.0 --quiet !pip install tensorflow_addons==0.12 --quiet #@test {"output": "ignore"} import numpy as np import tensorflow as tf import tensorflow_datasets as tfds import tensorflow_addons as tfa try: import sonnet.v2 as snt except ModuleNotFoundError: import sonne...
adukic/nd101
intro-to-tflearn/Sentiment Analysis with TFLearn.ipynb
mit
import pandas as pd import numpy as np import tensorflow as tf import tflearn from tflearn.data_utils import to_categorical """ Explanation: Sentiment analysis with TFLearn In this notebook, we'll continue Andrew Trask's work by building a network for sentiment analysis on the movie review data. Instead of a network w...
shareactorIO/pipeline
source.ml/jupyterhub.ml/notebooks/zz_old/TensorFlow/Distributed/Distributed_Tensorflow_Training_HybridCloud.ipynb
apache-2.0
import tensorflow as tf !pip install version_information %load_ext version_information %version_information numpy, scipy, matplotlib, pandas, tensorflow, sklearn, skflow """ Explanation: Distributed Tensorflow End of explanation """ !kubectl get pod CLUSTER_SPEC= """ { 'ps' : ['clustered-tensorflow-ps0:2222',...
mhdella/scipy_2015_sklearn_tutorial
notebooks/04.3 Analyzing Model Capacity.ipynb
cc0-1.0
import numpy as np import matplotlib.pyplot as plt from sklearn.pipeline import Pipeline from sklearn.svm import SVR from sklearn import cross_validation rng = np.random.RandomState(42) n_samples = 200 kernels = ['linear', 'poly', 'rbf'] true_fun = lambda X: X ** 3 X = np.sort(5 * (rng.rand(n_samples) - .5)) y = tru...
mrcinv/matpy
02b_vrste.ipynb
gpl-2.0
from sympy import * init_printing() n = Symbol('n') a = lambda n: 1/(n*(n+2)) Sum(a(n),(n,1,oo)) """ Explanation: ^ gor: Uvod Številske vrste Vrsta je neskončna vsota $$a_0+a_1+a_2+\ldots = \sum_{n=0}^\infty a_n.$$ Vsoto vrste definiramo z zaporedjem delnih vsot $$S_n=a_0+a_1+\ldots a_n =\sum_{k=0}^n a_k$$ in $$\sum_{...
bmeaut/python_nlp_2017_fall
course_material/05_Generator_expressions_list_comprehension/05_OOP_Comprehension_ContextM_lab_solution.ipynb
mit
from math import gcd class RationalNumber(object): # TODO r = RationalNumber(43, 2) assert r + r == RationalNumber(43) # q = 1 in this case assert r * 2 == r + r r1 = RationalNumber(3, 2) r2 = RationalNumber(4, 3) assert r1 * r2 == RationalNumber(12, 6) assert r1 / r2 == RationalNumber(9, 8) as...
unapiedra/BBChop
analysis/Example Run.ipynb
gpl-2.0
with open('example_run.csv') as f: s = f.read() N = 10 runs = [[1/N for _ in range(N)]] for line in s.split('\n'): line = line.strip('[]') if len(line) > 0: li = [float(i) for i in line.split(',')] runs.append(li) """ Explanation: In this little experiment, I printed the likelihoods after each...
chivalrousS/word2vec
examples/doc2vec.ipynb
apache-2.0
from __future__ import unicode_literals import os import nltk directories = ['train/pos', 'train/neg', 'test/pos', 'test/neg', 'train/unsup'] input_file = open('/Users/drodriguez/Downloads/alldata.txt', 'w') id_ = 0 for directory in directories: rootdir = os.path.join('/Users/drodriguez/Downloads/aclImdb', dire...
hagne/atm-py
examples/instruments_POPS_mie.ipynb
mit
from atmPy.aerosols.instruments.POPS import mie %matplotlib inline import matplotlib.pylab as plt plt.rcParams['figure.dpi'] = 200 """ Explanation: Introduction This module provides tools to simulate scattering intensities detected by POPS as a function of particle size, refractive index, and some more less obvious p...
European-XFEL/h5tools-py
docs/parallel_example.ipynb
bsd-3-clause
from karabo_data import RunDirectory import multiprocessing import numpy as np """ Explanation: Parallel processing with a virtual dataset This example demonstrates splitting up some data to be processed by several worker processes, and collecting the results back together. For this example, we'll use data from an XGM...
uwoseis/anemoi
notebooks/Compare Solutions Homogeneous.ipynb
mit
import sys sys.path.append('../') import numpy as np from anemoi import MiniZephyr, SimpleSource, AnalyticalHelmholtz import matplotlib.pyplot as plt import matplotlib.cm as cm import matplotlib %matplotlib inline from IPython.display import set_matplotlib_formats set_matplotlib_formats('png') matplotlib.rcParams['...
datascienceguide/datascienceguide.github.io
tutorials/.ipynb_checkpoints/Linear-Regression-Tutorial-Copy1-checkpoint.ipynb
mit
import matplotlib.pyplot as plt import numpy as np import pandas as pd from math import log from sklearn import linear_model #comment below if not using ipython notebook %matplotlib inline """ Explanation: Linear Regression Tutorial Author: Andrew Andrade (andrew@andrewandrade.ca) This is part one of a series of tu...
sempwn/ABCPRC
Tutorial_Ecology.ipynb
mit
%matplotlib inline import ABCPRC as prc import numpy as np import scipy.stats as stats import matplotlib.pyplot as plt """ Explanation: Ecology Example We use here the example of migratory birds in order to demonstrate the model fitting of this package End of explanation """ def ibm(*ps): m0,k = ps[0],ps[1] ...
tingelst/pymanopt
examples/MoG_singularity_heuristic.ipynb
bsd-3-clause
import autograd.numpy as np np.set_printoptions(precision=2) import matplotlib.pyplot as plt %matplotlib inline # Number of data N = 1000 # Dimension of data D = 2 # Number of clusters K = 3 pi = [0.1, 0.6, 0.3] mu = [np.array([-4, 1]), np.array([0, 0]), np.array([2, -1])] Sigma = [np.array([[3, 0],[0, 1]]), np.arr...
wmfschneider/CHE30324
Homework/HW4-soln.ipynb
gpl-3.0
import sympy as sy from sympy import * x=Symbol('x') a=Symbol('a',positive=True) b=Symbol('b',positive=True) Wavefunction=a*exp(-x**2/2/b**2) A=integrate(Wavefunction**2,(x,-oo,+oo)) # calculate the integral of (wavefunc) * (wavefunc*) from -oo to +oo Wavefunction_normalized=Wavefunction/sqrt(A) pprint(Wavefunct...
Jackie789/JupyterNotebooks
Naive+Bayes+for+Classification+of+Positive-Negative+reviews.ipynb
gpl-3.0
%matplotlib inline import numpy as np import pandas as pd import scipy import sklearn import matplotlib.pyplot as plt import seaborn as sns # Grab and process the raw data. data_path = ("/Users/jacquelynzuker/Desktop/sentiment labelled sentences/amazon_cells_labelled.txt" ) amazon_raw = pd.read_csv(data_pa...
vyvojer/ploev
notebooks/Board matching.ipynb
gpl-3.0
odds_oracle = OddsOracle() calc = Calc(odds_oracle) """ Explanation: Сначала присоединяемся к серверу OddsOracle End of explanation """ # Префлоп диапазоны (используем сохранненные диапазоны PokerJuice) main_ranges = ['$FI12', '$FI20', '$FI25', '$FI30', '$FI40', '$FI50', '$3b4i', '$3b6i', '$3b8i', '$...
kit-cel/wt
wt/vorlesung/ch7_9/weakly_stationary.ipynb
gpl-2.0
# importing import numpy as np import matplotlib.pyplot as plt import matplotlib # showing figures inline %matplotlib inline # plotting options font = {'size' : 20} plt.rc('font', **font) plt.rc('text', usetex=True) matplotlib.rc('figure', figsize=(18, 6) ) """ Explanation: Content and Objective Checking for (...
tyamamot/h29iro
codes/5_Learning_to_Rank.ipynb
mit
! ../bin/svm_rank_learn -c 0.03 ../data/svmrank_sample/train.dat ../data/svmrank_sample/model """ Explanation: 第5回 ランキング学習(Ranking SVM) この演習課題ページでは,Ranking SVMの実装であるSVM-rankの使い方を説明します.この演習ページの目的は,SVM-rankを用いてモデルの学習,テストデータに対するランク付けが可能になることです. この演習ページでは以下のツールを使用します. - SVM-rank (by Prof. Thorsten Joachims) - https://w...
tuanavu/coursera-university-of-washington
machine_learning/1_machine_learning_foundations/assignment/week4/Document retrieval.ipynb
mit
import graphlab """ Explanation: Document retrieval from wikipedia data Fire up GraphLab Create End of explanation """ people = graphlab.SFrame('people_wiki.gl/') """ Explanation: Load some text data - from wikipedia, pages on people End of explanation """ people.head() len(people) """ Explanation: Data contain...
nansencenter/nansat-lectures
notebooks/03 object oriented programming.ipynb
gpl-3.0
class A(): pass """ Explanation: Intorduction to Object Oriented Programming in Python Definition of the minimal class in two lines Define class End of explanation """ a = A() # create an instance of class A print (a) print (type(a)) """ Explanation: Use class End of explanation """ class Human(object): ...
robertoalotufo/ia898
2S2018/13 Correlacao de fase.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np from numpy.fft import * import sys,os ia898path = os.path.abspath('../../') if ia898path not in sys.path: sys.path.append(ia898path) import ia898.src as ia f = mpimg.imread('../data/cameraman.tif') # Transladan...
dipanjank/ml
data_analysis/abalone.ipynb
gpl-3.0
%pylab inline pylab.style.use('ggplot') import pandas as pd import numpy as np import seaborn as sns url = 'https://archive.ics.uci.edu/ml/machine-learning-databases/abalone/abalone.data' data_df = pd.read_csv(url, header=None) data_df.head() """ Explanation: Abalone - UCI End of explanation """ data_df.columns = ...
diegocavalca/Studies
books/deep-learning-with-python/5.2-using-convnets-with-small-datasets.ipynb
cc0-1.0
import os, shutil # The path to the directory where the original # dataset was uncompressed original_dataset_dir = '/Users/fchollet/Downloads/kaggle_original_data' # The directory where we will # store our smaller dataset base_dir = '/Users/fchollet/Downloads/cats_and_dogs_small' os.mkdir(base_dir) # Directories for...
gbtimmon/ase16GBT
code/6/magoff2_pom3_ga.ipynb
unlicense
%matplotlib inline # All the imports from __future__ import print_function, division from math import * import random import sys import matplotlib.pyplot as plt # TODO 1: Enter your unity ID here __author__ = "magoff2" class O: """ Basic Class which - Helps dynamic updates - Pretty Prints ...
betoesquivel/comment_summarization
Lab1 Text processing with python.ipynb
mit
import sklearn import numpy as np import matplotlib.pyplot as plt data = np.array([[1,2], [2,3], [3,4], [4,5], [5,6]]) x = data[:,0] y = data[:,1] data, x, y """ Explanation: Basic usage of Sklearn End of explanation """ from sklearn.feature_extraction.text import CountVectorizer vectorizer = CountVectorizer(min_d...
d-k-b/udacity-deep-learning
embeddings/Skip-Grams-Solution.ipynb
mit
import time import numpy as np import tensorflow as tf import utils """ Explanation: Skip-gram word2vec In this notebook, I'll lead you through using TensorFlow to implement the word2vec algorithm using the skip-gram architecture. By implementing this, you'll learn about embedding words for use in natural language p...
brian-rose/ClimateModeling_courseware
Lectures/Lecture10 -- Who needs spectral bands.ipynb
mit
# Ensure compatibility with Python 2 and 3 from __future__ import print_function, division """ Explanation: ATM 623: Climate Modeling Brian E. J. Rose, University at Albany Lecture 10: Who needs spectral bands? We do. Some baby steps... Warning: content out of date and not maintained You really should be looking at T...
yl565/statsmodels
examples/notebooks/interactions_anova.ipynb
bsd-3-clause
%matplotlib inline from __future__ import print_function from statsmodels.compat import urlopen import numpy as np np.set_printoptions(precision=4, suppress=True) import statsmodels.api as sm import pandas as pd pd.set_option("display.width", 100) import matplotlib.pyplot as plt from statsmodels.formula.api import ols...
csdms/pymt
notebooks/gipl_and_ecsimplesnow.ipynb
mit
import pymt.models import matplotlib.pyplot as plt import seaborn as sns import numpy as np import matplotlib.colors as mcolors from matplotlib.colors import LinearSegmentedColormap sns.set(style='whitegrid', font_scale= 1.2) """ Explanation: Coupling GIPL and ECSimpleSnow models Before you begin, install: conda insta...
DJCordhose/ai
notebooks/ai/Play.ipynb
mit
terrain = [ ["_", "R", "_", "_"], ["H", "_", "B", "_"], ["_", "_", "B", "_"], ["B", "_", "G", "_"] ] """ Explanation: Robot Run The Game In a certain terrain a Robot (R) plays against a Human player (H) * Both Human and Robot try to reach a goal which is at the same distance from both of them * Blocks ...
tlhr/plumology
examples/example.ipynb
mit
from plumology import vis, util, io import numpy as np import pandas as pd import matplotlib.pyplot as plt %matplotlib inline """ Explanation: PLUMOLOGY vis: Visualization and plotting functions util: Various utilities and calculation functions io: Functions to read certain output files and an HDF interface End of e...
metpy/MetPy
v0.9/_downloads/d02fda82caa4290e31f980126221b2a4/Wind_SLP_Interpolation.ipynb
bsd-3-clause
import cartopy.crs as ccrs import cartopy.feature as cfeature from matplotlib.colors import BoundaryNorm import matplotlib.pyplot as plt import numpy as np import pandas as pd from metpy.calc import wind_components from metpy.cbook import get_test_data from metpy.interpolate import interpolate_to_grid, remove_nan_obse...
letsgoexploring/linearsolve-package
examples/cia_model.ipynb
mit
# Import numpy, pandas, linearsolve, scipy.optimize, matplotlib.pyplot import numpy as np import pandas as pd import linearsolve as ls from scipy.optimize import root,fsolve,broyden1,broyden2 import matplotlib.pyplot as plt plt.style.use('classic') %matplotlib inline """ Explanation: A Cash-in-Advance Model Replicate ...
mne-tools/mne-tools.github.io
0.22/_downloads/1935e973eb220e31cb4a6a6541231eb1/plot_background_statistics.ipynb
bsd-3-clause
# Authors: Eric Larson <larson.eric.d@gmail.com> # License: BSD (3-clause) from functools import partial import numpy as np from scipy import stats import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D # noqa, analysis:ignore import mne from mne.stats import (ttest_1samp_no_p, bonferroni_correctio...
mbinkowski/DeepSpeechDistances
deep_speech_distances.ipynb
apache-2.0
!pip install python_speech_features !pip install resampy !pip install scipy !pip install gdown !pip install tqdm -U """ Explanation: This notebook provides a demo for the use of DeepSpeech Distances proposed in High Fidelity Speech Synthesis with Adversarial Networks as new evaluation metrics for neural speech synthes...
CivicTechTO/ttc_subway_times
doc/Single_station_all_day_analysis.ipynb
gpl-3.0
import datetime from psycopg2 import connect import configparser import pandas as pd import pandas.io.sql as pandasql import numpy as np import matplotlib import matplotlib.pyplot as plt from matplotlib.widgets import Slider %matplotlib qt try: con.close() except: print("No existing connection... moving on")...
vvishwa/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...
ogoann/StatisticalMethods
examples/SDSScatalog/GalaxySizes.ipynb
gpl-2.0
%load_ext autoreload %autoreload 2 import numpy as np import SDSS import pandas as pd import matplotlib %matplotlib inline galaxies = "SELECT top 1000 \ petroR50_i AS size, \ petroR50Err_i AS err \ FROM PhotoObjAll \ WHERE \ (type = '3' AND petroR50Err_i > 0)" print galaxies # Download data. This can take a few mome...
thewtex/SimpleITK-Notebooks
02_Pythonic_Image.ipynb
apache-2.0
import matplotlib.pyplot as plt import matplotlib as mpl mpl.rc('image', aspect='equal') %matplotlib inline import SimpleITK as sitk # Download data to work on from downloaddata import fetch_data as fdata """ Explanation: Pythonic Syntactic Sugar The Image Basics Notebook was straight forward and closely follows ITK's...
TomTranter/OpenPNM
examples/percolation/Part A - Ordinary Percolation.ipynb
mit
import openpnm as op import matplotlib.pyplot as plt import numpy as np np.random.seed(10) from ipywidgets import interact, IntSlider %matplotlib inline ws = op.Workspace() ws.settings["loglevel"] = 40 """ Explanation: Part A: Ordinary Percolation OpenPNM contains several percolation algorithms which are central to th...
mathLab/RBniCS
tutorials/08_nonlinear_parabolic/tutorial_nonlinear_parabolic_exact.ipynb
lgpl-3.0
from dolfin import * from rbnics import * from utils import * """ Explanation: Tutorial 08 - Non linear Parabolic problem Keywords: exact parametrized functions, POD-Galerkin 1. Introduction In this tutorial, we consider the FitzHugh-Nagumo (F-N) system. The F-N system is used to describe neuron excitable systems. The...
sameersingh/ml-discussions
week1/using_mltools_package.ipynb
apache-2.0
from __future__ import division import numpy as np import matplotlib.pyplot as plt %matplotlib inline np.random.seed(0) """ Explanation: I combined all the code lines I said should be at the begining of your code. End of explanation """ !ls """ Explanation: Importing mltools First you want to make sure it sits in ...
gee-community/gee_tools
notebooks/image/addConstantBand.ipynb
mit
import ee ee.Initialize() from geetools import tools col = ee.ImageCollection('COPERNICUS/S2').select(['B1', 'B2', 'B3']).limit(10) """ Explanation: addConstantBands(value, names, *pairs) Adds bands with a constant value names: final names for the additional bands value: constant value pairs: keywords for the bands...
JonasHarnau/apc
apc/vignettes/vignette_over_dispersed_apc.ipynb
gpl-3.0
import apc # Turn off a FutureWarnings import warnings warnings.simplefilter('ignore', FutureWarning) """ Explanation: Over-dispersed Age-Period-Cohort Models We replicate the data example in Harnau and Nielsen (2017) in Section 6. The work on this vignette was supported by the European Research Council, grant AdG 69...
tensorflow/docs-l10n
site/ja/tutorials/generative/dcgan.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...