repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
vascotenner/holoviews
doc/Tutorials/Bokeh_Backend.ipynb
bsd-3-clause
import numpy as np import pandas as pd import holoviews as hv hv.notebook_extension('bokeh') """ Explanation: <div class="alert alert-info" role="alert"> This tutorial contains a lot of bokeh plots, which may take a little while to load and render. </div> One of the major design principles of HoloViews is that t...
SylvainCorlay/bqplot
examples/Tutorials/Linking Plots With Widgets.ipynb
apache-2.0
import numpy as np import ipywidgets as widgets import bqplot.pyplot as plt """ Explanation: Building interactive plots using bqplot and ipywidgets bqplot is built on top of the ipywidgets framework ipwidgets and bqplot widgets can be seamlessly integrated to build interactive plots bqplot figure widgets can be stac...
spm2164/foundations-homework
14/14 - TF-IDF Homework.ipynb
artistic-2.0
# If you'd like to download it through the command line... !curl -O http://www.cs.cornell.edu/home/llee/data/convote/convote_v1.1.tar.gz # And then extract it through the command line... !tar -zxf convote_v1.1.tar.gz """ Explanation: Homework 14 (or so): TF-IDF text analysis and clustering Hooray, we kind of figured ...
mayank-johri/LearnSeleniumUsingPython
Section 2 - Advance Python/Chapter S2.05 - REST API - Server & Clients/Web%20scraping%20with%20Python.ipynb
gpl-3.0
import urllib2 response = urllib2.urlopen("http://example.com") print response.read() """ Explanation: Web scraping with Python This is an introduction to web scraping using Python, where our task is to extract information from web pages. Prerequisites (knowledge): basic Python (its data structures, string manipulati...
giacomov/3ML
examples/Joint fitting XRT and GBM data with XSPEC models.ipynb
bsd-3-clause
%matplotlib inline %matplotlib notebook from threeML import * import os """ Explanation: Joint fitting XRT and GBM data with XSPEC models Goals 3ML is designed to properly joint fit data from different instruments with thier instrument dependent likelihoods. We demostrate this with joint fitting data from GBM and XRT ...
drphilmarshall/OM10
notebooks/tutorial.ipynb
mit
from __future__ import division, print_function import os, numpy as np import matplotlib matplotlib.use('TkAgg') %matplotlib inline import om10 %load_ext autoreload %autoreload 2 """ Explanation: OM10 Tutorial In this notebook we demonstrate the basic functionality of the om10 package, including how to: Make some ...
terrydolan/lfctransfers
lfctransfers.ipynb
mit
import pandas as pd import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import sys import collections from datetime import datetime from __future__ import division # enable inline plotting %matplotlib inline """ Explanation: LFC Data Analysis: The Transfers See Terry's blog Inspiring Transfers...
CUFCTL/DLBD
Fall2017/Module1.ipynb
mit
import sys, os import pickle import torch import torch.utils.data as data import glob from PIL import Image import numpy as np def unpickle(fname): with open(fname, 'rb') as f: Dict = pickle.load(f, encoding='bytes') return Dict def load_data(batch): print ("Loading batch:{}".format(batch)) ...
Saytiras/StalkerML
Calculate Opinion with Base.ipynb
gpl-2.0
# import logging # logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s') # logging.root.level = logging.INFO from os import path from random import shuffle from corputil import FileCorpus, ListCorpus from corputil.utils import load_stopwords from gensim.models.word2vec import LineSentence, Word2Vec ...
robertoalotufo/ia898
master/tutorial_numpy_1_10.ipynb
mit
import numpy as np a = np.array([11,1,2,3,4,5,12,-3,-4,7,4]) print('a = ',a) print('np.clip(a,0,10) = ', np.clip(a,0,10)) """ Explanation: Table of Contents <p><div class="lev1 toc-item"><a href="#Clip" data-toc-modified-id="Clip-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Clip</a></div><div class="lev2 toc-ite...
mne-tools/mne-tools.github.io
0.20/_downloads/3927e2933ae8d1b19effcbd5c5341bd0/plot_20_visualize_evoked.ipynb
bsd-3-clause
import os import numpy as np import mne """ Explanation: Visualizing Evoked data This tutorial shows the different visualization methods for :class:~mne.Evoked objects. :depth: 2 As usual we'll start by importing the modules we need: End of explanation """ sample_data_folder = mne.datasets.sample.data_path() samp...
pysal/pysal
notebooks/explore/pointpats/pointpattern.ipynb
bsd-3-clause
import pysal.lib as ps import numpy as np from pysal.explore.pointpats import PointPattern """ Explanation: Planar Point Patterns in PySAL Author: Serge Rey &#115;&#106;&#115;&#114;&#101;&#121;&#64;&#103;&#109;&#97;&#105;&#108;&#46;&#99;&#111;&#109; and Wei Kang &#119;&#101;&#105;&#107;&#97;&#110;&#103;&#57;&#48;&#48;...
reetawwsum/Jupyter-Notebooks
Data analysis in Python with pandas.ipynb
mit
import pandas as pd """ Explanation: Data analysis in Python with pandas What is pandas? pandas: Open source library in Python for data analysis, data manipulation, and data visualisation. Pros: 1. Tons of functionality 2. Well supported by community 3. Active development 4. Lot of documentation 5. Plays well with oth...
tyamamot/h29iro
codes/4_Link_Analysis.ipynb
mit
import numpy as np import numpy.linalg as lg import networkx as nx import matplotlib.pyplot as plt %matplotlib inline %precision 2 """ Explanation: 第4回 リンク解析 この演習では,PageRankアルゴリズムの実装例を通して、アルゴリズムの理解を深めることおよび,既存のライブラリを用いてグラフの描画およびPageRankの計算ができることを目的とします. この演習では以下のライブラリを使用します. - NetworkX - グラフの生成,分析,描画などグラフに対する各種操作の...
stephank16/enes_graph_use_case
.ipynb_checkpoints/ENES1-checkpoint.ipynb
gpl-3.0
import ENESNeoTools from py2neo import Graph, Node, Relationship, authenticate authenticate("localhost:7474", ENESNeoTools.user_name, ENESNeoTools.pass_word) # connect to authenticated graph database graph = Graph("http://localhost:7474/db/data/") """ Explanation: ENES use case graph example A graph is generated re...
GoogleCloudPlatform/mlops-on-gcp
immersion/kubeflow_pipelines/walkthrough/labs/lab-01.ipynb
apache-2.0
import json import os import numpy as np import pandas as pd import pickle import uuid import time import tempfile from googleapiclient import discovery from googleapiclient import errors from google.cloud import bigquery from jinja2 import Template from kfp.components import func_to_container_op from typing import N...
shareactorIO/pipeline
source.ml/jupyterhub.ml/notebooks/spark/Deploy_SparkML_Census_DecisionTree.ipynb
apache-2.0
# You may need to Reconnect (more than Restart) the Kernel to pick up changes to these sett import os master = '--master spark://127.0.0.1:47077' conf = '--conf spark.cores.max=1 --conf spark.executor.memory=512m' packages = '--packages com.amazonaws:aws-java-sdk:1.7.4,org.apache.hadoop:hadoop-aws:2.7.1' jars = '--jar...
chris1610/pbpython
notebooks/Combining-Multiple-Excel-File-with-Pandas.ipynb
bsd-3-clause
import pandas as pd import numpy as np """ Explanation: Introduction One of the most common tasks for pandas and python is to automate the process to aggregate data from multiple spreadsheets and files. This article will walk through the basic flow required to parse multiple excel files, combine some data, clean it up...
JannesKlaas/MLiFC
Week 4/Ch. 17 - NLP and Word Embeddings.ipynb
mit
import os imdb_dir = './aclImdb' # Data directory train_dir = os.path.join(imdb_dir, 'train') # Get the path of the train set # Setup empty lists to fill labels = [] texts = [] # First go through the negatives, then through the positives for label_type in ['neg', 'pos']: # Get the sub path dir_name = os.path...
ozorich/phys202-2015-work
assignments/assignment07/AlgorithmsEx02.ipynb
mit
%matplotlib inline from matplotlib import pyplot as plt import seaborn as sns import numpy as np """ Explanation: Algorithms Exercise 2 Imports End of explanation """ a=[1,2,3,4,5,3] for x in a: print(x) def find_peaks(a): """Find the indices of the local maxima in a sequence.""" a=list(a) index=[]...
tomlyscan/Ordenacao
Notas Ordenacao.ipynb
gpl-3.0
# Encontrando o maximo e minimo valor em uma lista: a = [1, -2, 2, 0, 3, 4, 5, 10, -3, -1] print('Maior valor da lista: ', max(a)) print('Menor valor da lista: ', min(a)) # Criar uma lista de tamanho fixo inicializado com 0: contador = max(a) + abs(min(a)) + 1 pos_zero = abs(min(a)) lista_contador = [0]*contador prin...
aldian/tensorflow
tensorflow/lite/examples/experimental_new_converter/keras_lstm.ipynb
apache-2.0
!pip install tf-nightly --upgrade """ Explanation: Overview This CodeLab demonstrates how to build a LSTM model for MNIST recognition using Keras, and how to convert it to TensorFlow Lite. The CodeLab is very similar to the tf.lite.experimental.nn.TFLiteLSTMCell CodeLab. However, with the control flow support in the e...
LSSTC-DSFP/LSSTC-DSFP-Sessions
Sessions/Session07/Day0/TooBriefVizSolutions.ipynb
mit
import numpy as np import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Introduction to Visualization: Density Estimation and Data Exploration Version 0.1 There are many flavors of data analysis that fall under the "visualization" umbrella in astronomy. Today, by way of example, we will focus on 2 basic...
jvines/Metodos-Numericos
Catedras/Catedra_04.ipynb
gpl-3.0
import numpy as np import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Catedra 04 End of explanation """ def bisection(f, a, b, eps=1e-5): ''' Bisection busca la raiz de la funcion f a traves del metodo de la biseccion. Parameters ---------- f : function Funcion a ev...
krosaen/ml-study
python-ml-book/ch12/ch12.ipynb
mit
import os import struct import numpy as np def load_mnist(path, kind='train'): """Load MNIST data from `path`""" labels_path = os.path.join(path, '%s-labels-idx1-ubyte' % kind) images_path = os.path.join(path, '%s-images-idx3-ubyte' % kind) ...
jansoe/FUImaging
examples/Chaining/CompareMFInitialisation.ipynb
mit
import sys import os import pickle import matplotlib.pyplot as plt import numpy as np from collections import defaultdict from scipy.spatial.distance import pdist from scipy.stats import gaussian_kde pythonpath_for_regnmf = os.path.realpath(os.path.join(os.path.pardir, os.path.pardir)) sys.path.append(pythonpath_for_r...
raybuhr/pyfolio
pyfolio/examples/bayesian.ipynb
apache-2.0
%matplotlib inline import pyfolio as pf """ Explanation: Bayesian performance analysis example in pyfolio There are also a few more advanced (and still experimental) analysis methods in pyfolio based on Bayesian statistics. The main benefit of these methods is uncertainty quantification. All the values you saw above,...
ES-DOC/esdoc-jupyterhub
notebooks/awi/cmip6/models/sandbox-1/land.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'awi', 'sandbox-1', 'land') """ Explanation: ES-DOC CMIP6 Model Properties - Land MIP Era: CMIP6 Institute: AWI Source ID: SANDBOX-1 Topic: Land Sub-Topics: Soil, Snow, Vegetation, Energy Balance...
CSB-book/CSB
scientific/solutions/Lord_of_the_flies_solution.ipynb
gpl-3.0
from Bio import Entrez import re """ Explanation: Solution of 6.6.1, Lord of the Fruit Flies Identify the number of papers in PubMed that has Drosophila virilis in the title or abstract End of explanation """ # Always tell NCBI who you are (edit the e-mail below!) Entrez.email = "your_name@yourmailhost.com" handle =...
cancilla/streamsx.health
samples/HealthcareJupyterDemo/notebooks/experimental/HealthcareDemo-AnalyticsService.ipynb
apache-2.0
!pip install --user --upgrade streamsx !pip install --user --upgrade "git+https://github.com/IBMStreams/streamsx.health.git#egg=healthdemo&subdirectory=samples/HealthcareJupyterDemo/package" """ Explanation: Healthcare Python Streaming Application Demo This application demonstrates how users can develop Python Streami...
htwangtw/Patterns-of-Thought
notebooks/2.0-FC-vs-NYCQ-nestedKFold-Yeo7nodes.ipynb
mit
import copy import os, sys import numpy as np import pandas as pd import joblib os.chdir('../') # loa my modules from src.utils import load_pkl from src.file_io import save_output from src.models import nested_kfold_cv_scca, clean_confound, permutate_scca from src.visualise import set_text_size, show_results, write_...
monaen/CellClassification
shape/analysis_shape_classification.ipynb
mit
import numpy as np import os, sys import matplotlib.pyplot as plt from pylab import * import glob import collections import random import math from PIL import Image, ImageDraw %matplotlib inline caffe_root = '../../../' import caffe from caffe import layers as L, params as P ## define workspace paramsworkspace works...
kwant-project/kwant-tutorial-2016
3.4.graphene_qshe.ipynb
bsd-2-clause
# We'll have 3D plotting and 2D band structure, so we need a handful of helper functions. %run matplotlib_setup.ipy from types import SimpleNamespace from ipywidgets import interact import matplotlib from matplotlib import pyplot from mpl_toolkits import mplot3d import numpy as np import kwant from wraparound impor...
tpin3694/tpin3694.github.io
python/pandas_lowercase_column_names.ipynb
mit
# Import modules import pandas as pd # Set ipython's max row display pd.set_option('display.max_row', 1000) # Set iPython's max column width to 50 pd.set_option('display.max_columns', 50) """ Explanation: Title: Lower Case Column Names In Pandas Dataframe Slug: pandas_lowercase_column_names Summary: Lower Case Colum...
csiu/100daysofcode
misc/day44_querying_database.ipynb
mit
dbname="kick" tblname="info" engine = create_engine( 'postgresql://localhost:5432/{dbname}'.format(dbname=dbname)) # Connect to database conn = psycopg2.connect(dbname=dbname) cur = conn.cursor() """ Explanation: Questions to answer What kind of projects are popular on Kickstarter? How much are people askin...
plopd/music-mining-massive-datasets
Duplicate Detection with LSH Cosine Similarity.ipynb
mit
data_path = os.path.join('MillionSongSubset', 'AdditionalFiles', 'subset_msd_summary_file.h5') features = ['duration', 'end_of_fade_in','key', 'loudness', 'mode', 'start_of_fade_out', 'tempo', 'time_signature'] verbose = False """ Explanation: Reading the data data has to be a .h5 data file. data_path should contain ...
nicolas998/wmf
Examples/Calibracion_Barbosa_NSGAII.ipynb
gpl-3.0
%matplotlib inline import numpy as np import pylab as pl from wmf import wmf import pandas as pnd # Herramientas para DEAP from deap import base, creator import random from deap import tools """ Explanation: Calibracion BARBOSA NSGAII Este es un ensayo de como se puede implementar el algortimo NSGAII para la cali...
junghao/fdsn
examples/GeoNet_FDSN_demo_station.ipynb
mit
from obspy import UTCDateTime from obspy.clients.fdsn import Client as FDSN_Client from obspy import read_inventory """ Explanation: GeoNet FDSN webservice with Obspy demo - Station Service This demo introduces some simple code that requests data using GeoNet's FDSN webservices and the obspy module in python. This not...
ledeprogram/algorithms
class7/donow/Kandrach_Sasha_7_donow.ipynb
gpl-3.0
import pandas as pd %matplotlib inline import numpy as np from sklearn.linear_model import LogisticRegression """ Explanation: Apply logistic regression to categorize whether a county had high mortality rate due to contamination 1. Import the necessary packages to read in the data, plot, and create a logistic regressi...
bollwyvl/ipymd
examples/ex2.notebook.ipynb
bsd-3-clause
# some code in python def f(x): y = x * x return y """ Explanation: Test notebook This is a text notebook. Here are some rich text, code, $\pi\simeq 3.1415$ equations. Another equation: $$\sum_{i=1}^n x_i$$ Python code: End of explanation """ import IPython print("Hello world!") 2*2 def decorator(f): r...
vadim-ivlev/STUDY
coding/.ipynb_checkpoints/hacker rank-checkpoint.ipynb
mit
# Это единственный комментарий который имеет смысл # I s def find_index(m,a): try: return a.index(m) except : return -1 def find_two_sum(a, s): ''' >>> (3, 5) == find_two_sum([1, 3, 5, 7, 9], 12) True ''' if len(a)<2: return (-1,-1) idx = dict( (v,i) f...
jinntrance/MOOC
coursera/deep-neural-network/quiz and assignments/week 5/Gradient+Checking+v1.ipynb
cc0-1.0
# Packages import numpy as np from testCases import * from gc_utils import sigmoid, relu, dictionary_to_vector, vector_to_dictionary, gradients_to_vector """ Explanation: Gradient Checking Welcome to the final assignment for this week! In this assignment you will learn to implement and use gradient checking. You are ...
james-prior/cohpy
20160523-cohpy-speed-of-searching-sets-and-lists-simplified.ipynb
mit
def make_list(n): if True: return list(range(n)) else: return list(str(i) for i in range(n)) n = int(25e6) # n = 5 m = (0, n // 2, n-1, n) a_list = make_list(n) a_set = set(a_list) n, m # Finding something that is in a set is fast. # The key one is looking for has little effect on the speed. ...
mne-tools/mne-tools.github.io
0.20/_downloads/d5764d6befb13ad52368247a508e45f6/plot_3d_to_2d.ipynb
bsd-3-clause
# Authors: Christopher Holdgraf <choldgraf@berkeley.edu> # # License: BSD (3-clause) from scipy.io import loadmat import numpy as np from matplotlib import pyplot as plt from os import path as op import mne from mne.viz import ClickableImage # noqa from mne.viz import (plot_alignment, snapshot_brain_montage, ...
privong/pythonclub
sessions/06-mcmc/MCMC with emcee.ipynb
gpl-3.0
%matplotlib inline import numpy as np import matplotlib.pyplot as plt import emcee import corner """ Explanation: MCMC Demonstration Markov Chain Monte Carlo is a useful technique for fitting models to data and obtaining estimates for the uncertainties of the model parameters. There are a slew of python modules and in...
mattgiguere/EPRV
code/make_missings.ipynb
mit
import re import numpy as np import pandas as pd import matplotlib.pyplot as plt import matplotlib.image as mpimg import matplotlib #%matplotlib inline """ Explanation: manipulate_regonline_output This notebook reads the RegOnline output into a pandas DataFrame and reworks it to have each row contain the attendee, th...
dchandan/rebound
ipython_examples/OrbitPlot.ipynb
gpl-3.0
import rebound sim = rebound.Simulation() sim.add(m=1) sim.add(m=0.1, e=0.041, a=0.4, inc=0.2, f=0.43, Omega=0.82, omega=2.98) sim.add(m=1e-3, e=0.24, a=1.0, pomega=2.14) sim.add(m=1e-3, e=0.24, a=1.5, omega=1.14, l=2.1) sim.add(a=-2.7, e=1.4, f=-1.5,omega=-0.7) # hyperbolic orbit """ Explanation: Orbit Plot REBOUND c...
phoebe-project/phoebe2-docs
development/tutorials/pblum.ipynb
gpl-3.0
#!pip install -I "phoebe>=2.4,<2.5" import phoebe from phoebe import u # units import numpy as np logger = phoebe.logger() b = phoebe.default_binary() """ Explanation: Passband Luminosity Setup Let's first make sure we have the latest version of PHOEBE 2.4 installed (uncomment this line if running in an online note...
EnergyID/opengrid
scripts/TimeSeries.ipynb
gpl-2.0
import os, sys import inspect import numpy as np import datetime as dt import time import pytz import pandas as pd import pdb script_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) # add the path to opengrid to sys.path sys.path.append(os.path.join(script_dir, os.pardir, os.pardir)) f...
pombredanne/https-gitlab.lrde.epita.fr-vcsn-vcsn
doc/notebooks/automaton.infiltration.ipynb
gpl-3.0
import vcsn c = vcsn.context('lal_char, seriesset<lal_char, z>') std = lambda exp: c.expression(exp).standard() c """ Explanation: automaton.infiltration Create the (accessible part of the) infiltration product of two automata. In a way the infiltration product combines the conjunction (synchronized) and the shuffle ...
vlad17/vlad17.github.io
assets/2020-11-01-lbfgs-vs-gd.ipynb
apache-2.0
from numpy_ringbuffer import RingBuffer import numpy as np from scipy.stats import special_ortho_group from scipy import linalg as sla %matplotlib inline from matplotlib import pyplot as plt from scipy.optimize import line_search class LBFGS: def __init__(self, m, d, x0, g0): self.s = RingBuffer(capacity=m...
ldiary/marigoso
notebooks/an_example_of_using_jupyter_for_documenting_and_automating_bdd_style_tests.ipynb
mit
from marigoso import Test browser = Test().launch_browser("Firefox") browser.get_url("https://www.blogger.com/") header = browser.get_element("tag=h2") assert header.text == "Sign in to continue to Blogger" """ Explanation: An example of using Jupyter for Documenting and Automating BDD Style Tests This is a sample doc...
CalPolyPat/phys202-2015-work
days/day12/Integration.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import seaborn as sns import numpy as np """ Explanation: Numerical Integration Learning Objectives: Learn how to numerically integrate 1d and 2d functions that are represented as Python functions or numerical arrays of data using scipy.integrate. This lesson was orgi...
Cairo4/pythonkurs
02 jupyter notebook, python/02 Jupyter Notebook & Python Intro.ipynb
mit
#Mit einem Hashtag vor einer Zeile können wir Code kommentieren, auch das ist sehr wichtig. #Immer, wirklich, immer den eigenen Code zu kommentieren. Vor allem am Anfang. print('hello world') #Der Printbefehl druckt einfach alles aus. Nicht wirklich wahnsinnig toll. #Doch er ist später sehr nützlich. Vorallem wenn ...
EvanBianco/striplog
tutorial/Basic_objects.ipynb
apache-2.0
import striplog striplog.__version__ """ Explanation: Basic objects A striplog depends on a hierarchy of objects. This notebook shows the objects and their basic functionality. Lexicon: A dictionary containing the words and word categories to use for rock descriptions. Component: A set of attributes. Interval: One e...
maviator/Kaggle_home_price_prediction
Script/SKlearn models.ipynb
mit
# Adding needed libraries and reading data import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns from sklearn.linear_model import ElasticNet, Lasso, BayesianRidge, LassoLarsIC from sklearn.ensemble import RandomForestRegressor, GradientBoostingRegressor from sklearn.kernel_rid...
amozie/amozie
testzie/keras_logistic_regression.ipynb
apache-2.0
from keras.layers import * from keras.models import * from keras.optimizers import * from keras.callbacks import * import keras from keras import backend as K import numpy as np import matplotlib.pyplot as plt import pandas as pd import itertools %matplotlib inline """ Explanation: <h1>Table of Contents<span class="t...
jcmgray/xyzpy
docs/examples/visualize matrix.ipynb
mit
import xyzpy as xyz import numpy as np import scipy.linalg as sla """ Explanation: Visualizing Linear Algebra Decompositions In this notebook we just demonstrate the utility function xyzpy.visualize_matrix on various linear algebra decompositions taken from scipy. This function plots matrices with the values of numbe...
miykael/nipype_tutorial
notebooks/introduction_quickstart.ipynb
bsd-3-clause
import os from os.path import abspath from nipype import Workflow, Node, MapNode, Function from nipype.interfaces.fsl import BET, IsotropicSmooth, ApplyMask from nilearn.plotting import plot_anat %matplotlib inline import matplotlib.pyplot as plt """ Explanation: Nipype Quickstart Existing documentation Visuali...
gfeiden/MagneticUpperSco
notes/convective_structure.ipynb
mit
%matplotlib inline import numpy as np import matplotlib.pyplot as plt from scipy.interpolate import interp1d """ Explanation: Radiative Cores & Convective Envelopes Analysis of how magnetic fields influence the extent of radiative cores and convective envelopes in young, pre-main-sequence stars. Begin with some prelim...
AaronCWong/phys202-2015-work
assignments/assignment05/MatplotlibEx03.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np """ Explanation: Matplotlib Exercise 3 Imports End of explanation """ def well2d(x, y, nx, ny, L=1.0): firstsine = (nx*np.pi*x)/L secondsine = ((ny*np.pi*y)/L) psi = np.array(2/L*((np.sin(firstsine)*(np.sin(secondsine))))) return p...
MLIME/12aMostra
src/Tensorflow Tutorial.ipynb
gpl-3.0
import numpy as np import tensorflow as tf import pandas as pd import util %matplotlib inline """ Explanation: Tutorial em Tensorflow: Regressão Linear Nesse tutorial vamos montar um modelo de regressão linear usando a biblioteca Tensorflow. End of explanation """ # Podemos olhar o começo dessa tabela df = pd.read_e...
mne-tools/mne-tools.github.io
0.23/_downloads/da9f4c4e77e7268fbe1384cfc1b249a5/70_eeg_mri_coords.ipynb
bsd-3-clause
# Authors: Eric Larson <larson.eric.d@gmail.com> # # License: BSD Style. import os.path as op import nibabel from nilearn.plotting import plot_glass_brain import numpy as np import mne from mne.channels import compute_native_head_t, read_custom_montage from mne.viz import plot_alignment """ Explanation: EEG source ...
blackjax-devs/blackjax
examples/TemperedSMC.ipynb
apache-2.0
import jax import jax.numpy as jnp import matplotlib.pyplot as plt import numpy as np from jax.scipy.stats import multivariate_normal jax.config.update("jax_platform_name", "cpu") import blackjax import blackjax.smc.resampling as resampling """ Explanation: Use Tempered SMC to improve exploration of MCMC methods. Mu...
GlobalFishingWatch/vessel-scoring
notebooks/Model-Sensitivity-to-Seed.ipynb
apache-2.0
%matplotlib inline from vessel_scoring import data, utils from vessel_scoring.models import train_model_on_data from vessel_scoring.evaluate_model import evaluate_model, compare_models from IPython.core.display import display, HTML, Markdown import numpy as np import sys from sklearn import metrics from vessel_scoring...
cloudera/ibis
docs/source/user_guide/geospatial_analysis.ipynb
apache-2.0
# Launch the postgis container. # This may take a bit of time if it needs to download the image. !docker run -d -p 5432:5432 --name postgis-db -e POSTGRES_PASSWORD=supersecret mdillon/postgis:9.6-alpine """ Explanation: Ibis and Geospatial Operations One of the most popular extensions to PostgreSQL is PostGIS, which a...
mercybenzaquen/foundations-homework
databases_hw/db04/Homework_4-graded.ipynb
mit
numbers_str = '496,258,332,550,506,699,7,985,171,581,436,804,736,528,65,855,68,279,721,120' """ Explanation: Graded = 10/11 Homework #4 These problem sets focus on list comprehensions, string operations and regular expressions. Problem set #1: List slices and list comprehensions Let's start with some data. The followi...
root-mirror/training
NCPSchool2021/RDataFrame/04-rdataframe-advanced.ipynb
gpl-2.0
import numpy import ROOT np_dict = {colname: numpy.random.rand(100) for colname in ["a","b","c"]} df = ROOT.RDF.MakeNumpyDataFrame(np_dict) print(f"Columns in the RDataFrame: {df.GetColumnNames()}") co = df.Count() m_a = df.Mean("a") fil1 = df.Filter("c < 0.7") def1 = fil1.Define("d", "a+b+c") h = def1.Histo1D("d"...
rsignell-usgs/notebook
NEXRAD/THREDDS_NEXRAD.ipynb
mit
import matplotlib import warnings warnings.filterwarnings("ignore", category=matplotlib.cbook.MatplotlibDeprecationWarning) %matplotlib inline """ Explanation: Using Python to Access NEXRAD Level 2 Data from Unidata THREDDS Server This is a modified version of Ryan May's notebook here: http://nbviewer.jupyter.org/gist...
bhargavvader/pycobra
docs/notebooks/voronoi_clustering.ipynb
mit
%matplotlib inline import numpy as np from pycobra.cobra import Cobra from pycobra.visualisation import Visualisation from pycobra.diagnostics import Diagnostics import matplotlib.pyplot as plt from sklearn import cluster """ Explanation: Visualising Clustering with Voronoi Tesselations When experimenting with using t...
fisicatyc/Cuantica_Jupyter
estados_ligados.ipynb
mit
from tecnicas_numericas import * import tecnicas_numericas print(dir(tecnicas_numericas)) """ Explanation: <div class="alert alert-success"> Este notebook de ipython depende de los modulos: <li> `tecnicas_numericas`, ilustrado en el notebook [Técnicas numéricas](tecnicas_numericas.ipynb). <li> `vis_int`, ilustrado...
iurilarosa/thesis
codici/Archiviati/numpy/.ipynb_checkpoints/Prove numpy-checkpoint.ipynb
gpl-3.0
unimatr = numpy.ones((10,10)) #unimatr duimatr = unimatr*2 #duimatr uniarray = numpy.ones((10,1)) #uniarray triarray = uniarray*3 scalarray = numpy.arange(10) scalarray = scalarray.reshape(10,1) #NB fare il reshape da orizzontale a verticale è come se aggiungesse #una dimensione all'array facendolo diventare un nda...
csyhuang/hn2016_falwa
examples/.ipynb_checkpoints/example_barotropic-checkpoint.ipynb
mit
from hn2016_falwa.wrapper import barotropic_eqlat_lwa # Module for plotting local wave activity (LWA) plots and # the corresponding equivalent-latitude profile from math import pi from netCDF4 import Dataset import numpy as np import matplotlib.pyplot as plt %matplotlib inline # --- Parameters...
ES-DOC/esdoc-jupyterhub
notebooks/inpe/cmip6/models/besm-2-7/toplevel.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'inpe', 'besm-2-7', 'toplevel') """ Explanation: ES-DOC CMIP6 Model Properties - Toplevel MIP Era: CMIP6 Institute: INPE Source ID: BESM-2-7 Sub-Topics: Radiative Forcings. Properties: 85 (42 re...
seifip/udacity-deep-learning-nanodegree
!P3 - TV Script Generation/dlnd_tv_script_generation.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...
eneskemalergin/OldBlog
_oldnotebooks/Basic_Sequence_Analysis.ipynb
mit
from Bio import Entrez, SeqIO # Using my email Entrez.email = "eneskemalergin@gmail.com" # Get the FASTA file hdl = Entrez.efetch(db='nucleotide', id=['NM_002299'],rettype='fasta') # Lactase gene # Read it and store it in seq seq = SeqIO.read(hdl, 'fasta') print "First 10 and last 10: " + seq.seq[:10] + "..." + seq.se...
tudarmstadt-lt/sensegram
QuickStart.ipynb
apache-2.0
import sensegram # see README for model download information sense_vectors_fpath = "model/dewiki.txt.clusters.minsize5-1000-sum-score-20.sense_vectors" sv = sensegram.SenseGram.load_word2vec_format(sense_vectors_fpath, binary=False) """ Explanation: Demonstrating various stages of word sense disambiguation The exampl...
GoogleCloudPlatform/vertex-ai-samples
notebooks/official/explainable_ai/sdk_automl_tabular_classification_online_explain.ipynb
apache-2.0
import os # Google Cloud Notebook if os.path.exists("/opt/deeplearning/metadata/env_version"): USER_FLAG = "--user" else: USER_FLAG = "" ! pip3 install --upgrade google-cloud-aiplatform $USER_FLAG """ Explanation: Vertex SDK: AutoML training tabular classification model for online explanation <table align="l...
nealjean/predicting-poverty
figures/Figure 4.ipynb
mit
from fig_utils import * import matplotlib.pyplot as plt import time %matplotlib inline """ Explanation: Figure 4: Evaluation of model performance This notebook generates individual panels of Figure 4 in "Combining satellite imagery and machine learning to predict poverty". End of explanation """ country_path = '../...
evanmiltenburg/python-for-text-analysis
Chapters/Chapter 10 - Dictionaries.ipynb
apache-2.0
student_grades = ['Frank', 8, 'Susan', 7, 'Guido', 10] student = 'Frank' index_of_student = student_grades.index(student) # we use the index method (list.index) print('grade of', student, 'is', student_grades[index_of_student + 1]) """ Explanation: Chapter 10 - Dictionaries This notebook uses code snippets and explan...
sdpython/ensae_teaching_cs
_doc/notebooks/td2a_ml/td2a_tree_selection_correction.ipynb
mit
from jyquickhelper import add_notebook_menu add_notebook_menu() %matplotlib inline """ Explanation: 2A.ml - Réduction d'une forêt aléatoire - correction Le modèle Lasso permet de sélectionner des variables, une forêt aléatoire produit une prédiction comme étant la moyenne d'arbres de régression. Et si on mélangeait l...
naifrec/cnn-dropout
cnn-scyfer-project.ipynb
mit
import cPickle import gzip import os import sys import timeit import numpy import theano import theano.tensor as T from theano.tensor.signal import downsample from theano.tensor.nnet import conv rng = numpy.random.RandomState(23455) # instantiate 4D tensor for input input = T.tensor4(name='input') w_shp = (2, 3, 9...
sdpython/pyquickhelper
_unittests/ut_ipythonhelper/data/example_corrplot.ipynb
mit
%pylab inline import pyensae import matplotlib.pyplot as plt plt.style.use('ggplot') import pandas import numpy letters = "ABCDEFGHIJKLM"[0:10] df = pandas.DataFrame(dict(( (k, numpy.random.random(10)+ord(k)-65) for k in letters))) df.head() from pyensae.graph_helper import Corrplot c = Corrplot(df) c.plot(figsize=(...
anhaidgroup/py_entitymatching
notebooks/guides/step_wise_em_guides/Performing Matching with a Rule-Based Matcher.ipynb
bsd-3-clause
# Import py_entitymatching package import py_entitymatching as em import os import pandas as pd """ Explanation: Introduction This IPython notebook illustrates how to perform matching using the rule-based matcher. First, we need to import py_entitymatching package and other libraries as follows: End of explanation """...
mne-tools/mne-tools.github.io
0.24/_downloads/93b9388c9b54989a6ee795fd5dedd153/otp.ipynb
bsd-3-clause
# Author: Eric Larson <larson.eric.d@gmail.com> # # License: BSD-3-Clause import os.path as op import mne import numpy as np from mne import find_events, fit_dipole from mne.datasets.brainstorm import bst_phantom_elekta from mne.io import read_raw_fif print(__doc__) """ Explanation: Plot sensor denoising using over...
samuxiii/prototypes
learning/stock/stock.ipynb
mit
from sklearn.linear_model import RidgeCV from sklearn.model_selection import train_test_split from sklearn.externals import joblib import numpy as np import matplotlib.pyplot as plt import os data = np.loadtxt(fname = 'data.txt', delimiter = ',') X, y = data[:,:5], data[:,5] print("Features sample: {}".format(X[1])) ...
gaufung/Data_Analytics_Learning_Note
DesignPattern/AdapterPattern.ipynb
mit
class ACpnStaff(object): name="" id="" phone="" def __init__(self,id): self.id=id def getName(self): print ("A protocol getName method...id:%s"%self.id) return self.name def setName(self,name): print ("A protocol setName method...id:%s"%self.id) self.name=...
ual/hedonic-models
sales-hedonic-output.ipynb
bsd-3-clause
# Startup steps import pandas as pd, numpy as np, statsmodels.api as sm import matplotlib.pyplot as plt, matplotlib.cm as cm, matplotlib.font_manager as fm import matplotlib.mlab as mlab from scipy.stats import pearsonr, ttest_rel %matplotlib inline """ Explanation: Tutorial on Hedonic Regression This material uses Py...
robblack007/clase-cinematica-robot
Practicas/practica4/Practica.ipynb
mit
# Esta libreria tiene las funciones principales que utilizaremos from sympy import var, Matrix, Function, sin, cos, pi, trigsimp # Esta libreria contiene una funcion que la va a dar un formato "bonito" a nuestras ecuaciones from sympy.physics.mechanics import mechanics_printing mechanics_printing() τ = 2*pi """ Explan...
GEMScienceTools/rmtk
notebooks/vulnerability/derivation_fragility/NLTHA_on_SDOF/MSA_on_SDOF.ipynb
agpl-3.0
import numpy as np from rmtk.vulnerability.common import utils from rmtk.vulnerability.derivation_fragility.NLTHA_on_SDOF import MSA_on_SDOF from rmtk.vulnerability.derivation_fragility.NLTHA_on_SDOF import MSA_utils from rmtk.vulnerability.derivation_fragility.NLTHA_on_SDOF.read_pinching_parameters import read_paramet...
PyDataMadrid2016/Conference-Info
workshops_materials/20160408_1100_Pandas_for_beginners/tutorial/EN - Tutorial 03 - Basic operations with pandas data structures.ipynb
mit
# first, the imports import os import datetime as dt import pandas as pd import numpy as np import matplotlib.pyplot as plt np.random.seed(19760812) %matplotlib inline # we read data from file 'mast.txt' ipath = os.path.join('Datos', 'mast.txt') # Now, we define a function to parse the dates def dateparse(date, tim...
MIT-LCP/mimic-workshop
intro_to_mimic/01-example-patient-heart-failure.ipynb
mit
import numpy as np import pandas as pd import matplotlib.pyplot as plt import sqlite3 %matplotlib inline """ Explanation: Exploring the trajectory of a single patient Import Python libraries We first need to import some tools for working with data in Python. - NumPy is for working with numbers - Pandas is for analysi...
MBARIMike/stoqs
stoqs/loaders/CANON/toNetCDF/notebooks/lrauv_nav_adjust.ipynb
gpl-3.0
from netCDF4 import Dataset import numpy as np # 1. Initial daphne file from the https://stoqs.mbari.org/stoqs_canon_may2018 campaign, wget'ted from: # http://dods.mbari.org/data/lrauv/daphne/missionlogs/2018/20180603_20180611/20180608T003220/201806080032_201806090421.nc4 #df = '/vagrant/dev/stoqsgit/201806080032_2018...
VUInformationRetrieval/IR2016_2017
02_building.ipynb
gpl-2.0
Summaries_file = 'data/malaria__Summaries.pkl.bz2' Abstracts_file = 'data/malaria__Abstracts.pkl.bz2' import pickle, bz2 from collections import namedtuple Summaries = pickle.load( bz2.BZ2File( Summaries_file, 'rb' ) ) paper = namedtuple( 'paper', ['title', 'authors', 'year', 'doi'] ) for (id, paper_info) in Summar...
miaecle/deepchem
examples/tutorials/15_Synthetic_Feasibility_Scoring.ipynb
mit
%tensorflow_version 1.x !curl -Lo deepchem_installer.py https://raw.githubusercontent.com/deepchem/deepchem/master/scripts/colab_install.py import deepchem_installer %time deepchem_installer.install(version='2.3.0') import deepchem as dc # Lets get some molecules to play with from deepchem.molnet.load_function import...
chbrandt/pynotes
SS82_filtering/.ipynb_checkpoints/Untitled-checkpoint.ipynb
gpl-2.0
from IPython.display import HTML HTML('''<script> code_show=true; function code_toggle() { if (code_show){ $('div.input').hide(); } else { $('div.input').show(); } code_show = !code_show } $( document ).ready(code_toggle); </script> <form action="javascript:code_toggle()"><input type="submit" value="Click here...
AhmetHamzaEmra/Deep-Learning-Specialization-Coursera
Sequence Models/Operations+on+word+vectors+-+v1.ipynb
mit
import numpy as np from w2v_utils import * """ Explanation: Operations on word vectors Welcome to your first assignment of this week! Because word embeddings are very computionally expensive to train, most ML practitioners will load a pre-trained set of embeddings. After this assignment you will be able to: Load pr...
iglpdc/comp-phys
01_01_euler.ipynb
mit
t0 = 10. # initial temperature ts = 83. # temp. of the environment r = 0.1 # cooling rate dt = 0.05 # time step tmax = 60. # maximum time nsteps = int(tmax/dt) # number of steps t = t0 for i in range(1,nsteps+1): new_t = t - r*(t-ts)*dt t = new_t print i,i*dt, t # we can also do t = t - r*(t-t...
gonzmg88/cnn_basic_course
transfer_learning.ipynb
gpl-3.0
import dogs_vs_cats as dvc all_files = dvc.image_files() """ Explanation: Pretrained CNN: transfer learning Nature article: Dermatologist-level classification of skin cancer with deep neural networks End of explanation """ from keras.applications.nasnet import NASNetMobile from keras.preprocessing import image from ...
kmunve/APS
aps/notebooks/meps_det_pp_1km.ipynb
mit
# ensure loading of APS modules import sys, os sys.path.append(r'C:\Users\kmu\PycharmProjects\APS') print(sys.path) # -*- coding: utf-8 -*- import matplotlib.pyplot as plt import matplotlib matplotlib.style.use('seaborn-notebook') import matplotlib.patches as patches plt.rcParams['figure.figsize'] = (14, 6) %matplotli...