repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
carichte/pyasf | pyasf/examples/STO polar displacements.ipynb | gpl-3.0 | %matplotlib inline
import pyasf
import pylab as pl
import sympy as sp
pl.rcParams.update({'font.size':14})
from IPython.display import display, Math
print_latex = lambda x: display(Math(sp.latex(x)))
sto = pyasf.unit_cell("sto_bulk_80873.cif") # init the cif file, this one has quite OK Debye Waller factors
print_latex... |
ES-DOC/esdoc-jupyterhub | notebooks/cams/cmip6/models/sandbox-3/landice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'cams', 'sandbox-3', 'landice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Landice
MIP Era: CMIP6
Institute: CAMS
Source ID: SANDBOX-3
Topic: Landice
Sub-Topics: Glaciers, Ice.
Properties:... |
ngoldbaum/RunNotebook | example/source/SymPy.ipynb | bsd-2-clause | from IPython.display import display
from sympy.interactive import printing
printing.init_printing(use_latex='mathjax')
from __future__ import division
import sympy as sym
from sympy import *
x, y, z = symbols("x y z")
k, m, n = symbols("k m n", integer=True)
f, g, h = map(Function, 'fgh')
"""
Explanation: SymPy: Ope... |
detcitty/intro-numerical-methods | 4_error.ipynb | mit | f = numpy.exp(1)
f_hat = 2.71
# Error
print "Absolute Error = ", numpy.abs(f - f_hat)
print "Relative Error = ", numpy.abs(f - f_hat) / numpy.abs(f)
# Precision
p = 3
n = numpy.floor(numpy.log10(f_hat)) + 1 - p
print "%s = %s" % (f_hat, numpy.round(10**(-n) * f_hat) * 10**n)
"""
Explanation: Sources of Error
Error c... |
tleonhardt/LearningCython | Learning_Cython_video/Chapter07/cpp-support/cpp-support.ipynb | mit | %%cython
# cython: language_level = 3
from libcpp.vector cimport vector
cdef vector[int] vect
cdef int i
for i in range(10):
vect.push_back(i)
for i in range(10):
print(vect[i], end=',')
"""
Explanation: Standard Template Library Support!
We're so excited to try it out! Let's go!
End of explanation
"""
%%c... |
walkon302/CDIPS_Recommender | notebook_versions/Exploring_Data_v1.ipynb | apache-2.0 | import sys
import os
sys.path.append(os.getcwd()+'/../')
# other
import numpy as np
import glob
import pandas as pd
import ntpath
#keras
from keras.preprocessing import image
# plotting
import seaborn as sns
sns.set_style('white')
import matplotlib.pyplot as plt
%matplotlib inline
# debuggin
from IPython.core.debu... |
ireapps/pycar | completed/scraper_notebook_complete.ipynb | mit | import requests
from bs4 import BeautifulSoup
import csv
"""
Explanation: A full-fledged scraper
Import our modules or packages that we will need to scrape a website, including requests and bs4 and csv
End of explanation
"""
r = requests.get('https://s3-us-west-2.amazonaws.com/nicar-2015/Weekly+Rankings+-+Weekend+Bo... |
mathinmse/mathinmse.github.io | Lecture-20-Introduction-to-FiPy.ipynb | mit | %matplotlib osx
from fipy import *
%matplotlib
from fipy import *
"""
Explanation: Lecture 20: Introduction to FiPy - Getting to Know the Diffusion Equation
Objectives:
Understand how to create the diffusion equation in FiPy.
Be able to change variables in the equation and observe the effects in the diffusion equati... |
LargePanda/ccg_tweet_wikification | data_preparation.ipynb | gpl-2.0 | import pyprind
import sys
import pickle
data_folder = "/Volumes/backup/ccg_tweet_wikifier_data/"
"""
Explanation: <h1 align="center">Data Preparation</h1>
<h4 align="center">Jiarui Xu - jxu57@illinois.edu</h4>
End of explanation
"""
# Set API keys
consumer_key = 'FTglCRcahFJxH3U0TVoakD3BS'
consumer_secret = 'BoNfyA... |
performlabrit/ECEM-2017-Eyetracking-in-VR | 1. Examine calibration - SMI 60 Hz.ipynb | gpl-3.0 | from __future__ import division, print_function
from modules import PerformParser as parser
import numpy as np
import pandas as pd
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot
import plotly.graph_objs as go
import os
np.set_printoptions(precision=2)
init_notebook_mode(connected=True)... |
Luke035/dlnd-lessons | batch-norm/Batch_Normalization_Exercises.ipynb | mit | import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True, reshape=False)
"""
Explanation: Batch Normalization – Practice
Batch normalization is most useful when building deep neural networks. To demonstrate this, we'll create a con... |
mattcieslak/MITTENS | notebooks/graph_test.ipynb | bsd-2-clause | # Only necessary on mac os 10.14+
import os
os.environ['KMP_DUPLICATE_LIB_OK']='TRUE'
# Remove data from previous runs
import glob
for f in glob.glob("*.nii*") + glob.glob("*.fib*") + glob.glob("*.mat"):
os.remove(f)
# Download testing data
from urllib.request import urlretrieve
urlretrieve(
"https://upenn.bo... |
ES-DOC/esdoc-jupyterhub | notebooks/ec-earth-consortium/cmip6/models/ec-earth3-cc/seaice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'ec-earth-consortium', 'ec-earth3-cc', 'seaice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Seaice
MIP Era: CMIP6
Institute: EC-EARTH-CONSORTIUM
Source ID: EC-EARTH3-CC
Topic: Seaice
Sub-To... |
alvaroing12/CADL | session-1/lecture-1.ipynb | apache-2.0 | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
plt.style.use('ggplot')
"""
Explanation: Session 1: Introduction to Tensorflow
<p class='lead'>
Creative Applications of Deep Learning with Tensorflow<br />
Parag K. Mital<br />
Kadenze, Inc.<br />
</p>
<a name="learning-goals"></a>
Learning Goals
... |
YAtOff/python0-reloaded | week10/While-loops.ipynb | mit | counter = 1
while counter <= 10:
print(counter)
counter = counter + 1
print("end")
"""
Explanation: Какво е "цикъл"?
В програмирането често се налага многократно изпълнение на дадена
последователност от операции.
Цикъл (loop) е основна конструкция в програмирането, която позволява
многократно изпълнение н... |
sbenthall/bigbang | examples/obsolete_notebooks/SummerSchoolThreadsAnalysis.ipynb | agpl-3.0 | %matplotlib inline
from bigbang.archive import Archive
from bigbang.archive import load as load_archive
from bigbang.thread import Thread
from bigbang.thread import Node
from bigbang.utils import remove_quoted
import matplotlib.pyplot as plt
import datetime
import csv
from collections import defaultdict
"""
Explanatio... |
ANNarchy/ANNarchy | examples/image/Webcam.ipynb | gpl-2.0 | from ANNarchy import *
from ANNarchy.extensions.image import *
from ANNarchy.extensions.convolution import Convolution, Pooling
clear()
# Definition of the neurons
LinearNeuron = Neuron(equations="r=sum(exc): min=0.0")
DNF = Neuron(parameters="tau=10.0", equations="tau*dr/dt + r = sum(exc) + sum(inh): min=0.0, max=1.0... |
jsanz/dataviz15 | assignments/week04/vizs.ipynb | mit | p = Path('../../data/ncdc')
observationsCSV = p.joinpath('observations_vlc.csv')
print ('Reading observations CSV')
dfObs = pd.read_csv(str(observationsCSV),index_col=0)
dfObs = dfObs[(dfObs.stn != 'stn')]
print ("{:,} observations".format(len(dfObs)))
dfObs.head()
"""
Explanation: Getting the observations for the se... |
prisae/blog-notebooks | fftlogtest.ipynb | cc0-1.0 | import fftlog
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
%matplotlib inline
plt.style.use('ggplot')
mpl.rcParams.update({'font.size': 16})
"""
Explanation: FFTLog
This notebook is a translation of fftlogtest.f from the Fortran package FFTLog, which was presented in Appendix B of Hamil... |
aschaffn/phys202-2015-work | assignments/assignment05/MatplotlibEx03.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
"""
Explanation: Matplotlib Exercise 3
Imports
End of explanation
"""
def well2d(x, y, nx, ny, L=1.0):
"""Compute the 2d quantum well wave function."""
return (2/L)*np.sin(nx*np.pi*x/L) * np.sin(ny*np.pi*y/L)
psi = well2d(np.linspace(0,1,... |
mne-tools/mne-tools.github.io | 0.16/_downloads/plot_epochs_to_data_frame.ipynb | bsd-3-clause | # Author: Denis Engemann <denis.engemann@gmail.com>
#
# License: BSD (3-clause)
import mne
import matplotlib.pyplot as plt
import numpy as np
from mne.datasets import sample
print(__doc__)
data_path = sample.data_path()
raw_fname = data_path + '/MEG/sample/sample_audvis_filt-0-40_raw.fif'
event_fname = data_path + '... |
datactive/bigbang | examples/name-and-gender/Working Group Emails and Drafts-httpbis.ipynb | mit | import bigbang.mailman as mailman
from bigbang.parse import get_date
#from bigbang.functions import *
from bigbang.archive import Archive
from ietfdata.datatracker import *
"""
Explanation: This notebook compares the email activities and draft activites of an IETF working group.
Import the BigBang modules as needed. ... |
NeuroDataDesign/seelviz | jon/algorithms/testing/testing clviz 0.1.0.ipynb | apache-2.0 | # get_regions(points_path, anno_path, output_path)
# rp = cl.get_regions('../Fear199_points.csv', '../img/Fear199_anno.nii', 'Fear199_regions.csv')
"""
Explanation: After registration, downsampling, and getting a csv with the coordinates and brightess of the brightest points
Mapping the points to its appropriate regio... |
DJCordhose/ai | notebooks/tf2/embeddings.ipynb | mit | !pip install -q tf-nightly-gpu-2.0-preview
import tensorflow as tf
print(tf.__version__)
!curl -O https://raw.githubusercontent.com/jpatokal/openflights/master/data/routes.dat
# pd.read_csv?
import pandas as pd
df = pd.read_csv('routes.dat', quotechar="'", sep=',', encoding='utf-8', header=None, na_values='\\N',
... |
NYUDataBootcamp/Projects | MBA_S16/Hoffmann - Maciukiewicz - Twitter & Democrats .ipynb | mit | import sys # system module
import pandas as pd # data package
import matplotlib.pyplot as plt # graphics module
import datetime as dt # date and time module
import numpy as np # foundation for Pandas
import tweepy ... |
oxcompsoc/learntocode | session6/.ipynb_checkpoints/notebook-checkpoint.ipynb | gpl-3.0 | print("Hello, world!")
"""
Explanation: So far, we've been running all of our code linearly, i.e. we execute a file an we let Python do its job. Here we will be running code interactively. Each cell will contain some code, which we can execute by clicking on the cell and pressing Shift + Enter. Here is an example:
End... |
AllenDowney/ThinkBayes2 | soln/chap16.ipynb | mit | # If we're running on Colab, install empiricaldist
# https://pypi.org/project/empiricaldist/
import sys
IN_COLAB = 'google.colab' in sys.modules
if IN_COLAB:
!pip install empiricaldist
# Get utils.py
from os.path import basename, exists
def download(url):
filename = basename(url)
if not exists(filename... |
tensorflow/federated | docs/tutorials/custom_aggregators.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... |
sony/nnabla | tutorial/dcgan_image_generation.ipynb | apache-2.0 | !pip install nnabla-ext-cuda100
!git clone https://github.com/sony/nnabla-examples.git
%cd nnabla-examples
"""
Explanation: Image Generation with DCGAN
This tutorial shows how to generate images using DCGAN. We use MNIST dataset for this tutorial, but any other dataset of reasonable size can be used.
End of explanatio... |
mne-tools/mne-tools.github.io | 0.19/_downloads/b6ed91fbff318e8f41327003eca14299/plot_read_and_write_raw_data.ipynb | bsd-3-clause | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License: BSD (3-clause)
import mne
from mne.datasets import sample
print(__doc__)
data_path = sample.data_path()
fname = data_path + '/MEG/sample/sample_audvis_raw.fif'
raw = mne.io.read_raw_fif(fname)
# Set up pick list: MEG + STI 014 - bad channels
... |
DistrictDataLabs/ceb-training | 01 - Visual Data Exploration.ipynb | mit | %matplotlib notebook
import numpy as np
import matplotlib.pyplot as plt
"""
Explanation: Day 01 - Visual Data Exploration
Today's workshop will cover the following topics:
Intro to matplotlib for visualization (the pyplot API)
Data Frames for visual exploration
Pandas plotting API
Seaborn for visual statistical an... |
kubeflow/pipelines | samples/core/dsl_static_type_checking/dsl_static_type_checking.ipynb | apache-2.0 | !python3 -m pip install 'kfp>=0.1.31' --quiet
"""
Explanation: KubeFlow Pipeline DSL Static Type Checking
In this notebook, we will demo:
Defining a KubeFlow pipeline with Python DSL
Compile the pipeline with type checking
Static type checking helps users to identify component I/O inconsistencies without running t... |
EducationalTestingService/rsmtool | rsmtool/notebooks/summary/evaluation.ipynb | apache-2.0 | def read_evals(model_list, file_format_summarize):
has_missing_trims = False
evals = []
for (model_id, model_name, config, csvdir, file_format) in model_list:
csv_file = os.path.join(csvdir, '{}_eval_short.{}'.format(model_id, file_format))
if os.path.exists(csv_file):
df_eval ... |
pkreissl/espresso | doc/tutorials/lattice_boltzmann/lattice_boltzmann_poiseuille_flow.ipynb | gpl-3.0 | import logging
import sys
import matplotlib.pyplot as plt
import numpy as np
import espressomd
import espressomd.lb
import espressomd.lbboundaries
import espressomd.shapes
logging.basicConfig(level=logging.INFO, stream=sys.stdout)
espressomd.assert_features(['LB_BOUNDARIES_GPU'])
# System constants
BOX_L = 16.0
TI... |
anukarsh1/deep-learning-coursera | Improving Deep Neural networks- Hyperparameter Tuning - Regularization and Optimization/Gradient Checking.ipynb | mit | # Packages
import numpy as np
from testCases import *
from gc_utils import sigmoid, relu, dictionary_to_vector, vector_to_dictionary, gradients_to_vector
"""
Explanation: Gradient Checking
Welcome to the final assignment for this week! In this assignment you will learn to implement and use gradient checking.
You are ... |
mne-tools/mne-tools.github.io | dev/_downloads/d76fc6b994433139acc22a226164eadd/receptive_field_mtrf.ipynb | bsd-3-clause | # Authors: Chris Holdgraf <choldgraf@gmail.com>
# Eric Larson <larson.eric.d@gmail.com>
# Nicolas Barascud <nicolas.barascud@ens.fr>
#
# License: BSD-3-Clause
"""
Explanation: Receptive Field Estimation and Prediction
This example reproduces figures from Lalor et al.'s mTRF toolbox in
MATLAB :footcit... |
srcole/qwm | burrito/.ipynb_checkpoints/Burrito_nonlinear-checkpoint.ipynb | mit | %config InlineBackend.figure_format = 'retina'
%matplotlib inline
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
import pandas as pd
import statsmodels.api as sm
import pandasql
import seaborn as sns
sns.set_style("white")
"""
Explanation: San Diego Burrito Analytics: Data characterization
Sco... |
ES-DOC/esdoc-jupyterhub | notebooks/miroc/cmip6/models/nicam16-8s/land.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'miroc', 'nicam16-8s', 'land')
"""
Explanation: ES-DOC CMIP6 Model Properties - Land
MIP Era: CMIP6
Institute: MIROC
Source ID: NICAM16-8S
Topic: Land
Sub-Topics: Soil, Snow, Vegetation, Energy B... |
atulsingh0/MachineLearning | ML_UoW/Course01_Regression/Week02_Polynomial_Regression_Assignment02.ipynb | gpl-3.0 | train_data['bedrooms_squared'] = train_data['bedrooms']*train_data['bedrooms']
train_data['bed_bath_rooms'] = train_data['bedrooms']*train_data['bathrooms']
train_data['log_sqft_living'] = np.log(train_data['sqft_living'])
train_data['lat_plus_long'] = train_data['lat']+train_data['long']
test_data['bedrooms_squared']... |
lindsayad/jupyter_notebooks | zernikes.ipynb | mit | %matplotlib inline
import openmc
import numpy as np
import matplotlib.pyplot as plt
"""
Explanation: OpenMC's general tally system accommodates a wide range of tally filters. While most filters are meant to identify regions of phase space that contribute to a tally, there are a special set of functional expansion filt... |
Housebeer/Natural-Gas-Model | .ipynb_checkpoints/Matching Market v8-checkpoint.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import random as rnd
import pandas as pd
import numpy as np
import time
import datetime
import calendar
# fix what is missing with the datetime/time/calendar package
def add_months(sourcedate,months):
month = sourcedate.month - 1 + months
year = int(sourcedat... |
ShinjiKatoA16/UCSY-sw-eng | PrimNumber.ipynb | mit | def is_prime_simple(n):
if n < 2: return False
for div in range(2,n):
if n % div == 0:
return False # not Prime
return True
BIG_PRIME = 10**8 + 7
print(2, is_prime_simple(2))
print(97, is_prime_simple(97))
print(BIG_PRIME, is_prime_simple(BIG_PRIME))
"""
Explanation: Prime number chec... |
lcharleux/argiope | doc/notebooks/.ipynb_checkpoints/mesh_tutorial-checkpoint.ipynb | gpl-3.0 | %load_ext autoreload
%autoreload 2
import argiope as ag
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib as mpl
from string import Template
%matplotlib nbagg
"""
Explanation: Mesh tutorial
End of explanation
"""
geom_template = """
lc = $lc;
Point(1) = {0,0,0,lc};
Point(2) = ... |
niketanpansare/systemml-book | Chapter1_Introduction.ipynb | apache-2.0 | from IPython.display import YouTubeVideo
YouTubeVideo('sXx-PpEBR7k')
"""
Explanation: Introduction
History of Machine Learning
The field of machine learning has its roots in Artificial intelligence (AI), which started in 1950 with the seminal paper Computing Machinery and Intelligence. In this paper, Alan Turing posed... |
BrainIntensive/OnlineBrainIntensive | resources/matplotlib/Examples/formatting_1.ipynb | mit | %load_ext watermark
%watermark -u -v -d -p matplotlib,numpy
"""
Explanation: Sebastian Raschka
back to the matplotlib-gallery at https://github.com/rasbt/matplotlib-gallery
End of explanation
"""
%matplotlib inline
"""
Explanation: <font size="1.5em">More info about the %watermark extension</font>
End of explanati... |
ecabreragranado/OpticaFisicaII | Experimento de Young/.ipynb_checkpoints/Trenes de Onda-checkpoint.ipynb | gpl-3.0 | from IPython.display import Image
Image(filename="EsquemaYoung.png")
"""
Explanation: Experimento de Young con trenes de ondas
Consideraciones iniciales
End of explanation
"""
import matplotlib.pyplot as plt
import numpy as np
%matplotlib inline
plt.style.use('fivethirtyeight')
#import ipywidgets as widg
#from IPyth... |
tedunderwood/biographies | data/parts_of_speech.ipynb | mit | from collections import Counter
def get_counts(df):
c = Counter()
for idx, row in df['count_pos'].items():
c.update(row)
return c
all_counts = get_counts(bio)
male_char_counts = get_counts(bio.loc[bio.chargender == 'm',:])
female_char_counts = get_counts(bio.loc[bio.chargender == 'f',:])
male_au... |
ajhenrikson/phys202-2015-work | assignments/assignment05/MatplotlibEx03.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
"""
Explanation: Matplotlib Exercise 3
Imports
End of explanation
"""
def well2d(x, y, nx, ny, L=1.0):
"""Compute the 2d quantum well wave function."""
sci=2/L*np.sin((nx*np.pi*x)/L)*np.sin((ny*np.pi*y)/L)
return sci
psi = well2d(np.l... |
kingb12/languagemodelRNN | model_comparisons/noingX_bow_compared.ipynb | mit | report_files = ["/Users/bking/IdeaProjects/LanguageModelRNN/experiment_results/encdec_noing6_bow_200_512_04drb/encdec_noing6_bow_200_512_04drb.json", "/Users/bking/IdeaProjects/LanguageModelRNN/experiment_results/encdec_noing10_bow_200_512_04drb/encdec_noing10_bow_200_512_04drb.json", "/Users/bking/IdeaProjects/Languag... |
changshuaiwei/Udc-ML | titanic_survival_exploration/Titanic_Survival_Exploration.ipynb | gpl-3.0 | import numpy as np
import pandas as pd
# RMS Titanic data visualization code
from titanic_visualizations import survival_stats
from IPython.display import display
%matplotlib inline
# Load the dataset
in_file = 'titanic_data.csv'
full_data = pd.read_csv(in_file)
# Print the first few entries of the RMS Titanic data... |
MTgeophysics/mtpy | examples/workshop/plot_phasetensor_on_basemap.ipynb | gpl-3.0 | from mtpy.modeling.modem import PlotPTMaps
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import matplotlib as mpl
from mpl_toolkits.basemap import Basemap
from shapely.geometry import Polygon
from descartes import PolygonPatch
import numpy as np
"""
Explanation: Plotting phase tensors from a ModEM data ... |
francisc0garcia/autonomous_bicycle | docs/python_notebooks/UKF_with_sigma_model.ipynb | apache-2.0 | # Import dependencies
from __future__ import division, print_function
%matplotlib inline
import scipy
from filterpy.kalman import unscented_transform, MerweScaledSigmaPoints
from UKF_RST import UnscentedKalmanFilter as UKF
from BicycleTrajectory2D import *
from BicycleUtils import *
from FormatUtils import *
from Plo... |
tensorflow/docs-l10n | site/zh-cn/tutorials/quickstart/beginner.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... |
JohnWinter/JohnWinter.github.io | bkds-datachallenge-Winter-John/Data_Challenge_Stats.ipynb | mit | import math
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn
import scipy
from sklearn.decomposition import PCA
%matplotlib inline
"""
Explanation: John Winter Data Challenge
End of explanation
"""
height=np.array([150,163,167,168,170,178])
"""
Explanation: Question 1.a
End of... |
kadircet/CENG | 783/HW1/submissions/svm.ipynb | gpl-3.0 | # Run some setup code for this notebook.
import random
import numpy as np
from cs231n.data_utils import load_CIFAR10
import matplotlib.pyplot as plt
# This is a bit of magic to make matplotlib figures appear inline in the
# notebook rather than in a new window.
%matplotlib inline
plt.rcParams['figure.figsize'] = (10.... |
bcantarel/bcantarel.github.io | bicf_nanocourses/courses/ML_1/exercises/Scikit_Learn.ipynb | gpl-3.0 | from sklearn import datasets # for various test data sets
from sklearn import decomposition # for PCA. ICA, nNMF
from sklearn import manifold # MDS, tSNE
# then to use it you might go like
digits = datasets.load_digits(n_class=6)
# While we're at it, lets load a few other things we will need
import numpy as np
import... |
emjotde/UMZ | Cwiczenia/02/Uczenie Maszynowe - Ćwiczenia 2.2 - Wykresy kolumnowe, punktowe, histogramy.ipynb | cc0-1.0 | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
fig = plt.figure(figsize=(15,10))
ax = fig.add_subplot(111)
## the data
N = 5
menMeans = [18, 35, 30, 35, 27]
menStd = [2, 3, 4, 1, 2]
womenMeans = [25, 32, 34, 20, 25]
womenStd = [3, 5, 2, 3, 3]
## necessary variables
ind = np.arange(N) ... |
miykael/nipype_tutorial | notebooks/basic_data_input_bids.ipynb | bsd-3-clause | from bids.layout import BIDSLayout
layout = BIDSLayout("/data/ds000114/")
!tree -L 4 /data/ds000114/
"""
Explanation: Data input for BIDS datasets
DataGrabber and SelectFiles are great if you are dealing with generic datasets with arbitrary organization. However, if you have decided to use Brain Imaging Data Structur... |
jhamrick/citation-entity-resolution | 1 - Download citation data.ipynb | mit | with open("apidois.json", 'r') as fh:
dois = sorted(json.load(fh))
"""
Explanation: Get the list of DOIs from the provided json file:
End of explanation
"""
for i, doi in enumerate(dois):
pth = "citation_data/doi_{:05d}.json".format(i)
# skip DOIs that we have already fetched
if os.path.exists(pth):... |
dedx/cpalice | training/02_GraphicsIntro.ipynb | mit | # In iPython or the iPython notebook, it's easiest to use the pylab magic, which
# imports matplotlib, numpy, and scipy.
# The inline flag means that images will be shown here in the notebooks, rather
# than in pop-up windows.
%pylab notebook
# If you are using 'regular' Python, however, you'll want the following. Y... |
mne-tools/mne-tools.github.io | 0.16/_downloads/plot_mne_dspm_source_localization.ipynb | bsd-3-clause | import numpy as np
import matplotlib.pyplot as plt
import mne
from mne.datasets import sample
from mne.minimum_norm import make_inverse_operator, apply_inverse
# sphinx_gallery_thumbnail_number = 9
"""
Explanation: Source localization with MNE/dSPM/sLORETA/eLORETA
The aim of this tutorial is to teach you how to comp... |
fagonzalezo/is-2017-1 | masterball.ipynb | mit | '''
This variables MUST not be changed.
They represent the movements of the masterball.
'''
R_0 = "Right 0"
R_1 = "Right 1"
R_2 = "Right 2"
R_3 = "Right 3"
V_0 = "Vertical 0"
V_1 = "Vertical 1"
V_2 = "Vertical 2"
V_3 = "Vertical 3"
V_4 = "Vertical 4"
V_5 = "Vertical 5"
V_6 = "Vertical 6"
V_7 = "Vertical 7"
"""
Expla... |
kingsgeocomp/code-camp | notebook-08-dictionaries.ipynb | mit | myDict = {
"key1": "Value 1",
3: "3rd Value",
"key2": "2nd Value",
"Fourth Key": [4.0, 'Jon']
}
print(myDict)
"""
Explanation: Notebook-8: Dictionaries
Lesson Content
In this lesson, we'll continue our exploration of more advanced data structures. Last time we took a peek at a way to represent ordered ... |
obscode/bootcamp | MoreNotebooks/ModelFitting/NNLS.ipynb | mit | from numpy import * # Deal with it
# Start by defining some parameters. Change these if you like!
cont_zp = 500.0 # value at 0
cont_slope = 5.0 # change in continuum per channel
amplitude = 150.0 # peak of the line
width = 0.5 # Width of the line
center = 5.0 # location of the line
# Next, a grid of wa... |
ayox/hpelm_sandbox | food.ipynb | gpl-3.0 | imagesList = shuffle(trainingData)
# index = np.argwhere(imagesList== 175.0)
# imagesList = np.delete(imagesList, index,axis=0)
precentage = 0.77
print ('imaglist full', imagesList.shape)
trainImagesList = imagesList[0:int(imagesList.__len__() * precentage), :]
testImagesList = imagesList[int(imagesList.__len__() * pre... |
simpeg/tutorials | docs/case-studies/PF/TKC_Mag.ipynb | mit | ## First we need to load all the libraries and set up the path
## for the input files. Same files as used by the online tutorial
import matplotlib.pyplot as plt
from SimPEG import Mesh
from SimPEG import Utils
from SimPEG import Maps
from SimPEG import Regularization
from SimPEG import DataMisfit
from SimPEG import Opt... |
hdesmond/StatisticalMethods | examples/SDSScatalog/FirstLook.ipynb | gpl-2.0 | %load_ext autoreload
%autoreload 2
import numpy as np
import SDSS
import pandas as pd
import matplotlib
%matplotlib inline
objects = "SELECT top 10000 \
ra, \
dec, \
dered_u as u, \
dered_g as g, \
dered_r as r, \
dered_i as i, \
petroR50_i AS size \
FROM PhotoObjAll \
WHERE \
((type = '3' OR type = '6') AND \
ra > ... |
jsub10/MLCourse | Notebooks/Non-Linear-Logistic-Regression.ipynb | mit | # Import our usual libraries
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
# Set up the path
import os
# OS-independent way to navigate the file system
# Data directory is one directory up in relation to directory of this notebook
data_dir_root = os.path.normpath(os.getcwd()... |
quantopian/research_public | notebooks/lectures/Multiple_Linear_Regression/notebook.ipynb | apache-2.0 | import numpy as np
import pandas as pd
import statsmodels.api as sm
# If the observations are in a dataframe, you can use statsmodels.formulas.api to do the regression instead
from statsmodels import regression
import matplotlib.pyplot as plt
"""
Explanation: Multiple Linear Regression
By Evgenia "Jenny" Nitishinskaya... |
joosthub/pytorch-nlp-tutorial-sf2017 | day_2/00-Load-Vectorize-Generate-And-Sequences-as-Tensors.ipynb | mit | class RawSurnames(object):
def __init__(self, data_path=settings.SURNAMES_CSV, delimiter=","):
self.data = pd.read_csv(data_path, delimiter=delimiter)
def get_data(self, filter_to_nationality=None):
if filter_to_nationality is not None:
return self.data[self.data.nationality.isin(fi... |
samuxiii/notebooks | simpsons/Simpsons.ipynb | apache-2.0 | num_test_images = len(test_image_names)
idx = random.randint(0, num_test_images)
sample_file, sample_name = test_image_names[idx], test_image_names[idx].split('_')[:-1]
path_file = os.path.join(test_root_path, sample_file)
sample_image = imread(path_file)
print("Id: {}, Image Label: {}, Shape: {}".format(idx, '_'.joi... |
Wx1ng/Python4DataScience.CH | Series_0_Python_Tutorials/S0EP1_Python_Basics.ipynb | cc0-1.0 | 8 * 5 + 2
"""
Explanation: 1 基本使用方法
启动Python/Ipython Shell有几种方式:
命令行窗口键入python并回车
切换到你喜欢的目录,键入ipython notebook并回车
终端中键入Ipython并回车,或者在IDE中打开一个IPython
每次键入命令需要摁下Enter键(REPL中)或者Run Cell按钮(IPython)
你会得到一个显示结果反馈。
End of explanation
"""
2 ** 100
"""
Explanation: 世间真理42,以及
End of explanation
"""
"The answer to life,th... |
junhwanjang/DataSchool | Lecture/19. 나이브 베이즈/1) 나이브 베이즈 분류 모형.ipynb | mit | np.random.seed(0)
X0 = sp.stats.norm(-2, 1).rvs(40)
X1 = sp.stats.norm(+2, 1).rvs(60)
X = np.hstack([X0, X1])[:, np.newaxis]
y0 = np.zeros(40)
y1 = np.ones(60)
y = np.hstack([y0, y1])
sns.distplot(X0, rug=True, kde=False, norm_hist=True, label="class 0")
sns.distplot(X1, rug=True, kde=False, norm_hist=True, label="cla... |
stevetjoa/stanford-mir | feature_sonification.ipynb | mit | x, sr = librosa.load('audio/simple_loop.wav')
"""
Explanation: ← Back to Index
Understanding Audio Features through Sonification
In this exercise notebook, we will segment, feature extract, and analyze audio files. Goals:
Detect onsets in an audio signal.
Segment the audio signal at each onset.
Compute features ... |
florianm/biosys-etl | Kimberley LCI.ipynb | mit | import ckanapi
import csv
import json
import requests
from secret import CKAN, LCI, BIOSYS
import helpers as h
"""
Explanation: Overview
This notebook will contain the loading component of the Kimberley data loading procedure.
In preparation, the original data will have been
uploaded as-is to DPaW's internal CKAN d... |
goodwordalchemy/thinkstats_notes_and_exercises | code/.ipynb_checkpoints/chap11_regression-checkpoint.ipynb | gpl-3.0 | live, firsts, others = first.MakeFrames()
formula = 'totalwgt_lb ~ agepreg'
model = smf.ols(formula, data=live)
results = model.fit()
regression.SummarizeResults(results)
##Results are also available as parameters:
inter = results.params['Intercept']
slope = results.params['agepreg']
slope_pvalue = results.pvalues['ag... |
JShadowMan/package | python/course/ch04-advanced/Python高级特性.ipynb | mit | # 给一个变量赋值, 取得给定整形变量的绝对值
number1 = -11
value1 = number1
if value1 < 0:
value1 = -value1
print(value1)
# 我们这边可以使用Python中特殊的三目运算符形式
number2 = -22
value2 = number2 if number2 > 0 else -number2
print(value2)
"""
Explanation: Python中常用的高级特性
三目运算符
例如Javascript或者php等大部分编程语言中都会提供三目运算符以达到快捷的判断赋值功能.
但是在Python开发者认为不符合Pytho... |
hmenke/espresso | doc/tutorials/05-raspberry_electrophoresis/05-raspberry_electrophoresis.ipynb | gpl-3.0 | import espressomd
espressomd.assert_features(["ELECTROSTATICS", "ROTATION", "ROTATIONAL_INERTIA", "EXTERNAL_FORCES",
"MASS", "VIRTUAL_SITES_RELATIVE", "LB_GPU", "LENNARD_JONES"])
from espressomd import interactions
from espressomd import electrostatics
from espressomd import lb
from espress... |
SciTools/cube_browser | doc/write_your_own/components/Button.ipynb | bsd-3-clause | import ipywidgets
import IPython.display
import iris
import iris.plot as iplt
import matplotlib.pyplot as plt
from cube_browser import Contour, Browser, Contourf, Pcolormesh
"""
Explanation: Plot Button
Example showing how to construct a button which will execute the construction and display of a plot.
End of explana... |
ddtm/dl-course | Seminar6/Seminar6.ipynb | mit | # Useful imports that we are going to be needing throughout the seminar.
import os
"""
Explanation: Seminar 6: Hacking R-CNN
WARNING: This seminar was not thoroughly tested so expect weird bugs. Please report if you found one!
In this assignment, you will hack the existing code for object detection (https://github.com... |
gasabr/AtoD | examples/match_example.ipynb | mit | from atod import Match
# just a random match
match_id = 1000193456
match = Match(match_id)
# get the description of the match in terms of laning and heroes types
d = match.get_description(include=['laning', 'type'])
d
"""
Explanation: This class is under development
still, there are few things to try out. Remember, ... |
ivvv/spireFts | FtsDataAccess.ipynb | mit | #
# import some necessary packages
#
import matplotlib.pyplot as plt
%matplotlib inline
from astropy.io import fits
import tarfile
import requests
import tempfile
import os, shutil
def getSpireFtsLevel2(obsid, what='spss', archive='hsa', saveTar=True):
"""
PURPOSE:
Using the HTTP access to HAIO, retri... |
opensanca/trilha-python | 02-python-oo/aula-01/Aula 01.ipynb | mit | notas = {'bia': 10, 'pedro': 0, 'ana': 7}
notas
"""
Explanation: [Py-OO] Aula 01
Introdução a Orientação a Objetos em Python
O que você vai aprender nesta aula?
Após o término da aula você terá aprendido:
Objetos em Python
Como funcionam
Tipagem
Mutabilidade
Como funciona atribuição e variáveis
Classes
Sintaxe bási... |
google/jax | docs/notebooks/neural_network_with_tfds_data.ipynb | apache-2.0 | import jax.numpy as jnp
from jax import grad, jit, vmap
from jax import random
"""
Explanation: Copyright 2018 Google LLC.
Licensed under the Apache License, Version 2.0 (the "License");
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You... |
JAmarel/Phys202 | Interpolation/InterpolationEx01.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
from scipy.interpolate import interp1d
"""
Explanation: Interpolation Exercise 1
End of explanation
"""
dictionary = np.load('trajectory.npz')
y = dictionary.items()[0][1]
t = dictionary.items()[1][1]
x = dictionary.items()... |
rdjdejong/Leren2016 | assignment2_vanDenBoogerd_deJong2.ipynb | apache-2.0 | from __future__ import division
import numpy as np
import pandas as pd
import csv
import matplotlib.pylab as plt
class linReg:
df = None
input_vars = None
output_vars = None
thetas = None
alpha = 0.0
# formats the self.df properly
def __init__(self, fileName, alpha):
self.df = pd.... |
jinntrance/MOOC | coursera/deep-neural-network/quiz and assignments/Week 2 Logistic Regression as a Neural Network/Logistic+Regression+with+a+Neural+Network+mindset+v3.ipynb | cc0-1.0 | import numpy as np
import matplotlib.pyplot as plt
import h5py
import scipy
from PIL import Image
from scipy import ndimage
from lr_utils import load_dataset
%matplotlib inline
"""
Explanation: Logistic Regression with a Neural Network mindset
Welcome to your first (required) programming assignment! You will build a ... |
GoogleCloudPlatform/training-data-analyst | courses/ai-for-time-series/notebooks/02-model.ipynb | apache-2.0 | %pip install -U statsmodels scikit-learn --user
"""
Explanation: Overview
This notebook demonstrates how to sequence data for a time-series problem, and then how to build deep learning and statistical models.
Dataset
CTA - Ridership - Daily Boarding Totals: This dataset shows systemwide boardings for both bus and rail... |
LSSTC-DSFP/LSSTC-DSFP-Sessions | Sessions/Session10/Day2/MultiDimensionalMCMCSolutions.ipynb | mit | #!pip install emcee==3.0rc2
#!pip install corner
import numpy as np
import pandas as pd
from scipy.optimize import minimize, newton
import emcee
import corner
import matplotlib.pyplot as plt
np.random.seed(42)
"""
Explanation: If you are running this notebook on google collab, uncomment and execute the cell below. ... |
graphistry/pygraphistry | demos/more_examples/graphistry_features/layout_tree.ipynb | bsd-3-clause | from graphistry.layout.sugiyama import SugiyamaLayout
from graphistry.layout.graph import Graph, Vertex, Edge
import pandas as pd
import networkx as nx
import matplotlib
import matplotlib.pyplot as plt
def from_networkx(nxg):
"""
Converts a networkx graph to a sugiyama graph.
"""
vertices = []
... |
NathanYee/ThinkBayes2 | code/chap04.ipynb | gpl-2.0 | from __future__ import print_function, division
import numpy as np
import thinkbayes2
from thinkbayes2 import Pmf, Cdf, Suite
import thinkplot
% matplotlib inline
"""
Explanation: Think Bayes solutions: Chapter 4
This notebook presents solutions to exercises in Think Bayes.
Copyright 2016 Allen B. Downey
MIT Licens... |
blehman/pythonD3 | IPythonD3.ipynb | bsd-2-clause | # import requirments
from IPython.display import Image
from IPython.display import display
from IPython.display import HTML
from datetime import *
import json
from copy import *
from pprint import *
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import json
from ggplot import *
import networkx ... |
anandha2017/udacity | nd101 Deep Learning Nanodegree Foundation/notebooks/1 - playing with jupyter/mandelbrot_numbapro.ipynb | mit | %matplotlib inline
%config InlineBackend.figure_format = 'retina'
import numpy as np
from pylab import imshow, show
from timeit import default_timer as timer
"""
Explanation: A NumbaPro Mandelbrot Example
This notebook was written by Mark Harris based on code examples from Continuum Analytics that I modified somewhat... |
zuik/stuff | rf/RF-Entries.ipynb | mit | def list_entries():
d = col_entries.distinct("type")
return [x for x in d]
"""
Explanation: First look at entries
What are those?
End of explanation
"""
entries = Out[4]
def count_entry():
entry_count = []
for entry in entries:
c = col_entries.find({"type":entry}).count()
print("{}|{... |
probml/pyprobml | notebooks/book2/28/causal_impact_tfp.ipynb | mit | !pip install -qq tfcausalimpact
%matplotlib inline
import sys
import os
# sys.path.append(os.path.abspath('../'))
import numpy as np
import pandas as pd
try:
import tensorflow as tf
except ModuleNotFoundError:
%pip install -qq tensorflow
import tensorflow as tf
try:
import tensorflow_probability ... |
seg/2016-ml-contest | MandMs/03_Facies_classification-MandMs_SFS_v2.ipynb | apache-2.0 | %matplotlib inline
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
from sklearn import preprocessing
from sklearn.metrics import f1_score, accuracy_score, make_scorer
filename = 'engineered_features.csv'
training_data = pd.read_csv(filename)
training_data.describe()
tr... |
totalgood/twip | docs/notebooks/07 Features -- Text.ipynb | mit | # improve on the "stopword" filters here
#
# :-) (ask me about a smilie lexicon)
# not-so-simple words? (ask me about a regex for compound words)
# python variables names with underscores? (regex)
f = os.path.join(DATA_PATH, 'text.csv.gz')
df.to_csv(f, encoding='utf8', compression='gzip', quoting=pd.io.common.csv.QUOT... |
kabrapratik28/Stanford_courses | cs231n/assignment2/Dropout.ipynb | apache-2.0 | # As usual, a bit of setup
from __future__ import print_function
import time
import numpy as np
import matplotlib.pyplot as plt
from cs231n.classifiers.fc_net import *
from cs231n.data_utils import get_CIFAR10_data
from cs231n.gradient_check import eval_numerical_gradient, eval_numerical_gradient_array
from cs231n.solv... |
justincely/lightcurve_pipeline | dev/periodograms.ipynb | bsd-3-clause | short_freq = (hdulist[0].header['STEPSIZE'] / (60. * 60. * 24.))
med_freq = (10. / (60. * 24.))
long_freq = 1. / 24.
max_freq = 10. / 24.
"""
Explanation: It appears that this object has a period of ~0.004 days, or ~6 minutes
We should restrict ourselves to finding periods between the sampling time and the length of a... |
msanterre/deep_learning | intro-to-rnns/Anna_KaRNNa.ipynb | mit | import time
from collections import namedtuple
import numpy as np
import tensorflow as tf
"""
Explanation: Anna KaRNNa
In this notebook, I'll build a character-wise RNN trained on Anna Karenina, one of my all-time favorite books. It'll be able to generate new text based on the text from the book.
This network is base... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.