repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
aaossa/Dear-Notebooks | GitHub/RepositoryLabels_ES.ipynb | gpl-3.0 | # Primero tenemos que importar las librerias que usaremos para recopilar datos
import base64
import json
import requests
# Si queremos imprimir los json de respuesta
# de una forma mas agradable a la vista podemos usar
def print_pretty(jsonstring, indent=4, sort_keys=False):
print(json.dumps(jsonstring, indent=in... |
QuantStack/quantstack-talks | 2020-01-09-PyData-Heidelberg/examples/gridlayout.ipynb | bsd-3-clause | # Utils widgets
from ipywidgets import Button, Layout, jslink, IntText, IntSlider
def create_expanded_button(description, button_style):
return Button(description=description, button_style=button_style,
layout=Layout(height='auto', width='auto'))
top_left_button = create_expanded_button("Top le... |
sdpython/ensae_teaching_cs | _doc/notebooks/1a/exercice_xn.ipynb | mit | from jyquickhelper import add_notebook_menu
add_notebook_menu()
"""
Explanation: 1A.algo - Calculer x**n le plus rapidement possible
C'est un exercice courant lors des entretiens d'embauche. Il faut savoir ce qu'est la dichotomie et la notation binaire d'un nombre.
End of explanation
"""
def puissance2k(x,k):
wh... |
e-sr/SDWirkungNi | DSP/SpektrenBerechnen.ipynb | cc0-1.0 | %reset -f
%matplotlib notebook
%load_ext autoreload
%autoreload 1
%aimport functions
import numpy as np
import copy
import acoustics
from functions import *
import matplotlib.pyplot as plt
import matplotlib as mpl
import seaborn as sns
mpl.rcParams['lines.linewidth']=0.5
# uncomment next line to connect a qtconsole to ... |
turbomanage/training-data-analyst | courses/machine_learning/tensorflow/d_traineval.ipynb | apache-2.0 | import tensorflow as tf
import numpy as np
import shutil
print(tf.__version__)
"""
Explanation: <h1> 2d. Distributed training and monitoring </h1>
In this notebook, we refactor to call train_and_evaluate instead of hand-coding our ML pipeline. This allows us to carry out evaluation as part of our training loop instea... |
M-R-Houghton/euroscipy_2015 | scikit_image/lectures/adv1-lesion-quantification.ipynb | mit | 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="../images/zebrafish-spin... |
d00d/quantNotebooks | Notebooks/quantopian_research_public/notebooks/lectures/Violations_of_Regression_Models/notebook.ipynb | unlicense | # Import all the libraries we'll be using
import numpy as np
import statsmodels.api as sm
from statsmodels import regression, stats
import statsmodels
import matplotlib.pyplot as plt
residuals = np.random.normal(0, 1, 100)
_, pvalue, _, _ = statsmodels.stats.stattools.jarque_bera(residuals)
print pvalue
residuals = ... |
hanhanwu/Hanhan_Data_Science_Practice | Applied_Statistics/Learning_Notes/bayesian4fun/chapter3_expt2.ipynb | mit | figsize(12.5, 4)
data = np.loadtxt("../data/mixture_data.csv", delimiter=",")
plt.hist(data, bins=20, color="g", histtype="stepfilled", alpha=0.8)
plt.title("The Distribution of Mixture_Data Dataset")
plt.ylim([0, None]);
print(data[:10], "...")
"""
Explanation: Step 1 - Observe the Real Data
The Data below is the r... |
hackthemarket/pystrat | DEN1_datasim.ipynb | gpl-3.0 | # imports
import pandas as pd
import numpy as np
from scipy import stats
import sklearn
from sklearn import preprocessing as pp
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib import interactive
import sys
import tensorflow as tf
import time
import os
import os.path
import pickle
import loggi... |
mne-tools/mne-tools.github.io | 0.22/_downloads/32ac0c2b9b302521df6384e100fdf1fd/plot_eeglab_head_sphere.ipynb | bsd-3-clause | # Authors: Mikołaj Magnuski <mmagnuski@swps.edu.pl>
#
# License: BSD (3-clause)
import numpy as np
from matplotlib import pyplot as plt
import mne
print(__doc__)
"""
Explanation: How to plot topomaps the way EEGLAB does
If you have previous EEGLAB experience you may have noticed that topomaps
(topoplots) generated ... |
SchwaZhao/networkproject1 | 00_Introduction_to_Jupyter_and_Python.ipynb | mit | # press Shit+Enter to execute this cell
print('This is a cell containing python code')
#we can also make figures
import matplotlib.pyplot as plt
import numpy as np
% matplotlib inline
x = np.linspace(-np.pi, np.pi, 100)
plt.plot(x, np.sin(x))
# Use `Tab` for completion and `Shift-Tab` for code info
"""
Explanation:... |
physion/ovation-python | examples/attributes-and-annotations.ipynb | gpl-3.0 | from ovation.session import connect
from pprint import pprint
from getpass import getpass
"""
Explanation: Attributes and Annotations
To run this example, you'll need the Ovation Python API. Install with pip:
pip install ovation
End of explanation
"""
session = connect(input('Email: '), org=int(input("Organization ... |
eyaltrabelsi/my-notebooks | Lectures/search_in_practice-approximate_nearest_neighbors/Approximate Nearest Neighbors.ipynb | mit | # Additional Resources 📚
"""
Explanation: Search In Practice- Approximate Nearest Neighbors 🔎
End of explanation
"""
import pickle
import faiss
def load_data():
with open('movies.pickle', 'rb') as f:
data = pickle.load(f)
return data
data = load_data()
vectors = data["vector"]
names = data["name"... |
hujc91/uw-ffpg | foamTools/Examples.ipynb | mit | import numpy as np
import foamTools as ft
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Load libraries
End of explanation
"""
ccx = ft.loadScalar('example-files/ccx')
ccy = ft.loadScalar('example-files/ccy')
"""
Explanation: Load cell positions from OpenFOAM ccx, ccy, ccz (generated from OpenF... |
biorack/metatlas | notebooks/reference/Targeted_hybrid.ipynb | bsd-3-clause | # pylint: disable=invalid-name,missing-module-docstring
# full name of input atlas to load from database or name to give atlas loaded from CSV file
source_atlas = None
# full path to atlas CSV file or None if loading an atlas from the database
csv_atlas_file_name = None
# one of 'positive' or 'negative'
polarity = "... |
davidbrough1/pymks | notebooks/localization_cahn_hilliard_2D.ipynb | mit | import pymks
%matplotlib inline
%load_ext autoreload
%autoreload 2
import numpy as np
import matplotlib.pyplot as plt
"""
Explanation: Cahn-Hilliard Example
This example demonstrates how to use PyMKS to solve the Cahn-Hilliard equation. The first section provides some background information about the Cahn-Hilliard ... |
mne-tools/mne-tools.github.io | 0.20/_downloads/a68128275cc59b074b8c9782296d1d4a/decoding_rsa.ipynb | bsd-3-clause | # Authors: Jean-Remi King <jeanremi.king@gmail.com>
# Jaakko Leppakangas <jaeilepp@student.jyu.fi>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License: BSD (3-clause)
import os.path as op
import numpy as np
from pandas import read_csv
import matplotlib.pyplot as plt
from sklearn.model_sel... |
gojomo/gensim | docs/src/auto_examples/core/run_core_concepts.ipynb | lgpl-2.1 | import pprint
"""
Explanation: Core Concepts
This tutorial introduces Documents, Corpora, Vectors and Models: the basic concepts and terms needed to understand and use gensim.
End of explanation
"""
document = "Human machine interface for lab abc computer applications"
"""
Explanation: The core concepts of gensim a... |
tensorflow/hub | examples/colab/tf2_semantic_approximate_nearest_neighbors.ipynb | apache-2.0 | # Copyright 2018 The TensorFlow Hub Authors. All Rights Reserved.
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
GoogleCloudPlatform/training-data-analyst | bootcamps/imagereco/fashion_models.ipynb | apache-2.0 | import os
PROJECT = 'my-project-id' # REPLACE WITH YOUR PROJECT ID
BUCKET = 'my-bucket-name' # REPLACE WITH YOUR BUCKET NAME
REGION = 'us-central1' # REPLACE WITH YOUR BUCKET REGION e.g. us-central1
MODEL_TYPE='dnn' # 'dnn' or 'cnn'
# do not change these
os.environ['PROJECT'] = PROJECT
os.environ['BUCKET'] = BUCKET
... |
greg-ashby/deep-learning-nanodegree | 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... |
RaRe-Technologies/gensim | docs/src/auto_examples/tutorials/run_scm.ipynb | lgpl-2.1 | import matplotlib.pyplot as plt
import matplotlib.image as mpimg
img = mpimg.imread('scm-hello.png')
imgplot = plt.imshow(img)
plt.axis('off')
plt.show()
"""
Explanation: Soft Cosine Measure
Demonstrates using Gensim's implemenation of the SCM.
Soft Cosine Measure (SCM) is a promising new tool in machine learning that... |
atulsingh0/MachineLearning | scikit-learn/seaborn_plotting_01.ipynb | gpl-3.0 | names = [
'mpg'
, 'cylinders'
, 'displacement'
, 'horsepower'
, 'weight'
, 'acceleration'
, 'model_year'
, 'origin'
, 'car_name'
]
# reading the file and assigning the header
df = pd.read_csv("http://archive.ics.uci.edu/ml/machine-learning-databases/auto-mpg/auto-mpg.data... |
Weenkus/Machine-Learning-University-of-Washington | Regression/examples/numpy-tutorial.ipynb | mit | import numpy as np # importing this way allows us to refer to numpy as np
"""
Explanation: Numpy Tutorial
Numpy is a computational library for Python that is optimized for operations on multi-dimensional arrays. In this notebook we will use numpy to work with 1-d arrays (often called vectors) and 2-d arrays (often cal... |
TareasJF/INF393 | T3/Pregunta2.ipynb | mit | import pandas as pd
import numpy as np
dftrain = pd.read_csv('data/bike_sharing_train.csv')
dfval = pd.read_csv('data/bike_sharing_val.csv')
dftest = pd.read_csv('data/bike_sharing_test.csv')
ntrain = len(dftrain)
nval = len(dftrain) + len(dfval)
df = pd.concat([dftrain,dfval,dftest])
print('\nSummary - dataframe com... |
probml/pyprobml | notebooks/book2/28/bernoulli_hmm_example.ipynb | mit |
!pip install -qq git+git://github.com/lindermanlab/ssm-jax-refactor.git
try:
import ssm
except ModuleNotFoundError:
%pip install -qq ssm
import ssm
"""
Explanation: <a href="https://colab.research.google.com/github/probml/probml-notebooks/blob/main/notebooks/bernoulli_hmm_example.ipynb" target="_parent"... |
fuller-inc/bqx | example/get_started.ipynb | bsd-3-clause | from bqx.query import Query as Q
from bqx.parts import Table as T, Column as C
from bqx.func import SUM
"""
Explanation: Get Started
Here are some sample queries. See what BQX can do.
Initialization
End of explanation
"""
q = Q().SELECT('name').FROM('sample_table')
print(q.getq())
"""
Explanation: 1. Simple example... |
gtrichards/PHYS_T480 | NeuralNetworks.ipynb | mit | %matplotlib inline
import numpy as np
from matplotlib import pyplot as plt
from sklearn.datasets import load_boston
from sklearn.model_selection import train_test_split
boston = load_boston()
#print boston.DESCR
X = boston.data
y = boston.target
Xtrain, Xtest, ytrain, ytest = train_test_split(X, y, test_size=0.25, r... |
dwhswenson/openpathsampling | examples/toy_model_mstis/toy_mstis_A3_new_analysis.ipynb | mit | # if our large test file is available, use it. Otherwise, use file generated from toy_mstis_2_run.ipynb
from __future__ import print_function
import os
test_file = "../toy_mstis_1k_OPS1.nc"
filename = "mstis.nc" # this requires newer functionality that in the standard tests
#filename = test_file if os.path.isfile(test... |
jskDr/keraspp | RL/CH 10.6_PyTorch_PG.ipynb | mit | %matplotlib inline
"""
Explanation: 10.6 파이토치 - Cartpole을 다루는 PG 구현
정책 경사 (Polocy Gradient) 방법은 강화학습의 방법들 중에 정책 기반 방법 중의 기본적인 한 가지이다.
10.6.1 라이브러리 불러들이기
(1) 코드에 필요한 라이브러리를 불러온다.
라이브러리를 불러오기전에 그래픽을 주피터 노트북에서 보이기 위한 주피터 확장자를 불러온다.
End of explanation
"""
from IPython.display import clear_output
import random
from ite... |
econandrew/povcalnetjson | notebooks/2-empirical-piecewise.ipynb | mit | ##########################################
plt.rcParams["figure.figsize"] = (12,3.5)
fig, ax = plt.subplots(1, 3)
##########################################
# Observed points of the Lorenz curve and population parameters
p = [0.0, 0.4, 0.8, 1.0]
L = [0.0, 0.16, 0.64, 1.0]
mean = 10.0
population = 100
# Grids for pl... |
bblais/Classy | examples/Example Naive Bayes.ipynb | mit | %pylab inline
from classy import *
"""
Explanation: Example for Naive Bayes using the Iris Data
First we need the standard import
End of explanation
"""
data=load_excel('data/iris.xls',verbose=True)
"""
Explanation: Load the Data
End of explanation
"""
print((data.vectors.shape))
print((data.targets))
print((data... |
cathywu/flow | tutorials/tutorial03_rllib.ipynb | mit | import flow.scenarios as scenarios
print(scenarios.__all__)
"""
Explanation: Tutorial 03: Running RLlib Experiments
This tutorial walks you through the process of running traffic simulations in Flow with trainable RLlib-powered agents. Autonomous agents will learn to maximize a certain reward over the rollouts, using... |
tum-pbs/PhiFlow | demos/Planets_Tutorial.ipynb | mit | # !pip install phiflow
"""
Explanation: Solar System
This demo simulates the gravitational pull between multiple massive bodies.
We will use Euler steps in time which do not preserve energy.
Φ-Flow
Documentation
API
Demos
End of explanation
"""
from phi.flow ... |
dtamayo/MachineLearning | Day2/Titanic_RF_advanced.ipynb | gpl-3.0 | print('Importing libraries...')
import numpy as np
import pandas as pd
from sklearn import cross_validation as cv
from sklearn.cross_validation import KFold
from sklearn.ensemble import RandomForestClassifier
print('Fetching the training and test datasets...')
train = pd.read_csv("data/train.csv", dtype={"Age": np.flo... |
muneebalam/scrapenhl2 | examples/Entry and Exit Comparison.ipynb | mit | from os import listdir, chdir, getcwd
import pandas as pd
from pylab import *
from tqdm import tqdm # progress bar
%matplotlib inline
current_wd = getcwd()
"""
Explanation: Outline
The purpose of this notebook is to calculate zone entry and exit-related data for tracked games, and generate TOI and shot-related data fo... |
CompPhysics/MachineLearning | doc/Programs/ANN/Ann3.ipynb | cc0-1.0 | from IPython.display import YouTubeVideo
YouTubeVideo('5u0jaA3qAGk',width=640,height=360)
"""
Explanation: <p style="text-align: right;"> Nicolas Dronchi </p>
Day 23 Pre-Class assignment: Back propagation
This pre-class assignment finishes out the videos from "Neural Networks Demystified" module. Please watch the vid... |
gprakhar/janCC | Janacare_Habits_dataset_upto-7May2016.ipynb | bsd-3-clause | %reset
# Import the required modules
import pandas as pd
import numpy as np
import scipy as sp
# simple function to read in the user data file.
# the argument parse_dates takes in a list of colums, which are to be parsed as date format
user_data_raw_csv = pd.read_csv("/home/eyebell/local_bin/janacare/janCC/datasets/H... |
pvalienteverde/ElCuadernillo | ElCuadernillo/20160301_TensorFlowGradientDescentWithMomentum/GradientDescentWithMomentPlots.ipynb | mit | import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
import seaborn as sns
sns.set(color_codes=True)
%matplotlib inline
import sys
import time
from IPython.display import Image
sys.path.append('/home/pedro/git/ElCuadernillo/ElCuadernillo/20160301_TensorFlowGradientDescentWithMomentum')
import gr... |
hasadna/knesset-data-pipelines | jupyter-notebooks/committee meeting attendees.ipynb | mit | # Limit processing of protocol parts for development
PROCESS_PARTS_LIMIT = 500
# Enable caching of protocol parts data (not efficient, should only be used for local development with sensible PROCESS_PARTS_LIMIT)
PROCESS_PARTS_CACHE = True
# Filter the meetings to be processed, these kwargs are passed along to DataFlo... |
Aggieyixin/cjc2016 | code/08.analyzing_tianya_thread_network.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
"""
Explanation: 计算传播与统计初步
分析天涯论坛的帖子
王成军
wangchengjun@nju.edu.cn
计算传播网 http://computational-communication.com
End of explanation
"""
import pandas as pd
"""
Explanation:
End of explanation
"""
# Import the Pandas library
import pandas as pd
# Load the trai... |
inakic/matsoft | Uvod.ipynb | unlicense | ls
pwd
%matplotlib inline
%load integral_demo.py
integral_plot(func)
from IPython.display import Image
Image(url='http://python.org/images/python-logo.gif')
from IPython.display import HTML
HTML('<iframe width="560" height="315" src="//www.youtube.com/embed/-SqzarfTqRY" frameborder="0" allowfullscreen></iframe>')... |
NREL/bifacial_radiance | docs/tutorials/3 - Medium Level Example - Single Axis Tracking - hourly.ipynb | bsd-3-clause | import bifacial_radiance
import numpy as np
import os # this operative system to do teh relative-path testfolder for this example.
import pprint # We will be pretty-printing the trackerdictionary throughout to show its structure.
from pathlib import Path
"""
Explanation: 3 - Medium Level Example - 1-Axis tracker by... |
phoebe-project/phoebe2-docs | 2.0/tutorials/grav_redshift.ipynb | gpl-3.0 | !pip install -I "phoebe>=2.0,<2.1"
"""
Explanation: Gravitational Redshift (rv_grav)
Setup
Let's first make sure we have the latest version of PHOEBE 2.0 installed. (You can comment out this line if you don't use pip for your installation or don't want to update to the latest release).
End of explanation
"""
%matplo... |
gfeiden/Notebook | Daily/20150729_small_magnetic_grid.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
"""
Explanation: Young Star Magnetic Models
Convergence of magnetic models is improved with a new treatment of the peak magnetic field strength definition. Previously, it was defined as either $R_{\rm peak} = 0.5R_{\star}$ or $R_{\rm peak} = R_{\rm ... |
hadibakalim/deepLearning | 02.convolutinal_network/image_classification.ipynb | mit | from urllib.request import urlretrieve
from os.path import isfile, isdir
from tqdm import tqdm
import problem_unittests as tests
import tarfile
cifar10_dataset_folder_path = 'cifar-10-batches-py'
# Use Floyd's cifar-10 dataset if present
floyd_cifar10_location = '/input/cifar-10/python.tar.gz'
if isfile(floyd_cifar10... |
sccolbert/talk-2015 | Visualization.ipynb | mit | from IPython.display import display, Image, HTML
from talktools import website, nbviewer
"""
Explanation: Plotting and visualization
End of explanation
"""
%matplotlib inline
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import numpy as np
"""
Explanation: One of the main usage cases for this displ... |
numenta/htmresearch | projects/localization_rnn/1d.ipynb | agpl-3.0 | import torch
def simulate(T, L, nLM=2, vMax=1, aMax=0.25):
a = aMax * (2*torch.rand(T) - 1)
v = vMax - abs((a.cumsum(0) + vMax) % (4*vMax) - 2*vMax)
x = (L*torch.rand(1) + v.cumsum(0)) % L
landmarks = torch.rand(nLM) * L
lmSense = sum(torch.relu(1 - L/2 + abs(L/2 - abs(x-landmarks.unsquee... |
NumCosmo/NumCosmo | notebooks/LRTvsFisher.ipynb | gpl-3.0 | try:
import gi
gi.require_version('NumCosmo', '1.0')
gi.require_version('NumCosmoMath', '1.0')
except:
pass
from gi.repository import GObject
from gi.repository import NumCosmo as Nc
from gi.repository import NumCosmoMath as Ncm
import sys
import math
import numpy as np
import matplotlib.pyplot as plt
%matplo... |
eco32i/biodata | sessions/examples/09 - UTR PCA.ipynb | mit | def parse_barcodes(bcfile, bc_id='BC'):
res = {}
with open(bcfile, 'r') as fi:
for line in fi:
fields = line.strip().split(',')
if fields[0].startswith(bc_id):
res[fields[0]] = fields[1]
return res
def parse_exp_config(expfile, bc_dict):
res = []
fie... |
emiliom/stuff | geopandas_overlays.ipynb | cc0-1.0 | from IPython.core.display import Image
Image(url="http://docs.qgis.org/testing/en/_images/overlay_operations.png")
"""
Explanation: Examples: GeoPandas Overlay Operations
Spatial overlays allow you to compare two GeoDataFrames containing polygon or multipolygon geometries and create a new GeoDataFrame with the new ge... |
alorenzo175/pvlib-python | docs/tutorials/forecast_to_power.ipynb | bsd-3-clause | # built-in python modules
import datetime
import inspect
import os
# scientific python add-ons
import numpy as np
import pandas as pd
# plotting stuff
# first line makes the plots appear in the notebook
%matplotlib inline
import matplotlib.pyplot as plt
import matplotlib as mpl
# finally, we import the pvlib librar... |
jakerylandwilliams/partitioner | partitioner_examples.ipynb | apache-2.0 | from partitioner.tools import partitioner
"""
Explanation: Example usages of the partitioner module
JRW, 4/19/2017
To load the module, run:
End of explanation
"""
pa = partitioner(language = "en", doPOS = True, doLFD = True, q = {"type": 0.77, "POS": 0.71})
print("\n".join(pa.partition("How could something like this... |
lfairchild/PmagPy | data_files/iodp_magic/U999A.ipynb | bsd-3-clause | # import a bunch of packages for use in the notebook
import pmagpy.pmag as pmag # a bunch of PmagPy modules
import pmagpy.pmagplotlib as pmagplotlib
import pmagpy.ipmag as ipmag
import pmagpy.contribution_builder as cb
from pmagpy import convert_2_magic as convert # conversion scripts for many lab formats
from pmagpy i... |
PyDataBH/data-scraping-letrasmus | .ipynb_checkpoints/Raspando dados na Web com Requests e BeautifulSoup-checkpoint.ipynb | mit | # Importando a biblioteca Requests
import requests
url = "https://www.letras.mus.br/john-mayer/420168/"
r = requests.get(url)
type(r)
"""
Explanation: John Mayer - Gravity
John Clayton Mayer é um cantor, compositor e produtor musical norte-americano. Nascido em Bridgeport, no estado de Connecticut, ele estudou na B... |
sdss/marvin | docs/sphinx/tutorials/notebooks/lean-tutorial.ipynb | bsd-3-clause | from marvin.tools.query import doQuery
q, r = doQuery(search_filter='nsa.sersic_logmass >= 10 and nsa.sersic_logmass <= 11', limit=3)
"""
Explanation: $$
\def\CC{\bf C}
\def\QQ{\bf Q}
\def\RR{\bf R}
\def\ZZ{\bf Z}
\def\NN{\bf N}
$$
Lean Tutorial
This tutorial runs through all of the steps for doing a project with
Marv... |
tensorflow/tcav | Run_TCAV_on_colab.ipynb | apache-2.0 | %load_ext autoreload
%autoreload 2
import tcav.activation_generator as act_gen
import tcav.cav as cav
import tcav.model as model
import tcav.tcav as tcav
import tcav.utils as utils
import tcav.utils_plot as utils_plot # utils_plot requires matplotlib
import os
import tensorflow as tf
"""
Explanation: Running TCAV
T... |
albahnsen/PracticalMachineLearningClass | notebooks/06-decision_trees.ipynb | mit | # vehicle data
import pandas as pd
url = 'https://github.com/albahnsen/PracticalMachineLearningClass/raw/master/datasets/vehicles_train.csv'
train = pd.read_csv(url)
# before splitting anything, just predict the mean of the entire dataset
train['prediction'] = train.price.mean()
train
year = 2010
train['pred'] = trai... |
omoju/hiphopathy | HipHopDataExploration/HipHopDataExploration.ipynb | gpl-3.0 | from IPython.display import HTML
HTML('<iframe src=http://www.npr.org/2014/05/05/309840473/yeezy-or-the-bard-whos-the-best-wordsmith-in-hip-hop width=700 height=500></iframe>')
"""
Explanation: Introduction to Data Exploration using Hip-Hop Lyrics
Welcome to an innovative way of teaching and sharing the delights that... |
Python4AstronomersAndParticlePhysicists/PythonWorkshop-ICE | notebooks/02_01_TheLanguage.ipynb | mit | # While in a "code cell" (like this one) you may execute the content by pressing Cntrl+Enter
import sys
print(sys.version)
"""
Explanation: The language (1h)
1) Short historical overview (5m)
2) Briefly talk about python 2/3 (5m)
3) Getting started with pyhton (15m)
* Python terminal
* iPython
* Script with plain e... |
hktxt/MachineLearning | PyTorch Tutorials/2. Learning PyTorch with Examples.ipynb | gpl-3.0 | import numpy as np
# N batch size; D_in input dimension
# H hidden dimension, D_out output dimension
N, D_in, H, D_out = 64, 1000, 100, 10
#create radom input and output data
x = np.random.randn(N, D_in)
y = np.random.randn(N, D_out)
#random initialize weights
w1 = np.random.randn(D_in, H)
w2 = np.random.randn(H, D... |
chrislit/abydos | binder/Basic Examples.ipynb | gpl-3.0 | from abydos.phonetic import *
from abydos.distance import *
import pandas as pd
"""
Explanation: Basic Examples of using Abydos
We start by importing the phonetic & distance modules of Abydos, along with Pandas.
End of explanation
"""
names = pd.read_csv('../tests/corpora/uscensus2000.csv',
comm... |
minireference/noBSLAnotebooks | chapter03_exercises.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
from sympy import *
init_printing()
%matp... |
mayankjohri/LetsExplorePython | Section 1 - Core Python/Chapter 09 - Classes & OOPS/01_Classes_and_OOPS.ipynb | gpl-3.0 | # Declare a Class
class Class_Name(object):
pass
class Class_Name_slow():
pass
class Class_Name_for_lazy:
pass
"""
Explanation: Modules, Classes, and Objects & OOPS
Python is something called an “object- oriented programming language.” What this means is
there’s a construct in Python called a class tha... |
aje/POT | docs/source/auto_examples/plot_WDA.ipynb | mit | # Author: Remi Flamary <remi.flamary@unice.fr>
#
# License: MIT License
import numpy as np
import matplotlib.pylab as pl
from ot.dr import wda, fda
"""
Explanation: Wasserstein Discriminant Analysis
This example illustrate the use of WDA as proposed in [11].
[11] Flamary, R., Cuturi, M., Courty, N., & Rakotomamonjy,... |
naoyak/Agile_Data_Code_2 | ch02/Introduction to PySpark.ipynb | mit | # Initialize PySpark
APP_NAME = "Debugging Prediction Problems"
# If there is no SparkSession, create the environment
try:
sc and spark
except NameError as e:
import findspark
findspark.init()
import pyspark
import pyspark.sql
sc = pyspark.SparkContext()
spark = pyspark.sql.SparkSession(sc).builder.appN... |
royalosyin/Python-Practical-Application-on-Climate-Variability-Studies | ex16-Create anomaly correlation maps of nino3 SSTA-Sea Level Pressure.ipynb | mit | % matplotlib inline
import numpy as np
from scipy.stats import pearsonr
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
from netCDF4 import Dataset as netcdf # netcdf4-python module
from matplotlib.pylab import rcParams
rcParams['figure.figsize'] = 15, 9
"""
Explanation: Compute correlation... |
mne-tools/mne-tools.github.io | 0.15/_downloads/plot_elekta_epochs.ipynb | bsd-3-clause | # Author: Jussi Nurminen (jnu@iki.fi)
#
# License: BSD (3-clause)
import mne
import os
from mne.datasets import multimodal
fname_raw = os.path.join(multimodal.data_path(), 'multimodal_raw.fif')
print(__doc__)
"""
Explanation: ======================================
Getting averaging info from .fif files
==========... |
yassineAlouini/first-steps-data-science | first_steps_in_data_science.ipynb | mit | import pandas as pd
messy_df = pd.DataFrame({'2016': [1000, 2000, 3000],
'2017': [1200, 1300, 4000],
'company':
['slack', 'twitter', 'twitch']
})
"""
Explanation: First steps in data science with Python
Installation
... |
sdpython/actuariat_python | _doc/notebooks/sessions/seance5_sql_multidimensionnelle_enonce.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
plt.style.use('ggplot')
import pyensae
from pyquickhelper.helpgen import NbImage
from jyquickhelper import add_notebook_menu
add_notebook_menu()
"""
Explanation: Données multidimensionnelles SQL - énoncé
Ce notebook propose l'utilisation de SQL avec SQLite pour manipu... |
PyDataMadrid2016/Conference-Info | workshops_materials/20160408_1100_Pandas_for_beginners/tutorial/Tutorial 03 - Operaciones basicas con estructuras de datos pandas.ipynb | mit | # primero hacemos los imports de turno
import os
import datetime as dt
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
np.random.seed(19760812)
%matplotlib inline
# Leemos los datos del fichero 'mast.txt'
ipath = os.path.join('Datos', 'mast.txt')
def dateparse(date, time):
YY = 2000 + int... |
josef-pkt/statsmodels | examples/notebooks/statespace_dfm_coincident.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import pandas as pd
import statsmodels.api as sm
import matplotlib.pyplot as plt
np.set_printoptions(precision=4, suppress=True, linewidth=120)
from pandas_datareader.data import DataReader
# Get the datasets from FRED
start = '1979-01-01'
end = '2014-12-01'
indprod = DataReade... |
Phil9l/cosmos | code/artificial_intelligence/src/hierachical_clustering/hierachical_clustering/hierarchical_clustering.ipynb | gpl-3.0 | from sklearn.metrics import normalized_mutual_info_score
import matplotlib.pyplot as plt
from scipy.cluster.hierarchy import dendrogram, linkage, fcluster
from sklearn.datasets.samples_generator import make_blobs
import numpy as np
"""
Explanation: Hierarchical Clustering
In this notebook we will give a basic example... |
petrushy/CesiumWidget | Examples/CesiumWidget Example with CZML library.ipynb | apache-2.0 | from CesiumWidget import CesiumWidget
import czml
"""
Explanation: CesiumWidget together with CZML library
This notebook shows how to use the CesiumWidget together with the CZML library from https://github.com/cleder/czml
If the CesiumWidget is installed correctly, Cesium should be accessable at:
http://localhost:8888... |
dougsweetser/ipq | q_notebooks/quaternion_qm_chapter_1_2.ipynb | apache-2.0 | %%capture
%matplotlib inline
import numpy as np
import sympy as sp
import matplotlib.pyplot as plt
# To get equations the look like, well, equations, use the following.
from sympy.interactive import printing
printing.init_printing(use_latex=True)
from IPython.display import display
# Tools for manipulating quaternion... |
ewulczyn/talk_page_abuse | src/modeling/cv_ngram_architectures.ipynb | apache-2.0 | def get_best_estimator(cv):
params = cv.best_params_
model = cv.estimator
model = model.set_params(**params)
return model
def save_best_estimator(cv, directory, name):
model = get_best_estimator(cv)
save_pipeline(model, directory, name)
"""
Explanation: Helpers
End of explanation
"""
tas... |
ES-DOC/esdoc-jupyterhub | notebooks/nims-kma/cmip6/models/sandbox-3/toplevel.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'nims-kma', 'sandbox-3', 'toplevel')
"""
Explanation: ES-DOC CMIP6 Model Properties - Toplevel
MIP Era: CMIP6
Institute: NIMS-KMA
Source ID: SANDBOX-3
Sub-Topics: Radiative Forcings.
Properties:... |
rsterbentz/phys202-2015-work | assignments/assignment12/FittingModelsEx01.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import scipy.optimize as opt
"""
Explanation: Fitting Models Exercise 1
Imports
End of explanation
"""
a_true = 0.5
b_true = 2.0
c_true = -4.0
"""
Explanation: Fitting a quadratic curve
For this problem we are going to work with the following mod... |
ovilab/lammps | python/examples/pylammps/interface_usage_bonds.ipynb | gpl-2.0 | from lammps import IPyLammps
L = IPyLammps()
# 2d circle of particles inside a box with LJ walls
import math
b = 0
x = 50
y = 20
d = 20
# careful not to slam into wall too hard
v = 0.3
w = 0.08
L.units("lj")
L.dimension(2)
L.atom_style("bond")
L.boundary("f f p")
L.lattice("hex", 0.85)
L.region("... |
ResourceHog/POMDPCapstone | Capstone.ipynb | gpl-3.0 | # Import the visualization code
import visuals as vs
# Pretty display for notebooks"
%matplotlib inline
"""
Explanation: Machine Learning Engineer Nanodegree
Capstone
Project: Capstone: Creating a custom RL algorithm
Note: Code and Markdown cells can be executed using the Shift + Enter keyboard shortcut. In addition... |
OriolAbril/Statistics-Rocks-MasterCosmosUAB | Intro_IPython.ipynb | mit | # This is a comment
# This is code cell, we execute it pressing also Shift + Intro
print 1+2
"""
Explanation: Introduction to Ipython notebook
The Ipython notebook is an enviroment that can combine code, execution, text and plots, in the style of Matlab, Mathematica, or Maple.
The nice thing of these last three is th... |
mne-tools/mne-tools.github.io | 0.14/_downloads/plot_decoding_csp_space.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Romain Trachel <romain.trachel@inria.fr>
#
# License: BSD (3-clause)
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne import io
from mne.datasets import sample
print(__doc__)
data_path = sample.data_path()
"""
... |
Benedicto/ML-Learning | Deep Features for Image Retrieval.ipynb | gpl-3.0 | import graphlab
"""
Explanation: Building an image retrieval system with deep features
Fire up GraphLab Create
End of explanation
"""
image_train = graphlab.SFrame('image_train_data/')
"""
Explanation: Load the CIFAR-10 dataset
We will use a popular benchmark dataset in computer vision called CIFAR-10.
(We've red... |
aiguofer/bokeh | examples/howto/interactive_bubble/gapminder.ipynb | bsd-3-clause | fertility_df, life_expectancy_df, population_df_size, regions_df, years, regions_list = process_data()
sources = {}
region_name = regions_df.Group
region_name.name = 'region'
for year in years:
fertility = fertility_df[year]
fertility.name = 'fertility'
life = life_expectancy_df[year]
life.name = 'li... |
AaronCWong/phys202-2015-work | days/day20/MoviePy.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
from moviepy.video.io.bindings import mplfig_to_npimage
import moviepy.editor as mpy
"""
Explanation: Making Animations using MoviePy
This notebook shows how to make animations using MoviePy and Matplotlib. Here are links to the MoviePy documentatio... |
mclaughlin6464/pearce | notebooks/Make Multiple Config Files.ipynb | mit | import yaml
import copy
from os import path
orig_cfg_fname = '/home/users/swmclau2/Git/pearce/bin/mcmc/nh_gg_mcmc_config.yaml'
with open(orig_cfg_fname, 'r') as yamlfile:
orig_cfg = yaml.load(yamlfile)
orig_cfg
#this will enable easier string formatting
sbatch_template = """#!/bin/bash
#SBATCH --job-name={jobnam... |
kwinkunks/geopandas | examples/spatial_joins.ipynb | bsd-3-clause | import os
from shapely.geometry import Point
from geopandas import GeoDataFrame, read_file
from geopandas.tools import overlay
# NYC Boros
zippath = os.path.abspath('nybb_14aav.zip')
polydf = read_file('/nybb_14a_av/nybb.shp', vfs='zip://' + zippath)
# Generate some points
b = [int(x) for x in polydf.total_bounds]
N ... |
GrachevArtem/dl_course | week_05/HW 3.ipynb | mit | import tensorflow as tf
import matplotlib.pyplot as plt
plt.style.use('ggplot')
%matplotlib inline
plt.rcParams['figure.figsize'] = (15, 12) # set default size of plots
"""
Explanation: Подключим Tensorflow
End of explanation
"""
(x_train, y_train), (x_test, y_test) = cifar10.load_data()
"""
Explanation: Для обуче... |
zzsza/TIL | deep_learning_from_scratch/Lecture note_Chapter 5 ~.ipynb | mit | class MulLayer:
def __init__(self):
self.x = None
self.y = None # 순전파시의 입력 값을 유지하기 위해 사용
def forward(self, x, y):
self.x = x
self.y = y
out = x * y
return out
def backward(self, dout):
dx = dout * self.y
dy = dout * self.... |
wmfschneider/CHE30324 | Homework/HW11-soln.ipynb | gpl-3.0 | import numpy as np
import matplotlib.pyplot as plt
P = 2 # bar
xi = np.linspace(0,1,1000)
ximax = 1.0
X = xi/ximax
n_e0 = 1.2
n_o0 = 1
n_eo0 = 0
n_w0 = 0
n_e = n_e0 - X
n_o = n_o0 - X
n_eo = n_eo0 + X
n_w = n_w0 + X
Ntot = n_e + n_o + n_eo + n_w
y_e = n_e /Ntot
y_o = n_o /Ntot
y_eo = n_eo /Ntot
y_w = n_w / Ntot
... |
mdeff/ntds_2016 | algorithms/07_sol_graph_fourier.ipynb | mit | import numpy as np
import scipy.spatial
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: A Network Tour of Data Science
Michaël Defferrard, PhD student, Pierre Vandergheynst, Full Professor, EPFL LTS2.
Exercise 5: Graph Signals and Fourier Transform
The goal of this exercise is to experiment with th... |
mathemage/h2o-3 | examples/deeplearning/notebooks/deeplearning_tensorflow_mnist.ipynb | apache-2.0 | import h2o
h2o.init()
import os.path
PATH = os.path.expanduser("~/h2o-3/")
test_df = h2o.import_file(PATH + "bigdata/laptop/mnist/test.csv.gz")
train_df = h2o.import_file(PATH + "/bigdata/laptop/mnist/train.csv.gz")
"""
Explanation: DeepLearning
MNIST Dataset using DeepWater and TensorFlow
The MNIST database is a w... |
marioberges/F16-12-752 | projects/thongyi_weijian1/ipynb file/Project_2_thongyi_weijian1.ipynb | gpl-3.0 | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import pickle
%matplotlib inline
"""
Explanation: This ipython file is the project by Hongyi Tang and Weijian Li for course 12752.
There are four ipython files in the project in total. Each file consist of one cluster analysis task.
In this file, ... |
InsightSoftwareConsortium/SimpleITK-Notebooks | Python/34_Segmentation_Evaluation.ipynb | apache-2.0 | import SimpleITK as sitk
import numpy as np
%run update_path_to_download_script
from downloaddata import fetch_data as fdata
%matplotlib inline
import matplotlib.pyplot as plt
import gui
from ipywidgets import interact, fixed
"""
Explanation: Segmentation Evaluation <a href="https://mybinder.org/v2/gh/InsightSoftw... |
mne-tools/mne-tools.github.io | 0.12/_downloads/plot_sensors_decoding.ipynb | bsd-3-clause | import numpy as np
import matplotlib.pyplot as plt
from sklearn.metrics import roc_auc_score
from sklearn.cross_validation import StratifiedKFold
import mne
from mne.datasets import sample
from mne.decoding import TimeDecoding, GeneralizationAcrossTime
data_path = sample.data_path()
plt.close('all')
"""
Explanatio... |
xhqu1981/pymatgen | examples/Analyze and plot band structures.ipynb | mit | from pymatgen.matproj.rest import MPRester
from pymatgen.electronic_structure.core import Spin
#This initiliazes the Rest connection to the Materials Project db. Put your own API key if needed.
a = MPRester()
#load the band structure from mp-3748, CuAlO2 from the MP db
bs = a.get_bandstructure_by_material_id("mp-3748")... |
leegao/BullshitMath.lol | FastRoot.ipynb | cc0-1.0 | setup_html = r'''
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/github-fork-ribbon-css/0.2.0/gh-fork-ribbon.min.css" />
<!--[if lt IE 9]>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/github-fork-ribbon-css/0.2.0/gh-fork-ribbon.ie.min.css" />
<![endif]-->
<style>
.githu... |
mrcinv/moodle-questions | python/example_code.ipynb | gpl-3.0 | from moodle import *
"""
Explanation: Exercise sample: code
Change this sample according to your needs. Run all the cells, and upload resulting .xml file to Moodle.
Auxilary functions
End of explanation
"""
%%writefile root2.py
###########################################################################
# Write the f... |
marburg-open-courseware/gmoc | docs/mpg-if_error_continue/examples/e-02-2_conditionals.ipynb | mit | m = 5
if m > 0:
print("Larger than zero.")
"""
Explanation: Conditionals
You have already encountered conditional (or comparison) operators in this course <a href="https://oer.uni-marburg.de/goto.php?target=pg_2624_720&client_id=mriliasmooc">before</a> (not least during our session on while loops), performed simp... |
ES-DOC/esdoc-jupyterhub | notebooks/hammoz-consortium/cmip6/models/sandbox-1/toplevel.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'hammoz-consortium', 'sandbox-1', 'toplevel')
"""
Explanation: ES-DOC CMIP6 Model Properties - Toplevel
MIP Era: CMIP6
Institute: HAMMOZ-CONSORTIUM
Source ID: SANDBOX-1
Sub-Topics: Radiative Forc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.