repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
neilswainston/development-py | synbiochemdev/pablo_ml/Chemicals.ipynb | mit | """ Import_packages"""
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem.Draw import IPythonConsole
from IPython.display import SVG
from sklearn.cross_validation import train_test_split
import numpy as np
from scipy.stats import norm
import time
from sklearn.neighbors.kde import KernelDensity
import... |
hide-tono/python-training | python-machine-learning/ch05/pca.ipynb | apache-2.0 | # データの取得と前処理(標準化)
import pandas as pd
df_wine = pd.read_csv('https://archive.ics.uci.edu/ml/machine-learning-databases/wine/wine.data', header=None)
from sklearn.cross_validation import train_test_split
from sklearn.preprocessing import StandardScaler
X, y = df_wine.iloc[:, 1:].values, df_wine.iloc[:, 0].values
X_tra... |
palrogg/foundations-homework | 07/Class-7.ipynb | mit | # import pandas, but call it pd. Why? Because that's What People Do.
import pandas as pd
"""
Explanation: An Introduction to pandas
Pandas! They are adorable animals. You might think they are the worst animal ever but that is not true. You might sometimes think pandas is the worst library every, and that is only kind ... |
hotfuzzy/go | TensorFlow.ipynb | mit | Ylogits = tf.matmul(tf.reshape(X,[-1,D]), W) + b
Y = tf.nn.softmax(Ylogits) # Vector representation of board state
Y_ = tf.placeholder(tf.float32, [None, D])
"""
Explanation: In Tensorflow:
* Variables are determined by tensorflow during execution
* Placeholders are used to pass in data
tf.placeholder will be fed wit... |
j-andrews7/VENUSAR | venusar/debugging_motifs.ipynb | mit | import venusar
import motif
import thresholds
import motifs
import activity
import tf_expression
import gene_expression
# to get code changes
import imp
imp.reload(motif)
"""
Explanation: Notebook Analyzes Duplication in Motif Defintions
End of explanation
"""
motif_f_base='../../data/HOCOMOCOv10.JASPAR_FORMAT.... |
eds-uga/csci1360-fa16 | assignments/A5/A5_Q3.ipynb | mit | import numpy as np
np.random.seed(578435)
x11 = np.random.random(10)
x12 = np.random.random(10)
d1 = np.array([ 0.24542374, 0.19098998, 0.20645088, 0.49097139, -0.56594091,
-0.13363814, 0.46859546, -0.32476466, -0.35938731, 0.17459786])
np.testing.assert_allclose(d1, difference(x11, x12))
np.random.seed(8... |
fluffy-hamster/A-Beginners-Guide-to-Python | A Beginners Guide to Python/18. Indentation.ipynb | mit | if 1:
used_tab = True
if used_tab:
used_spaces = True
print("Something Something")
"""
Explanation: Indentation
Okay guys, I hope you are starting to get excited, I say that because we are only 1-2 lectures away from having all the necessary syntax for writing interesting programmes with Python.
Today I shall... |
CSB-book/CSB | python/solutions/Dalziel2016_solution.ipynb | gpl-3.0 | cities = set([]) # initialize an empty set
"""
Explanation: Solution of 3.8.1, Dalziel et al. 2016
Write a program that extracts the names of all the cities in the database (one city per entry)
For this exercise, we need to a) open the file data/Dalziel2016_data.csv for reading; b) read all the lines; c) add the name ... |
ericmjl/Network-Analysis-Made-Simple | archive/2-networkx-basics-instructor.ipynb | mit | G = cf.load_seventh_grader_network()
"""
Explanation: Nodes and Edges: How do we represent relationships between individuals using NetworkX?
As mentioned earlier, networks, also known as graphs, are comprised of individual entities and their representatives. The technical term for these are nodes and edges, and when w... |
harmsm/pythonic-science | labs/01_simulation/01_simulations.ipynb | unlicense | %matplotlib inline
import numpy as np
import scipy.stats
from matplotlib import pyplot as plt
"""
Explanation: Simulations Lab
End of explanation
"""
import time
for i in range(1000):
instrument_spew = time.time()
"""
Explanation: Practice
If you want to build a collection of things, keeping track of their o... |
harishkrao/DSE200x | Mini Project/Analysis on the Movie Lens dataset-Copy1.ipynb | mit | # The first step is to import the dataset into a pandas dataframe.
import pandas as pd
#path = 'C:/Users/hrao/Documents/Personal/HK/Python/ml-20m/ml-20m/'
path = '/Users/Harish/Documents/HK_Work/Python/ml-20m/'
movies = pd.read_csv(path+'movies.csv')
movies.shape
tags = pd.read_csv(path+'tags.csv')
tags.shape
rat... |
fevangelista/wicked | tutorials/03-WickTheorem.ipynb | mit | import wicked as w
from IPython.display import display, Math, Latex
def latex(expr):
"""Function to render any object that has a member latex() function"""
display(Math(expr.latex()))
w.reset_space()
w.add_space("o", "fermion", "occupied", ['i','j','k','l','m'])
w.add_space("v", "fermion", "unoccupied", [... |
GoogleCloudPlatform/documentai-notebooks | general/form_parser.ipynb | apache-2.0 | # Install necessary Python libraries and restart your kernel after.
!pip install -r ../requirements.txt
from google.cloud import documentai_v1 as documentai
from PIL import Image, ImageDraw
import os
import pandas as pd
"""
Explanation: Document AI Form Parser Visualizer
This notebook shows you how to analyze a docu... |
AllenDowney/ModSim | soln/chap25.ipynb | gpl-2.0 | # install Pint if necessary
try:
import pint
except ImportError:
!pip install pint
# download modsim.py if necessary
from os.path import exists
filename = 'modsim.py'
if not exists(filename):
from urllib.request import urlretrieve
url = 'https://raw.githubusercontent.com/AllenDowney/ModSim/main/'
... |
zenoss/pywbem | docs/notebooks/pywbemmock.ipynb | lgpl-2.1 | import pywbem
import pywbem_mock
# MOF string defining qualifiers declarations, class, and instance
# This mof will be used throughout this notebook
mof = '''
Qualifier Key : boolean = false,
Scope(property, reference),
Flavor(DisableOverride, ToSubclass);
Qualifier Description : string = null,... |
kkkddder/dmc | notebooks/week-5/02-using your own images.ipynb | apache-2.0 | %matplotlib inline
from matplotlib.pyplot import imshow
import matplotlib.pyplot as plt
import numpy as np
from scipy import misc
import os
import random
import pickle
"""
Explanation: Lab 5.2 - Using your own images
In the next part of the lab we will download another set of images from the web and format them for ... |
mlamoureux/PIMS_YRC | MachineLearning.ipynb | mit | %%bash
git clone https://github.com/amueller/introduction_to_ml_with_python.git
"""
Explanation: Lecture 8.1
Machine Learning
We will review some of the basic methods in machine learning.
The text for this is Introduction to Machine Learning by Anreas Muller and Sarah Guido. It focuses on using tools from Python, and... |
AtmaMani/pyChakras | udemy_ml_bootcamp/Python-for-Data-Visualization/Seaborn/Seaborn Exercises .ipynb | mit | import seaborn as sns
import matplotlib.pyplot as plt
%matplotlib inline
sns.set_style('whitegrid')
titanic = sns.load_dataset('titanic')
titanic.head()
titanic.shape
"""
Explanation: <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a>
Seaborn Exercises
Time to practice your new seabo... |
therealAJ/python-sandbox | data-science/learning/ud1/DataScience/LinearRegression.ipynb | gpl-3.0 | %matplotlib inline
import numpy as np
from pylab import *
pageSpeeds = np.random.normal(3.0, 1.0, 1000)
purchaseAmount = 100 - (pageSpeeds + np.random.normal(0, 0.1, 1000)) * 3
scatter(pageSpeeds, purchaseAmount)
"""
Explanation: Linear Regression
Let's fabricate some data that shows a roughly linear relationship be... |
ES-DOC/esdoc-jupyterhub | notebooks/nasa-giss/cmip6/models/sandbox-1/ocnbgchem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'nasa-giss', 'sandbox-1', 'ocnbgchem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem
MIP Era: CMIP6
Institute: NASA-GISS
Source ID: SANDBOX-1
Topic: Ocnbgchem
Sub-Topics: Tracers.
P... |
dbouquin/AstroHackWeek2015 | day1/day1_io.ipynb | gpl-2.0 | import os
import numpy as np
import requests
# get some CSV data from the SDSS SQL server
URL = "http://skyserver.sdss.org/dr12/en/tools/search/x_sql.aspx"
cmd = """
SELECT TOP 1000
p.u, p.g, p.r, p.i, p.z, s.class, s.z, s.zerr
FROM
PhotoObj AS p
JOIN
SpecObj AS s ON s.bestobjid = p.objid
WHERE
p.u BE... |
bbglab/adventofcode | 2020/claudia/2020_12_07/code.ipynb | mit | from collections import defaultdict
dict_of_colors = defaultdict(list)
with open('input.txt', 'r') as fd:
for line in fd:
if 'no other bags' not in line:
sentence = line.split(' ')
main_color = ' '.join(line.split(' ')[:2])
for i, word in enumerate(sentence):
... |
rsignell-usgs/notebook | CSW/csw_post_request-Copy1.ipynb | mit | #endpoint = 'http://catalog.data.gov/csw-all/csw'
endpoint = 'http://geoport.whoi.edu/csw'
input='''
<csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" version="2.0.2" service="CSW"
resultType="results" startPosition="1" maxRecords="100">
<csw:Query typeNames="csw:Record" xmlns:ogc="http://www.op... |
ES-DOC/esdoc-jupyterhub | notebooks/cas/cmip6/models/fgoals-g3/land.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'cas', 'fgoals-g3', 'land')
"""
Explanation: ES-DOC CMIP6 Model Properties - Land
MIP Era: CMIP6
Institute: CAS
Source ID: FGOALS-G3
Topic: Land
Sub-Topics: Soil, Snow, Vegetation, Energy Balance... |
fmaschler/networkit | Doc/uploads/docs/SpectralCentralityWithPandas.ipynb | mit | cd ../../
import networkit
import pandas as pd
import random as rd
G = networkit.graphio.readGraph("input/celegans_metabolic.graph", networkit.Format.METIS)
"""
Explanation: Centrality
This evaluates the Eigenvector Centrality and PageRank implemented in Python against C++-native EVZ and PageRank. The Python impleme... |
sueiras/training | tensorflow_old/02-template_class/template_class.ipynb | gpl-3.0 | #! /usr/bin/env python
import tensorflow as tf
# Access to the data
def get_data(data_dir='/tmp/MNIST_data'):
from tensorflow.examples.tutorials.mnist import input_data
return input_data.read_data_sets(data_dir, one_hot=True)
#Batch generator
def batch_generator(mnist, batch_size=256, type='train'):
if ... |
rrozewsk/OurProject | JupyterFiles/CDOPricingNEW.ipynb | mit | from datetime import timedelta
class CDS(object):
"""A generic CDS class. Can also be used for CDO tranches.
Attributes:
today (datetime.date): The present date.
maturity (datetime.date): The maturity of the CDO.
remaining_payments (list): A list of datetime.date objects indicating ... |
awilky/NLTK-TwitterMixer | NLTK TwitterMixer.ipynb | mit | # NLTK TwitterMixer, Copyright (C) 2017 Afton Wilky
# Author: Afton Wilky <aftonwilky.com>
# License: MIT
"""
Explanation: NLTK TwitterMixer
by Afton Wilky
The NLTK TwitterMixer generates new text based on tweets scraped from the Twitter API.
Twitter data is collect by a simple search query.
Writing functions scrape... |
sailuh/perceive | Notebooks/CWE/Fielder_Parser/CWE Field Parser.ipynb | gpl-2.0 | cwe_xml_file='cwec_v3.0.xml'
"""
Explanation: 0. Preparing Data
Before digging into the parser notebook, the version of the CWE xml file within this notebook is v3.0, which can be downloaded from this link. Here we loaded CWE v3.0 xml file. Therefore, if there is any new version of XML raw file, please make change for... |
swans-one/pgh-python-generators-presentation | 04-Coroutines.ipynb | mit | def print_if_error(error_is="error"):
while True:
line = yield
if line.startswith(error_is):
print(line)
"""
Explanation: Coroutines
A coroutine is a type of subroutine which can have multiple entry and exit points. They're useful for a number of concurrency patterns.
Python introduced ... |
chengsoonong/mclass-sky | mclearn/knfst/python/test.ipynb | bsd-3-clause | DATASET_URL = r"http://homes.esat.kuleuven.be/~tuytelaa/"\
"unsup/unsup_caltech256_dense_sift_1000_bow.tar.gz"
DATASET_DIR = "../../../projects/weiyen/data"
filename = os.path.split(DATASET_URL)[1]
dest_path = os.path.join(DATASET_DIR, filename)
if os.path.exists(dest_path):
print("{} exists. Skipping download...... |
GoogleCloudPlatform/tf-estimator-tutorials | 02_Classification/03.0 - TF Classification Model - DNN Wide & Deep + Train_And_Evaluate + Dataset + TFRecords.ipynb | apache-2.0 | MODEL_NAME = 'class-model-01'
TRAIN_DATA_FILES_PATTERN = 'data/train-*.tfrecords'
VALID_DATA_FILES_PATTERN = 'data/valid-*.tfrecords'
TEST_DATA_FILES_PATTERN = 'data/test-*.tfrecords'
RESUME_TRAINING = False
PROCESS_FEATURES = True
EXTEND_FEATURE_COLUMNS = True
MULTI_THREADING = True
"""
Explanation: Steps to use th... |
WeirdCircumstances/hu_bp_python_course | 05_dataio_matplotlib/.ipynb_checkpoints/Matplotlib_2015-checkpoint.ipynb | mit | %matplotlib inline
from pylab import *
"""
Explanation: Matplotlib 2015
requires ipython and ipyton-notebook packages
execute: ipython notebook
check out this resource for Matplotlib: http://matplotlib.org/gallery.html
End of explanation
"""
xv=[1,2,3,4]; yv=[5,1,4,0]
plot(xv,yv)
"""
Explanation: Above commands e... |
vicolab/neural-network-intro | 1-regression/2-multivariate-linear-regression.ipynb | mit | # Plots will be show inside the notebook
%matplotlib notebook
import matplotlib.pyplot as plt
# High-level package for creating and training artificial neural networks
import keras
# NumPy is a package for manipulating N-dimensional array objects
import numpy as np
# Pandas is a data analysis package
import pandas ... |
darcamo/pyphysim | ipython_notebooks/ZadoffchuChannelEstimation-NewClasses.ipynb | gpl-2.0 | # Create root sequence objects
a_u1 = RootSequence(u1, size=Nsc//2, Nzc=Nzc)
a_u2 = RootSequence(u1, size=Nsc//2, Nzc=Nzc)
a_u3 = RootSequence(u1, size=Nsc//2, Nzc=Nzc)
"""
Explanation: Note that the sequence size Nzc is lower then the number of subcarriers that will have elements of the Zadoff-Chu sequence. That is $... |
AllenDowney/CompStats | resampling.ipynb | mit | # Configure Jupyter so figures appear in the notebook
%matplotlib inline
# Configure Jupyter to display the assigned value after an assignment
%config InteractiveShell.ast_node_interactivity='last_expr_or_assign'
import numpy as np
import matplotlib.pyplot as plt
np.random.seed(4)
"""
Explanation: Teaching statisti... |
santipuch590/deeplearning-tf | dl_tf_BDU/5.AE/ML0120EN-5.2-Review-DBNMNIST.ipynb | mit | #urllib is used to download the utils file from deeplearning.net
from urllib import request
response = request.urlopen('http://deeplearning.net/tutorial/code/utils.py')
content = response.read()
target = open('utils.py', 'wb')
target.write(content)
target.close()
#Import the math function for calculations
import math
#... |
drublackberry/fantastic_demos | Titanic/Titanic.ipynb | mit | train_size = 80 # % of the training set used for training
N_MonteCarlo = 50 # number of runs for the monte-carlo analysis
"""
Explanation: Notebook to process Kaggle's Titanic dataset
This notebook uses the dataset from Kaggle's Titanic Comptetition to train a logistic regression and provides results with the test dat... |
kaushik94/tardis | docs/running/jupyter-widgets.ipynb | bsd-3-clause | # Import the tardis widgets module
import tardis.widgets as tw
"""
Explanation: Jupyter Widgets
Simpler GUI for running TARDIS - a collection of widgets provided by TARDIS to explore simulation data easily within Jupyter Notebook.
End of explanation
"""
# Create a Simulation object by running tardis
from tardis impo... |
GuillaumeDec/machine-learning | deep-lstm-rnn-anomaly-detector/deep-lstm-time-series.ipynb | gpl-3.0 | from __future__ import print_function
import mxnet as mx
from mxnet import nd, autograd
import numpy as np
from collections import defaultdict
mx.random.seed(1)
# ctx = mx.gpu(0)
ctx = mx.cpu(0)
%matplotlib inline
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
from datetim... |
ES-DOC/esdoc-jupyterhub | notebooks/bnu/cmip6/models/sandbox-3/ocnbgchem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'bnu', 'sandbox-3', 'ocnbgchem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem
MIP Era: CMIP6
Institute: BNU
Source ID: SANDBOX-3
Topic: Ocnbgchem
Sub-Topics: Tracers.
Properties: 6... |
qutip/qutip-notebooks | development/development-smesolve-tests.ipynb | lgpl-3.0 | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
from qutip import *
"""
Explanation: Development notebook: Tests for QuTiP's stochastic master equation solver
Copyright (C) 2011 and later, Paul D. Nation & Robert J. Johansson
In this notebook we test the qutip stochastic master equation solver (... |
ProjectQ-Framework/ProjectQ | examples/mapper_tutorial.ipynb | apache-2.0 | import projectq
from projectq.backends import ResourceCounter
from projectq.ops import CNOT, QFT
from projectq.setups import restrictedgateset
engine_list = restrictedgateset.get_engine_list(one_qubit_gates="any",
two_qubit_gates=(CNOT,))
resource_counter = ResourceCount... |
ga7g08/ga7g08.github.io | _notebooks/2015-09-09-Understanding-the-large-odds-ratios-due-to-the-choice-of-priors.ipynb | mit | %matplotlib inline
import triangle
import emcee
import matplotlib.pyplot as plt
import numpy as np
import seaborn
plt.rcParams['axes.labelsize'] = 22
def logunif(x, a, b):
above = x < b
below = x > a
if type(above) is not np.ndarray:
if above and below:
return -np.log(b-a)
else... |
gwtsa/gwtsa | examples/notebooks/5_groundwater_surfacewater.ipynb | mit | import pandas as pd
import pastas as ps
import matplotlib.pyplot as plt
%matplotlib notebook
"""
Explanation: <figure>
<IMG SRC="https://raw.githubusercontent.com/pastas/pastas/master/doc/_static/Art_logo.jpg" WIDTH=250 ALIGN="right">
</figure>
Simulating groundwater levels with a surface water level
Developed by ... |
satishgoda/learning | python/jupyter/tutorial/ipython_gui.ipynb | mit | %gui
from PyQt5 import QtWidgets
b1 = QtWidgets.QPushButton("Click Me")
"""
Explanation: GUI creation and interaction in IPython
End of explanation
"""
%gui qt5
from PyQt5 import QtWidgets
b1 = QtWidgets.QPushButton("Click Me")
b1.show()
"""
Explanation: A pop up will appear saying
The kernel appears to have ... |
jni/numpy-skimage-tutorial | notebooks/adv1-lesion-quantification.ipynb | bsd-3-clause | %matplotlib inline
from matplotlib import pyplot as plt, cm
from skimage import io
image = io.imread('../images/zebrafish-spinal-cord.png')
"""
Explanation: Quantifying spinal cord regeneration in zebrafish
We want to quantify the amount of fluorescent cells in a wounded zebrafish embryo spinal column:
<img src="../im... |
musketeer191/job_analytics | cluster_skill.ipynb | gpl-3.0 | import ja_helpers as ja_helpers; from ja_helpers import *
HOME_DIR = 'd:/larc_projects/job_analytics/'; DATA_DIR = HOME_DIR + 'data/clean/'
RES_DIR = HOME_DIR + 'results/skill_cluster/new/'
skill_df = pd.read_csv(DATA_DIR + 'skill_index.csv')
doc_skill = mmread(DATA_DIR + 'doc_skill.mtx')
skills = skill_df['skill']
... |
diegocavalca/Studies | phd-thesis/REDD - Coleta e Preparação dos Dados.ipynb | cc0-1.0 | import warnings
#warnings.filterwarnings("warning")
import traceback
import time
import tensorflow as tf
import matplotlib.pyplot as plt
%matplotlib inline
plt.style.use('ggplot')
from matplotlib import rcParams
rcParams['figure.figsize'] = (13, 10)
import pandas as pd
from tqdm import tqdm, tqdm_notebook
#tf.deb... |
kimkipyo/dss_git_kkp | Python 복습/07일차.목_크롤링, 정규표현식/7일차_5T_정규표현식.ipynb | mit | # 우선 형태만 보면
# class TestDoubleFunction(unittest.TestCase):
# def test_5_should_return_10(self):
# self.assertEqual(double(5), 10) # 이거랑 동일 assert double(5) == 10
# 주피터노트북에서는 이러한 형태로 테스트 못한다. 그래서 일단 pass
# 우선 hello.py라는 txt파일을 만든다. 안에 내용은
# def hello(name):
# print("hello, {name}".format(name=name))... |
Iolaum/ud370 | assignments/1_notmnist.ipynb | gpl-3.0 | # These are all the modules we'll be using later. Make sure you can import them
# before proceeding further.
from __future__ import print_function
import matplotlib.pyplot as plt
import numpy as np
import os
import sys
import tarfile
from IPython.display import display, Image
from scipy import ndimage
from sklearn.line... |
raoyvn/deep-learning | first-neural-network/Your_first_neural_network.ipynb | mit | %matplotlib inline
%config InlineBackend.figure_format = 'retina'
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
"""
Explanation: Your first neural network
In this project, you'll build your first neural network and use it to predict daily bike rental ridership. We've provided some of the code... |
BCNDojos/pyzmq-workshop | Introduction to pyzmq.ipynb | gpl-3.0 | %%writefile echo.py
#!/usr/bin/env python
import zmq
from zmq.eventloop import ioloop, zmqstream
def echo(stream, message):
stream.send_multipart(message)
io_loop = ioloop.IOLoop()
context = zmq.Context()
socket = context.socket(zmq.ROUTER)
stream = zmqstream.ZMQStream(socket, io_loop=io_loop)
stream.on_recv_stre... |
malcolmrh/solar-terrain | scratchbook.ipynb | mit | with open ('inputs/site.geojson') as f:
js = json.load(f)
s = shape(js['features'][0]['geometry'])
s
"""
Explanation: DEM analysis
Load site using shapely
End of explanation
"""
dem = gdal.Open('inputs/dem/filled.tif')
"""
Explanation: Load digital elevation model
End of explanation
"""
site = ogr.Geometry(o... |
kit-cel/wt | nt1/vorlesung/4_kanalcodierung/block_coding.ipynb | gpl-2.0 | import numpy as np
from scipy import stats, special
import itertools
import matplotlib.pyplot as plt
import matplotlib
# showing figures inline
%matplotlib inline
# plotting options
font = {'size' : 20}
plt.rc('font', **font)
plt.rc('text', usetex=matplotlib.checkdep_usetex(True))
matplotlib.rc('figure', figsize... |
ernestyalumni/MLgrabbag | NaturalLanguageProcessing/TextSummarization.ipynb | mit | word_tokens = nltk.word_tokenize(fread)
"""
Explanation: Tokenize the text using nltk
End of explanation
"""
tagged = nltk.pos_tag(word_tokens)
textlist = [x[0] for x in tagged]
# filter_for_tags
defaulttags = ['NN','JJ','NNP']
tagged_filtered = [item for item in tagged if item[1] in defaulttags]
tagged_filtered
... |
ckemere/CloudShuffles | score_bayes_parallel-orig.ipynb | gpl-3.0 | import numpy as np
import os
import pandas as pd
import warnings
import nelpy as nel
warnings.filterwarnings("ignore")
"""
Explanation: Score multi-session events using the replay score from Davidson et al.
End of explanation
"""
datadirs = ['/home/etienne/Dropbox/neoReader/',
'C:/Etienne/Dropbox/neoRe... |
materialsvirtuallab/matgenb | notebooks/2017-12-15-Plotting a Pourbaix Diagram.ipynb | bsd-3-clause | # Import necessary tools from pymatgen
from pymatgen import MPRester
from pymatgen.analysis.pourbaix_diagram import PourbaixDiagram, PourbaixPlotter
%matplotlib inline
# Initialize the MP Rester
mpr = MPRester()
"""
Explanation: Plotting a pourbaix diagram using the Materials Project API
If you use this infrastructur... |
gtesei/DeepExperiments | Autoencoders_1.1.0.ipynb | apache-2.0 | # Tensorflow
import tensorflow as tf
from tensorflow.contrib.layers import fully_connected
# Common imports
import numpy as np
import numpy.random as rnd
import os
import sys
# to make this notebook's output stable across runs
rnd.seed(42)
# To plot pretty figures
%matplotlib inline
import matplotlib
import matplot... |
EstevaoVieira/udacity_projects | student_intervention/student_intervention.ipynb | mit | # Import libraries
import numpy as np
import pandas as pd
from time import time
from sklearn.metrics import f1_score
# Read student data
student_data = pd.read_csv("student-data.csv")
print "Student data read successfully!"
"""
Explanation: Machine Learning Engineer Nanodegree
Supervised Learning
Project: Building a ... |
phobson/pygridtools | docs/tutorial/03_MergingSpliting.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import pandas
from shapely.geometry import Point, Polygon
import geopandas
import pygridgen as pgg
import pygridtools as pgt
"""
Explanation: Grid Manipulations (merge, split, refine, transform)
Notes
Most grid transformations such as merge and tra... |
david4096/bioapi-examples | python_notebooks/g2p-example-notebook.ipynb | apache-2.0 | from ga4gh.client import client
ga4gh_endpoint = "http://1kgenomes.ga4gh.org"
c = client.HttpClient(ga4gh_endpoint)
"""
Explanation: G2P Genotype to Phenotype example notebook.
This example illustrates how to access the GA4GH Genotype to Phenotype service.
The GA4GH G2P allows the researcher to query features, phenoty... |
ES-DOC/esdoc-jupyterhub | notebooks/messy-consortium/cmip6/models/sandbox-3/ocnbgchem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'messy-consortium', 'sandbox-3', 'ocnbgchem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem
MIP Era: CMIP6
Institute: MESSY-CONSORTIUM
Source ID: SANDBOX-3
Topic: Ocnbgchem
Sub-Topic... |
deepfield/ibis | docs/source/notebooks/tutorial/4-More-Value-Expressions.ipynb | apache-2.0 | import ibis
import os
hdfs_port = os.environ.get('IBIS_WEBHDFS_PORT', 50070)
hdfs = ibis.hdfs_connect(host='quickstart.cloudera', port=hdfs_port)
con = ibis.impala.connect(host='quickstart.cloudera', database='ibis_testing',
hdfs_client=hdfs)
ibis.options.interactive = True
"""
Explanation: M... |
edosedgar/xs-pkg | deep_learning/hw3/homework03_part2_autoencoders_basic.ipynb | gpl-2.0 | # if you're running in colab,
# 1. go to Runtime -> Change Runtimy Type -> GPU
# 2. uncomment this:
#!wget https://raw.githubusercontent.com/yandexdataschool/Practical_DL/hw3_19/homework03/lfw_dataset.py -O lfw_dataset.py
import torch
import numpy as np
from torch.utils.data import Dataset, DataLoader
import torch.nn... |
ES-DOC/esdoc-jupyterhub | notebooks/niwa/cmip6/models/ukesm1-0-ll/toplevel.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'niwa', 'ukesm1-0-ll', 'toplevel')
"""
Explanation: ES-DOC CMIP6 Model Properties - Toplevel
MIP Era: CMIP6
Institute: NIWA
Source ID: UKESM1-0-LL
Sub-Topics: Radiative Forcings.
Properties: 85 ... |
WNoxchi/Kaukasos | misc/IAU_PlanetNameGenerator_Data_Exploration.ipynb | mit | content = content[np.where([line.count("(") > 0 for line in content])[0]]
content.shape
"""
Explanation: Looks like I made a mistake with how I was getting my indices... they were inside a 1D tuple for some reason.. oops.
End of explanation
"""
??np.random.randint
content[np.random.randint(0, len(content))]
"""
E... |
scottprahl/miepython | docs/06_random_deviates.ipynb | mit | #!pip install --user miepython
import numpy as np
import matplotlib.pyplot as plt
try:
import miepython
except ModuleNotFoundError:
print('miepython not installed. To install, uncomment and run the cell above.')
print('Once installation is successful, rerun this cell again.')
"""
Explanation: Mie Random... |
quantopian/research_public | notebooks/lectures/Introduction_to_Futures/answers/notebook.ipynb | apache-2.0 | # Useful Libraries
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
"""
Explanation: Exercises: Introduction to Futures Contracts - Answer Key
By Christopher van Hoecke, Maxwell Margenot, and Delaney Mackenzie
Lecture Link :
https://www.quantopian.com/lectures/introduction-to-futures
IMPORTANT NO... |
malnoxon/board-game-data-science | stage4/stage4_report.ipynb | gpl-3.0 | import py_entitymatching as em
import os
import pandas as pd
# specify filepaths for tables A and B.
path_A = 'newTableA.csv'
path_B = 'tableB.csv'
# read table A; table A has 'ID' as the key attribute
A = em.read_csv_metadata(path_A, key='id')
# read table B; table B has 'ID' as the key attribute
B = em.read_csv_met... |
deepchem/deepchem | examples/tutorials/Synthetic_Feasibility_Scoring.ipynb | mit | !pip install --pre deepchem
import deepchem
deepchem.__version__
"""
Explanation: Synthetic Feasibility
Synthetic feasibility is a problem when running large scale enumerations. Often molecules that are enumerated are very difficult to make and thus not worth inspection, even if their other chemical properties are go... |
balazssimon/ml-playground | udacity/deep-learning/assignments/1_notmnist.ipynb | apache-2.0 | # These are all the modules we'll be using later. Make sure you can import them
# before proceeding further.
from __future__ import print_function
import matplotlib.pyplot as plt
import numpy as np
import os
import sys
import tarfile
from IPython.display import display, Image
from scipy import ndimage
from sklearn.line... |
ES-DOC/esdoc-jupyterhub | notebooks/cccma/cmip6/models/sandbox-3/ocnbgchem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'cccma', 'sandbox-3', 'ocnbgchem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem
MIP Era: CMIP6
Institute: CCCMA
Source ID: SANDBOX-3
Topic: Ocnbgchem
Sub-Topics: Tracers.
Propertie... |
HCsoft-RD/shaolin | examples/Dashboards.ipynb | agpl-3.0 | %%HTML
<style>
.container { width:100% !important; }
.input{ width:60% !important;
align: center;
}
.text_cell{ width:70% !important;
font-size: 16px;}
.title {align:center !important;}
</style>
"""
Explanation: In order to use the shaolin framework more comfortably we will use a little screen... |
IST256/learn-python | content/lessons/09-Dictionaries/MoreDict.ipynb | mit | person_name = "Mike"
person_age = 50
person_faculty = True
person = {}
person['name'] = "Mike"
person['age'] = 50
person['faculty'] = True
print(person)
"""
Explanation: What is this dictionary thing?
Stores multiple values under a single variable
End of explanation
"""
'dob' in person.keys()
if 'dob' not in per... |
mldbai/mldb | container_files/demos/Enron Spam Filtering.ipynb | apache-2.0 | from pymldb import Connection
mldb = Connection('http://localhost/')
"""
Explanation: Spam Filtering Using The Enron Dataset
End of explanation
"""
print mldb.post('/v1/procedures', {
'type': 'import.text',
'params': {
'dataFileUrl': 'file://mldb/mldb_test_data/enron.csv.gz',
'outputDataset':... |
QuantScientist/Deep-Learning-Boot-Camp | day03/3.2 RNN and LSTM.ipynb | mit | %matplotlib inline
import numpy as np
import pandas as pd
import theano
import theano.tensor as T
import keras
import numpy as np
import matplotlib.pyplot as plt
from sklearn.preprocessing import LabelEncoder
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
# -- ... |
bumblebeefr/poppy_rate | [poppyrate] Poppyrate instance.ipynb | gpl-2.0 | import logging
import logging.handlers
from poppy_rate import PoppyRate
import poppy_rate
import poppy_rate.primitives as pp
"""
Explanation: Instanciation de poppyrate
Exemple d'instanciation d'un poppyrate tel qu'il pourrais être lancé comme service, avec un serveur snap, http et remote(rpc).
Ce notebook peut servir... |
rv816/lightfm | examples/movielens/example.ipynb | apache-2.0 | import numpy as np
import data
"""
Explanation: Using lightfm on the Movielens dataset
Getting the data
The first step is to get the movielens data.
Let's import the utility functions from data.py:
End of explanation
"""
import inspect
print(inspect.getsource(data._build_interaction_matrix))
"""
Explanation: The f... |
cloudera-cares-austin/zika-hackathon | src/zika_excel_parsing.ipynb | apache-2.0 | occurrence.groupby(['genus', 'species'])['datasetkey'].count()
"""
Explanation: Should we only consider certain genuses or species?
End of explanation
"""
occurrence.groupby(['locality', 'year'])['datasetkey'].count()
occurrence.groupby('year')['datasetkey'].count()
occurrence[[u'eventdate', u'day', u'month', u'ye... |
googledatalab/notebooks | tutorials/BigQuery/Importing and Exporting Data.ipynb | apache-2.0 | from google.datalab import Context
import google.datalab.bigquery as bq
import google.datalab.storage as storage
import pandas as pd
try:
from StringIO import StringIO
except ImportError:
from io import BytesIO as StringIO
"""
Explanation: Importing and Exporting Data
Data can be imported into Google BigQuery from... |
trishnaguha/PyImage | Image_Processing_in_Python.ipynb | gpl-3.0 | %pylab inline
from __future__ import division #Python 2.X and 3.X Compatibility
from __future__ import print_function #Python 2.X and 3.X Compatibility
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
"""
Explanation: Image Processing in Python
Tanmoy Dasgupta
thetdg@live.com | Assistant Professor... |
hasecbinusr/pysal | pysal/contrib/viz/mapping_guide.ipynb | bsd-3-clause | shp_link = ps.examples.get_path('columbus.shp')
shp = ps.open(shp_link)
some = [bool(rdm.getrandbits(1)) for i in ps.open(shp_link)]
fig = figure()
base = maps.map_poly_shp(shp)
base.set_facecolor('none')
base.set_linewidth(0.75)
base.set_edgecolor('0.8')
some = maps.map_poly_shp(shp, which=some)
some.set_alpha(0.5)
... |
keras-team/keras-io | examples/vision/ipynb/probing_vits.ipynb | apache-2.0 | import zipfile
from io import BytesIO
import cv2
import gdown
import matplotlib.pyplot as plt
import numpy as np
import requests
import tensorflow as tf
import tensorflow_hub as hub
from PIL import Image
from sklearn.preprocessing import MinMaxScaler
from tensorflow import keras
"""
Explanation: Investigating Vision ... |
alexandrnikitin/algorithm-sandbox | courses/DAT256x/Module02/02-01-Rate of Change.ipynb | mit | %matplotlib inline
def q(x):
return 2*x + 1
# Plot the function
import numpy as np
from matplotlib import pyplot as plt
# Create an array of x values from 0 to 10
x = np.array(range(0, 11))
# Set up the graph
plt.xlabel('Seconds')
plt.ylabel('Meters')
plt.xticks(range(0,11, 1))
plt.yticks(range(0, 22, 1))
plt.g... |
sdpython/ensae_teaching_cs | _doc/notebooks/exams/td_note_2021.ipynb | mit | from jyquickhelper import add_notebook_menu
add_notebook_menu()
"""
Explanation: 1A - Enoncé 24 novembre 2020
Correction de l'examen du 24 novembre 2020.
End of explanation
"""
import pandas
df = pandas.read_csv("https://www.data.gouv.fr/en/datasets/r/63352e38-d353-4b54-bfd1-f1b3ee1cabd7", sep=";")
gr = df[["jour",... |
JackDi/phys202-2015-work | assignments/assignment12/FittingModelsEx02.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import scipy.optimize as opt
"""
Explanation: Fitting Models Exercise 2
Imports
End of explanation
"""
# YOUR CODE HERE
data = np.load('decay_osc.npz')
time=data['tdata']
y=data['ydata']
dy=data['dy']
plt.errorbar(time, y, dy,
fmt='.... |
tpin3694/tpin3694.github.io | sql/create_a_table.ipynb | mit | # Ignore
%load_ext sql
%sql sqlite://
%config SqlMagic.feedback = False
"""
Explanation: Title: Create A Table
Slug: create_a_table
Summary: Create a table in SQL.
Date: 2017-01-17 12:00
Category: SQL
Tags: Basics
Authors: Chris Albon
Note: This tutorial was written using Catherine Devlin's SQL in Jupyter Notebo... |
yamitzky/machine-learning-mokumoku | 02-library.ipynb | mit | %pylab inline
import numpy as np
import pylab as pl
"""
Explanation: ライブラリを使って機械学習を始めてみる
目次
機械学習のよくあるPDCA
直線関係のあるデータの可視化
線形回帰で回帰する
非線形な関数の回帰
手法の良さの評価
実際のデータとの違い
機械学習のよくあるPDCA
テキストデータやDBをPythonでロードする
ロードしたデータにバイナリ化などの処理を加えて、行列にロードする
機械学習のモデルを使って、学習する
予測をしてみる
結果を可視化する
誤差を定量的に測る
特徴量を増減させたり、モデルを変えて、3〜6を繰り返す
今回は、この一連の流... |
LukasMosser/Jupetro | notebooks/Casing Seat Depth Determination - Part 3.ipynb | gpl-3.0 | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
from scipy.signal import argrelmax
fracture_pressure_data = np.loadtxt("data/fracture_pressure_abnormal.csv", delimiter=",")
fracture_pressure, TVD_frac = fracture_pressure_data.T
pore_pressure_data = np.loadtxt("data/pore_pressure_abnormal.csv", d... |
agarsev/grafeno | docs/_examples/visualization.ipynb | agpl-3.0 | from grafeno import Graph
from grafeno.transformers import get_pipeline
from grafeno.jupyter import visualize
import yaml
semantic_pipeline = yaml.load(open('../../configs/semantic.yaml'))
T = get_pipeline(['spacy_parse']+semantic_pipeline.get('transformers'))
"""
Explanation: Interactive visualization of grafeno Gra... |
wittawatj/ipynb | notebooks/iris-knn-analysis.ipynb | mit | # เรียกใช้ไลบรารี่ที่จำเป็น
%matplotlib inline
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from sklearn import datasets
from __future__ import unicode_literals
matplotlib.rc('font', family='Garuda')
np.random.seed(2)
iris = datasets.load_iris()
# X เป็น array 150x2 เหมือนตารางด้านบน
X = iris.... |
Yangqing/caffe2 | caffe2/python/tutorials/Python_Op.ipynb | apache-2.0 | from caffe2.python import core, workspace
import numpy as np
def f(inputs, outputs):
outputs[0].feed(2 * inputs[0].data)
workspace.ResetWorkspace()
net = core.Net("tutorial")
net.Python(f)(["x"], ["y"])
workspace.FeedBlob("x", np.array([3.]))
workspace.RunNetOnce(net)
print(workspace.FetchBlob("y"))
"""
Explanat... |
NYUDataBootcamp/Projects | Summer_15/PISA_SusanChen_Aug_15.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import statsmodels.formula.api as smf
from pandas.io import wb
"""
Explanation: Is there a relationship between GDP per capita and PISA scores?
July 2015
Written by Susan Chen at NYU Stern with help from Professor David Backus
C... |
Hvass-Labs/TensorFlow-Tutorials | 03_PrettyTensor.ipynb | mit | from IPython.display import Image
Image('images/02_network_flowchart.png')
"""
Explanation: TensorFlow Tutorial #03
PrettyTensor
by Magnus Erik Hvass Pedersen
/ GitHub / Videos on YouTube
WARNING!
This tutorial does not work with TensorFlow v. 1.9 due to the PrettyTensor builder API apparently no longer being updated ... |
root-mirror/training | NCPSchool2021/RDataFrame/03-rdataframe-features.ipynb | gpl-2.0 | import ROOT
df = ROOT.RDataFrame("dataset","data/example_file.root")
df1 = df.Define("c","a+b")
out_treename = "outtree"
out_filename = "outtree.root"
snapdf = df1.Snapshot(out_treename, out_filename)
# Result of a Snapshot is still an RDataFrame that can be further used
snapdf.Display().Print()
"""
Explanation: Sa... |
ShubhamDebnath/Coursera-Machine-Learning | Course 1/Building your Deep Neural Network Step by Step v5.ipynb | mit | import numpy as np
import h5py
import matplotlib.pyplot as plt
from testCases_v3 import *
from dnn_utils_v2 import sigmoid, sigmoid_backward, relu, relu_backward
%matplotlib inline
plt.rcParams['figure.figsize'] = (5.0, 4.0) # set default size of plots
plt.rcParams['image.interpolation'] = 'nearest'
plt.rcParams['imag... |
unpingco/Python-for-Probability-Statistics-and-Machine-Learning | chapters/machine_learning/notebooks/ensemble.ipynb | mit | from IPython.display import Image
Image('../../../python_for_probability_statistics_and_machine_learning.jpg')
from pprint import pprint
import textwrap
import sys, re
def displ(x):
if x is None: return
print ("\n".join(textwrap.wrap(repr(x).replace(' ',''),width=80)))
sys.displayhook=displ
"""
Explanation: E... |
tensorflow/docs-l10n | site/ko/tutorials/interpretability/integrated_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... |
jhidding/adhesion-example | notebook/Interactive.ipynb | gpl-3.0 | # Create a box
box = cft.Box(dim=2, N=32, L=25.)
def get_potential(n_P):
# Specify the power spectrum
P = cft.Power_law(n=n_P) * cft.Scale(box, 0.5)
# Create initial density perturbations
delta_0 = cft.garfield(B=box, P=P, seed=420)
# Normalize (typical collapse time at D=1)
delta_0 /= delta_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.