repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
yfur/basic-mechanics-python | 0_quickstart/0_quickstart.ipynb | apache-2.0 | import numpy as np
from scipy.integrate import odeint
from math import sin
''' constants '''
m = 1 # mass of the pendulum [kg]
l = 1 # length of the pendulum [m]
g = 10 # Gravitational acceleration [m/s^2]
''' time setting '''
t_end = 10 # simulation time [s]
t_fps = 50 # frame per second. This value means smoothness... |
Connectomics-Classes/NeuroXplorer | Documentation/Gala's Watershed Introduction and Documentation.ipynb | apache-2.0 | ### Watershed segmentation imports
from gala import classify, morpho, features, agglo, evaluate as ev, optimized
import numpy as np
from skimage.morphology import closing
from skimage.morphology import binary_dilation
from skimage.morphology import binary_erosion
from skimage.filters.rank import threshold
import matpl... |
vinitsamel/udacitydeeplearning | intro-to-tensorflow/intro_to_tensorflow.ipynb | mit | import hashlib
import os
import pickle
from urllib.request import urlretrieve
import numpy as np
from PIL import Image
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelBinarizer
from sklearn.utils import resample
from tqdm import tqdm
from zipfile import ZipFile
print('All m... |
Sidon/Sidon.github.io | _posts/tools-submitw2.ipynb | mit | ''' Categoriacal explanatory variable with five levels '''
alcohol_map = {1: '>=0 <5', 2: '>=5 <10', 3: '>=10 <15', 4: '>=15 <20', 5: '>=20 <25'}
data2['alcohol'] = pd.cut(data1.alcohol,[0,5,10,15,20,25],
labels=[i for i in alcohol_map.values()])
data2["alcohol"] = data2["alcohol"].astype('ca... |
abulbasar/machine-learning | SparkML - 01 Regression.ipynb | apache-2.0 | !ls -ltr /data
spark
"""
Explanation: Data Source: https://archive.ics.uci.edu/ml/datasets/Combined+Cycle+Power+Plant
Features consist of hourly average ambient variables
Temperature (T) in the range 1.81°C and 37.11°C,
Ambient Pressure (AP) in the range 992.89-1033.30 milibar,
Relative Humidity (RH) in the range 25.... |
skkandrach/foundations-homework | .ipynb_checkpoints/Homework_8_DIY_Soma-checkpoint.ipynb | mit | import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
df= pd.read_excel("NHL 2014-15.xls")
!pip install xlrd
df.columns.value_counts()
"""
Explanation: 2016 NHL Hockey Data Set - Sasha Kandrach
End of explanation
"""
df.head()
"""
Explanation: Here's all of our data:
End of explanation
"""
... |
mhallett/MeDaReDa | demos/demo1/00_DEMO_01.ipynb | mit | import demo
import process
demo.clear_tables()
"""
Explanation: 00 DEMO
pre demo start office with 4 workers
start
* sever monitoring
* worker monitoring
* table counts
* ccy output
Clear tables
End of explanation
"""
demo.get_price('GBPUSD')
process.processSinglePrice()
demo.get_price('USDEUR')
process.processSi... |
ShinjiKatoA16/UCSY-sw-eng | Exclusive OR (XOR).ipynb | mit | # In Python, XOR operator is ^
for a in (False, True):
for b in (False,True):
for c in (False, True):
# print (a, b, c, a^(b^c), (a^b)^c)
print ("{!r:5} {!r:5} {!r:5} | {!r:5} {!r:5}".format(a, b, c, a^(b^c), (a^b)^c))
"""
Explanation: Exclusive OR
Following symbol are used to expla... |
kfollette/AST337-Fall2017 | Labs/Lab1/Lab1.ipynb | mit | #load packages
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: AST 337 In-Class Lab #1
Wednesday, September 6, 2017
In this lab, you'll learn to read in and manipulate tabular data with the python package pandas and plot that data with the plotting module mat... |
csaladenes/csaladenes.github.io | present/bi/2018/jupyter/pelda 2.ipynb | mit | import pandas as pd
import html5lib
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: BI kurzus
Bővítőcsomagok importálása:
End of explanation
"""
#https://www.csaladen.es/present/sapientia1/exportPivot_POP105A.csv
csv_path='exportPivot_POP105A.csv' #SAJAT HELY CSV FILE
df=pd.read_csv(csv_path)
... |
NeuralEnsemble/elephant | doc/tutorials/spade.ipynb | bsd-3-clause | import numpy as np
import quantities as pq
import neo
import elephant
import viziphant
np.random.seed(4542)
"""
Explanation: SPADE Tutorial
End of explanation
"""
spiketrains = elephant.spike_train_generation.compound_poisson_process(
rate=5*pq.Hz, A=[0]+[0.98]+[0]*8+[0.02], t_stop=10*pq.s)
len(spiketrains)
"""
... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/production_ml/solutions/sdk_metric_parameter_tracking_for_custom_jobs.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"
# Install additi... |
ML4DS/ML4all | P4.MLLib_DataTypes/Alumnos/numpy_exercises_alumnos.ipynb | mit | # Import some libraries that will be necessary for working with data and displaying plots
# To visualize plots in the notebook
%matplotlib inline
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import scipy.io # To read matlab files
import pylab
from test_helper import Test
"""
Explanatio... |
turbomanage/training-data-analyst | courses/machine_learning/deepdive2/structured/labs/4a_sample_babyweight.ipynb | apache-2.0 | %%bash
sudo pip freeze | grep google-cloud-bigquery==1.6.1 || \
sudo pip install google-cloud-bigquery==1.6.1
"""
Explanation: LAB 4a: Creating a Sampled Dataset.
Learning Objectives
Setup up the environment
Sample the natality dataset to create train/eval/test sets
Preprocess the data in Pandas dataframe
Introduct... |
nick-youngblut/SIPSim | ipynb/.ipynb_checkpoints/barkeri_extorquens-checkpoint.ipynb | mit | workDir = "/home/nick/notebook/SIPSim/t/M.bark_M.ext/"
"""
Explanation: Description
Simulating CsCl gradient to reproduce the results in:
Lueders T, Manefield M, Friedrich MW. (2004). Enhanced sensitivity of DNA- and rRNA-based stable isotope probing by fractionation and quantitative analysis of isopycnic centrifug... |
rusucosmin/courses | ml/ex05/template/ex05.ipynb | mit | from helpers import sample_data, load_data, standardize
# load data.
height, weight, gender = load_data()
# build sampled x and y.
seed = 1
y = np.expand_dims(gender, axis=1)
X = np.c_[height.reshape(-1), weight.reshape(-1)]
y, X = sample_data(y, X, seed, size_samples=200)
x, mean_x, std_x = standardize(X)
"""
Expla... |
vitojph/2016progpln | notebooks/10-telegram.ipynb | mit | # bot: progpln
# username: progplnbot
# url: https://t.me/progplnbot
# token: 304523995:AAF09xZgnX7cXQZr7u-CayCY19FweyfGD-0
"""
Explanation: Interactuando con Telegram
Introducción
En este cuaderno vamos a crear un bot de Telegram (un sencillo programa que interactúa con otros usuarios y se activa a través de mensajes... |
empet/geom_modeling | Tubular-and-canal-surfaces-Plotly.ipynb | bsd-2-clause | import numpy as np
from scipy import integrate
def curv(s):#curvature
return 3*np.sin(s/10.)*np.sin(s/10.)
def tors(s):#torsion is constant
return 0.35
def Frenet_eqns(x, s):# right side vector field of the system of ODE
return [ curv(s)*x[3],
curv(s)*x[4],
curv(s)*x[5],
... |
Upward-Spiral-Science/uhhh | code/DavidWest - Analysis.ipynb | apache-2.0 | # Import necessary libraries
% matplotlib inline
from matplotlib import pyplot as plt
from sklearn.decomposition import PCA
from sklearn.decomposition import PCA
import numpy as np
import pandas as pd
import seaborn as sns
from pylab import *
import csv
from mpl_toolkits.mplot3d import Axes3D
# Read in the data
data ... |
nonotone79/investigativ | 13 lösungen/03 Python II Homework.ipynb | mit | def double(number):
bigger = number * 2
return bigger
double(5)
"""
Explanation: Python II Hausaufgaben
1.Baue eine Funktion mit dem Namen 'double', der die Zahl 5 vedoppelt:
End of explanation
"""
lst = list(range(1,5))
for n in lst:
print(double(n))
"""
Explanation: 2.Baue einen for-loop, der durch ... |
WNoxchi/Kaukasos | FAML1/RandomForests-Redux.ipynb | mit | %load_ext autoreload
%autoreload 2
%matplotlib inline
from fastai.imports import *
from fastai.structured import *
from pandas_summary import DataFrameSummary
from sklearn.ensemble import RandomForestRegressor, RandomForestClassifier
from IPython.display import display
from sklearn import metrics
PATH = "../../data... |
Kaggle/learntools | notebooks/time_series/raw/tut5.ipynb | apache-2.0 | #$HIDE_INPUT$
from pathlib import Path
from warnings import simplefilter
import matplotlib.pyplot as plt
import pandas as pd
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split
from statsmodels.tsa.deterministic import CalendarFourier, DeterministicProcess
from xgboos... |
mne-tools/mne-tools.github.io | stable/_downloads/709b65f447b790ec915e9d00176f0746/virtual_evoked.ipynb | bsd-3-clause | # Author: Mainak Jas <mainak.jas@telecom-paristech.fr>
# License: BSD-3-Clause
import mne
from mne.datasets import sample
print(__doc__)
# read the evoked
data_path = sample.data_path()
meg_path = data_path / 'MEG' / 'sample'
fname = meg_path / 'sample_audvis-ave.fif'
evoked = mne.read_evokeds(fname, condition='Lef... |
gaufung/Data_Analytics_Learning_Note | DesignPattern/MediatorPattern.ipynb | mit | class colleague():
mediator = None
def __init__(self,mediator):
self.mediator = mediator
class purchaseColleague(colleague):
def buyStuff(self,num):
print ("PURCHASE:Bought %s"%num)
self.mediator.execute("buy",num)
def getNotice(self,content):
print ("PURCHASE:Get Notice-... |
balarsen/pymc_learning | Counting/Poisson and exponential.ipynb | bsd-3-clause | %matplotlib inline
from pprint import pprint
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import pymc3 as mc
import spacepy.toolbox as tb
import spacepy.plot as spp
import tqdm
from scipy import stats
import seaborn as sns
sns.set(font_scale=1.5)
# matplotlib.pyplot.rc('fig... |
dgergel/VIC | samples/notebooks/example_reformat_vic4_parameters_to_vic5image.ipynb | gpl-2.0 | %matplotlib inline
import os
import getpass
from datetime import datetime
import numpy as np
import xarray as xr
import matplotlib.pyplot as plt
# For more information on tonic, see: https://github.com/UW-Hydro/tonic/
import tonic.models.vic.grid_params as gp
# Metadata to be used later
user = getpass.getuser()
now... |
tensorflow/docs-l10n | site/zh-cn/guide/ragged_tensor.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... |
kubeflow/examples | mnist/mnist_gcp.ipynb | apache-2.0 | import logging
import os
import uuid
from importlib import reload
from oauth2client.client import GoogleCredentials
credentials = GoogleCredentials.get_application_default()
"""
Explanation: MNIST end to end on Kubeflow on GKE
This example guides you through:
Taking an example TensorFlow model and modifying it to sup... |
bollwyvl/ip-cad | CAD Widget Example.ipynb | bsd-3-clause | from ipcad.widgets import CAD
"""
Explanation: Widget: CAD
<i class="fa fa-info-circle fa-2x text-primary"></i> Execute each of these cells in order, such as with <label class="label label-default">Shift+Enter</label>
First, load CAD from your module:
End of explanation
"""
cadExample = CAD(assembly_url="examples/... |
amcdawes/QMlabs | Chapter 4 In-Class Problems-Solutions.ipynb | mit | from numpy import sin,cos,sqrt,pi
from qutip import *
"""
Explanation: Chapter 4 in-class problems - Solutions
Using what you learned in Lab, answer questions 4.7, 4.8, 4.10, 4.11, 4.12, and 4.13
End of explanation
"""
H = Qobj([[1],[0]])
V = Qobj([[0],[1]])
P45 = Qobj([[1/sqrt(2)],[1/sqrt(2)]])
M45 = Qobj([[1/sqrt(... |
Autodesk/molecular-design-toolkit | moldesign/_notebooks/Tutorial 2. Biochemical basics.ipynb | apache-2.0 | # First, import MDT
import moldesign as mdt
from moldesign import units as u
# This sets up your notebook to draw inline plots:
%matplotlib inline
import numpy as np
from matplotlib.pylab import *
try: import seaborn
except ImportError: pass
"""
Explanation: <span style="float:right"><a href="http://moldesign.bionan... |
empet/Plotly-plots | Plotly-Mesh3d.ipynb | gpl-3.0 | from IPython.display import IFrame
IFrame('https://plot.ly/~empet/13475/', width=800, height=350)
"""
Explanation: Plotly Alpha Shapes as Mesh3d instances
Starting with a finite set of 3D points, Plotly can generate a Mesh3d object, that depending on a key value can be the convex hull of that set, its Delaunay tria... |
mne-tools/mne-tools.github.io | 0.18/_downloads/f6a41d9af14a63d7204c864cb0e1de2f/plot_receptive_field.ipynb | bsd-3-clause | # Authors: Chris Holdgraf <choldgraf@gmail.com>
# Eric Larson <larson.eric.d@gmail.com>
#
# License: BSD (3-clause)
# sphinx_gallery_thumbnail_number = 7
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne.decoding import ReceptiveField, TimeDelayingRidge
from scipy.stats import multivar... |
ajgpitch/qutip-notebooks | examples/temporal-photon-scattering.ipynb | lgpl-3.0 | import numpy as np
import matplotlib.pyplot as plt
from qutip import *
from multiprocessing import Pool, cpu_count
from IPython.display import display, Math, Latex
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
worker_count = max(cpu_count() - 1, 1)
"""
Explanation: QuTiP Lecture: Photon Scatteri... |
infilect/ml-course1 | week1/CNN/notebook/how_to_save_restor.ipynb | mit | from IPython.display import Image
Image('images/02_network_flowchart.png')
"""
Explanation: TensorFlow Tutorial On Save & Restore Model
Introduction
This tutorial demonstrates how to save and restore the variables of a Neural Network. During optimization we save the variables of the neural network whenever its classif... |
tlby/mxnet | example/adversary/adversary_generation.ipynb | apache-2.0 | %matplotlib inline
import mxnet as mx
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from mxnet import gluon
"""
Explanation: Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additiona... |
AndreySheka/dl_ekb | hw12/a2c_kungfu_dmia.ipynb | mit | import matplotlib.pyplot as plt
import numpy as np
%matplotlib inline
#setup theano/lasagne. Prefer GPU
%env THEANO_FLAGS=device=gpu,floatX=float32
#If you are running on a server, launch xvfb to record game videos
#Please make sure you have xvfb installed (apt-get install xvfb, see gym readme on xvfb)
import os
if o... |
christophebertrand/ada-epfl | HW01-Intro_to_Pandas/Data Wrangling with Pandas.ipynb | mit | %matplotlib inline
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_context('notebook')
"""
Explanation: Table of Contents
<p><div class="lev1"><a href="#Data-Wrangling-with-Pandas"><span class="toc-item-num">1 </span>Data Wrangling with Pandas</a></div><d... |
mined-gatech/pymks_overview | notebooks/cahn_hilliard.ipynb | mit | %matplotlib inline
%load_ext autoreload
%autoreload 2
import numpy as np
import matplotlib.pyplot as plt
"""
Explanation: Cahn-Hilliard Example
This example demonstrates how to use PyMKS to solve the Cahn-Hilliard equation. The first section provides some background information about the Cahn-Hilliard equation as wel... |
kbase/data_api | examples/notebooks/plot_feature_positions.ipynb | mit | %matplotlib notebook
import seaborn as sns
import os
from doekbase import data_api
from doekbase.data_api import display
b = data_api.browse(1013)
g = b['kb|g.1'].object
g
"""
Explanation: Introduction
This notebook shows how to use the Data API to plot the features in a genome. After initialization, this is broken i... |
pysg/pyther | Modelo de impregnacion/modelo2/Activité 10_Viernes2-checkpoint.ipynb | mit | import numpy as np
from scipy import integrate
from matplotlib.pylab import *
"""
Explanation: Evaluation des modèles pour l'extraction supercritique
L'extraction supercritique est de plus en plus utilisée afin de retirer des matières organiques de différents liquides ou matrices solides. Cela est dû au fait que les f... |
google/prog-edu-assistant | exercises/dataframe-pre1-master.ipynb | apache-2.0 | df2 = pd.read_csv(io.StringIO("""
x,y
1,2
3,4
"""))
df2
"""
Explanation: lang:enIn this exercise, we will consider what is a data frame and how to represent
the data in a "tidy" way. We will use the pandas data frame library.
lang:jaこの講義では、「データフレーム」を使って、データをキレイに(tidy) 表現する方法を説明します。
本講義では データフレームのためのライブラリとしてpandas を使用し... |
ES-DOC/esdoc-jupyterhub | notebooks/csir-csiro/cmip6/models/vresm-1-0/ocean.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'csir-csiro', 'vresm-1-0', 'ocean')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocean
MIP Era: CMIP6
Institute: CSIR-CSIRO
Source ID: VRESM-1-0
Topic: Ocean
Sub-Topics: Timestepping Framewor... |
mne-tools/mne-tools.github.io | 0.15/_downloads/plot_mixed_source_space_inverse.ipynb | bsd-3-clause | # Author: Annalisa Pascarella <a.pascarella@iac.cnr.it>
#
# License: BSD (3-clause)
import os.path as op
import matplotlib.pyplot as plt
import mne
from mne.datasets import sample
from mne import setup_volume_source_space
from mne import make_forward_solution
from mne.minimum_norm import make_inverse_operator, apply_... |
leizhipeng/ml | customer_segments/customer_segments.ipynb | gpl-3.0 | # Import libraries necessary for this project
import numpy as np
import pandas as pd
from IPython.display import display # Allows the use of display() for DataFrames
# Import supplementary visualizations code visuals.py
import visuals as vs
# Pretty display for notebooks
%matplotlib inline
# Load the wholesale custo... |
ES-DOC/esdoc-jupyterhub | notebooks/snu/cmip6/models/sandbox-2/atmoschem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'snu', 'sandbox-2', 'atmoschem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmoschem
MIP Era: CMIP6
Institute: SNU
Source ID: SANDBOX-2
Topic: Atmoschem
Sub-Topics: Transport, Emissions Co... |
BrainIntensive/OnlineBrainIntensive | resources/matplotlib/Examples/barplots.ipynb | mit | %load_ext watermark
%watermark -u -v -d -p matplotlib,numpy
"""
Explanation: Sebastian Raschka
back to the matplotlib-gallery at https://github.com/rasbt/matplotlib-gallery
End of explanation
"""
%matplotlib inline
"""
Explanation: <font size="1.5em">More info about the %watermark extension</font>
End of explanati... |
bitrepository/jupyter-release-tests | GetChecksums Tests.ipynb | apache-2.0 | %env CLIENT bitrepository-client-1.9-RC1
!wget -Nq "https://sbforge.org/download/attachments/25395346/${CLIENT}.zip"
!unzip -quo ${CLIENT}.zip
%alias bitmag ${CLIENT}/bin/bitmag.sh %l
"""
Explanation: Setup command line client
End of explanation
"""
%env TESTFILE1 README.md
%bitmag put-file -c integrationtest1 -f... |
achillesrasquinha/brains-from-scratch | Brains from Scratch - Machine Learning for dummies.ipynb | mit | from abc import ABCMeta, abstractmethod
class Model(metaclass = ABCMeta):
@abstractmethod
def predict(self, features, parameters):
pass
"""
Explanation: Brains from Scratch
Machine Learning for dummies - Achilles Rasquinha
Q. What is this page all about?
This is a one-page comprehensive publish tha... |
aldian/tensorflow | tensorflow/lite/micro/examples/magic_wand/train/train_magic_wand_model.ipynb | apache-2.0 | # Clone the repository from GitHub
!git clone --depth 1 -q https://github.com/tensorflow/tensorflow
# Copy the training scripts into our workspace
!cp -r tensorflow/tensorflow/lite/micro/examples/magic_wand/train train
"""
Explanation: Train a gesture recognition model for microcontroller use
This notebook demonstrate... |
soxofaan/dahuffman | examples.ipynb | mit | codec = dahuffman.HuffmanCodec.from_frequencies({'e': 100, 'n':20, 'x':1, 'i': 40, 'q':3})
encoded = codec.encode('exeneeeexniqneieini')
print(encoded)
print(encoded.hex())
print(len(encoded))
codec.decode(encoded)
codec.print_code_table()
"""
Explanation: Usage
Basic usage example, where the code table is built ba... |
xoolive/quadtree | tutorial.ipynb | mit | from smartquadtree import Quadtree
"""
Explanation: Quadtrees iterating on pairs of neighbouring items
A quadtree is a tree data structure in which each node has exactly four children. It is a particularly efficient way to store elements when you need to quickly find them according to their x-y coordinates.
A common p... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive/01_bigquery/labs/c_extract_and_benchmark.ipynb | apache-2.0 | PROJECT = "cloud-training-demos" # Replace with your PROJECT
REGION = "us-central1" # Choose an available region for Cloud MLE
import os
os.environ["PROJECT"] = PROJECT
os.environ["REGION"] = REGION
!pip freeze | grep google-cloud-bigquery==1.21.0 || pip install google-cloud-bigquery==1.21.0
%load_ext go... |
econandrew/povcalnetjson | notebooks/A-Check PovCalNet Empirical.ipynb | mit | # BGR_3_2001.json
# BRA_3_2001.json
# MWI_3_2010.23.json
# ECU_3_2014.json
# ARM_3_2010.json
# NGA_3_2009.83.json
# IDN_1_2014.json quite pointed / triangular
# PHL_3_2009.json
# ZAR_3_2012.4.json
# TZA_3_2011.77.json
# VNM_3_2008.json
# MOZ_3_2008.67.json quite rounded
# UZB_3_2003.json
# KIR_3_2006.json needs 1e-4
# ... |
navoj/ecell4 | ipynb/Tutorials/ModelBasics.ipynb | gpl-2.0 | from ecell4 import *
A = Species("A")
B = Species("B")
"""
Explanation: Tutorial 1 (Model)
This is a tutorial for E-Cell4. Here, we represent the way of modeling with E-Cell 4.
Species
We'll show you how to create Species.
End of explanation
"""
A = Species("A")
A.set_attribute("radius", "0.005")
A.set_attribute("D... |
cogeorg/black_rhino | examples/solow/Example_Solow.ipynb | gpl-3.0 | import xml.etree.ElementTree as ET
"""
Explanation: The Solow growth model
This post provides an example of the Solow growth model in the Black Rhino package. It will first cover the Solow model itself and how it is implemented in Black Rhino. Then, it will cover how to use Black Rhino to actually run the model and an... |
mattgiguere/doglodge | code/bfscraper.ipynb | mit | from bs4 import BeautifulSoup
#import urllib.request
import requests
"""
Explanation: bfscraper
a notebook for scraping data from bringfido. Note, mechanize only works with python 2.X.
End of explanation
"""
url="http://www.bringfido.com/lodging/city/new_haven_ct_us/"
try:
from urllib.request import Request, ur... |
boland1992/SeisSuite | docs/Preprocess_Example.ipynb | gpl-3.0 | from pysismo.pspreprocess import Preprocess
from obspy import read
from obspy.core import Stream
import matplotlib.pyplot as plt
import numpy as np
%matplotlib inline
"""
Explanation: Ambient Noise Waveforms Preprocessing Methods Examples
The following notebook contains examples for using the psprocess.py toolbox fo... |
TeamEmily/Emily_server | customKonlpy/tutorials/usage_of_templatetagger.ipynb | mit | import konlpy
konlpy.__version__
from konlpy.tag import Twitter as OriginalTwitter
twitter_original = OriginalTwitter()
print(twitter_original.pos('우리아이오아이는 정말 이뻐요'),'\n')
print(twitter_original.pos('트둥이꺼 tt도 좋아요'))
"""
Explanation: KoNLPy의 트위터 한국어 분석기 (현 오픈 한국어 분석기)는 속도도 빠르고 다양한 사전도 확보하고 있는 한국어 분석기입니다. 하지만 컴파일이 되어 ... |
liffiton/ATLeS | notebooks/Atles-Stats-Descriptives.ipynb | mit | from pathlib import Path
import configparser
import numpy as np
import pandas as pd
import seaborn
import matplotlib.pyplot as plt
import pingouinparametrics as pp
# add src/ directory to path to import ATLeS code
import os
import sys
module_path = os.path.abspath(os.path.join('..', 'src'))
if module_path not in sys.p... |
zzsza/Datascience_School | 16. 과최적화와 정규화/02. 교차 검증.ipynb | mit | X = np.arange(10).reshape((5, 2))
X
y = np.arange(5)
y
from sklearn.cross_validation import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33, random_state=42)
X_train
y_train
X_test
y_test
"""
Explanation: 교차 검증
모형 검증
예측 모형의 최종 성능을 객관적으로 측정하려면 모수 추정(parameter fitting) 즉 트... |
spm2164/foundations-homework | 11/homework_11_violations.ipynb | artistic-2.0 | import pandas as pd
import numpy as np
from dateutil import parser
from time import strptime
from time import mktime
from datetime import datetime
import math
import matplotlib.pyplot
%matplotlib inline
def timefixer(time):
return_time=time
return_time.replace('+', '0')
if time == 'nan':
return np.... |
tensorflow/probability | tensorflow_probability/examples/jupyter_notebooks/Probabilistic_PCA.ipynb | apache-2.0 | #@title Licensed under the Apache License, Version 2.0 (the "License"); { display-mode: "form" }
# 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, sof... |
mathLab/RBniCS | tutorials/12_stokes/tutorial_stokes_1_rb.ipynb | lgpl-3.0 | from dolfin import *
from rbnics import *
from sampling import LinearlyDependentUniformDistribution
"""
Explanation: TUTORIAL 12 - Stokes Equations
Keywords: geometrical parametrization, reduced basis method, mixed formulation, inf sup condition
1. Introduction
This tutorial addresses geometrical parametrization and t... |
iamtrask/polyglot | notebooks/NamedEntityRecognition.ipynb | gpl-3.0 | from polyglot.downloader import downloader
print(downloader.supported_languages_table("ner2", 3))
"""
Explanation: Named Entity Extraction
Named entity extraction task aims to extract phrases from plain text that correpond to entities.
Polyglot recognizes 3 categories of entities:
Locations (Tag: I-LOC): cities, coun... |
PAIR-code/ai-explorables | server-side/fill-in-the-blank/gender-over-time-colab/gender-over-time.ipynb | apache-2.0 | %%capture
import os
import torch
!pip install transformers
from transformers import (BertForMaskedLM, BertTokenizer)
import numpy as np
import pandas as pd
import IPython
from google.colab import output
%%capture
modelpath_bert_large = "bert-large-uncased"
tokenizer = BertTokenizer.from_pretrained(modelpath_bert_lar... |
jnobre/lxmls-toolkit-2017 | lxmls/laboratories/.ipynb_checkpoints/day6-checkpoint.ipynb | mit | # Add tools
# NOTE: This should only be needed if you do not store the notebook on the lxmls root
import sys
sys.path.append('../../')
from pdb import set_trace
# Location of Part-of-Speech WSJ Data
WSJ_TRAIN = "../../data/train-02-21.conll"
WSJ_TEST = "../../data/test-23.conll"
WSJ_DEV = "../../data/dev-22.conll"
# ... |
emjotde/UMZ | Wyklady/12/Deep Learning.ipynb | cc0-1.0 | from __future__ import print_function
import numpy as np
np.random.seed(1337) # for reproducibility
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation
from keras.optimizers import SGD, Adam, RMSprop
from keras.utils import np_utils
batch_siz... |
boada/planckClusters | analysis_ir/notebooks/04a. Liu et al -- full.ipynb | mit | cosmo = LambdaCDM(H0=70, Om0=0.3, Ode0=0.7, Tcmb0=2.725)
"""
Explanation: Setup Cosmology
End of explanation
"""
# check to make sure we have defined the bpz filter path
if not os.getenv('EZGAL_FILTERS'):
os.environ['EZGAL_FILTERS'] = (f'{os.environ["HOME"]}/Projects/planckClusters/MOSAICpipe/bpz-1.99.3/FILTER/'... |
piskvorky/gensim | docs/notebooks/downloader_api_tutorial.ipynb | lgpl-2.1 | import logging
import gensim.downloader as api
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
"""
Explanation: Tutorial for using Gensim's API for downloading corpuses/models
Let's start by importing the api module.
End of explanation
"""
corpus = api.load('text8')
"""
... |
ashleysmart/mlgym | Colaboratory_へようこそ.ipynb | mit | seconds_in_a_day = 24 * 60 * 60
seconds_in_a_day
"""
Explanation: <a href="https://colab.research.google.com/github/ashleysmart/mlgym/blob/master/Colaboratory_%E3%81%B8%E3%82%88%E3%81%86%E3%81%93%E3%81%9D.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/><... |
bcmd/BCMD | batch/bsx/Overnight_Optim_Analysis.ipynb | gpl-2.0 | OVERNIGHT_FILE = '/home/buck06191/Desktop/optimisation_edit.json'
with open(OVERNIGHT_FILE) as f:
optim_data = json.load(f)
# Check length of each dict section before converting to pandas DF
import copy
x = copy.copy(optim_data)
{k:len(x[k]) for k in x.keys()}
overnight_df = pd.DataFrame(optim_data)
"""
Explanati... |
zingale/hydro_examples | finite-volume/conservative-interpolation-cyl.ipynb | bsd-3-clause | a, b = symbols("a b")
r, r0 = symbols("r r0")
f = a*(r-r0) + b
f
dr = symbols("\Delta")
"""
Explanation: Linear axisymmetric conservative interpolation
We want to construct a linear polynomal through that points $r_i$, $r_{i+1}$ that gives the correct averages,
$r_i$, and $r_{i+1}$ when integrated over the volume, e.... |
tabakg/potapov_interpolation | orthogonality testing.ipynb | gpl-3.0 | import Potapov_Code.Roots as Roots
import Potapov_Code.Potapov as Potapov
import Potapov_Code.Time_Delay_Network as Time_Delay_Network
import Potapov_Code.Time_Sims as Time_Sims
import Potapov_Code.functions as functions
import Potapov_Code.tests as tests
import numpy as np
import numpy.linalg as la
import matplotlib... |
ueapy/ueapy.github.io | content/notebooks/2015-11-20-cartopy-example.ipynb | mit | %matplotlib inline
"""
Explanation: This post is essentially a Python script that we discussed at today's meeting. It is written in a form of Jupyter Notebook and can be downloaded as a whole (the link at the end).
The script below is a simple example on how you can utulise matplotlib and cartopy awesomeness to create... |
LSSTC-DSFP/LSSTC-DSFP-Sessions | Sessions/Session05/Day3/Introduction to Astrometry.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
import astropy.io.fits as fits
from astropy import wcs
from astroquery.gaia import Gaia
## make matplotlib appear in the notebook rather than in a new window
%matplotlib inline
"""
Explanation: Introduction to Astrometry - Exercises
Dora Föhring, University of Hawaii ... |
HazyResearch/snorkel | tutorials/workshop/Workshop_5_Advanced_Preprocessing.ipynb | apache-2.0 | import sys; sys.version
"""
Explanation: <img align="left" src="imgs/logo.jpg" width="50px" style="margin-right:10px">
Snorkel Workshop: Extracting Spouse Relations <br> from the News
Part 5: Preprocessing & Building the Snorkel Database
In this tutorial, we will walk through the process of using Snorkel to identify m... |
Jim00000/Numerical-Analysis | 4_Least_Squares.ipynb | unlicense | # Import modules
import sys
import math
import numpy as np
from matplotlib import pyplot as plt
from scipy import linalg
from scipy import sparse
"""
Explanation: ★ Least Squares ★
End of explanation
"""
A = np.array([1, -4, 2, 3, 2, 2]).reshape(3, 2)
b = np.array([-3, 15, 9])
x = linalg.lstsq(A, b)
print(x[0])
"""... |
PMEAL/OpenPNM | examples/reference/data_management/interleaving_data.ipynb | mit | import openpnm as op
pn = op.network.Cubic([5, 5, 5])
geo1 = op.geometry.GenericGeometry(network=pn, pores=range(0, 75),
throats=range(0, 150))
geo2 = op.geometry.GenericGeometry(network=pn, pores=range(75, 125),
throats=range(150, 300))
geo1['pore.... |
ES-DOC/esdoc-jupyterhub | notebooks/cnrm-cerfacs/cmip6/models/cnrm-esm2-1-hr/atmos.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'cnrm-cerfacs', 'cnrm-esm2-1-hr', 'atmos')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmos
MIP Era: CMIP6
Institute: CNRM-CERFACS
Source ID: CNRM-ESM2-1-HR
Topic: Atmos
Sub-Topics: Dynamic... |
wgong/open_source_learning | learn_stem/devops/curl-test-rest-api.ipynb | apache-2.0 | !curl -o todos-1.json https://jsonplaceholder.typicode.com/todos/1
!cat todos-1.json
"""
Explanation: https://www.baeldung.com/curl-rest
https://jsonplaceholder.typicode.com/
is a great REST API test site
Save curl output
save curl output response to a file
$ curl -o jsonplaceholder.html https://jsonplaceholder.typic... |
ssunkara1/bqplot | examples/Marks/Object Model/Graph.ipynb | apache-2.0 | fig_layout = Layout(width='960px', height='500px')
"""
Explanation: Nodes and Links should be supplied to the Graph mark.
<p>Node attributes
| Attribute| Type | Description | Default |
|:----------:|:-------------:|:------:|
| label | str | node label | mandatory attribute |
| label_display | {center, ou... |
edhenry/notebooks | LR_Example.ipynb | mit | from __future__ import print_function
from ipywidgets import interact, interactive, fixed, interact_manual
from ipywidgets import widget
from IPython.display import display
from math import pi, sin
import numpy as np
from matplotlib import pyplot as plt
from sklearn.linear_model import Ridge
%matplotlib inline
def t... |
Reproducible-Science-Curriculum/introduction-RR-Jupyter | notebooks/getting_started_with_jupyter_notebooks.ipynb | cc0-1.0 | import this
"""
Explanation: Familiarize Yourself with Jupyter
The Jupyter Notebook is a web application that allows you to create and share documents that contain live code, equations, visualizations and explanatory text. The following links may be useful in gaining a basic understanding of Jupyter and how to work in... |
quantopian/research_public | notebooks/lectures/Position_Concentration_Risk/questions/notebook.ipynb | apache-2.0 | import numpy as np
import pandas as pd
import scipy.stats as stats
import matplotlib.pyplot as plt
import math
import cvxpy
"""
Explanation: Exercise Answer Key: Position Concentration Risk
Lecture Link
This exercise notebook refers to this lecture. Please use the lecture for explanations and sample code.
https://www.... |
chrisfilo/fmri-analysis-vm | analysis/Bayesian/BayesianGLM.ipynb | mit | import os,sys
import numpy
%matplotlib inline
import matplotlib.pyplot as plt
sys.path.insert(0,'../')
from utils.mkdesign import create_design_singlecondition
from nipy.modalities.fmri.hemodynamic_models import spm_hrf,compute_regressor
from statsmodels.tsa.arima_process import arma_generate_sample
import scipy.stats
... |
grokkaine/biopycourse | day2/stats_learning.ipynb | cc0-1.0 | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
from scipy import stats
np.random.seed(1) # for repeatability
E_true = 1000 # true expression
N = 50 # samples
E = stats.poisson(E_true).rvs(N) # N measurements of the expression
err = np.sqrt(E) # errors on Poisson counts estimated via square ... |
ES-DOC/esdoc-jupyterhub | notebooks/nerc/cmip6/models/hadgem3-gc31-hh/seaice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'nerc', 'hadgem3-gc31-hh', 'seaice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Seaice
MIP Era: CMIP6
Institute: NERC
Source ID: HADGEM3-GC31-HH
Topic: Seaice
Sub-Topics: Dynamics, Thermody... |
nguy/AWOT | examples/awot_time_series_flight_data.ipynb | gpl-2.0 | # Load the needed packages
import numpy as np
import matplotlib.pyplot as plt
import awot
from awot.graph.common import create_basemap
from awot.graph import FlightLevel
%matplotlib inline
"""
Explanation: <h2>Plot flight variables in time series format</h2>
<p>University of Wyoming flight data
End of explanation
""... |
turbomanage/training-data-analyst | courses/machine_learning/deepdive2/structured/solutions/5b_deploy_keras_ai_platform_babyweight.ipynb | apache-2.0 | import os
"""
Explanation: LAB 5b: Deploy and predict with Keras model on Cloud AI Platform.
Learning Objectives
Setup up the environment
Deploy trained Keras model to Cloud AI Platform
Online predict from model on Cloud AI Platform
Batch predict from model on Cloud AI Platform
Introduction
In this notebook, we'll ... |
openfisca/combine-calculators | scripts/visual_comparisons.ipynb | gpl-3.0 | from compare_simulators import CalculatorComparator
from population_simulator import CerfaPopulationSimulator
from utils import multi_scatter
import matplotlib.pyplot as plt
import pandas as pd
import qgrid
import copy
%matplotlib inline
"""
Explanation: Guillaume Chaslot guillau... |
newworldnewlife/TensorFlow-Tutorials | 10_Fine-Tuning.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import PIL
import tensorflow as tf
import numpy as np
import os
"""
Explanation: TensorFlow Tutorial #10
Fine-Tuning
by Magnus Erik Hvass Pedersen
/ GitHub / Videos on YouTube
Introduction
We have previously seen in Tutorials #08 and #09 how to use a pre-trained Neura... |
Mashimo/datascience | 01-Regression/LinearRegression.ipynb | apache-2.0 | import pandas as pd
wine = pd.read_csv("wine.csv")
baseline = wine.Price.mean()
print (baseline)
"""
Explanation: Linear Regression
Introduction: the price of wine
There are differences in price and quality of wine from year to year that are sometimes very significant: wines are tasting better when they are older. So,... |
crdguez/mat4ac | tmp/Ejercicios 1_3.ipynb | gpl-3.0 | enunciado = list([r'\frac{7!}{6!}',r'\frac{{8!}}{{9!}}',r'\frac{{9!}}{{5!\cdot 4!}}',r'\frac{{m!}}{{(m - 1)!}}', r'\frac{{( {m + 1} )!}}{{( {m - 1} )!}}'])
enunciado
enunciado = list([r'\frac{7!}{6!}',r'\frac{{8!}}{{9!}}',r'\frac{{9!}}{{5!\cdot 4!}}',r'\frac{{m!}}{{(m - 1)!}}', r'\frac{{( {m + 1} )!}}{{( {m - 1} )!}}'... |
cubewise-code/TM1py-samples | Samples/Cubike/cubike_data_science.ipynb | mit | import configparser
config = configparser.ConfigParser()
config.read(r'..\..\config.ini')
"""
Explanation: Data science with IBM Planning Analytics
Cubike example - Part 2 and 3
Welcome to the second part of the Data Science with TM1/Planning Analytics.
In Part 1 , we uploaded in our TM1 cubes the weather data from a... |
romilly/rpi-docker-tensorflow | build-tensor-pi/notebooks/index.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... |
mdiaz236/DeepLearningFoundations | tensorboard/Anna_KaRNNa.ipynb | mit | import time
from collections import namedtuple
import numpy as np
import tensorflow as tf
"""
Explanation: Anna KaRNNa
In this notebook, I'll build a character-wise RNN trained on Anna Karenina, one of my all-time favorite books. It'll be able to generate new text based on the text from the book.
This network is base... |
dnstanciu/masters-project | sources/notebooks/statistical_testing.ipynb | gpl-3.0 | import random
random.seed(20)
from pprint import pprint
import scipy
import pandas as pd
from pandas.tools.plotting import parallel_coordinates
from pandas import concat
import matplotlib
# Set backend to pgf
matplotlib.use('pgf')
import matplotlib.pyplot as plt
import numpy as np
# Some nice default configurati... |
kazuhirokomoda/deep_learning | fast.ai/lesson1_17flowers/17flowers_run.ipynb | mit | from __future__ import division, print_function
%matplotlib inline
path = "data/17flowers/"
import os, json
from glob import glob
import numpy as np
np.set_printoptions(precision=4, linewidth=100)
from matplotlib import pyplot as plt
# check that ~/.keras/keras.json is set for Theano and includes "image_data_format... |
gboeing/pynamical | examples/pynamical-demo-logistic-model.ipynb | mit | import IPython.display as IPdisplay
import matplotlib.cm as cm
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import pynamical
from pynamical import simulate, bifurcation_plot, save_fig
%matplotlib inline
title_font = pynamical.get_title_font()
label_font = pynamical.get_label_font()
"""
Expla... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.