repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
ES-DOC/esdoc-jupyterhub | notebooks/csir-csiro/cmip6/models/vresm-1-0/atmos.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', 'atmos')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmos
MIP Era: CMIP6
Institute: CSIR-CSIRO
Source ID: VRESM-1-0
Topic: Atmos
Sub-Topics: Dynamical Core, Radia... |
laurentperrinet/elasticite | posts/2015-10-27 élasticité rapsberry pyserial.ipynb | mit | nb_pas = 12
position_present = 6
position_desired = 4
d_position = (position_desired - position_present + nb_pas//2 ) % nb_pas - nb_pas//2
print (d_position)
position_present = (position_present + d_position ) % nb_pas
print (position_present)
"""
Explanation: sharing internet on the laocal machine
ifconfig
sca... |
MarkUsProject/Markus | db/data/autotest_files/jupyter/script_files/test.ipynb | mit | %pylab inline
import numpy as np
"""
Explanation: Welcome to your assignment! Do the questions and write the answers in the code cells provided below.
Here's a bit of setup for you.
End of explanation
"""
a =
# test_shape
assert a.shape == (100, 100), "Shape is wrong :("
"""
Explanation: Question 1: Create a 100 ... |
robertoalotufo/ia898 | dev/2017-01-31-RAL-Numpy-reducao-de-eixo.ipynb | mit |
import numpy as np
a = np.arange(24).reshape((4,6))
print("a = \n", a)
print('a.max()=', a.max())
print('a.mean()=', a.mean())
print('a.sum()=', a.sum())
"""
Explanation: Introdução ao NumPy no ambiente Adessowiki
Redução de eixo
.. contents::
Operação combinando todos os pixels
Existem várias funções que calcula... |
danielfrg/danielfrg.github.io-source | content/blog/notebooks/2100/ipynb.ipynb | apache-2.0 | a = 1
a
b = 'pew'
b
%matplotlib inline
import matplotlib.pyplot as plt
from pylab import *
x = linspace(0, 5, 10)
y = x ** 2
figure()
plot(x, y, 'r')
xlabel('x')
ylabel('y')
title('title')
show()
import numpy as np
num_points = 130
y = np.random.random(num_points)
plt.plot(y)
"""
Explanation: Lorem ipsum dol... |
vzg100/Post-Translational-Modification-Prediction | .ipynb_checkpoints/Tyrosine Phosphorylation Example-checkpoint.ipynb | mit | from pred import Predictor
from pred import sequence_vector
"""
Explanation: Example of using ptm_pred to prototype phosphorylation classifiers
Histadine Phosphorylation is a quick place to start, not much data though. However, that means the code runs much faster.
Predictor is the class which handles reading the dat... |
AllenDowney/ThinkStats2 | code/chap02ex.ipynb | gpl-3.0 | import numpy as np
from os.path import basename, exists
def download(url):
filename = basename(url)
if not exists(filename):
from urllib.request import urlretrieve
local, _ = urlretrieve(url, filename)
print("Downloaded " + local)
download("https://github.com/AllenDowney/ThinkStats... |
magwenelab/mini-term-2016 | ode-modeling2-instructor.ipynb | cc0-1.0 | # import statements to make numeric and plotting functions available
%matplotlib inline
from numpy import *
from matplotlib.pyplot import *
## We'll specify the behavior of X as a series of pulse of different length
## so we'll define a function to generate pulses
def pulse(ontime, offtime, ntimes, onval=1):
if ... |
poppy-project/community-notebooks | tutorials-education/poppy-humanoid_balance_leg.ipynb | lgpl-3.0 | from poppy.creatures import PoppyHumanoid
poppy = PoppyHumanoid(simulator='vrep')
%pylab inline
#import time
"""
Explanation: A method to use the present_load to balance the leg of poppy
End of explanation
"""
import time as real_time
class time:
def __init__(self,robot):
self.robot=robot
def time(... |
tensorflow/docs | site/en/r1/guide/autograph.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... |
lia-statsletters/notebooks | MSE (Maximum Spacing Estimation).ipynb | gpl-3.0 | import numpy as np
from scipy.stats.mstats import gmean
from scipy.stats import pareto
import matplotlib.pyplot as plt
print plt.style.available
plt.style.use('ggplot')
#this is the real shape parameter that we will try to approximate with the estimators
realAlpha=3.
#the left limit of this Pareto distribution
realXm=... |
MatthewDaws/OSMDigest | notebooks/Convert to SQLite DB.ipynb | mit | import sys
sys.path.insert(0, "..")
import sqlite3
import datetime
import os
import osmdigest.sqlite as sq
# Delete the database if it already exists.
try:
os.remove("demo.db")
except FileNotFoundError:
pass
import os
filename = os.path.join("//media", "disk", "OSM_Data", "isle-of-man-latest.osm.bz2")
#file... |
minireference/noBSLAnotebooks | Linear_algebra_chapters_overview.ipynb | mit | # helper code needed for running in colab
if 'google.colab' in str(get_ipython()):
print('Downloading plot_helpers.py to util/ (only neded for colab')
!mkdir util; wget https://raw.githubusercontent.com/minireference/noBSLAnotebooks/master/util/plot_helpers.py -P util
# setup SymPy
from sympy import *
x, y, z,... |
aje/POT | notebooks/plot_otda_mapping_colors_images.ipynb | mit | # Authors: Remi Flamary <remi.flamary@unice.fr>
# Stanislas Chambon <stan.chambon@gmail.com>
#
# License: MIT License
import numpy as np
from scipy import ndimage
import matplotlib.pylab as pl
import ot
r = np.random.RandomState(42)
def im2mat(I):
"""Converts and image to matrix (one pixel per line)"""... |
gogrean/SurfFit | examples/notebooks/PyXel Example - Constant Model.ipynb | gpl-3.0 | %matplotlib inline
import os
import pickle
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as mtick
from astropy.modeling.functional_models import Const1D
from pyxel import Image, load_region
from pyxel.fitters import CstatFitter
from pyxel.models import IntModel
"""
Explanation: PyXel Ex... |
joommf/tutorial | workshops/2017-04-24-Intermag2017/tutorial0_first_notebook.ipynb | bsd-3-clause | import oommfc as oc
import discretisedfield as df
%matplotlib inline
"""
Explanation: Tutorial 0 - First JOOMMF notebook
The goal of this tutorial is for all participants to familiarise themselves with running JOOMMF simulations in Jupyter notebook. The only thing you need to know for this tutorial is how to execute i... |
mne-tools/mne-tools.github.io | stable/_downloads/772492bca9aff751a357f5e3e0163e67/50_cluster_between_time_freq.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License: BSD-3-Clause
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne.time_frequency import tfr_morlet
from mne.stats import permutation_cluster_test
from mne.datasets import sample
print(__doc__)
"""
Explanation: Non-parametric ... |
JAmarel/Phys202 | Interact/InteractEx03.ipynb | mit | %matplotlib inline
from matplotlib import pyplot as plt
import numpy as np
from IPython.html.widgets import interact, interactive, fixed
from IPython.display import display
"""
Explanation: Interact Exercise 3
Imports
End of explanation
"""
def soliton(x, t, c, a):
"""Return phi(x, t) for a soliton wave with co... |
ageron/ml-notebooks | tools_pandas.ipynb | apache-2.0 | from __future__ import division, print_function, unicode_literals
"""
Explanation: Tools - pandas
The pandas library provides high-performance, easy-to-use data structures and data analysis tools. The main data structure is the DataFrame, which you can think of as an in-memory 2D table (like a spreadsheet, with column... |
sameersingh/ml-discussions | week7/clustering_and_faces.ipynb | apache-2.0 | # Import all required libraries
from __future__ import division # For python 2.*
import numpy as np
import matplotlib.pyplot as plt
import mltools as ml
np.random.seed(0)
%matplotlib inline
"""
Explanation: In this notebook we'll cover the concept of clustering which is an unsupervised learning algorithm. We'll use ... |
brucefan1983/GPUMD | examples/empirical_potentials/thermal_transport_emd/Thermal Transport - EMD.ipynb | gpl-3.0 | from pylab import *
from ase.build import graphene_nanoribbon
from thermo.gpumd.data import load_hac
from thermo.gpumd.io import ase_atoms_to_gpumd
"""
Explanation: Thermal Conductivity from EMD
1. Introduction
In this example, we use the EMD (Green-Kubo) method to calculate the lattice thermal conductivity of graphe... |
tensorflow/docs | site/en/tutorials/distribute/save_and_load.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... |
bsafdi/NPTFit | examples/Example8_Galactic_Center_nonPoissonian.ipynb | mit | # Import relevant modules
%matplotlib inline
%load_ext autoreload
%autoreload 2
import numpy as np
from NPTFit import nptfit # module for performing scan
from NPTFit import create_mask as cm # module for creating the mask
from NPTFit import dnds_analysis # module for analysing the output
from NPTFit import psf_corre... |
atcemgil/notes | RobustRegression.ipynb | mit |
# A toy data set with outliers
x = np.matrix('[0,1,2,3,4,5]').T
y = np.matrix('[2,4,6,-1,10,12]').T
# Degree of the fitted polynomial
degree = 1
N = len(x)
A = np.hstack((np.power(x,i) for i in range(degree+1)))
xx = np.matrix(np.arange(-1,6,0.1)).T
A2 = np.hstack((np.power(xx,i) for i in range(degree+1)))
# Norm ... |
llscm0202/BIGDATA2017 | ATIVIDADE2/Lab2_Spark_PySpark.ipynb | gpl-3.0 | from pyspark import SparkContext
sc =SparkContext()
ListaPalavras = ['gato', 'elefante', 'rato', 'rato', 'gato']
palavrasRDD = sc.parallelize(ListaPalavras, 4)
print type(palavrasRDD)
"""
Explanation: Spark + Python = PySpark
Esse notebook introduz os conceitos básicos do Spark através de sua interface com a linguagem... |
jphall663/GWU_data_mining | 02_analytical_data_prep/src/py_part_2_over_sample.ipynb | apache-2.0 | import pandas as pd # pandas for handling mixed data sets
import numpy as np # numpy for basic math and matrix operations
# imbalanced-learn for oversampling
from imblearn.over_sampling import RandomOverSampler
"""
Explanation: License
Copyright (C) 2017 J. Patrick Hall,... |
OpenWIM/pywim | notebooks/SpeedDetection.ipynb | mit | from IPython.display import display
from matplotlib import pyplot as plt
import numpy as np
import pandas as pd
import peakutils
import sys
# local
sys.path.insert(0, '../')
from pywim.utils import storage
from pywim.utils.stats import iqr
%matplotlib inline
"""
Explanation: Table of Contents
<p><div class="lev1 to... |
mne-tools/mne-tools.github.io | 0.14/_downloads/plot_stats_cluster_spatio_temporal_2samp.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Eric Larson <larson.eric.d@gmail.com>
# License: BSD (3-clause)
import os.path as op
import numpy as np
from scipy import stats as stats
import mne
from mne import spatial_tris_connectivity, grade_to_tris
from mne.stats import spatio_... |
sangheestyle/ml2015project | howto/model14_DPGMM_avg_pos_and_acc_ratio_for_category.ipynb | mit | import gzip
import pickle
from os import path
from collections import defaultdict
from numpy import sign
"""
Load buzz data as a dictionary.
You can give parameter for data so that you will get what you need only.
"""
def load_buzz(root='../data', data=['train', 'test', 'questions'], format='pklz'):
buzz_data = {... |
kubeflow/katib | examples/v1beta1/sdk/cmaes-and-resume-policies.ipynb | apache-2.0 | # Install required package (Katib SDK).
!pip install kubeflow-katib==0.13.0
"""
Explanation: HyperParameter tunning using CMA-ES
In this example you will deploy 3 Katib Experiments with Covariance Matrix Adaptation Evolution Strategy (CMA-ES) using Jupyter Notebook and Katib SDK. These Experiments have various resume... |
MadsJensen/intro_to_scientific_computing | src/Z1-Outline-of-topics.ipynb | bsd-3-clause | 2
type(2)
3.0
type(3.0)
2/3.0
type('a')
len('a')
len('abc')
"""
Explanation: Foundations of data-driven health science
Day 1: The anatomy of a computer and data
Summarize how the main components of a computer relate to, and constrain, the act of "computing".
See What is a computer-notebook
Describe the basic o... |
jrg365/gpytorch | examples/01_Exact_GPs/Spectral_Mixture_GP_Regression.ipynb | mit | import math
import torch
import gpytorch
from matplotlib import pyplot as plt
%matplotlib inline
%load_ext autoreload
%autoreload 2
"""
Explanation: GP Regression with a Spectral Mixture Kernel
Introduction
This example shows how to use a SpectralMixtureKernel module on an ExactGP model. This module is designed for
... |
merenlab/web | files/2018_BPHS_WORKSHOP/BPHS_WORKSHOP_RF.ipynb | mit | import pandas as pd
tax_level = 'species' # if you want to use genus, just switch this to 'genus'
data_file = 'samples-'+ tax_level + '-taxonomy.txt'
target_file = 'crassphage-samples-information.txt'
raw_data = pd.read_csv(data_file, sep='\t', index_col=0)
raw_target = pd.read_csv(target_file, sep='\t', index_col=0)... |
louistang5/grammarly-exercise | grammarly-exercise.ipynb | mit | %config Completer.use_jedi = False
import json
import re
import sys
import csv
import pandas as pd
import numpy as np
from datetime import timedelta, date
from itertools import groupby
import matplotlib.pyplot as plt
import seaborn as sns
import plotly.plotly as py
import plotly.graph_objs as go
%matplotlib inline
wi... |
raharjaliu/BIFers | scripts/notebook/binding.ipynb | mit | ## matrix and vector tools
import pandas as pd
from pandas import DataFrame as df
from pandas import Series
import numpy as np
## sklearn
from sklearn.datasets import make_friedman1
from sklearn.feature_selection import RFE
from sklearn.svm import SVR
from sklearn.svm import SVC
from sklearn.model_selection import ... |
sdpython/ensae_teaching_cs | _doc/notebooks/1a/exercice_echelle.ipynb | mit | from jyquickhelper import add_notebook_menu
add_notebook_menu()
"""
Explanation: 1A.algo - Calculer le nombre de façons de monter une échelle.
Une grenouille monte une échelle. Elle peut faire des bonds de un ou deux barreaux. Combien a-t-elle de façons de monter une échelle de treize barreaux ? Notion abordée : fonct... |
google/dv360-automation | dv360-automation-notebook.ipynb | apache-2.0 | !pip install google-api-python-client
!pip install google-cloud-vision
import csv
import datetime
import io
import json
import pprint
from google.api_core import retry
from google.cloud import vision
from google.colab import files
from google_auth_oauthlib.flow import InstalledAppFlow
from googleapiclient import disc... |
aakashm301/Workshop | Refactored_Py_DS_ML_Bootcamp-master/07-Pandas-Built-in-Data-Viz/01-Pandas Built-in Data Visualization.ipynb | gpl-3.0 | import numpy as np
import pandas as pd
%matplotlib inline
"""
Explanation: <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a>
Pandas Built-in Data Visualization
In this lecture we will learn about pandas built-in capabilities for data visualization! It's built-off of matplotlib, but it b... |
oroszl/topins | SSH.ipynb | gpl-2.0 | # We import pylab and interactive widgets
%pylab inline
from ipywidgets import *
"""
Explanation: Su-Schrieffer-Heeger model
<img src="ssh_chain_bulkedge.png" width="1000" >
In this notebook we explore the the Su-Schrieffer-Heeger model depicted above. We build the tight-binding model, calculate the spectrum and insp... |
sandeep-n/incubator-systemml | samples/jupyter-notebooks/ALS_python_demo.ipynb | apache-2.0 | from pyspark.sql import SparkSession
from pyspark.sql.types import *
from systemml import MLContext, dml
spark = SparkSession\
.builder\
.appName("als-example")\
.getOrCreate()
schema = StructType([StructField("movieId", IntegerType(), True),
StructField("userId", IntegerT... |
danresende/deep-learning | sentiment_network/Sentiment Classification - Mini Project 2.ipynb | mit | def pretty_print_review_and_label(i):
print(labels[i] + "\t:\t" + reviews[i][:80] + "...")
g = open('reviews.txt','r') # What we know!
reviews = list(map(lambda x:x[:-1],g.readlines()))
g.close()
g = open('labels.txt','r') # What we WANT to know!
labels = list(map(lambda x:x[:-1].upper(),g.readlines()))
g.close()... |
leblancfg/project_euler | project_euler.ipynb | mit | print(sum([n for n in range(1000) if n % 3 == 0 or n % 5 == 0]))
"""
Explanation: Project Euler
This notebook contains my problem-solving code used to answer the various challenges posted on the website https://projecteuler.net. It is often cited as good coding practice, to get used to things like basic algorithms, da... |
tensorflow/docs-l10n | site/ko/agents/tutorials/6_reinforce_tutorial.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... |
amirziai/learning | python/defaultdict-of-fixed-length-buffers.ipynb | mit | from collections import deque
# Buffer with maximum length of 3
buffer = deque([], 3)
buffer
buffer.append(1)
buffer
buffer.append(2)
buffer.append(3)
buffer
buffer.append(4)
# First item is kicked out
buffer
"""
Explanation: defaultdict of fixed-length buffers
End of explanation
"""
from collections import ... |
tritemio/multispot_paper | out_notebooks/Multi-spot vs usALEX FRET histogram comparison-out-27d.ipynb | mit | data_id = '17d'
ph_sel_name = "None"
data_id = "27d"
"""
Explanation: Executed: Mon Mar 27 22:24:54 2017
Duration: 11 seconds.
End of explanation
"""
from fretbursts import *
sns = init_notebook()
import os
import pandas as pd
from IPython.display import display, Math
import lmfit
print('lmfit version:', lmfit._... |
arcyfelix/Courses | 17-09-17-Python-for-Financial-Analysis-and-Algorithmic-Trading/02-NumPy/1-NumPy-Arrays.ipynb | apache-2.0 | import numpy as np
"""
Explanation: <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a>
<center>Copyright Pierian Data 2017</center>
<center>For more information, visit us at www.pieriandata.com</center>
NumPy
NumPy (or Numpy) is a Linear Algebra Library for Python, the reason it is so im... |
evanmiltenburg/python-for-text-analysis | Assignments-colab/ASSIGNMENT_RESIT_A.ipynb | apache-2.0 | %%capture
!wget https://github.com/cltl/python-for-text-analysis/raw/master/zips/Data.zip
!wget https://github.com/cltl/python-for-text-analysis/raw/master/zips/images.zip
!wget https://github.com/cltl/python-for-text-analysis/raw/master/zips/Extra_Material.zip
!unzip Data.zip -d ../
!unzip images.zip -d ./
!unzip Ext... |
pauliacomi/pyGAPS | docs/examples/initial_enthalpy.ipynb | mit | # import isotherms
%run import.ipynb
# import the characterisation module
import pygaps.characterisation as pgc
"""
Explanation: Initial enthalpy calculations and enthalpy modelling
Experimentally, the enthalpy of adsorption can be obtained either indirectly,
through the isosteric enthalpy method, or directly, using ... |
AmberJBlue/aima-python | mdp.ipynb | mit | from mdp import MDP, GridMDP, sequential_decision_environment, value_iteration
"""
Explanation: Markov decision processes (MDPs)
This IPy notebook acts as supporting material for topics covered in Chapter 17 Making Complex Decisions of the book Artificial Intelligence: A Modern Approach. We makes use of the implementa... |
tpin3694/tpin3694.github.io | python/iterating_over_dictionary_keys.ipynb | mit | Officers = {'Michael Mulligan': 'Red Army',
'Steven Johnson': 'Blue Army',
'Jessica Billars': 'Green Army',
'Sodoni Dogla': 'Purple Army',
'Chris Jefferson': 'Orange Army'}
Officers
"""
Explanation: Title: Iterating Over Dictionary Keys
Slug: iterating_over_dictionary_... |
martinjrobins/hobo | examples/plotting/mcmc-histogram-plots.ipynb | bsd-3-clause | import pints
import pints.toy as toy
import numpy as np
import matplotlib.pyplot as plt
# Load a forward model
model = toy.LogisticModel()
# Create some toy data
real_parameters = [0.015, 500] # growth rate, carrying capacity
times = np.linspace(0, 1000, 100)
org_values = model.simulate(real_parameters, times)
# Ad... |
johnpfay/environ859 | 07_DataWrangling/Geopandas/CreateStatePSUT.ipynb | gpl-3.0 | #Import modules
import sys, os
import pandas as pd
from openpyxl import load_workbook
"""
Explanation: Create State Physical Supply Usage Table (PSUT)
Uses values in the WaterBalanceData.csv file to populate values in the StatePSUT.xlsx file
Requires the openyxl module: https://openpyxl.readthedocs.io/en/default/
End ... |
tleonhardt/LearningCython | Learning_Cython_video/Chapter11/dates/dateobject.ipynb | mit | import numpy as np
import pandas as pd
def make_sample_data(size):
d = dict(
# Years: 1980 - 2015
year=np.random.randint(1980, 2016, int(size)),
# Months 1 - 12
month=np.random.randint(1, 13, int(size)),
# Day number: 1 - 28
day=np.random.randint(1, 28, int(size)),
... |
teuben/pitp2016 | notebooks/python-basic.ipynb | gpl-3.0 | # setting a variable in python uses dynamic typing
a = 1.23
# in this cell, several python commands can be given. Execute this cell with "SHIFT-ENTER"
# although just writing the variable will show it's value, but this is not the recommended
# way, because per cell only the last one will be printed and stored in t... |
3DGenomes/tadbit | doc/source/nbpictures/tutorial_10-Modeling_parameters_optimization.ipynb | gpl-3.0 | from pytadbit import load_chromosome
from pytadbit.parsers.hic_parser import load_hic_data_from_bam
crm = load_chromosome('results/fragment/chr3.tdb')
B, PSC = crm.experiments
B, PSC
"""
Explanation: Experimental data assessment and model parameters optimisation
Data preparation
The first step to generate three-dim... |
diegocavalca/Studies | deep-learnining-specialization/4. Convolutional Neural Networks/resources/Keras - Tutorial - Happy House v1.ipynb | cc0-1.0 | import numpy as np
from keras import layers
from keras import optimizers
from keras.layers import Input, Dense, Activation, ZeroPadding2D, BatchNormalization, Flatten, Conv2D
from keras.layers import AveragePooling2D, MaxPooling2D, Dropout, GlobalMaxPooling2D, GlobalAveragePooling2D
from keras.models import Model
from ... |
AutuanLiu/Python | fastai_notes/LinearAlgebra/speech04.ipynb | mit | #@title Power iteration
import numpy as np
def power_iteration(A, num_simulations):
# Ideally choose a random vector
# To decrease the chance that our vector
# Is orthogonal to the eigenvector
b_k = np.random.rand(A.shape[0])
for _ in range(num_simulations):
# calculate the matrix-by-vecto... |
frazer-lab/cardips-ipsc-eqtl | notebooks/eQTL Input.ipynb | mit | import copy
import cPickle
import glob
import gzip
import os
import random
import shutil
import subprocess
import cdpybio as cpb
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import peer
import pybedtools as pbt
import scipy.stats as stats
import seaborn as sns
import statsmodels.api as sm
imp... |
sueiras/training | sklearn/03 - Control overfit and hyperparameter optimization - SOLVED.ipynb | gpl-3.0 | from __future__ import print_function
from sklearn import __version__ as sklearn_version
print('Sklearn version:', sklearn_version)
"""
Explanation: Sklearn control overfit example
- Use the California house database to show how to control overfit tuning the model parameters
End of explanation
"""
from sklearn impo... |
mintcloud/deep-learning | batch-norm/Batch_Normalization_Lesson.ipynb | mit | # Import necessary packages
import tensorflow as tf
import tqdm
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
# Import MNIST data so we have something for our experiments
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
"... |
ComputationalPhysics2015-IPM/FiniteDifferences-PartialDifferentialEquations | PDE.ipynb | gpl-2.0 | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: PDE
We are going to solve this equtation:
$\frac{\partial u}{\partial t} = -v \frac{\partial u}{\partial x}$
End of explanation
"""
Nx, Nt = 200, 1000
v = 1
dt = 0.02
dx = 0.1
delta = 0.5 * v * dt / dx
u = np.zeros((Nt,Nx))
#u[... |
dcavar/python-tutorial-for-ipython | notebooks/Python Clustering with Scikit-learn.ipynb | apache-2.0 | import numpy
X = numpy.array([[1, 2], [1, 4], [1, 0], [4, 2], [4, 4], [4, 0]])
"""
Explanation: Python Clustering with Scikit-learn
(C) 2017-2019 by Damir Cavar
Download: This and various other Jupyter notebooks are available from my GitHub repo.
License: Creative Commons Attribution-ShareAlike 4.0 International Lice... |
tensorflow/docs | site/en/r1/tutorials/eager/custom_training_walkthrough.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... |
bluthen/starsynctrackers | docs/error_analysis/Error Analysis.ipynb | lgpl-2.1 | import math
sigma_err = 20.0
t = 10
sigma = 0.0
theta = 3.81*sigma_err/(t*math.cos(sigma))
print "%f'" % (theta,)
print "%f deg" % (theta/60.)
"""
Explanation: Star tracker error Analysis
We are going to go for a goal of using a 100mm lens exposing for 10 minutes with a DSLR.
Per Howard's Astronomical Adventures fiel... |
turbomanage/training-data-analyst | courses/machine_learning/asl/open_project/class_imbalance_weighted_loss_function/tf_class_imbalance_cost_sensitive_loss.ipynb | apache-2.0 | import shutil
import numpy as np
import pandas as pd
import tensorflow as tf
print(tf.__version__)
"""
Explanation: Imbalanced Weighted Binary Classification
End of explanation
"""
df = pd.read_csv(filepath_or_buffer = "UCI_Credit_Card.csv")
df.head()
df.describe()
FEATURE_NAMES = list(df.columns)
NUMERIC_FEATURE_... |
tensorflow/docs-l10n | site/ja/model_optimization/guide/clustering/clustering_example.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... |
piskvorky/gensim | docs/src/auto_examples/howtos/run_compare_lda.ipynb | lgpl-2.1 | # sphinx_gallery_thumbnail_number = 2
import logging
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
"""
Explanation: How to Compare LDA Models
Demonstrates how you can visualize and compare trained topic models.
End of explanation
"""
from string import punctuation
from n... |
darkomen/TFG | medidas/22072015/.ipynb_checkpoints/Untitled-checkpoint.ipynb | cc0-1.0 | #Importamos las librerías utilizadas
import numpy as np
import pandas as pd
import seaborn as sns
#Mostramos las versiones usadas de cada librerías
print ("Numpy v{}".format(np.__version__))
print ("Pandas v{}".format(pd.__version__))
print ("Seaborn v{}".format(sns.__version__))
#Abrimos el fichero csv con los datos... |
spectralDNS/shenfun | binder/Poisson2D.ipynb | bsd-2-clause | from shenfun import *
import matplotlib.pyplot as plt
N = (16, 12)
BX = FunctionSpace(N[0], 'L', bc=(0, 0))
BY = FunctionSpace(N[1], 'F')
V = TensorProductSpace(comm, (BX, BY))
v = TestFunction(V)
u = TrialFunction(V)
A = inner(grad(u), grad(v))
print(A)
"""
Explanation: Demo - Poisson equation 2D
Solve Poisson's e... |
apryor6/apryor6.github.io | visualizations/plotly/.ipynb_checkpoints/line-checkpoint.ipynb | mit | import plotly.plotly as py
import cufflinks as cf
import pandas as pd
import numpy as np
import plotly.graph_objs as go
%matplotlib inline
df = cf.datagen.lines()
df.head()
"""
Explanation: Line Chart
Interactive line charts with plotly and cufflinks
dataset: cufflinks.datagen.lines()
End of explanation
"""
py.ip... |
mne-tools/mne-tools.github.io | 0.23/_downloads/5ac2a3ff8baa6aba4bf6dd1d047703e2/spm_faces_dataset_sgskip.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Denis Engemann <denis.engemann@gmail.com>
#
# License: BSD (3-clause)
import matplotlib.pyplot as plt
import mne
from mne.datasets import spm_face
from mne.preprocessing import ICA, create_eog_epochs
from mne import io, combine_evoked
from mne.mi... |
dsacademybr/PythonFundamentos | Cap14/DSA-Python-Cap14-03-WebScraping-Pandas.ipynb | gpl-3.0 | # Versão da Linguagem Python
from platform import python_version
print('Versão da Linguagem Python Usada Neste Jupyter Notebook:', python_version())
"""
Explanation: <font color='blue'>Data Science Academy - Python Fundamentos - Capítulo 14</font>
Download: http://github.com/dsacademybr
End of explanation
"""
!pip i... |
ES-DOC/esdoc-jupyterhub | notebooks/cnrm-cerfacs/cmip6/models/sandbox-2/aerosol.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'cnrm-cerfacs', 'sandbox-2', 'aerosol')
"""
Explanation: ES-DOC CMIP6 Model Properties - Aerosol
MIP Era: CMIP6
Institute: CNRM-CERFACS
Source ID: SANDBOX-2
Topic: Aerosol
Sub-Topics: Transport, ... |
ksooklall/deep_learning_foundation | tv-script-generation/dlnd_tv_script_generation.ipynb | mit | """
DON'T MODIFY ANYTHING IN THIS CELL
"""
import helper
data_dir = './data/simpsons/moes_tavern_lines.txt'
text = helper.load_data(data_dir)
# Ignore notice, since we don't use it for analysing the data
text = text[81:]
text[:100]
"""
Explanation: TV Script Generation
In this project, you'll generate your own Simps... |
AEW2015/PYNQ_PR_Overlay | Pynq-Z1/notebooks/examples/pmod_tmp2.ipynb | bsd-3-clause | from pynq import Overlay
Overlay("base.bit").download()
from pynq.iop import Pmod_TMP2
from pynq.iop import PMODB
mytmp = Pmod_TMP2(PMODB)
temperature = mytmp.read()
print(str(temperature) + " C")
"""
Explanation: PmodTMP2 Sensor example
In this example, the Pmod temperature sensor is initialized and set to log a r... |
tkzeng/molecular-design-toolkit | moldesign/_notebooks/Tutorial 3. Quantum Chemistry.ipynb | apache-2.0 | %matplotlib inline
import numpy as np
from matplotlib.pylab import *
try: import seaborn #optional, makes plots look nicer
except ImportError: pass
import moldesign as mdt
from moldesign import units as u
"""
Explanation: <span style="float:right"><a href="http://moldesign.bionano.autodesk.com/" target="_blank" titl... |
GeoNet/fits | examples/Notebook_3.ipynb | apache-2.0 | import pandas as pd
import matplotlib.pyplot as plt
import datetime
import numpy as np
# Create list of all typeIDs available in the FITS database
all_type_URL = 'https://fits.geonet.org.nz/type'
all_types = pd.read_json(all_type_URL).iloc[:,0]
all_typeIDs= []
for row in all_types:
all_typeIDs.append(row[... |
tensorflow/probability | tensorflow_probability/examples/jupyter_notebooks/Optimizers_in_TensorFlow_Probability.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... |
NervanaSystems/neon_course | 04b Writing a custom layer.ipynb | apache-2.0 | import neon
# use a GPU backend
from neon.backends import gen_backend
be = gen_backend('gpu', batch_size=128)
# load data
mnist = MNIST(path='data/')
train_set = mnist.train_iter
test_set = mnist.valid_iter
"""
Explanation: Building a new layer
This notebook will guide you through implementing a custom layer in neon... |
mayankjohri/LetsExplorePython | Section 2 - Advance Python/Chapter S2.01 - Functional Programming/02_03_iter.ipynb | gpl-3.0 | class MyIter(object):
def __init__(self, lst):
self.lst = lst
self.i = 0
def __iter__(self):
self.i = 0
return self
def __next__(self):
if self.i < len(self.lst):
nxt = self.lst[self.i]
self.i +=1
return nxt
else:
... |
JonathanRaiman/theano_lstm | Tutorial.ipynb | bsd-3-clause | ## Fake dataset:
class Sampler:
def __init__(self, prob_table):
total_prob = 0.0
if type(prob_table) is dict:
for key, value in prob_table.items():
total_prob += value
elif type(prob_table) is list:
prob_table_gen = {}
for key in prob_tabl... |
phanrahan/magmathon | notebooks/tutorial/icestick/Counter.ipynb | mit | import magma as m
m.set_mantle_target("ice40")
"""
Explanation: Counter
End of explanation
"""
from mantle import Register
class SimpleCounter4(m.Circuit):
IO = ["O", m.Out(m.UInt[4])] + m.ClockInterface()
@classmethod
def definition(io):
reg4 = Register(4, _type=m.UInt)
io.O <= reg4(reg... |
turbomanage/training-data-analyst | blogs/babyweight/train_deploy.ipynb | apache-2.0 | pip install --user apache-beam[gcp]==2.16.0
"""
Explanation: <h1> Structured data prediction using Cloud ML Engine </h1>
This notebook illustrates:
<ol>
<li> Creating datasets for Machine Learning using Dataflow
<li> Creating a model using the high-level Estimator API
<li> Training on Cloud ML Engine
<li> Deploying ... |
ppyht2/tf-exercise | 011. Word to Vector/word2vec.ipynb | gpl-3.0 | import numpy as np
import os
import tensorflow as tf
import matplotlib.pyplot as plt
import zipfile
from six.moves.urllib.request import urlretrieve
import collections
import random
import math
from sklearn.manifold import TSNE
import matplotlib.pylab
% matplotlib inline
plt.style.use('ggplot')
"""
Explanation: ... |
spacedrabbit/PythonBootcamp | Errors and Exceptions Homework.ipynb | mit | for i in ['a','b','c']:
try:
result = i**2
except TypeError:
print("Type error attempting to run on {i}".format(i=i))
else:
print result
"""
Explanation: Errors and Exceptions Homework -
Problem 1
Handle the exception thrown by the code below by using try and except blocks.
End of ... |
ngcm/training-public | FEEG6016 Simulation and Modelling/05-Agents-Lab-1.ipynb | mit | from IPython.core.display import HTML
css_file = 'https://raw.githubusercontent.com/ngcm/training-public/master/ipython_notebook_styles/ngcmstyle.css'
HTML(url=css_file)
"""
Explanation: Agents: Lab 1
End of explanation
"""
%matplotlib inline
import numpy
from matplotlib import pyplot, animation
from matplotlib imp... |
jhprinz/openpathsampling | examples/toy_model_mistis/toy_mistis_2_flux.ipynb | lgpl-2.1 | old = paths.AnalysisStorage("mistis.nc")
engine = old.engines[0]
network = old.networks[0]
states = set(network.initial_states + network.final_states)
"""
Explanation: As always, we load things from files so we don't have to set them up again.
End of explanation
"""
flux_pairs = [(trans.stateA, trans.interfaces[0]) ... |
spatialmodel/inmap | website/static/blog/2019-04-20-sr/sr_example.ipynb | gpl-3.0 | from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
"""
Explanation: Working with source-receptor matrices using https://inmap.run and GeoPandas in Python
Air pollution source-receptor matrices give relationships between emissions at sourc... |
gaufung/Data_Analytics_Learning_Note | Data_Analytics_in_Action/scikit_learning.ipynb | mit | from sklearn import datasets
iris = datasets.load_iris()
# 取前10行数据
iris.data[0:10]
"""
Explanation: scikit-learn 机器学习
1 数据集
Iris (鸢尾花)数据集是安德森通过测量鸢尾花花朵的各个部分得到的,该数据集采用了三种不同的鸢尾花(山鸢尾,变色鸢尾和维吉尼亚鸢尾),分别表示了花朵的萼片和花瓣的长宽。scikit-learn 库中数据集为$150 \times 4$数组。
萼片长度 | 萼片宽度 | 花瓣长度 | 花瓣宽度
--- | --- | --- | ---
5.1 | 3.5 | 1.4 | 0.2
4... |
nbortolotti/tensorflow-code-experiences | colaboratory/Experience_with_iris_dataset_using_tf_data_&_tf_keras_&_tensorflow.ipynb | apache-2.0 | #%tensorflow_version 2.x
"""
Explanation: <a href="https://colab.research.google.com/github/nbortolotti/tensorflow-experiences/blob/master/colaboratory/Experience_with_iris_dataset_using_tf_data_%26_tf_keras_%26_tensorflow.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt=... |
DJCordhose/ai | notebooks/2019_tf/embeddings-viz.ipynb | mit | import tensorflow as tf
tf.logging.set_verbosity(tf.logging.ERROR)
print(tf.__version__)
"""
Explanation: <a href="https://colab.research.google.com/github/DJCordhose/ai/blob/master/notebooks/2019_tf/embeddings-viz.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In... |
mmaelicke/felis_python1 | felis_python1/lectures/06_Classes.ipynb | mit | f = open('afile.txt', 'w')
print(f)
print(f.__class__)
print(type(f))
print(f.readline)
f.close()
"""
Explanation: Classes
One of the main features in the Python programming language is its object oriented structure. Thus, beside procedual programming (scripting) it's also possible to use Python for object oriented Pr... |
seanjh/data-analysis-CM | BeerDataAnalysis.ipynb | mit | import os
from IPython.display import HTML
from IPython.display import display, Image
from PIL import Image as PILImage
def files_at_relpath(rel_path):
return [os.path.join(rel_path, f) for f in os.listdir(rel_path)]
def display_images(img_path, **kwargs):
scale = kwargs.get('scale')
if scale is not Non... |
bgroveben/python3_machine_learning_projects | learn_kaggle/pandas/creating_reading_writing_reference.ipynb | mit | import pandas as pd
"""
Explanation: Creating, reading, and writing reference
This is the reference component to the "Creating, reading, and writing" section of the tutorial.
For the workbook section, click here.
The very first step in any data analytics project will probably be reading the data out of a file somewhe... |
quantopian/research_public | notebooks/data/eventvestor.dividends/notebook.ipynb | apache-2.0 | # import the dataset
# from quantopian.interactive.data.eventvestor import dividends as dataset
# or if you want to import the free dataset, use:
from quantopian.interactive.data.eventvestor import dividends_free as dataset
# import data operations
from odo import odo
# import other libraries we will use
import panda... |
BinRoot/TensorFlow-Book | ch05_clustering/Concept03_som.ipynb | mit | %matplotlib inline
import tensorflow as tf
import numpy as np
"""
Explanation: Ch 05: Concept 03
Self-organizing map
Import TensorFlow and NumPy:
End of explanation
"""
class SOM:
def __init__(self, width, height, dim):
self.num_iters = 100
self.width = width
self.height = height
... |
Bookworm-project/Bookworm-MARC | Hathi Catalog Builder.ipynb | mit | %load_ext autoreload
%autoreload 2
import pymarc
import random
from bookwormMARC.bookwormMARC import BRecord
from bookwormMARC.bookwormMARC import parse_record
from bookwormMARC.hathi_methods import All_Hathi
from bookwormMARC.bookwormMARC import LCCallNumber
import bz2
import bookwormMARC
import sys
import os
from co... |
catalyst-cooperative/pudl | test/validate/notebooks/validate_mcoe.ipynb | mit | %load_ext autoreload
%autoreload 2
import sys
import pandas as pd
import numpy as np
import sqlalchemy as sa
import pudl
import warnings
import logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
handler = logging.StreamHandler(stream=sys.stdout)
formatter = logging.Formatter('%(message)s')
handler.set... |
mtakeo/Portfolio | Text Mining with Twitter API.ipynb | mit | #Import the necessary methods from tweepy library
from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
from tweepy import Stream
access_token = "Access Token"
access_token_secret = "Access Token Secret"
consumer_key = "Consumer Key"
consumer_secret = "Consumer Secret"
class StdOutListener(Str... |
HsKA-ThermalFluiddynamics/NSS-1 | 4_5-Potentialtheorie_Quell-Panel-Verfahren.ipynb | mit | import math
import numpy as np
from scipy import integrate
import matplotlib.pyplot as plt
%matplotlib inline
class Panel:
# Initialisiert ein Objekt der Klasse Panel
def __init__(self, ax, ay, bx, by, lamb=0):
# Panel-Stärke lambda
self.lamb = lamb
# Koordinaten der beide... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.