repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
hankcs/HanLP | plugins/hanlp_demo/hanlp_demo/zh/srl_mtl.ipynb | apache-2.0 | !pip install hanlp -U
"""
Explanation: <h2 align="center">点击下列图标在线运行HanLP</h2>
<div align="center">
<a href="https://colab.research.google.com/github/hankcs/HanLP/blob/doc-zh/plugins/hanlp_demo/hanlp_demo/zh/srl_mtl.ipynb" target="_blank"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Ope... |
tensorflow/docs-l10n | site/zh-cn/quantum/tutorials/gradients.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... |
molgor/spystats | notebooks/Sandboxes/MCMC/.ipynb_checkpoints/SpatialGaussianProcess inference in PyMC3-checkpoint.ipynb | bsd-2-clause | # Load Biospytial modules and etc.
%matplotlib inline
import sys
sys.path.append('/apps/external_plugins/spystats/')
#import django
#django.setup()
import pandas as pd
import matplotlib.pyplot as plt
## Use the ggplot style
plt.style.use('ggplot')
import numpy as np
## Model Specification
import pymc3 as pm
from spyst... |
rice-solar-physics/hot_plasma_single_nanoflares | notebooks/plot_two_fluid_ebtel_terms.ipynb | bsd-2-clause | import sys
import os
import subprocess
import numpy as np
import seaborn.apionly as sns
import astropy.constants as const
from matplotlib import ticker
import matplotlib.pyplot as plt
sys.path.append(os.path.join(os.environ['EXP_DIR'],'ebtelPlusPlus/rsp_toolkit/python'))
from xml_io import InputHandler,OutputHandler
... |
jdhp-docs/python_notebooks | nb_dev_python/python_keras_hello_en.ipynb | mit | import tensorflow as tf
tf.__version__
import keras
keras.__version__
import h5py
h5py.__version__
import pydot
pydot.__version__
from keras.models import Sequential
model = Sequential()
from keras.layers import Dense
model.add(Dense(units=6, activation='relu', input_dim=4))
model.add(Dense(units=3, activation='... |
dnc1994/MachineLearning-UW | ml-regression/blank/week-5-lasso-assignment-2-blank.ipynb | mit | import graphlab
"""
Explanation: Regression Week 5: LASSO (coordinate descent)
In this notebook, you will implement your very own LASSO solver via coordinate descent. You will:
* Write a function to normalize features
* Implement coordinate descent for LASSO
* Explore effects of L1 penalty
Fire up graphlab create
Make... |
ES-DOC/esdoc-jupyterhub | notebooks/noaa-gfdl/cmip6/models/gfdl-cm4/seaice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'noaa-gfdl', 'gfdl-cm4', 'seaice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Seaice
MIP Era: CMIP6
Institute: NOAA-GFDL
Source ID: GFDL-CM4
Topic: Seaice
Sub-Topics: Dynamics, Thermodynami... |
kubeflow/pipelines | samples/tutorials/Data passing in python components.ipynb | apache-2.0 | # Put your KFP cluster endpoint URL here if working from GCP notebooks (or local notebooks). ('https://xxxxx.notebooks.googleusercontent.com/')
kfp_endpoint='https://XXXXX.{pipelines|notebooks}.googleusercontent.com/'
# Install Kubeflow Pipelines SDK. Add the --user argument if you get permission errors.
!PIP_DISABLE_... |
ElMejorEquipoDeLaSerena/VariableStarsClassification | Classification.ipynb | mit | # Load our matched data from the catalog
cat_data = 'catalog_data_final/matched_data.csv'
# Number of rows
!wc -l $cat_data
catalog = pandas.read_csv(cat_data, index_col=0, usecols=[1,2,3,7,10,11,12,13,14,15,16,17])
# Filter and scrub
catalog = catalog[catalog['Blend'] == 0]
catalog.rename(columns={
'V_(mag)... |
SeldonIO/seldon-server | python/examples/wine.ipynb | apache-2.0 | df["target"] = df["target"] - 1
t_auto = auto.Auto_transform(exclude=["target"])
df2 = t_auto.fit_transform(df)
df2.head()
"""
Explanation: Create an auto transform to scale numeric columns automatically.
End of explanation
"""
from seldon import xgb
import seldon.pipeline.cross_validation as cf
xgb = xgb.XGBoostCla... |
dtherrick/dataviz_baseball | iPython/4 - Scrape and Plot 2015 Baseball Standings With Plotly.ipynb | mit | import pandas as pd
import matplotlib.pyplot as plt
import plotly.plotly as py
import plotly.graph_objs as go
import ipywidgets
from IPython.display import display
from collections import OrderedDict
from datetime import datetime as dt
%matplotlib inline
pd.options.mode.chained_assignment = None # default='warn'
""... |
turbomanage/training-data-analyst | courses/machine_learning/deepdive/06_structured/labs/5_train.ipynb | apache-2.0 | # change these to try this notebook out
BUCKET = 'cloud-training-demos-ml'
PROJECT = 'cloud-training-demos'
REGION = 'us-central1'
import os
os.environ['BUCKET'] = BUCKET
os.environ['PROJECT'] = PROJECT
os.environ['REGION'] = REGION
os.environ['TFVERSION'] = '1.13'
%%bash
gcloud config set project $PROJECT
gcloud con... |
EstevaoVieira/udacity_projects | titanic_survival_exploration/titanic_survival_exploration.ipynb | mit | # 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 dataset
in_file... |
OSGeo-live/CesiumWidget | GSOC/notebooks/Projects/GRASS/python-grass-addons/02_pygrass_library.ipynb | apache-2.0 | from grass.pygrass.vector import VectorTopo
from grass.pygrass.vector.geometry import Point
"""
Explanation: PyGRASS
PyGRASS is a library originally developed during the Google Summer of Code 2012. The PyGRASS library adds two main functionalities:
a Python interface through the ctypes binding of the C API of GRASS, ... |
Aggieyixin/cjc2016 | code/06.data_cleaning_Tweets.ipynb | mit | bigfile = open('/Users/chengjun/百度云同步盘/Writing/OWS/ows-raw.txt', 'rb')
chunkSize = 1000000
chunk = bigfile.readlines(chunkSize)
print len(chunk)
with open("/Users/chengjun/GitHub/cjc2016/data/ows_tweets_sample.txt", 'w') as f:
for i in chunk:
f.write(i)
"""
Explanation: 数据清洗之推特数据
王成军
wangchengjun@nju.edu... |
mathinmse/mathinmse.github.io | Lecture-17-Explicit-Finite-Difference.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
"""
Explanation: Lecture 17: Numerical Solutions to the Diffusion Equation (Explicit Methods)
Reading and Reference
Numerical Recipes, W. Press, Cambridge University Press, 1986
Numerical Methods, R. Hornbeck, Quantum Publishers, 1975
B. Gustafsso... |
mne-tools/mne-tools.github.io | 0.14/_downloads/plot_read_forward.ipynb | bsd-3-clause | # Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Denis Engemann <denis.engemann@gmail.com>
#
# License: BSD (3-clause)
import mne
from mne.datasets import sample
import matplotlib.pyplot as plt
print(__doc__)
data_path = sample.data_path()
fname = data_path + '/MEG/sample/sample_audv... |
gaargly/gaargly.github.io | 2021_06_16_Lira_Second_Assignment.ipynb | mit | # your code here
current_users = ["lira", "sarah", "james", "nicole", "AJ"]
new_users = ["lira", "sarah", "li", "chidi", "olympia"]
for i in current_users:
if i in new_users:
print("You need to enter a new username")
else:
print("This username is available")
"""
Explanation: <a href="https://colab.researc... |
sshopov/pyconau2017 | final.ipynb | mit | import sys
import time
import rpyc
host = '192.168.198.70' #host name or IP address of the EV3
try:
conn = rpyc.classic.connect(host)
ev3 = conn.modules['ev3dev.ev3'] #import ev3dev.ev3 remotely
except:
print(sys.exc_info()[1])
finally:
from ev3dev import ev3 #RPyC failed so we must be running on the... |
fangohr/polygon-finite-difference-mesh-tools | notebooks/MeshArea.ipynb | bsd-2-clause | class CartesianCoords(object):
def __init__(self, x, y, z=0):
self.x = x
self.y = y
self.z = z
self.r = math.sqrt(x**2 + y**2 + z**2) #radial
self.a = np.arctan2(x, y) #azimuth
self.h = z #cylindrical height
class PolarCoords(object):
def __init__(s... |
elivre/arfe | e2018/.ipynb_checkpoints/030-rede2018_ajusta_receitas-checkpoint.ipynb | mit | ano_eleicao = '2018'
dbschema = f'rede{ano_eleicao}'
dbschema_tse = f'tse{ano_eleicao}'
table_receitas = f'{dbschema}.receitas_{ano_eleicao}'
table_receitas_candidatos = f'{dbschema_tse}.receitas_candidatos_{ano_eleicao}'
table_receitas_candidatos_doador_originario = f'{dbschema_tse}.receitas_candidatos_doador_origina... |
h-mayorquin/time_series_basic | presentations/2016-01-18(Prediction with Bigrams).ipynb | bsd-3-clause | import nltk
from nltk.book import text7 as text
"""
Explanation: Prediction with Bigrams
In this notebook I will show how to do predictions in text using a very simple scheme. The idea is to get the frequency of the letters for a certain text and for each letter predict the most frequent letter. This method is in my o... |
parrt/msan692 | notes/pdf.ipynb | mit | ! curl https://www.tesla.com/sites/default/files/tesla-model-s.pdf > /tmp/tsla.pdf
"""
Explanation: Extracting text from PDFs
PDF stands for "Portable Document Format" and PDF files contain images, text, and page layout information. PDF files are actually programs in a very simple programming language and, hence, can... |
florisvanvugt/afnipy | Read AFNI.ipynb | mit | %pylab inline
import afni
fname = "TT_N27+tlrc" # make sure you have downloaded (and g-unzipped it)
hdr,dat = afni.read(fname)
dat.shape
f, axarr = plt.subplots(1, 3, figsize=(12,5.5))
axarr[0].imshow(dat[50,:,:,0].T,origin='lower',cmap='gray')
axarr[0].set_title("x=50")
axarr[1].imshow(dat[:,50,:,0].T,origin='lowe... |
GoogleCloudPlatform/asl-ml-immersion | notebooks/bigquery/solutions/b_bqml.ipynb | apache-2.0 | from google import api_core
from google.cloud import bigquery
PROJECT = !gcloud config get-value project
PROJECT = PROJECT[0]
%env PROJECT=$PROJECT
"""
Explanation: Big Query Machine Learning (BQML)
Learning Objectives
- Understand that it is possible to build ML models in Big Query
- Understand when this is appropr... |
srcolinas/supervised-avanzado-german-traffic-signs | explore.ipynb | mit | import os
import random
from tqdm import tqdm
import matplotlib.pyplot as plt
from skimage import io #Para leer las imágenes
from skimage import img_as_float
%matplotlib inline
"""
Explanation: Exploración inicial de los datos
End of explanation
"""
ROOT_DIR = os.getcwd()
DATA_DIR = os.path.join(ROOT_DIR, 'germa... |
maxis42/ML-DA-Coursera-Yandex-MIPT | 4 Stats for data analysis/Homework/3 test bootstrap conf int/Test Bootstrap conf int.ipynb | mit | from __future__ import division
import numpy as np
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"
"""
Explanation: Тест. Доверительные интервалы
End of explanation
"""
from scipy import stats
print('Answer: %.4f' % stats.norm.ppf(1-0.003/2))
"""
Explanati... |
instagrambot/instapro | examples/notebooks/getter_example.ipynb | apache-2.0 | import sys
sys.path.append('../../')
from instabot import User, Getter
"""
Explanation: Getter example
The example of simple Getter class usage and even simpler analysis on recieved data.
Preparations
Import instabot from sources
End of explanation
"""
_ = User("user_for_scrapping1", "password")
_ = User("user_for_s... |
HaFl/ufldl-tutorial-python | Logistic_Regression.ipynb | mit | # get data: contains 70k samples of which the last 10k are meant for testing
mnist = fetch_mldata('MNIST original', data_home='./data')
# prepare for concat
y_all = mnist.target[:, np.newaxis]
# intercept term to be added
intercept = np.ones_like(y_all)
# normalize the data (zero mean and unit variance)
train_normal... |
rvuduc/cse6040-ipynbs | 13--pagerank-partial-solns.ipynb | bsd-3-clause | import sqlite3 as db
import pandas as pd
def get_table_names (conn):
assert type (conn) == db.Connection # Only works for sqlite3 DBs
query = "SELECT name FROM sqlite_master WHERE type='table'"
return pd.read_sql_query (query, conn)
def print_schemas (conn, table_names=None, limit=0):
assert type (con... |
nick-youngblut/SIPSim | ipynb/theory/diff_bound_layer.ipynb | mit | import os
import numpy as np
from scipy.integrate import quad
%load_ext rpy2.ipython
workDir = '/home/nick/notebook/SIPSim/dev/theory/'
%%R
library(readxl)
library(dplyr)
library(tidyr)
library(ggplot2)
library(rootSolve)
if not os.path.isdir(workDir):
os.makedirs(workDir)
%cd $workDir
"""
Explanation: Goal:
M... |
VandyAstroML/Vandy_AstroML | notebooks/Project_ScikitLearn_Datasets.ipynb | mit | $ git config --global user.name "John Doe"
$ git config --global user.email "johndoe@example.com"
"""
Explanation: ML Projects - Main
For this week's project, we'll be using the dataset Digits dataset from Scikit-Learn.
This dataset contains the pixel value of a 8x8 image of a number, from 0 to 9.
Purpose
We will use... |
Kaggle/learntools | notebooks/feature_engineering/raw/tut2.ipynb | apache-2.0 | #$HIDE_INPUT$
import pandas as pd
from sklearn.preprocessing import LabelEncoder
ks = pd.read_csv('../input/kickstarter-projects/ks-projects-201801.csv',
parse_dates=['deadline', 'launched'])
# Drop live projects
ks = ks.query('state != "live"')
# Add outcome column, "successful" == 1, others are 0
... |
uber/pyro | tutorial/source/bo.ipynb | apache-2.0 | import matplotlib.gridspec as gridspec
import matplotlib.pyplot as plt
import torch
import torch.autograd as autograd
import torch.optim as optim
from torch.distributions import constraints, transform_to
import pyro
import pyro.contrib.gp as gp
assert pyro.__version__.startswith('1.7.0')
pyro.set_rng_seed(1)
"""
Exp... |
dataDogma/Computer-Science | Courses/DAT-208x/DAT208x - Week 1 - Python Basics.ipynb | gpl-3.0 | # working with print function
print(5 / 8)
# Add another print function on new line
print(7 + 10)
"""
Explanation: Lecture : Hello Python!
[RQ-1] : Which of the following statements is correct?
Ans: The Ipython Shell is typically used to work with Python interactively.
[RQ-2] : Which file extension is used for P... |
yl565/statsmodels | examples/notebooks/statespace_sarimax_internet.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import pandas as pd
from scipy.stats import norm
import statsmodels.api as sm
import matplotlib.pyplot as plt
import requests
from io import BytesIO
from zipfile import ZipFile
# Download the dataset
dk = requests.get('http://www.ssfpack.com/files/DK-data.zip').content
f = Bytes... |
kit-cel/wt | ccgbc/ch2_Codes_Basic_Concepts/Repetition_Codes.ipynb | gpl-2.0 | import numpy as np
from scipy.stats import norm
from scipy.special import comb
import matplotlib.pyplot as plt
"""
Explanation: Repetition Codes on the BSC, BEC, and BI-AWGN Channel
This code is provided as supplementary material of the lecture Channel Coding 2 - Advanced Methods.
This code illustrates
* The decoding ... |
Chipe1/aima-python | classical_planning_approaches.ipynb | mit | from planning import *
"""
Explanation: Classical Planning
Classical Planning Approaches
Introduction
Planning combines the two major areas of AI: search and logic. A planner can be seen either as a program that searches for a solution or as one that constructively proves the existence of a solution.
Currently, the m... |
streety/biof509 | Wk01-Overview-solution.ipynb | mit | import numpy as np
print("Numpy:", np.__version__)
"""
Explanation: Week 1 - Getting Started
End of explanation
"""
dir(np)
"""
Explanation: Python Summary
Further information
More information is usually available with the help function. Using ? brings up the same information in ipython.
Using the dir function li... |
dariox2/CADL | session-5/.ipynb_checkpoints/session-5-part-1-checkpoint.ipynb | apache-2.0 | # First check the Python version
import sys
if sys.version_info < (3,4):
print('You are running an older version of Python!\n\n',
'You should consider updating to Python 3.4.0 or',
'higher as the libraries built for this course',
'have only been tested in Python 3.4 and higher.\n')
... |
mr06/hello-world | Bonjour_Colaboratory.ipynb | gpl-3.0 | import tensorflow as tf
input1 = tf.ones((2, 3))
input2 = tf.reshape(tf.range(1, 7, dtype=tf.float32), (2, 3))
output = input1 + input2
with tf.Session():
result = output.eval()
result
"""
Explanation: <a href="https://colab.research.google.com/github/mr06/hello-world/blob/master/Bonjour_Colaboratory.ipynb" targ... |
silberman/polygoggles | deep_polygoggles.ipynb | mit | import math
import os
import tensorflow as tf
import datasets
import make_polygon_pngs
use_MNIST_instead_of_our_data = False
if use_MNIST_instead_of_our_data:
width = 28
height = 28
num_training_steps = 20000
batch_size = 50
else:
width = 70 # at 150, takes forever, 0 training accuracy after step... |
MChehadeh/CarND-term1-P1 | P1.ipynb | mit | #importing some useful packages
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
import cv2
%matplotlib inline
#reading in an image
image = mpimg.imread('test_images/solidWhiteRight.jpg')
#printing out some stats and plotting
print('This image is:', type(image), 'with dimesions:', im... |
initialkommit/kookmin | midterm/kookmin_midterm_조재환_2.ipynb | mit | drinks={
'martini' : {'vodka', 'vermouth'},
'black russian' : {'vodka', 'kahlua'},
'white russian' : {'cream', 'kahlua', 'vodka'},
'manhattan' : {'rye', 'vermouth', 'bitters'},
'screwdriver': {'orange juice', 'vodka'},
'verorange' : {'orange juice', 'vermouth'},
'kahlua milk' : {'kahlua', 'm... |
dwhswenson/openpathsampling | examples/alanine_dipeptide_tps/AD_tps_1_trajectory.ipynb | mit | from __future__ import print_function
%matplotlib inline
import matplotlib.pyplot as plt
import openpathsampling as paths
import openpathsampling.engines.openmm as omm
from simtk.openmm import app
import simtk.openmm as mm
import simtk.unit as unit
from openmmtools.integrators import VVVRIntegrator
import mdtraj as m... |
opencobra/cobrapy | documentation_builder/getting_started.ipynb | gpl-2.0 | import cobra
from cobra.io import load_model
# "iJO1366" and "salmonella" are also valid arguments
model = load_model("textbook")
"""
Explanation: Getting Started
Loading a model and inspecting it
To begin with, cobrapy comes with bundled models for Salmonella and E. coli, as well as a "textbook" model of E. coli cor... |
gcgruen/homework | foundations-homework/08/homework-08-gruen-dataset1-waterdata.ipynb | mit | import pandas as pd
import matplotlib.pyplot as plt
% matplotlib inline
df = pd.read_csv('water_data_class.csv', encoding='latin-1')
df
# only countries with more than 25 million inhabitants and those who have values in every column (2002 that one with most non-values)
big_ones = df[df['population'] > 25000000]
notn... |
fluffy-hamster/A-Beginners-Guide-to-Python | A Beginners Guide to Python/09.1 Numbers, Part One.ipynb | mit | string_number = "1066"
integer = int(string_number)
print(int(integer))
print(type(integer)) # <-- the type function returns the type of the object passed in eg 1 is an integer, "hi" is a string, etc.
"""
Explanation: Numbers
Today we shall be discussing floats and integers. The good news is that most of the stuff w... |
adlyons/AWOT | examples/hiwrap_plot.ipynb | gpl-2.0 | # Load the needed packages
import os
import matplotlib.pyplot as plt
import numpy as np
import awot
from awot.graph.common import create_basemap
from awot.graph import RadarVerticalPlot
%matplotlib inline
"""
Explanation: <h2>Plot a swath of NASA HIWRAP data</h2>
End of explanation
"""
Project = "GRIP"
ncfileKu = ... |
tensorflow/docs-l10n | site/en-snapshot/tfx/tutorials/tfx/components.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... |
folivetti/PIPYTHON | Aula01_EX.ipynb | mit | segundos = 19
media = 2.1
letraO = 'o'
"""
Explanation: Exercício 1: Dadas as seguintes variáveis
python
segundos = 19
media = 2.1
letraO = 'o'
Qual será o resultado das seguintes operações:
python
segundos/2
segundos/2.0
media/3
(segundos + media)/2
letraO*10+'la'
Utilize o interpretador do Notebook para verificar as... |
pdamodaran/yellowbrick | examples/rebeccabilbro/pipelines.ipynb | apache-2.0 | %matplotlib inline
import os
import sys
# Modify the path
sys.path.append("/Users/rebeccabilbro/Desktop/waves/stuff/yellowbrick")
import requests
import numpy as np
import pandas as pd
import yellowbrick as yb
import matplotlib.pyplot as plt
"""
Explanation: Chained Visualizations with Yellowbrick Pipelines
In ... |
andmax/gpufilter | python/alg5.ipynb | mit | import math
import cmath
import numpy as np
from scipy import ndimage, linalg
from skimage.color import rgb2gray
from skimage.measure import structural_similarity as ssim
from sklearn.metrics import mean_squared_error
import matplotlib.pyplot as plt
%matplotlib inline
plt.gray() # to plot gray images using gray scale
... |
statsmodels/statsmodels.github.io | v0.13.0/examples/notebooks/generated/tsa_arma_0.ipynb | bsd-3-clause | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import statsmodels.api as sm
from scipy import stats
from statsmodels.tsa.arima.model import ARIMA
from statsmodels.graphics.api import qqplot
"""
Explanation: Autoregressive Moving Average (ARMA): Sunspots data
End of explanat... |
jbarnoud/PBxplore | doc/source/notebooks/Deformability.ipynb | mit | from __future__ import print_function, division
from pprint import pprint
from IPython.display import Image, display
import matplotlib.pyplot as plt
import os
# The following line, in a jupyter notebook, allows to display
# the figure directly in the notebook. See <https://jupyter.org/>
%matplotlib inline
import pbxp... |
koaning/kadro | vignette.ipynb | mit | import numpy as np
import pandas as pd
import kadro as kd
%matplotlib inline
np.random.seed(42)
n = 20
df = pd.DataFrame({
'a': np.random.randn(n),
'b': np.random.randn(n),
'c': ['foo' if x > 0.5 else 'bar' for x in np.random.rand(n)],
'd': ['fizz' if x > 0.6 else 'bo' for x in np.random.rand(n)]
})... |
jeicher/NMRPy | nmrpy/docs/quickstart_tutorial.ipynb | bsd-3-clause | import matplotlib
%matplotlib ipympl
import nmrpy
import numpy as np
import scipy as sp
from matplotlib import pyplot as plt
import os
"""
Explanation: NMRPy quickstart tutorial
Refer to https://nmrpy.readthedocs.io/en/latest/quickstart.html
End of explanation
"""
fname = os.path.join(os.path.dirname(nmrpy.__file__)... |
opesci/devito | examples/userapi/00_sympy.ipynb | mit | import math
math.sqrt(3)
math.sqrt(8)
"""
Explanation: Symbolic Computation
Symbolic computation deals with symbols, representing them exactly, instead of numerical approximations (floating point).
We will start with the following borrowed tutorial to introduce the concepts of SymPy. Devito uses SymPy heavily and b... |
zrhans/python | topicos/Estacoes-ATMOS.ipynb | gpl-2.0 | import sys
import numpy as np
import pandas as pd
print(sys.version) # Versao do python - Opcional
print(np.__version__) # VErsao do modulo numpy - Opcional
import matplotlib
import matplotlib.pyplot as plt
%matplotlib inline
import datetime
import time
#?pd.date_range
#rng = pd.date_range('1/1/2011', periods=90, freq... |
tcmoore3/mdtraj | examples/atom-selection.ipynb | lgpl-2.1 | from __future__ import print_function
import mdtraj as md
traj = md.load('ala2.h5')
print(traj)
"""
Explanation: Basics
In this example, we'll go over the basics of atom and reside selection in MDTraj. First let's load up an example trajectory.
End of explanation
"""
print('How many atoms? %s' % traj.n_atoms)
pr... |
jsfenfen/parsing-prickly-pdfs | examples/la-precinct-bulletin/la-precinct-bulletin.ipynb | bsd-2-clause | import pandas as pd
import pdfplumber
import re
"""
Explanation: Parsing Los Angeles County's precinct-level results from the 2014 general election.
End of explanation
"""
pdf = pdfplumber.open("2014-bulletin-first-10-pages.pdf")
print(len(pdf.pages))
"""
Explanation: Load the PDF in PDFPlumber:
End of explanation
... |
ES-DOC/esdoc-jupyterhub | notebooks/ncc/cmip6/models/noresm2-lme/toplevel.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'ncc', 'noresm2-lme', 'toplevel')
"""
Explanation: ES-DOC CMIP6 Model Properties - Toplevel
MIP Era: CMIP6
Institute: NCC
Source ID: NORESM2-LME
Sub-Topics: Radiative Forcings.
Properties: 85 (4... |
cdawei/digbeta | dchen/music/pla_split.ipynb | gpl-3.0 | %matplotlib inline
import os
import sys
import gzip
import numpy as np
import pickle as pkl
from scipy.sparse import lil_matrix, issparse, hstack, vstack
from collections import Counter
import gensim
import matplotlib.pyplot as plt
import seaborn as sns
np_settings0 = np.seterr(all='raise')
RAND_SEED = 0
plt.style.u... |
zzsza/TIL | Tensorflow/Estimator(Custom).ipynb | mit | import tensorflow as tf
import numpy as np
BATCH_SIZE = 100
"""
Explanation: Estimator(Custom)
- Tensorflow High Level API
- Tensorflow 공식 문서
- 미리 정의된 모델(pre-made) 말고도 custom하게 estimator 사용 가능
- tf.Session을 따로 관리할 필요 없으며, tf.global_variables_initializer() tf.local_variables_initializer()도 필요없음
- 이 글에선 custom estimat... |
napjon/moocs_solution | coursera-statistics/cheatsheet/Addition.ipynb | mit | %%R
mean = 1500
sd = 300
d = 1800
(d-mean)/sd
"""
Explanation: Probability
Disjoint events, probability one of them occured is P(1) + P(2)+ ..., it's the same as probability one of number in die is add up to 1.
events : set of outcomes.
Law of Addition Rule, disjoint vs not disjoint. Disjoint, P(A and B) automatica... |
CUBoulder-ASTR2600/lectures | lecture_13_integration.ipynb | isc | def forward_difference(f, x, h):
return (f(x + h) - f(x)) / h
def central_difference(f, x, h):
return (f(x + h) - f(x - h)) / (2. * h)
"""
Explanation: Review of Numerical Differentiation
Q. What orders are the errors?
End of explanation
"""
def trapezoidal(f, x_L, x_U, n):
"""
Integrate function f ... |
hpparvi/ldtk | notebooks/A1_manuscript_plots.ipynb | gpl-2.0 | %pylab inline
import seaborn as sb
from matplotlib.patches import Ellipse
from scipy.stats import chi2
from ldtk import LDPSetCreator, BoxcarFilter, TabulatedFilter
AAOCW, AAPGW = 3.465, 7.087
rc(['xtick','ytick','axes'], labelsize=8)
def eigsorted(cov):
vals, vecs = np.linalg.eigh(cov)
order = vals... |
Ciaran1981/geospatial-learn | example_notebooks/.ipynb_checkpoints/Change_detection-checkpoint.ipynb | gpl-3.0 | %matplotlib inline
"""
Explanation: The following notebook is a tutorial on machine learning to detect change using geospatial_learn
Documentation on the lib can be found here:
http://geospatial-learn.readthedocs.io/en/latest/
Please use QGIS to visualise results as this is quicker than plotting them in the notebook.... |
FESOM/pyfesom | notebooks/plot_transect.ipynb | mit | import sys
sys.path.append("../")
import pyfesom as pf
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
from matplotlib.colors import LinearSegmentedColormap
import numpy as np
# %matplotlib notebook
%matplotlib inline
from matplotlib import cm
from netCDF4 import Dataset, MFDataset
basedir = ... |
nnadeau/pybotics | examples/kinematics.ipynb | mit | from pybotics.robot import Robot
from pybotics.predefined_models import ur10
robot = Robot.from_parameters(ur10())
"""
Explanation: Robot Kinematics
Initialize Robot Model
A robot model, at a very minimum, is a kinematic chain
The kinematic chain is defined by a series of parameters
See Modified DH parameters for mo... |
kimkipyo/dss_git_kkp | 통계, 머신러닝 복습/160608수_13일차_회귀분석 실습, 과최적화/2.다항 회귀와 과최적화.ipynb | mit | np.random.seed(0)
n_samples = 30
X = np.sort(np.random.rand(n_samples))
y = np.cos(1.5 * np.pi * X) + np.random.randn(n_samples) * 0.1
dfX = pd.DataFrame(X, columns=["x"])
dfX = sm.add_constant(dfX)
dfy = pd.DataFrame(y, columns=["y"])
df = pd.concat([dfX, dfy], axis=1)
print(sm.OLS.from_formula("y ~ x", data=df).fit... |
robertclf/FAFT | FAFT_64-points_R2C/nbFAFT128_3D.ipynb | bsd-3-clause | import numpy as np
import ctypes
from ctypes import *
import pycuda.gpuarray as gpuarray
import pycuda.driver as cuda
import pycuda.autoinit
from pycuda.compiler import SourceModule
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import math
import time
%matplotlib inline
"""
Explanation: 3D Fa... |
GoogleCloudPlatform/mlops-with-vertex-ai | 04-pipeline-deployment.ipynb | apache-2.0 | import os
import kfp
import tfx
print("Tensorflow Version:", tfx.__version__)
print("KFP Version:", kfp.__version__)
"""
Explanation: 04 - Test and Deploy Training Pipeline to Vertex Pipelines
The purpose of this notebook is to test, deploy, and run the TFX pipeline on Vertex Pipelines. The notebook covers the follow... |
jmoldow/jmoldow-python3-async-tutorial | 02-generators-revisited.ipynb | apache-2.0 | def range_generator_function(stop):
"""Naive implementation of builtins.range generator."""
# This function runs immediately, since it has no `yield` statements.
# It is a normal function, which happens to return a generator iterator.
print("Running line 1")
if not isinstance(stop, int):
rai... |
jibanCat/healpy_object_counts | tutorial/Jupyter_Intro_Healpix_WISE-2MASS.ipynb | mit | # how many magic function we got?
%lsmagic
from matplotlib import pyplot as plt
%matplotlib inline
%config IPython.matplotlib.backend = 'retina'
%config InlineBackend.figure_format = 'retina'
plt.style.use('ggplot') # seaborn
plt.plot(range(10), [x*x for x in range(10)]);
%%writefile test.py
print('Hello, AstroTalk.... |
LSSTC-DSFP/LSSTC-DSFP-Sessions | Sessions/Session13/Day4/ConditionalEntropy.ipynb | mit | def gen_periodic_data(x, period=1, amplitude=1, phase=0, noise=0):
'''Generate periodic data given the function inputs
y = A*cos(x/p - phase) + noise
Parameters
----------
x : array-like
input values to evaluate the array
period : float (default=1)
period of the pe... |
Elucidation/lumpsum_vs_dca | Lumpsum_vs_DCA.ipynb | apache-2.0 | import pandas as pd
import pandas_datareader.data as web
import datetime
pd.set_option('display.width', 200) # Displaying more columns in one row
# Data date range, Google provides up to 4000 entries in one call
start = datetime.datetime(2000, 2, 10)
end = datetime.datetime(2016, 1, 9)
spy = web.DataReader("SPY", "y... |
ES-DOC/esdoc-jupyterhub | notebooks/cmcc/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', 'cmcc', 'sandbox-1', 'seaice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Seaice
MIP Era: CMIP6
Institute: CMCC
Source ID: SANDBOX-1
Topic: Seaice
Sub-Topics: Dynamics, Thermodynamics, Radi... |
VandyAstroML/Vanderbilt_Computational_Bootcamp | notebooks/Week_13/13_Sys_and_Writing_Modules.ipynb | mit | # %load ./arguments.py
#!/usr/bin/python
import sys
# it's easy to print this list of course:
print sys.argv
# or it can be iterated via a for loop:
for i in range(len(sys.argv)):
if i == 0:
print "Function name: %s" % sys.argv[0]
else:
print "%d. argument: %s" % (i,sys.argv[i])
# copied f... |
thehackerwithin/berkeley | code_examples/python_parallel/Classification_serial.ipynb | bsd-3-clause | # Load the data
train_images = np.load('./data/train_images.npy')
train_labels = np.load('./data/train_labels.npy')
test_images = np.load('./data/test_images.npy')
# Define function to have a look at the data
def show_random_digit( images, labels=None ):
""""Show a random image out of `images`,
with the corre... |
antoniomezzacapo/qiskit-tutorial | community/terra/qis_adv/vaidman_detection_test.ipynb | apache-2.0 | # useful additional packages
import matplotlib.pyplot as plt
%matplotlib inline
import numpy as np
from collections import Counter #Use this to convert results from list to dict for histogram
# importing QISKit
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import execute, Aer, IBMQ... |
RyanSkraba/beam | examples/notebooks/documentation/transforms/python/elementwise/flatmap-py.ipynb | apache-2.0 | #@title Licensed under the Apache License, Version 2.0 (the "License")
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you u... |
Luke035/dlnd-lessons | sentiment-rnn/Sentiment_RNN.ipynb | mit | import numpy as np
import tensorflow as tf
with open('../sentiment-network/reviews.txt', 'r') as f:
reviews = f.read()
with open('../sentiment-network/labels.txt', 'r') as f:
labels = f.read()
reviews[:2000]
"""
Explanation: Sentiment Analysis with an RNN
In this notebook, you'll implement a recurrent neural... |
ktmud/deep-learning | dcgan-svhn/DCGAN.ipynb | mit | %matplotlib inline
import pickle as pkl
import matplotlib.pyplot as plt
import numpy as np
from scipy.io import loadmat
import tensorflow as tf
!mkdir data
"""
Explanation: Deep Convolutional GANs
In this notebook, you'll build a GAN using convolutional layers in the generator and discriminator. This is called a De... |
SciTools/cube_browser | doc/write_your_own/components/Workflow1.ipynb | bsd-3-clause | from collections import OrderedDict
import IPython.display
import glob
import ipywidgets
import iris
import iris.quickplot as iplt
import matplotlib.pyplot as plt
import numpy as np
import os
"""
Explanation: Selection Process
This is a demonstration of a chain of widgets that can be used in the data plotting process... |
guildai/guild-examples | keras/basic_classification.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... |
a378ec99/bcn | bcn/examples/Example.ipynb | mit | # Setup of general parameters for the recovery experiment.
n_restarts = 10
rank = 6
n_measurements = 2800
shape = (50, 70) # samples, features
missing_fraction = 0.1
noise_amplitude = 2.0
m_blocks_size = 5 # size of each block
correlation_threshold = 0.75
correlation_strength = 1.0
bias_model = 'image'
# Creation of t... |
mcamack/Jupyter-Notebooks | keras/keras101-LinearModel.ipynb | apache-2.0 | %matplotlib inline
"""
Explanation: Setup Notebook
Ensure plots show up in the notebook itself
End of explanation
"""
#path = "data/dogscats/"
path = "data/dogscats/sample/"
# Handy trick to get a file link
from IPython.display import FileLink
FileLink('AF.png')
"""
Explanation: The entire dogscats/ directory can ... |
fdmazzone/Ecuaciones_Diferenciales | Teoria_Basica/scripts/GruposLie.ipynb | gpl-2.0 | from sympy import *
init_printing() #muestra símbolos más agradab
R=lambda n,d: Rational(n,d)
"""
Explanation: <h2> Ejercicios varios relacionados con grupos de Lie </h2>
End of explanation
"""
x,y,a,b,c,d,e,f=symbols('x,y,a,b,c,d,e,f',real=True)
#cargamos la función
F=x*y**4/3-R(2,3)*y/x+R(1,3)/x**3/y**2
F
"""
Exp... |
betatim/BlackBox | examples/strategy-comparison.ipynb | bsd-3-clause | import numpy as np
np.random.seed(123)
%matplotlib inline
import matplotlib.pyplot as plt
plt.set_cmap("viridis")
"""
Explanation: Comparing surrogate models
Tim Head, July 2016.
End of explanation
"""
from skopt.benchmarks import branin as _branin
def branin(x, noise_level=0.):
return _branin(x) + noise_level... |
dereneaton/ipyrad | newdocs/API-analysis/cookbook-mb-ipcoal.ipynb | gpl-3.0 | # conda install ipyrad toytree mrbayes -c conda-forge -c bioconda
import toytree
import ipcoal
import ipyrad.analysis as ipa
"""
Explanation: <h1><span style="color:gray">ipyrad-analysis toolkit:</span> mrbayes</h1>
In these analyses our interest is primarily in inferring accurate branch lengths under a relaxed mole... |
beyondvalence/biof509_wtl | Wk01-overview/Wk01-Overview_wl.ipynb | mit | import numpy as np
print("Numpy:", np.__version__)
"""
Explanation: Week 1 - Getting Started
End of explanation
"""
location = 'Bethesda'
zip_code = 20892
elevation = 71.9
print("We're in", location, "zip code", zip_code, ", ", elevation, "m above sea level")
print("We're in " + location + " zip code " + str(zip_c... |
AaronCWong/phys202-2015-work | days/day08/Display.ipynb | mit | class Ball(object):
pass
b = Ball()
b.__repr__();
print(b)
"""
Explanation: Display of Rich Output
In Python, objects can declare their textual representation using the __repr__ method.
End of explanation
"""
class Ball(object):
def __repr__(self):
return 'TEST'
b = Ball()
print(b)
"""
Explanati... |
ES-DOC/esdoc-jupyterhub | notebooks/test-institute-1/cmip6/models/sandbox-2/land.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'test-institute-1', 'sandbox-2', 'land')
"""
Explanation: ES-DOC CMIP6 Model Properties - Land
MIP Era: CMIP6
Institute: TEST-INSTITUTE-1
Source ID: SANDBOX-2
Topic: Land
Sub-Topics: Soil, Snow, ... |
iamaziz/PyDataset | examples/basic-usage.ipynb | mit | from pydataset import data
"""
Explanation: Basic usage of PyDataset
Import the main method of the module:
End of explanation
"""
from pydataset import data
"""
Explanation: Don't worry about the log message, it will appear at the first import of the module only. (it won't again, unless if that directory doesn't ex... |
mikemull/midaspy | examples/MIDASExamples.ipynb | mit | %matplotlib inline
import datetime
import numpy as np
import pandas as pd
from midas.mix import mix_freq
from midas.adl import estimate, forecast, midas_adl, rmse
"""
Explanation: MIDAS Examples
If you're reading this you probably already know that MIDAS stands for Mixed Data Sampling, and it is a technique for crea... |
carnby/matta | examples/Basic Examples.ipynb | bsd-3-clause | import pandas as pd
import networkx as nx
import matta
import json
import requests
from networkx.readwrite import json_graph
# we do this to load the required libraries when viewing on NBViewer
matta.init_javascript(path='https://rawgit.com/carnby/matta/master/matta/libs')
"""
Explanation: matta - view and scaffold ... |
geoscixyz/gpgLabs | notebooks/mag/MagneticDipoleApplet.ipynb | mit | from geoscilabs.mag.MagDipoleApp import MagneticDipoleApp
mag = MagneticDipoleApp()
"""
Explanation: This is the <a href="https://jupyter.org/">Jupyter Notebook</a>, an interactive coding and computation environment. For this lab, you do not have to write any code, you will only be running it.
To use the notebook:
- ... |
rcrehuet/Python_for_Scientists_2017 | notebooks/solutions/7_0_matplotlib_scatter_plots.ipynb | gpl-3.0 | from IPython.display import Image
Image('./data/scatter_plot.png')
"""
Explanation: Matplotlib scatter plots
The aim of this tutorial is to reproduce the following figure. You can imagine this figure as measuring A and B from a set of samples numbered (0,1,2,3, and 4).
End of explanation
"""
import numpy as np
impor... |
PyLCARS/PythonUberHDL | myHDL_DigitalSignalandSystems/.ipynb_checkpoints/myHDL_SinewaveGenerator-checkpoint.ipynb | bsd-3-clause | import numpy as np
import pandas as pd
from sympy import *
init_printing()
from IPython.display import display, Math, Latex
from myhdl import *
from myhdlpeek import Peeker
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: \title{Continues HDL Sinewave Generator via Chebyshev Polynomial Approximat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.