repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
Olsthoorn/TransientGroundwaterFlow
Syllabus_in_notebooks/Sec5_4_5_superposition_in_time_erfc.ipynb
gpl-3.0
import numpy as np import matplotlib.pyplot as plt import scipy.special as sp """ Explanation: Superposition in time with the erfc function IHE, Delft, 20200106 @T.N.Olsthoorn See page 56 of the syllabus Context Consider a situation where groundwater is directly subject to varying surface water levels at $x=0$. Show t...
sz-workshop-2017/virtual-machine
notebooks/2.4 - Challenge - Program a simple game.ipynb
apache-2.0
import random """ Explanation: This challenge will get you familiar with the basic elements of Python by programming a simple card game. We will create a custom class to represent each player in the game, which will store information about their current pot, as well as a series of methods defining how they play the ga...
landlab/landlab
notebooks/tutorials/fields/working_with_fields.ipynb
mit
import numpy as np from landlab import RasterModelGrid, FieldError from landlab.components import LinearDiffuser mg = RasterModelGrid((3, 4)) """ Explanation: <a href="http://landlab.github.io"><img style="float: left" src="../../landlab_header.png"></a> Understanding and working with Landlab data fields <hr> <small>...
trungdong/datasets-provanalytics-dmkd
Extra 3.2 - Historical Provenance - Application 3.ipynb
mit
import pandas as pd filepath = "rrg/ancestor-graphs.csv" df = pd.read_csv(filepath, index_col=0) df.head() """ Explanation: Extra 3.2 - Historical Provenance - Application 3: RRG Chat Messages Identifying instructions from chat messages in the Radiation Response Game. In this notebook, we explore the performance of ...
mayankjohri/LetsExplorePython
Section 1 - Core Python/Chapter 04 - Control Flow/3.1 Compound Statements.ipynb
gpl-3.0
password = input("Please enter the password:") if password == "Simsim": print("\t> Welcome to the cave") x = "Mayank" y = "TEST" if y == "TEST": print(x) if y: print("Hello World") z = None if z: print("TEST") x = 11 if x > 10: print("Hello") if x > 10.999999999999: print("Hello agai...
ajhenrikson/phys202-2015-work
assignments/assignment04/TheoryAndPracticeEx02.ipynb
mit
from IPython.display import Image """ Explanation: Theory and Practice of Visualization Exercise 2 Imports End of explanation """ # Add your filename and uncomment the following line: Image(filename='bad graph.jpg') """ Explanation: Violations of graphical excellence and integrity Find a data-focused visualization ...
UDST/pandana
examples/Pandana-demo.ipynb
agpl-3.0
import numpy as np import pandas as pd import pandana print(pandana.__version__) """ Explanation: Pandana demo Sam Maurer, July 2020 This notebook demonstrates the main features of the Pandana library, a Python package for network analysis that uses contraction hierarchies to calculate super-fast travel accessibility...
quantopian/research_public
notebooks/lectures/Linear_Correlation_Analysis/questions/notebook.ipynb
apache-2.0
# Useful Functions def find_most_correlated(data): n = data.shape[1] keys = data.keys() pair = [] max_value = 0 for i in range(n): for j in range(i+1, n): S1 = data[keys[i]] S2 = data[keys[j]] result = np.corrcoef(S1, S2)[0,1] if result > max_v...
ondrolexa/sg2
15_Transpression.ipynb
mit
%pylab inline from scipy import linalg as la """ Explanation: Transpressional deformation End of explanation """ def KDparams(F): u, s, v = svd(F) Rxy = s[0]/s[1] Ryz = s[1]/s[2] K = (Rxy-1)/(Ryz-1) D = sqrt((Rxy-1)**2 + (Ryz-1)**2) return K, D """ Explanation: Here we will examine strain e...
swirlingsand/deep-learning-foundations
rnns/embeddings/.ipynb_checkpoints/Skip-Gram_word2vec-checkpoint.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...
gfeiden/Notebook
Projects/mlt_calib/resampling_tests.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np kde_pdf = np.genfromtxt('data/run08_kde_props.txt') # KDE of full PDF kde_pbr = np.genfromtxt('data/run08_kde_props_tmp.txt') # KDE of bootstrap resample on final 75 iterations kde_fbr = np.genfromtxt('data/run08_kde_props_tmp2.txt') # KDE of ...
ProfessorKazarinoff/staticsite
content/code/ENGR213/Problem_2C6.ipynb
gpl-3.0
import math P = 10 c = 5 L = 100 E = 120*1000 #120 GPa = 120 * 1000 MPa d_exact = (P*L)/(2*math.pi*(c**2)*E) print(f"The exact value for delfection of the cone is d_exact = {d_exact}") """ Explanation: The Problem Below is an engineering mechanics problem that can be solved in Python. Follow along this post to see ...
Naereen/notebooks
agreg/Mémoisation_en_Python_et_OCaml.ipynb
mit
from time import sleep def f1(n): sleep(3) return n + 3 def f2(n): sleep(4) return n * n %timeit f1(10) %timeit f2(10) """ Explanation: Table of Contents <p><div class="lev1 toc-item"><a href="#Mémoïsation,-en-Python-et-en-OCaml" data-toc-modified-id="Mémoïsation,-en-Python-et-en-OCaml-1"><span cla...
peterdalle/mij
3 News robot/Weather news robot.ipynb
gpl-3.0
# Import all the things! import urllib.request from datetime import * from lxml import html from bs4 import BeautifulSoup """ Explanation: Weather news robot A simple and stupid news robot written in Python that scrapes tomorrows weather and writes a short text complaining about how cold it is. 1. Import libraries End...
rsignell-usgs/notebook
HOPS/.ipynb_checkpoints/hops2cf-checkpoint.ipynb
mit
from netCDF4 import Dataset url = ('http://geoport.whoi.edu/thredds/dodsC/usgs/data2/rsignell/gdrive/' 'nsf-alpha/Data/MIT_MSEAS/MSEAS_Tides_20160317/mseas_tides_2015071612_2015081612_01h.nc') nc = Dataset(url) """ Explanation: The problem: CF compliant readers cannot read HOPS dataset directly. The solution...
anhaidgroup/py_entitymatching
notebooks/guides/step_wise_em_guides/.ipynb_checkpoints/Sampling and Labeling-checkpoint.ipynb
bsd-3-clause
# Import py_entitymatching package import py_entitymatching as em import os import pandas as pd # Get the datasets directory datasets_dir = em.get_install_path() + os.sep + 'datasets' path_A = datasets_dir + os.sep + 'DBLP.csv' path_B = datasets_dir + os.sep + 'ACM.csv' path_C = datasets_dir + os.sep + 'tableC.csv' ...
Saxafras/Spacetime
transitions.ipynb
bsd-3-clause
dom_test = ECA(54,domain_54(20*4, 'a')) dom_test.evolve(20*4) diagram(dom_test.get_spacetime()) np.random.seed(0) domain_states = epsilon_field(dom_test.get_spacetime()) domain_states.estimate_states(3,3,1) domain_states.filter_data() a = domain_states.state_transition((10,10), 'forward') print a b = domain_states....
ecervera/mindstorms-nb
nxt/sensors/index.ipynb
mit
from functions import connect, touch, light, sound, ultrasonic, disconnect connect(12) """ Explanation: Sensors Hi ha quatre sensors diferents montats i connectats al robot: Anem a comprovar el funcionament de cadascun d'ells. Primer, necessitem algunes funcions, i com sempre, connectar-nos al robot. End of explanat...
IsacLira/data-science-cookbook
2017/06-linear-regression/resp_linear_regression_isaclira.ipynb
mit
import pandas as pd import numpy as np import matplotlib.pyplot as plt % matplotlib inline # Define uma função para carregar os dados def load_csv(path): df = pd.read_csv(path,names=['num_reinv','pag_total']) return df insdf = load_csv('insurance.csv') insdf.head() plt.scatter(insdf.num_reinv,insdf....
Kaggle/learntools
notebooks/ml_explainability/raw/ex4_shap_basic.ipynb
apache-2.0
from learntools.ml_explainability.ex4 import * print("Setup Complete") """ Explanation: Set Up At this point, you have enough tools to put together compelling solutions to real-world problems. You will ned to pick the right techniques for each part of the following data science scenario. Along the way, you'll use SHAP...
roaminsight/roamresearch
BlogPosts/Average_precision/Average_precision_post.ipynb
apache-2.0
__author__ = 'Nick Dingwall' """ Explanation: Stepping away from linear interpolation End of explanation """ from average_precision_post_code import * """ Explanation: TL;DR Interpolated average precision is a common metric for classification tasks. However, interpolating linearly between operating points, as in sc...
dombrno/PG
Notebooks/test_cluster.ipynb
bsd-2-clause
Tc_mf = meV_to_K(0.5*250) print meV_to_K(pi/2.0) print 1.0/0.89 print cst.physical_constants["Boltzmann constant"] print '$T_c^{MF} = $', Tc_mf, "K" T_KT = meV_to_K(0.1*250) print r"$T_{KT} = $", T_KT, "K" """ Explanation: TB Model We pick the following parameters: + hopping constant $ t= 250$ meV + $\Delta = 1.0 t$...
h-mayorquin/camp_india_2016
tutorials/machine learning/Tutorial_notebook.ipynb
mit
%matplotlib inline import sklearn import scipy.io as sio import matplotlib.pylab as plt import matplotlib as mp import numpy as np import scipy as sp import scipy.ndimage import scipy.signal """ Explanation: Lets first import the important modules. End of explanation """ ft=sio.loadmat("firingTimes.mat") print ft....
robblack007/clase-cinematica-robot
Practicas/practica2/Practica.ipynb
mit
from math import pi, sin, cos from numpy import matrix from matplotlib.pyplot import figure, plot, style from mpl_toolkits.mplot3d import Axes3D style.use("ggplot") %matplotlib notebook τ = 2*pi """ Explanation: Matrices de Transformación Las matrices de rotación y traslación nos sirven para transformar una coordenad...
Ircam-RnD/xmm
python/examples/QuickStart_Python.ipynb
gpl-3.0
import xmm """ Explanation: Multimodal (Gaussian Mixture/Hidden Markov) Models for Motion-Sound Mapping — Quickstart guide Building and using the XMM Python library See http://ircam-rnd.github.io/xmm/ The python library reflects the sructure of the C++ library. The same classes and methods can be used on both implemen...
landlab/landlab
notebooks/tutorials/network_sediment_transporter/run_network_generator_OpenTopoDEM.ipynb
mit
import os import numpy as np import matplotlib.pyplot as plt import xarray as xr from landlab import imshow_grid """ Explanation: <a href="http://landlab.github.io"><img style="float: left" src="../../landlab_header.png"></a> Generate a Network Model Grid on an OpenTopography DEM <hr> <small>For more Landlab tutorial...
Kaggle/learntools
notebooks/feature_engineering_new/raw/what_is_feature_engineering_ex.ipynb
apache-2.0
# Setup feedback system from learntools.core import binder binder.bind(globals()) from learntools.feature_engineering_new.ex1 import * import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from sklearn.model_selection import cross_val_score from xgboost import XGBRegressor # Set...
Abjad/intensive
day-3/1-making-music.ipynb
mit
pairs = [(4, 4), (3, 4), (7, 16), (6, 8)] time_signatures = [abjad.TimeSignature(_) for _ in pairs] durations = [_.duration for _ in time_signatures] time_signature_total = sum(durations) counts = [1, 2, -3, 4] denominator = 16 talea = rmakers.Talea(counts, denominator) talea_index = 0 """ Explanation: Designing a mus...
datacommonsorg/api-python
notebooks/analyzing_genomic_data.ipynb
apache-2.0
# Install datacommons !pip install --upgrade --quiet datacommons """ Explanation: <a href="https://colab.research.google.com/github/datacommonsorg/api-python/blob/master/notebooks/analyzing_genomic_data.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a...
oroszgy/oroszgy.github.io
content/handouts/sklearn-exercise.ipynb
mit
%pylab inline import sklearn from sklearn.linear_model import LogisticRegression from sklearn.datasets import load_digits from sklearn.pipeline import Pipeline from sklearn.decomposition import PCA digits = load_digits() X_digits = digits.data y_digits = digits.target logistic = LogisticRegression() pca = PCA() pipe...
mne-tools/mne-tools.github.io
0.22/_downloads/1c42464343cb8d2a19e726a89ed2fd17/plot_simulated_raw_data_using_subject_anatomy.ipynb
bsd-3-clause
# Author: Ivana Kojcic <ivana.kojcic@gmail.com> # Eric Larson <larson.eric.d@gmail.com> # Kostiantyn Maksymenko <kostiantyn.maksymenko@gmail.com> # Samuel Deslauriers-Gauthier <sam.deslauriers@gmail.com> # License: BSD (3-clause) import os.path as op import numpy as np import mne from mne.da...
xpmanoj/content
HW1.ipynb
mit
# special IPython command to prepare the notebook for matplotlib %matplotlib inline from fnmatch import fnmatch import numpy as np import pandas as pd import matplotlib.pyplot as plt import requests import urllib2 from pattern import web from bs4 import BeautifulSoup as bs # set some nicer defaults for matplotlib f...
simkovic/simkovic.github.io
_ipynb/Guess what?! Another Analysis of the Schnall-Johnson Data.ipynb
mit
%pylab inline import pystan from matustools.matusplotlib import * from scipy import stats import warnings warnings.filterwarnings("ignore") il=['dog','trolley','wallet','plane','resume', 'kitten','mean score','median score'] D=np.loadtxt('schnallstudy1.csv',delimiter=',') D[:,1]=1-D[:,1] Dtemp=np.zeros((D.shape[0]...
valentin-nemcev/tensor-flow-hackathon
helloworld.ipynb
mit
from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) """ Explanation: what is tensor? tensor is a multidimensional array! End of explanation """ x = tf.placeholder(tf.float32, [None, 784]) W = tf.Variable(tf.zeros([784, 10])) b = tf.Variable(tf.zer...
ES-DOC/esdoc-jupyterhub
notebooks/noaa-gfdl/cmip6/models/sandbox-1/seaice.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'noaa-gfdl', 'sandbox-1', 'seaice') """ Explanation: ES-DOC CMIP6 Model Properties - Seaice MIP Era: CMIP6 Institute: NOAA-GFDL Source ID: SANDBOX-1 Topic: Seaice Sub-Topics: Dynamics, Thermodyna...
rajul/tvb-library
tvb/simulator/demos/surface_stochastic.ipynb
gpl-2.0
from tvb.datatypes.cortex import Cortex from tvb.simulator.lab import * """ Explanation: Demonstrate using the simulator for a surface simulation, deterministic integration. Run time: approximately 30 seconds (workstation circa 2010). Memory requirement: < 1 GB End of explanation """ #Initialise a Model, Coupling,...
kensugino/jGEM_examples
tutorial.ipynb
mit
# This is to change logging level of jupyter notebook try: from importlib import reload # for python 3 except: pass import logging reload(logging) logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.INFO, datefmt='%I:%M:%S') # This is to show matplotlib output in the notebook %matplotlib inli...
jhprinz/openpathsampling
examples/misc/fun_with_pathmovers.ipynb
lgpl-2.1
import openpathsampling as p """ Explanation: PathMovers This notebook is an introduction to handling PathMover and MoveChange instances. It mostly covers the questions on 1. how to check if a certain mover was part of a change. 2. What are the possible changes a mover can generate. 3. ... Load OPENPATHSAMPLING End ...
materialsvirtuallab/matgenb
notebooks/2013-01-01-Plotting and Analyzing a Phase Diagram using the Materials API.ipynb
bsd-3-clause
from pymatgen.ext.matproj import MPRester from pymatgen.analysis.phase_diagram import PhaseDiagram, PDPlotter %matplotlib inline """ Explanation: Introduction This notebook shows how to plot and analyze a phase diagram. Written using: - pymatgen==2021.2.8 End of explanation """ #This initializes the REST adaptor. Yo...
google/jax
docs/jax-101/01-jax-basics.ipynb
apache-2.0
import jax import jax.numpy as jnp x = jnp.arange(10) print(x) """ Explanation: JAX As Accelerated NumPy Authors: Rosalia Schneider & Vladimir Mikulik In this first section you will learn the very fundamentals of JAX. Getting started with JAX numpy Fundamentally, JAX is a library that enables transformations of arra...
bobflagg/sentiment-analysis
Baselines.ipynb
gpl-3.0
import numpy as np import pandas as pd """ Explanation: Some Baselines for Sentiment Analysis A good starting point for understanding recent work in sentiment analysis and text classification is Baselines and Bigrams: Simple, Good Sentiment and Topic Classification by Sida Wang and Christopher D. Manning. In this not...
robertoalotufo/ia898
src/dftview.ipynb
mit
import numpy as np def dftview(F): import ia898.src as ia FM = ia.dftshift(np.log(np.abs(F)+1)) return ia.normalize(FM).astype(np.uint8) """ Explanation: Function iadftview Synopse Generate optical Fourier Spectrum from DFT data. g = iadftview(F) OUTPUT g: Image. INPUT F: Image. n-dimensional DFT com...
microsoft/dowhy
docs/source/example_notebooks/dowhy_simple_example.ipynb
mit
import numpy as np import pandas as pd from dowhy import CausalModel import dowhy.datasets # Avoid printing dataconversion warnings from sklearn and numpy import warnings from sklearn.exceptions import DataConversionWarning warnings.filterwarnings(action='ignore', category=DataConversionWarning) warnings.filterwarni...
zhuanxuhit/deep-learning
embeddings/Skip-Gram_word2vec.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...
AntArch/Presentations_Github
20160202_Nottingham_GIServices_Lecture3_Beck_InteroperabilitySemanticsAndOpenData/.ipynb_checkpoints/20160202_Nottingham_GIServices_Lecture3_Beck_InteroperabilitySemanticsAndOpenData-checkpoint.ipynb
cc0-1.0
from IPython.display import YouTubeVideo YouTubeVideo('F4rFuIb1Ie4') ## PDF output using pandoc import os ### Export this notebook as markdown commandLineSyntax = 'ipython nbconvert --to markdown 20160202_Nottingham_GIServices_Lecture3_Beck_InteroperabilitySemanticsAndOpenData.ipynb' print (commandLineSyntax) os.s...
ES-DOC/esdoc-jupyterhub
notebooks/ncc/cmip6/models/noresm2-mh/ocnbgchem.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'ncc', 'noresm2-mh', 'ocnbgchem') """ Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem MIP Era: CMIP6 Institute: NCC Source ID: NORESM2-MH Topic: Ocnbgchem Sub-Topics: Tracers. Properties:...
insectatorious/hn_kaggle
HN.ipynb
gpl-3.0
from sklearn.feature_extraction.text import TfidfVectorizer vectoriser = TfidfVectorizer(max_df=0.5, min_df=1, stop_words='english', use_idf=True) tfidf_matrix = vectoriser.fit_transform(hn['title']) feature_names = vectoriser.get_feature_names() """ Explanation: Fitting a TF-IDF matrix See the documentation for Tf-i...
teuben/astr288p
notebooks/02-flow.ipynb
mit
a = 1.0 if a == 0.0: print('zero') elif a > 10.0 or a < -10: print("too big") else: print("close enough") """ Explanation: Python Control Flow if/then/else for-loop/else while-loop/else functions class (?) 1. if/then/else Note there is no "else if" or need to indent this, python uses "elif". Again, n...
mne-tools/mne-tools.github.io
0.20/_downloads/5c1cfe3ed46585b58c66f76ec83c96c6/plot_20_event_arrays.ipynb
bsd-3-clause
import os import numpy as np import mne sample_data_folder = mne.datasets.sample.data_path() sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample', 'sample_audvis_raw.fif') raw = mne.io.read_raw_fif(sample_data_raw_file, verbose=False) raw.crop(tmax=60).load_data()...
robertoalotufo/ia898
src/pca.ipynb
mit
import numpy as np def pca(X): ''' features are in the columns samples are in the rows ''' n, dim = X.shape mu = X.mean(axis=0) Xc = X - mu # 0 mean C = (Xc.T).dot(Xc)/(n-1) # Covariance matrix e,V = np.linalg.eigh(C) # eigenvalues and eigenvectors o...
wuafeing/Python3-Tutorial
02 strings and text/02.09 normalize unicode text to regexp.ipynb
gpl-3.0
s1 = "Spicy Jalape\u00f1o" s1 s2 = "Spicy Jalapen\u0303o" s2 s1 == s2 len(s1) len(s2) """ Explanation: Previous 2.9 将Unicode文本标准化 问题 你正在处理 Unicode 字符串,需要确保所有字符串在底层有相同的表示。 解决方案 在 Unicode 中,某些字符能够用多个合法的编码表示。为了说明,考虑下面的这个例子: End of explanation """ import unicodedata t1 = unicodedata.normalize("NFC", s1) t2 = unicode...
brain-research/l2hmc
SCGExperiment.ipynb
apache-2.0
def network(x_dim, scope, factor): with tf.variable_scope(scope): net = Sequential([ Zip([ Linear(x_dim, 10, scope='embed_1', factor=1.0 / 3), Linear(x_dim, 10, scope='embed_2', factor=factor * 1.0 / 3), Linear(2, 10, scope='embed_3', factor=1.0 / ...
Vibzy19/tensorflow_from_scratch
tensorflow_from_scratch+.+2+.+Gaussian+Curve.ipynb
mit
sess = tf.InteractiveSession() mean = 0.0 sigma = 1.0 x = tf.linspace(-5.0,5.0,100) z = (tf.exp(tf.neg((tf.pow(x-mean,2.0) / 2.0 * tf.pow(sigma , 2.0)))) * (1.0 / sigma*tf.sqrt(tf.multiply(2.0 , 3.1415)))) z gauss = z.eval() gauss plt.plot(gauss) plt.show() """ Explanation: The Gaussian Curve ...
kevroy314/msl-iposition-pipeline
examples/2-Room Spatial Navigation Analyses.ipynb
gpl-3.0
data_path = r'Z:\Kelsey\2017 Summer RetLu\Virtual_Navigation_Task\v5_2\NavigationTask_Data\Logged_Data' study_labels = ['PurseCube', 'CrownCube', 'BasketballCube', 'BootCube', 'CloverCube', 'GuitarCube', 'HammerCube', 'LemonCube', 'IceCubeCube', 'BottleCube'] locations = [[8, -8], [-2, -23], [8, -38], [-14, -13], [15, ...
DarkEnergySurvey/ugali
notebooks/kernel_example.ipynb
mit
def draw_kernel(k,**kwargs): lon = k.lon+np.linspace(-0.4,0.4,100) lat = k.lat+np.linspace(-0.4,0.4,100) xx,yy = np.meshgrid(lon,lat) val = k(xx.flat,yy.flat).reshape(xx.shape) plt.pcolormesh(lon,lat,val,**kwargs) # Note that it's important to set the aspect when drawing ellipses plt.gca().s...
NYUDataBootcamp/Materials
Code/notebooks/bootcamp_plotly_update.ipynb
mit
import numpy as np # foundation for Pandas import pandas as pd # data package from pandas_datareader import wb, data as web # worldbank data import html5lib import matplotlib.pyplot as plt # graphics module import datetime as dt ...
ES-DOC/esdoc-jupyterhub
notebooks/nims-kma/cmip6/models/sandbox-2/atmos.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'nims-kma', 'sandbox-2', 'atmos') """ Explanation: ES-DOC CMIP6 Model Properties - Atmos MIP Era: CMIP6 Institute: NIMS-KMA Source ID: SANDBOX-2 Topic: Atmos Sub-Topics: Dynamical Core, Radiation...
elsonidoq/prediccion_votaciones
Analisis votaciones.ipynb
apache-2.0
import main raw_data = main.load_raw_data([]) # asume el cache gdf = main.get_grouped_dataset(raw_data, level=4) m, dfX = main.get_model_to_draw(4) """ Explanation: Levantando los datos End of explanation """ import model figure() distr = model.ConditionalDistribution(gdf['131_pct'], gdf['135_pct']).fit() distr.dra...
Mashimo/datascience
02-Classification/TensorFlow introduction.ipynb
apache-2.0
# Let's start importing Tensorflow import tensorflow as tf # Check its version tf.__version__ """ Explanation: What is TensorFlow? TensorFlow is a software library used for machine learning applications, especially deep learning. It uses symbolic mathematics (instead of purely numerical computations), which enables...
seifip/udacity-deep-learning-nanodegree
embeddings/Skip-Gram_word2vec.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...
mne-tools/mne-tools.github.io
dev/_downloads/7ba58cd4e9bc2622d60527d21fc13577/decoding_spatio_temporal_source.ipynb
bsd-3-clause
# Author: Denis A. Engemann <denis.engemann@gmail.com> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Jean-Remi King <jeanremi.king@gmail.com> # Eric Larson <larson.eric.d@gmail.com> # # License: BSD-3-Clause import numpy as np import matplotlib.pyplot as plt from sklearn.pipeline import...
csaladenes/csaladenes.github.io
present/bi/2020/jupyter/2_pandas_filetipusok.ipynb
mit
pd.read_json('data.json') """ Explanation: JSON file beolvasás End of explanation """ df=pd.read_excel('2.17deaths causes.xls',sheet_name='2.17',skiprows=5) """ Explanation: Excel file beolvasás: sorok kihagyhatók a file tetejéről, munkalap neve választható. End of explanation """ import numpy as np """ Explanat...
hektor-monteiro/curso-python
graficos.ipynb
gpl-2.0
# essa instrução faz com que os gráficos apareçam no notebook %matplotlib inline import matplotlib.pyplot as plt y = [ 1.0, 2.4, 1.7, 0.3, 0.6, 1.8 ] plt.plot(y) plt.show() # em geral teremos dados em x e y import matplotlib.pyplot as plt import numpy as np x = [ 0.5, 1.0, 2.0, 4.0, 7.0, 10.0 ] y = [ 1.0, 2.4...
zzsza/Datascience_School
26. 앙상블 방법론/01. 모형 결합(배깅, 랜덤포레스트).ipynb
mit
X = np.array([[-1.0, -1.0], [-1.2, -1.4], [1, -0.5], [-3.4, -2.2], [1.1, 1.2], [-2.1, -0.2]]) y = np.array([1, 1, 1, 2, 2, 2]) x_new = [0, 0] plt.scatter(X[y==1,0], X[y==1,1], s=100, c='r') plt.scatter(X[y==2,0], X[y==2,1], s=100, c='b') plt.scatter(x_new[0], x_new[1], s=100, c='g') from sklearn.linear_model import Lo...
Wei1234c/Elastic_Network_of_Things_with_MQTT_and_MicroPython
notebooks/demo/MQTT bridged LoRa networks - demo.ipynb
gpl-3.0
import os import sys import time import json sys.path.append(os.path.abspath(os.path.join(os.path.pardir, os.path.sep.join(['..', 'codes']), 'client'))) sys.path.append(os.path.abspath(os.path.join(os.path.pardir, os.path.sep.join(['..', 'codes']), 'node'))) sys.path.append(os.path.abspath(os.path.join(os.path.pardir...
parrt/msan692
notes/chars.ipynb
mit
from sys import getsizeof print(getsizeof('')) # 49 bytes of overhead for a string object print(getsizeof('a')) print(getsizeof('ab')) print(getsizeof('abc')) print(getsizeof('Ω')) # add non-ASCII char and overhead goes way up print(getsizeof('ΩΩ')) print(getsizeof('ΩΩΩ')) """ Explanation: Representing text in a com...
GoogleCloudPlatform/vertex-ai-samples
notebooks/official/pipelines/google_cloud_pipeline_components_bqml_text.ipynb
apache-2.0
import os # The Google Cloud Notebook product has specific requirements IS_GOOGLE_CLOUD_NOTEBOOK = os.path.exists("/opt/deeplearning/metadata/env_version") # Google Cloud Notebook requires dependencies to be installed with '--user' USER_FLAG = "" if IS_GOOGLE_CLOUD_NOTEBOOK: USER_FLAG = "--user" if os.getenv("IS...
tebeka/pythonwise
Most-Time-Spent.ipynb
bsd-3-clause
import numpy as np import pandas as pd """ Explanation: Most Time Spent Let's say we have data from NYC City Bike Data We have a DataFrame with start and end time. We'd like to know for each ride where it spent most of the time - morning, noon, evening or night. We're going to convert time of day to minutes since midn...
mperrin/jwxml
notebooks/Using the SIAF class.ipynb
bsd-3-clause
%pylab inline --no-import-all plt.style.use('ggplot') """ Explanation: Using the SIAF class The Science Instrument Aperture File, or SIAF, provides approximate conversions of sky positions to detector positions in support of operations. (More sophisticated corrections, e.g. for correcting and analyzing science data, a...
amandersillinois/landlab
notebooks/tutorials/flow__distance_utility/application_of_flow__distance_utility.ipynb
mit
from landlab.io import read_esri_ascii from landlab.components import FlowAccumulator from landlab.plot import imshow_grid from matplotlib.pyplot import figure %matplotlib inline from landlab.utils import watershed import numpy as np from landlab.utils.flow__distance import calculate_flow__distance """ Explanation: <a...
gcgruen/homework
foundations-homework/08/homework-08-gruen-dataset2-baggageclaims.ipynb
mit
import pandas as pd import matplotlib.pyplot as plt % matplotlib inline df=pd.read_csv('baggageclaims_data.csv') df.head() """ Explanation: Homework 8: Dataset 2: Baggage claims Open your dataset up using pandas in a Jupyter notebook Do a .head() to get a feel for your data Write down 12 questions to ask your data,...
yandexdataschool/gumbel_lstm
demo_gumbel_softmax.ipynb
mit
temperature = 0.01 logits = np.linspace(-2,2,10).reshape([1,-1]) gumbel_softmax = GumbelSoftmax(t=temperature)(logits) softmax = T.nnet.softmax(logits) import matplotlib.pyplot as plt %matplotlib inline plt.title('gumbel-softmax samples') for i in range(100): plt.plot(range(10),gumbel_softmax.eval()[0],marker='o',...
quantopian/research_public
notebooks/lectures/Leverage/notebook.ipynb
apache-2.0
import numpy as np import pandas as pd import matplotlib.pyplot as plt from __future__ import division capital_base = 100000 r_p = 0.05 # Aggregate performance of assets in the portfolio r_no_lvg = capital_base * r_p print 'Portfolio returns without leverage: {0}'.format(r_no_lvg) """ Explanation: Leverage by Maxwel...
mne-tools/mne-tools.github.io
0.23/_downloads/5bedf835c134d956a9b527dc8c5f488c/20_rejecting_bad_data.ipynb
bsd-3-clause
import os import mne sample_data_folder = mne.datasets.sample.data_path() sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample', 'sample_audvis_filt-0-40_raw.fif') raw = mne.io.read_raw_fif(sample_data_raw_file, verbose=False) events_file = os.path.join(sample_data...
VectorBlox/PYNQ
Pynq-Z1/notebooks/examples/opencv_face_detect_webcam.ipynb
bsd-3-clause
from pynq import Overlay Overlay("base.bit").download() """ Explanation: OpenCV Face Detection Webcam In this notebook, opencv face detection will be applied to webcam images. To run all cells in this notebook a webcam and HDMI output monitor are required. References: https://github.com/Itseez/opencv/blob/master/dat...
throx66/deep-learning
image-classification/dlnd_image_classification_answer.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' class DLProgress(tqdm): last_block = 0 def hoo...
mauriciogtec/PropedeuticoDataScience2017
Alumnos/Rodrigo_Cedeno/Tarea_2_Rodrigo_Cedeno.ipynb
mit
#Importar Librerías import numpy as np from PIL import Image import matplotlib.pyplot as plt #Abrir imágen im = Image.open("/escudo_ferrari.png") #Convertir imágen a blanco y negro im_gray = im.convert('LA') #Convertir los True y False en 1s y 0s matrix_im = np.array(list(im_gray.getdata(band=0)), float) matrix_im.s...
BeatHubmann/17F-U-DLND
seq2seq/sequence_to_sequence_implementation.ipynb
mit
import numpy as np import time import helper source_path = 'data/letters_source.txt' target_path = 'data/letters_target.txt' source_sentences = helper.load_data(source_path) target_sentences = helper.load_data(target_path) """ Explanation: Character Sequence to Sequence In this notebook, we'll build a model that ta...
PMEAL/OpenPNM-Examples
Topology/generate_dual_cubic_lattice.ipynb
mit
import scipy as sp import openpnm as op import matplotlib.pyplot as plt %matplotlib inline wrk = op.Workspace() # Initialize a workspace object wrk.loglevel=50 """ Explanation: Generate a Cubic Lattice with an Interpenetrating Dual Cubic Lattice (Since version 1.6) OpenPNM offers two options for generating dual netwo...
mkcor/datavis-tut
1D.ipynb
cc0-1.0
import matplotlib %matplotlib inline matplotlib.__version__ import pandas as pd pd.__version__ """ Explanation: Visualizing 1D data End of explanation """ ts = pd.Series.from_csv('data/coherence_timeseries.csv') ts.plot() matplotlib.style.use('ggplot') ts.plot() """ Explanation: Let's start with 1D data, e.g....
rashikaranpuria/Machine-Learning-Specialization
Clustering_&_Retrieval/Week4/Assignment2/.ipynb_checkpoints/4_em-with-text-data_blank-checkpoint.ipynb
mit
import graphlab """ Explanation: Fitting a diagonal covariance Gaussian mixture model to text data In a previous assignment, we explored k-means clustering for a high-dimensional Wikipedia dataset. We can also model this data with a mixture of Gaussians, though with increasing dimension we run into two important issue...
ES-DOC/esdoc-jupyterhub
notebooks/noaa-gfdl/cmip6/models/gfdl-cm4/atmos.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'noaa-gfdl', 'gfdl-cm4', 'atmos') """ Explanation: ES-DOC CMIP6 Model Properties - Atmos MIP Era: CMIP6 Institute: NOAA-GFDL Source ID: GFDL-CM4 Topic: Atmos Sub-Topics: Dynamical Core, Radiation...
dsacademybr/PythonFundamentos
Cap09/Mini-Projeto2/Mini-Projeto2 - Analise2.ipynb
gpl-3.0
# Imports import os import subprocess import stat import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from datetime import datetime sns.set(style = "white") %matplotlib inline # Dataset clean_data_path = "dataset/autos.csv" df = pd.read_csv(clean_data_path,encoding = "latin-1")...
e-koch/pyspeckit
examples/AmmoniaLevelPopulation.ipynb
mit
# This is a test to show what happens if you add lines vs. computing a single optical depth per channel from pyspeckit.spectrum.models.ammonia_constants import (line_names, freq_dict, aval_dict, ortho_dict, voff_lines_dict, tau_wts_dict) from astropy import constants from astropy import ...
rashikaranpuria/Machine-Learning-Specialization
Regression/Assignment_two/.ipynb_checkpoints/week-2-multiple-regression-assignment-1-blank-checkpoint.ipynb
mit
import graphlab graphlab.product_key.set_product_key("C0C2-04B4-D94B-70F6-8771-86F9-C6E1-E122") """ Explanation: Regression Week 2: Multiple Regression (Interpretation) The goal of this first notebook is to explore multiple regression and feature engineering with existing graphlab functions. In this notebook you will ...
dblyon/PandasIntro
Exercises_part_B_with_Solutions.ipynb
mit
%%javascript $.getScript('misc/kmahelona_ipython_notebook_toc.js') """ Explanation: <h1 id="tocheading">Table of Contents</h1> <div id="toc"></div> End of explanation """ fn = r"data/drinks.csv" # Answer: df = pd.read_csv(fn, sep=",") """ Explanation: Getting and Knowing your Data Task: load the following file as...
NathanYee/ThinkBayes2
code/chap03.ipynb
gpl-2.0
from __future__ import print_function, division % matplotlib inline import thinkplot from thinkbayes2 import Hist, Pmf, Suite, Cdf """ Explanation: Think Bayes: Chapter 3 This notebook presents example code and exercise solutions for Think Bayes. Copyright 2016 Allen B. Downey MIT License: https://opensource.org/lic...
khalido/algorithims
bubble-sort.ipynb
gpl-3.0
%matplotlib inline import matplotlib.pyplot as plt import matplotlib.animation as animation from IPython import display import random import numpy as np """ Explanation: bubble sort all the things End of explanation """ data = [random.randint(0,100) for i in range(100)] plt.title("The Unsorted data") plt.bar(np.ara...
OpenTire/OpenTire
examples/FY_SA_Example.ipynb
mit
from opentire import OpenTire from opentire.Core import TireState from opentire.Core import TIRFile from pprint import pprint import numpy as np import matplotlib.pyplot as plt """ Explanation: Getting Started with OpenTire w/ Jupyter Notebook Generate a lateral force vs slip angle plot Import OpenTire and other libr...
tzoiker/gensim
docs/notebooks/gensim Quick Start.ipynb
lgpl-2.1
raw_corpus = ["Human machine interface for lab abc computer applications", "A survey of user opinion of computer system response time", "The EPS user interface management system", "System and human system engineering testing of EPS", "Relation of user pe...
teuben/astr288p
notebooks/fitting-01.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np import math """ Explanation: Model Fitting One of the most common things in scientific computing is model fitting. Numerical Recipes devotes a number of chapters to this. scipy "curve_fit" astropy.modeling lmfit (emcee) - Levenberg-Marquardt pysp...
mtasende/Machine-Learning-Nanodegree-Capstone
notebooks/prod/n08_simple_q_learner_1000_states_full_training_15_epochs.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...
ToqueWillot/M2DAC
FDMS/TME9/tme9.ipynb
gpl-2.0
#import %matplotlib inline import numpy as np import random import pandas as pd import matplotlib.pyplot as plt import seaborn as sns """ Explanation: TME 9 FDMS, problèmes de bandits End of explanation """ f = open("./CTR.txt") ctr=[] for i in f.readlines(): line = i.split(':') ctr.append([int(line[0]),[flo...
chinapnr/python_study
Python 基础课程/Python Basic Lesson 11 - 集合库 collections.ipynb
gpl-3.0
# nametuple 举例 from collections import namedtuple point = namedtuple('Point', ['x', 'y']) p = Point(1, 2) print(p.x, p.y) print(type(p)) i = p.x + p.y print(i) # nametuple 举例 from collections import namedtuple Web = namedtuple('web', ['name', 'type', 'url']) p1 = Web('google', 'search', 'www.google.com') p2 = W...
motkeg/Deep-learning
CNN/fashion_mnist_cnn/fashion_cnn_tpu.ipynb
apache-2.0
""" this is an model that only use to detact fashion_mnist images using tensorflow and keras """ import tensorflow as tf from tensorflow.keras.layers import (MaxPool2D , Conv2D , Activation, Dropout , Flatten , Dense , BatchNormalization) fro...
Vvkmnn/books
AutomateTheBoringStuffWithPython/lesson33.ipynb
gpl-3.0
import os # Define base directory defaultpath = os.path.expanduser('~/Dropbox/learn/books/Python/AutomateTheBoringStuffWithPython') #Change directory to files directory if set in default if (os.getcwd() == defaultpath): os.chdir('/files') else: os.chdir(defaultpath + '/files') """ Explanation: Lesson ...
opesci/devito
examples/cfd/02_convection_nonlinear.ipynb
mit
from examples.cfd import plot_field, init_hat import numpy as np import sympy %matplotlib inline # Some variable declarations nx = 101 ny = 101 nt = 80 c = 1. dx = 2. / (nx - 1) dy = 2. / (ny - 1) sigma = .2 dt = sigma * dx """ Explanation: Example 2: Nonlinear convection in 2D Following the initial convection tutori...
neerajdixit/car-lane-detection
.ipynb_checkpoints/car-lane-detection-checkpoint.ipynb
apache-2.0
import os import math import glob import cv2 from collections import deque import numpy as np import matplotlib.pyplot as plt import matplotlib.image as mpimg from moviepy.editor import VideoFileClip %matplotlib inline """ Explanation: Import required packages End of explanation """ class cam_util(): """ ...
BioGraphs-LD/BioPax-patterns
PathwayCommons-sample-query.ipynb
mit
PC_Endpoint = \ "http://rdf.pathwaycommons.org/sparql" """ Explanation: SPARQL engine configuration End of explanation """ from SPARQLWrapper import SPARQLWrapper, JSON from IPython.display import display, Markdown # for telling jupyter to display the result as markdown def runQuery(queryString, outputFormat...
GoogleCloudPlatform/ai-platform-samples
notebooks/samples/tensorflow/keras/getting_started_keras.ipynb
apache-2.0
PROJECT_ID = '[your-project-id]' #@param {type:"string"} ! gcloud config set project $PROJECT_ID """ Explanation: Getting started: Training and prediction with Keras in AI Platform <img src="https://storage.googleapis.com/cloud-samples-data/ai-platform/census/keras-tensorflow-cmle.png" alt="Keras, TensorFlow, and AI P...