repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
mauroalberti/gsf | docs/notebooks/Vectors and orientations.ipynb | gpl-3.0 | %load_ext autoreload
%autoreload 1
"""
Explanation: Vectors and orientations
March 2018, June 2019, Mauro Alberti
Last version: 2021-04-24
Last running version: 2021-04-24
Developement code:
End of explanation
"""
%matplotlib inline
"""
Explanation: 1. Introduction
Since we will plot geometric data into stereonets,... |
tedunderwood/changepoint | changepoint.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import csv, os, random
import numpy as np
from collections import Counter
from scipy import spatial
songsbyquarter = dict()
numfields = 14
fieldnames = []
for i in range(14):
fieldnames.append('PC' + str(i+1))
maxquarter = 0
with open('EvolutionPopUSA_MainData.... |
exe0cdc/PyscesToolbox | documentation/notebooks/basic_usage.ipynb | bsd-3-clause | # PySCeS model instantiation using the `example_model.py` file
# with name `mod`
mod = pysces.model('example_model')
mod.SetQuiet()
# Parameter scan setup and execution
# Here we are changing the value of `Vf2` over logarithmic
# scale from `log10(1)` (or 0) to log10(100) (or 2) for a
# 100 points.
mod.scan_in = 'Vf2... |
uber/pyro | tutorial/source/easyguide.ipynb | apache-2.0 | import os
import torch
import pyro
import pyro.distributions as dist
from pyro.infer import SVI, Trace_ELBO
from pyro.contrib.easyguide import easy_guide
from pyro.optim import Adam
from torch.distributions import constraints
smoke_test = ('CI' in os.environ)
assert pyro.__version__.startswith('1.7.0')
"""
Explanatio... |
LSSTC-DSFP/LSSTC-DSFP-Sessions | Sessions/Session14/Day1/IntroToScikitLearnSolutions.ipynb | mit | # execute example code here
from sklearn import datasets
from sklearn.ensemble import RandomForestClassifier
iris = datasets.load_iris()
RFclf = RandomForestClassifier().fit(iris.data, iris.target)
"""
Explanation: Introduction to scikit-learn
Version 0.1
By AA Miller (Northwestern/CIERA)
28 Feb 2022
Broadly speakin... |
samejack/blog-content | keras-ml/keras-cat-vs-dog-datagen.ipynb | apache-2.0 | #!pip install kaggle
api_token = {"username":"your_username","key":"your_token"}
import json
import zipfile
import os
if not os.path.exists("/root/.kaggle"):
os.makedirs("/root/.kaggle")
with open('/root/.kaggle/kaggle.json', 'w') as file:
json.dump(api_token, file)
!chmod 600 /root/.kaggle/kaggle.json
if no... |
atulsingh0/MachineLearning | MasteringML_wSkLearn/01_Linear_Regression.ipynb | gpl-3.0 | import matplotlib.pyplot as plt
import numpy as np
%matplotlib inline
x = np.random.randint(0, 30, 10)
y = np.random.randint(0, 55, 10)
plt.figure()
plt.title("Scatter Plot")
plt.xlabel("X")
plt.ylabel("Y")
plt.scatter(x,y, color='red')
plt.grid(True, color='0')
plt.autoscale(True)
plt.show()
# import
import numpy ... |
VectorBlox/PYNQ | Pynq-Z1/notebooks/examples/pmod_grove_pir.ipynb | bsd-3-clause | from time import sleep
from pynq import Overlay
from pynq.board import LED
from pynq.iop import Grove_PIR
from pynq.iop import PMODA
from pynq.iop import PMOD_GROVE_G1
ol1 = Overlay("base.bit")
ol1.download()
pir = Grove_PIR(PMODA,PMOD_GROVE_G1)
"""
Explanation: PMOD Grove PIR Motion Sensor
This example shows how to... |
Kulbear/deep-learning-nano-foundation | DLND-language-translation/dlnd_language_translation.ipynb | mit | """
DON'T MODIFY ANYTHING IN THIS CELL
"""
import helper
import problem_unittests as tests
source_path = 'data/small_vocab_en'
target_path = 'data/small_vocab_fr'
source_text = helper.load_data(source_path)
target_text = helper.load_data(target_path)
"""
Explanation: Language Translation
In this project, you’re going... |
gtrichards/PHYS_T480 | DimensionReduction.ipynb | mit | # Execute this cell
# from Andy Connolly
%matplotlib inline
import numpy as np
import scipy.special as sp
from matplotlib import pyplot as plt
def unitVolume(dimension, radius=1.):
return 2*(radius**dimension *np.pi**(dimension/2.))/(dimension*sp.gamma(dimension/2.))
dim = np.linspace(1,100)
#-------------------... |
DistrictDataLabs/entity-resolution | Entity Resolution Workshop.ipynb | apache-2.0 | ## Imports
import os
import csv
import nltk
import json
import math
import random
import distance
## Important Paths
FIXTURES = os.path.join(os.getcwd(), "fixtures")
PRODUCTS = os.path.join(FIXTURES, "products")
## Module Constants
GOOGID = 'http://www.google.com/base/feeds/snippets'
def load_data(name):
"""... |
strikingmoose/chi_lars_face_detection | notebook/14 - Naming CNN Layers.ipynb | apache-2.0 | import cv2
import numpy as np
import pandas as pd
import urllib
import math
import boto3
import os
import copy
from tqdm import tqdm
from matplotlib import pyplot as plt
%matplotlib inline
# Temporarily load from np arrays
chi_photos_np = np.load('chi_photos_np_0.03_compress.npy')
lars_photos_np = np.load('lars_photos... |
scikit-optimize/scikit-optimize.github.io | 0.8/notebooks/auto_examples/parallel-optimization.ipynb | bsd-3-clause | print(__doc__)
import numpy as np
"""
Explanation: Parallel optimization
Iaroslav Shcherbatyi, May 2017.
Reviewed by Manoj Kumar and Tim Head.
Reformatted by Holger Nahrstaedt 2020
.. currentmodule:: skopt
Introduction
For many practical black box optimization problems expensive objective can be
evaluated in parallel ... |
gregtucker/dem_analysis_with_gdal | dem_processing_with_gdal_python.ipynb | mit | from osgeo import gdal
import numpy as np
"""
Explanation: Short introduction to working with DEMs in Python GDAL
Greg Tucker, CU Boulder, Feb 2016
Install GDAL library
You'll need to install the GDAL library. If you have Anaconda installed, you can do this from the command line by:
conda install gdal
Download some DE... |
mne-tools/mne-tools.github.io | stable/_downloads/9619fd95b952a0c715b83d0e6b37c416/10_epochs_overview.ipynb | bsd-3-clause | import os
import mne
"""
Explanation: The Epochs data structure: discontinuous data
This tutorial covers the basics of creating and working with :term:epoched
<epochs> data. It introduces the :class:~mne.Epochs data structure in
detail, including how to load, query, subselect, export, and plot data from an
:clas... |
sisnkemp/deep-learning | first-neural-network/Your_first_neural_network.ipynb | mit | %matplotlib inline
%config InlineBackend.figure_format = 'retina'
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
"""
Explanation: Your first neural network
In this project, you'll build your first neural network and use it to predict daily bike rental ridership. We've provided some of the code... |
turbomanage/training-data-analyst | self-paced-labs/tensorflow-2.x/synthetic_features_and_outliers_solution.ipynb | apache-2.0 | !pip install tensorflow==2.0.0-beta1
from matplotlib import cm
from matplotlib import gridspec
from matplotlib import pyplot as plt
import numpy as np
import pandas as pd
import logging
from packaging import version
from IPython.display import display
pd.options.display.max_rows = 10
pd.options.display.float_format =... |
ES-DOC/esdoc-jupyterhub | notebooks/nims-kma/cmip6/models/sandbox-2/ocean.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'nims-kma', 'sandbox-2', 'ocean')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocean
MIP Era: CMIP6
Institute: NIMS-KMA
Source ID: SANDBOX-2
Topic: Ocean
Sub-Topics: Timestepping Framework, A... |
mne-tools/mne-tools.github.io | 0.19/_downloads/12e915738bb5b40ffcb1157f1c2dee72/plot_receptive_field.ipynb | bsd-3-clause | # Authors: Chris Holdgraf <choldgraf@gmail.com>
# Eric Larson <larson.eric.d@gmail.com>
#
# License: BSD (3-clause)
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne.decoding import ReceptiveField, TimeDelayingRidge
from scipy.stats import multivariate_normal
from scipy.io import loadm... |
chanitacr/sc-python | 02-widgets-answers.ipynb | mit | !conda install -y netcdf4
from netCDF4 import Dataset, num2date, date2num
from numpy import *
import matplotlib.pyplot as plt
%matplotlib inline
from ipywidgets import interact, interactive, fixed
import ipywidgets as widgets
x=linspace(0,1,100)
f=2
plt.plot(x, sin(2*pi*x*f))
def pltsin(f):
plt.plot(x,sin(2*pi... |
dennisobrien/PublicNotebooks | fivethirtyeight/2020-05-22 Can you Find the Fish in State Names.ipynb | mit | from collections import Counter
from joblib import Parallel, delayed
import json
import pandas as pd
import requests
"""
Explanation: Can You Find the Fish in State Names?
The Riddler - 2020-05-22
Ohio is the only state whose name doesn’t share any letters with the word “mackerel.” It’s strange, but it’s true.
But th... |
karlbenedict/karlbenedict.github.io | presentations/2014-04-CI-day/examples/notebook_02-Copy1.ipynb | mit | import urllib
import zipfile
import StringIO
import string
import pandas
import matplotlib.pyplot as plt
import numpy as np
from IPython.display import HTML
import json
"""
Explanation: Network Data Access - USGS NWIS Service-based Data Access
Karl Benedict
Director, Earth Data Analysis Center
Associate Professor, Uni... |
ES-DOC/esdoc-jupyterhub | notebooks/cmcc/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', 'cmcc', 'sandbox-1', 'toplevel')
"""
Explanation: ES-DOC CMIP6 Model Properties - Toplevel
MIP Era: CMIP6
Institute: CMCC
Source ID: SANDBOX-1
Sub-Topics: Radiative Forcings.
Properties: 85 (42 ... |
metpy/MetPy | v0.9/_downloads/98f29c056841d0a15e65eb4289574392/Station_Plot.ipynb | bsd-3-clause | import cartopy.crs as ccrs
import cartopy.feature as cfeature
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from metpy.calc import reduce_point_density
from metpy.calc import wind_components
from metpy.cbook import get_test_data
from metpy.plots import add_metpy_logo, current_weather, sky_cove... |
topologicalbudapest/topins2 | Spring_semester_second_session.ipynb | gpl-2.0 | def fOn(t,n):
'''
A piecewise function ...
'''
return ( 1*((t>=n)&(t<n+1)) + 0*((t<n)&(t>=n+1)));
def fSwitchOn(t,n):
return (t-n)*fOn(t,n);
def fSwitchOff(t,n):
return fOn(t,n)*(1-fSwitchOn(t,n));
"""
Explanation: Topological insulators II/02: Majorana fermions and brading
Task: Berry-phase... |
jinntrance/MOOC | coursera/deep-neural-network/quiz and assignments/Week 1 Python Basics with Numpy/Python+Basics+With+Numpy+v2.ipynb | cc0-1.0 | ### START CODE HERE ### (≈ 1 line of code)
test = "Hello IPython Notebook"
### END CODE HERE ###
print ("test: " + test)
"""
Explanation: Python Basics with Numpy (optional assignment)
Welcome to your first assignment. This exercise gives you a brief introduction to Python. Even if you've used Python before, this wil... |
BigDataRepublic/bdr-analytics-py | notebooks/bdr-imbalanced-classification.ipynb | apache-2.0 | import sys
sys.path.append('../')
# import generic packages
import numpy as np
import pandas as pd
# pd.options.display.max_columns = None
# pd.options.display.max_colwidth = 100
from IPython.display import display
# visualization packages
import matplotlib.pyplot as plt
import matplotlib
import seaborn as sns
sns.se... |
tensorflow/docs-l10n | site/ko/io/tutorials/dicom.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... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/how_google_does_ml/bigquery/labs/analyze_with_bigquery.ipynb | apache-2.0 | import os
import pandas as pd
PROJECT = "<YOUR PROJECT>" #TODO Replace with your project id
os.environ["PROJECT"] = PROJECT
pd.options.display.max_columns = 50
"""
Explanation: Analyze a large dataset with Google BigQuery
Learning Objectives
Access an ecommerce dataset
Look at the dataset metadata
Remove duplicat... |
Housebeer/Natural-Gas-Model | Matching Market v9.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... |
SnShine/aima-python | neural_nets.ipynb | mit | from learning import *
from notebook import psource, pseudocode
"""
Explanation: NEURAL NETWORKS
This notebook covers the neural network algorithms from chapter 18 of the book Artificial Intelligence: A Modern Approach, by Stuart Russel and Peter Norvig. The code in the notebook can be found in learning.py.
Execute t... |
wanderer2/pymc3 | docs/source/notebooks/GLM-robust.ipynb | apache-2.0 | %matplotlib inline
import pymc3 as pm
import matplotlib.pyplot as plt
import numpy as np
import theano
"""
Explanation: GLM: Robust Linear Regression
Author: Thomas Wiecki
This tutorial first appeard as a post in small series on Bayesian GLMs on my blog:
The Inference Button: Bayesian GLMs made easy with PyMC3
Thi... |
tensorflow/docs | site/en/r1/tutorials/distribute/keras.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... |
sthuggins/phys202-2015-work | assignments/assignment04/TheoryAndPracticeEx02.ipynb | mit | from IPython.display import Image
"""
Explanation: Theory and Practice of Visualization Exercise 2
Imports
End of explanation
"""
# Add your filename and uncomment the following line:
# Image(filename='yourfile.png')
Image('netfli.png')
"""
Explanation: Violations of graphical excellence and integrity
Find a data-f... |
markeyser/TensorFlow-Tutorials | MNIST-For-ML-Beginners.ipynb | mit | from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data", one_hot=True)
"""
Explanation: MNIST for ML beginners
Contents
About this tutorial.
The MNIST Data.
Softmax Regressions.
Implementing the Regression.
Training.
Evaluating Our Model.
When one learns how to prog... |
annarev/tensorflow | tensorflow/lite/g3doc/tutorials/model_maker_question_answer.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... |
datascienceguide/datascienceguide.github.io | tutorials/multiple_regression_in_python.ipynb | mit | import pandas as pd
import numpy as np
import statsmodels.api as sm
import matplotlib.pyplot as plt
%matplotlib inline
df_adv = pd.read_csv('http://www-bcf.usc.edu/~gareth/ISL/Advertising.csv', index_col=0)
X = df_adv[['TV', 'Radio']]
y = df_adv['Sales']
df_adv.head()
"""
Explanation: Multiple Regression using Statsm... |
ES-DOC/esdoc-jupyterhub | notebooks/csiro-bom/cmip6/models/sandbox-1/ocnbgchem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'csiro-bom', 'sandbox-1', 'ocnbgchem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem
MIP Era: CMIP6
Institute: CSIRO-BOM
Source ID: SANDBOX-1
Topic: Ocnbgchem
Sub-Topics: Tracers.
P... |
FinTechies/HedgingRL | notebooks/TD Learning Black Scholes1.ipynb | mit | aapl = data.DataReader('AAPL', 'yahoo', '2000-01-01')
print(aapl.head())
"""
Explanation: Plan
Some data: look at some stock price series
devise a model for stock price series: Geometric Brownian Motion (GBM)
Example for a contingent claim: call option
Pricing of a call option under the assumtpion of GBM
Challenges
... |
cenkbircanoglu/pycon-2017-ie | Exercise-4-intro-to-recommendation.ipynb | mit | correlated_items = ratings_pivot.corr()["B002I0JZOC"].sort_values(ascending=False).head(5)
correlated_items.index
"""
Explanation: Filter out video games which have no title
Filter out video games which have less than 5 ratings
Filter out users which have less than 5 ratings
Merge ratings and videogames dataframe on p... |
karlstroetmann/Algorithms | Python/Chapter-07/Ordered-Binary-Tree.ipynb | gpl-2.0 | class OrderedBinaryTree:
def __init__(self):
self.mKey = None
self.mValue = None
self.mLeft = None
self.mRight = None
"""
Explanation: Ordered Binary Trees
This notebook implements ordered binary trees. In order to define this notion, we first have to define
the concept of orde... |
vicolab/neural-network-intro | 4-gan/1-gan-multimodal-distribution.ipynb | mit | import pandas as pd
import numpy as np
import admin.tools as tools
data = pd.read_csv('resources/multinomial.csv', index_col=0 )
"""
Explanation: Generative Adversarial Networks 1
<div class="alert alert-warning">
In this notebook we will use what we have learned about artificial neural networks to explore generative... |
Nikolay-Lysenko/dsawl | docs/active_learning_demo.ipynb | mit | import math
from copy import copy
from typing import List
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import seaborn as sns
from sklearn.base import BaseEstimator
from sklearn.metrics import accuracy_score
from sklearn.ensemble import RandomForestClassifier
from sklearn.calibration import C... |
dryadb11781/machine-learning-python | general_examples/Ex2_feature_stacker.ipynb | bsd-3-clause | from sklearn.pipeline import Pipeline, FeatureUnion
from sklearn.grid_search import GridSearchCV
from sklearn.svm import SVC
from sklearn.datasets import load_iris
from sklearn.decomposition import PCA
from sklearn.feature_selection import SelectKBest
iris = load_iris()
X, y = iris.data, iris.target
"""
Explanation:... |
DJCordhose/ai | notebooks/tf2/ux-rnn.ipynb | mit | # for colab
!pip install -q tf-nightly-gpu-2.0-preview
import tensorflow as tf
print(tf.__version__)
# a small sanity check, does tf seem to work ok?
hello = tf.constant('Hello TF!')
print("This works: {}".format(hello))
# this should return True even on Colab
tf.test.is_gpu_available()
tf.test.is_built_with_cuda()... |
JuliaSprenger/elephant | doc/tutorials/unitary_event_analysis.ipynb | bsd-3-clause | import random
import numpy as np
import matplotlib.pyplot as plt
import quantities as pq
import neo
import elephant.unitary_event_analysis as ue
# Fix random seed to guarantee fixed output
random.seed(1224)
"""
Explanation: The Unitary Events Analysis
The executed version of this tutorial is at https://elephant.read... |
andrewzwicky/puzzles | FiveThirtyEightRiddler/2017-07-14/classic/championship.ipynb | mit | from matplotlib import pyplot as plt
from scipy.special import binom
"""
Explanation: Congratulations! The Acme Axegrinders, which you own, are the regular season champions of the National Squishyball League (NSL). Your team will now play a championship series against the Boondocks Barbarians, which had the second-bes... |
ethen8181/machine-learning | python/algorithms/recursion.ipynb | mit | from jupyterthemes import get_themes
from jupyterthemes.stylefx import set_nb_theme
themes = get_themes()
set_nb_theme(themes[1])
%load_ext watermark
%watermark -a 'Ethen' -d -t -v -p jupyterthemes
"""
Explanation: <h1>Table of Contents<span class="tocSkip"></span></h1>
<div class="toc"><ul class="toc-item"><li><span... |
mbatchkarov/LSH | lsh_minhash.ipynb | mit | document = 'Lorem Ipsum dolor sit amet'
# shingle and discard the last 5 as these are just the last n<5 characters from the document
shingles = [document[i:i+5] for i in range(len(document))][:-5]
shingles
other_document = 'Lorem Ipsum dolor sit amet is how dummy text starts'
# shingle and discard the last 5 as these ... |
bhermanmit/openmc | docs/source/examples/mg-mode-part-i.ipynb | mit | import os
import matplotlib.pyplot as plt
import matplotlib.colors as colors
import numpy as np
import openmc
%matplotlib inline
"""
Explanation: This Notebook illustrates the usage of OpenMC's multi-group calculational mode with the Python API. This example notebook creates and executes the 2-D C5G7 benchmark mode... |
eblur/AstroHackWeek2015 | day3-machine-learning/06 - Model Complexity.ipynb | gpl-2.0 | from plots import plot_kneighbors_regularization
plot_kneighbors_regularization()
"""
Explanation: Model Complexity, Overfitting and Underfitting
End of explanation
"""
from sklearn.datasets import load_digits
from sklearn.ensemble import RandomForestClassifier
from sklearn.learning_curve import validation_curve
di... |
ARM-software/lisa | ipynb/deprecated/examples/trace_analysis/TraceAnalysis_TasksLatencies.ipynb | apache-2.0 | import logging
from conf import LisaLogging
LisaLogging.setup()
# Generate plots inline
%matplotlib inline
import json
import os
# Support to access the remote target
import devlib
from env import TestEnv
# Support for workload generation
from wlgen import RTA, Ramp
# Support for trace analysis
from trace import T... |
chicagopython/CodingWorkshops | problems/data_science/team_project.ipynb | gpl-3.0 | !pip install meetup-api
import meetup.api
import pandas as pd
from IPython.display import Image, display, HTML
from itertools import combinations
import sys
"""
Explanation: Data Analysis using Pandas
Pandas has become the defacto package for data analysis. In this workshop, we are going to use the basics of pandas to... |
mne-tools/mne-tools.github.io | 0.20/_downloads/d1c21eabe5d4637eadd4844f42a680d3/plot_define_target_events.ipynb | bsd-3-clause | # Authors: Denis Engemann <denis.engemann@gmail.com>
#
# License: BSD (3-clause)
import mne
from mne import io
from mne.event import define_target_events
from mne.datasets import sample
import matplotlib.pyplot as plt
print(__doc__)
data_path = sample.data_path()
"""
Explanation: Define target events based on time ... |
fabianrost84/Rost-Rodrigo-Albors-et-al-2016 | calculations/lg_model/plot_lg_model_results.ipynb | bsd-3-clause | scale_growth = 1.0 / 1000.0
time = sp.array(store['time'])
gexpdata = store['gexpdata']
outgrowth_pop = store['outgrowth_pop']
condition = 'full'
fig, ax = plt.subplots(1, 2, sharex = True, figsize = (80.0/25.4, 52.0/25.4))
# fig.suptitle(full_title[condition], fontsize = 8)
# experimental data
ax[1].errorbar(sp.... |
keras-team/keras-io | guides/ipynb/keras_cv/cut_mix_mix_up_and_rand_augment.ipynb | apache-2.0 | import keras_cv
import matplotlib.pyplot as plt
import tensorflow as tf
import tensorflow_datasets as tfds
from tensorflow import keras
from tensorflow.keras import applications
from tensorflow.keras import losses
from tensorflow.keras import optimizers
"""
Explanation: CutMix, MixUp, and RandAugment image augmentatio... |
theandygross/HIV_Methylation | Setup/Imports.ipynb | mit | %pylab inline
rcParams['axes.color_cycle']
"""
Explanation: Global Imports
End of explanation
"""
from __future__ import division
import os as os
import pickle as pickle
import pandas as pd
"""
Explanation: External Package Imports
End of explanation
"""
from Helpers.LinAlg import *
from Helpers.Pandas import *... |
eds-uga/csci1360e-su16 | lectures/L9.ipynb | mit | def our_function():
pass
"""
Explanation: Lecture 9: Introduction to Functions
CSCI 1360E: Foundations for Informatics and Analytics
Overview and Objectives
In this lecture, we'll introduce the concept of functions, critical abstractions in nearly every modern programming language. Functions are important for abst... |
robertwb/incubator-beam | examples/notebooks/documentation/transforms/python/elementwise/regex-py.ipynb | apache-2.0 | #@title Licensed under the Apache License, Version 2.0 (the "License")
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you u... |
brian-rose/ClimateModeling_courseware | Assignments/Assignment02 -- Introducing CESM.ipynb | mit | # Ensure compatibility with Python 2 and 3
from __future__ import print_function, division
"""
Explanation: ATM 623: Climate Modeling
Brian E. J. Rose, University at Albany
Introducing the Community Earth System Model (CESM)
Warning: content out of date and not maintained
You really should be looking at The Climate L... |
InsightSoftwareConsortium/SimpleITK-Notebooks | Python/11_Progress.ipynb | apache-2.0 | %matplotlib inline
import matplotlib.pyplot as plt
import SimpleITK as sitk
print(sitk.Version())
import sys
import os
import threading
from myshow import myshow
from myshow import myshow3d
size = 256 # if this is too fast increase the size
img = sitk.GaborSource(
sitk.sitkFloat32,
size=[size] * 3,
sig... |
ecervera/UJI_AMR | exercises/Angle.ipynb | mit | import packages.initialization
import pioneer3dx as p3dx
p3dx.init()
"""
Explanation: <img align="right" src="../img/exercise_turning.png" />
Exercise: Turn the robot for an angle.
You are going to make a program for turning the robot from the initial position at the start of the simulation, in the center of the room.... |
ComputationalModeling/spring-2017-danielak | past-semesters/fall_2016/day-by-day/day05-flint-water-data-analysis-day2/flint-data-2-IN-CLASS-ACTIVITY.ipynb | agpl-3.0 | # THIS CELL READS IN THE FLINT DATASET - DO NOT CHANGE ANYTHING!
# Make plots inline
%matplotlib inline
# Make inline plots vector graphics instead of raster graphics
from IPython.display import set_matplotlib_formats
set_matplotlib_formats('pdf', 'svg')
# import modules for plotting and data analysis
import matplot... |
mayank-johri/LearnSeleniumUsingPython | Section 1 - Core Python/Chapter 03 - Control Flow/3.1 Compound Statements.ipynb | gpl-3.0 | password = input("Please enter the password:")
if password == "Simsim":
print("\t> Welcome to the cave")
x = "Mayank"
y = "TEST"
if y == "TEST":
print(x)
if y:
print("Hello World")
z = None
if z:
print("TEST")
x = 11
if x > 10:
print("Hello")
if x > 10.999999999999:
print("Hello agai... |
google/trax | trax/tf_numpy_and_keras.ipynb | apache-2.0 | #@title
# Copyright 2020 Google LLC.
# 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... |
kylepjohnson/notebooks | public_talks/2016_10_26_harvard/0 Setup.ipynb | mit | import datetime as dt
from cltk.corpus.utils.importer import CorpusImporter
corpus_importer = CorpusImporter('greek')
corpus_importer.list_corpora
corpus_importer.import_corpus('tlg', '/root/classics_corpora/TLG_E')
"""
Explanation: Import TLG
http://docs.cltk.org/en/latest/importing_corpora.html
End of explanation... |
maartenbreddels/vaex | docs/source/index.ipynb | mit | import vaex
df = vaex.example() # open the example dataset provided with vaex
"""
Explanation: Installation
Tutorials
Examples
Gallery
API
Datasets
FAQ
What is Vaex?
Vaex is a python library for lazy Out-of-Core DataFrames (similar to Pandas), to visualize and explore big tabular datasets. It can calculate statistics... |
mne-tools/mne-tools.github.io | 0.16/_downloads/plot_ica_comparison.ipynb | bsd-3-clause | # Authors: Pierre Ablin <pierreablin@gmail.com>
#
# License: BSD (3-clause)
from time import time
import mne
from mne.preprocessing import ICA
from mne.datasets import sample
print(__doc__)
"""
Explanation: Compare the different ICA algorithms in MNE
Different ICA algorithms are fit to raw MEG data, and the corres... |
pysg/pyther | Modelo de impregnacion/modelo2/Activité 10.ipynb | mit | import numpy as np
from scipy import integrate
from matplotlib.pylab import *
"""
Explanation: Evaluation des modèles pour l'extraction supercritique
L'extraction supercritique est de plus en plus utilisée afin de retirer des matières organiques de différents liquides ou matrices solides. Cela est dû au fait que les f... |
jason-neal/eniric | docs/Notebooks/Convolution_speeds.ipynb | mit | import matplotlib.pyplot as plt
import numpy as np
import PyAstronomy.pyasl as pyasl
import eniric
from eniric import config
from eniric.broaden import rotational_convolution, resolution_convolution
from eniric.utilities import band_limits, load_aces_spectrum, wav_selector
from scripts.phoenix_precision import convolv... |
rnwatanabe/projectPR | ExampleNotebooks/MuscleHillExample.ipynb | gpl-3.0 | import sys
sys.path.insert(0, '..')
import time
import matplotlib.pyplot as plt
%matplotlib notebook
from IPython.display import set_matplotlib_formats
set_matplotlib_formats('pdf', 'png')
plt.rcParams['savefig.dpi'] = 75
plt.rcParams['figure.autolayout'] = False
plt.rcParams['figure.figsize'] = 10, 6
plt.rcParams['ax... |
FFroehlich/AMICI | python/examples/example_constant_species/ExampleEquilibrationLogic.ipynb | bsd-2-clause | from IPython.display import Image
fig = Image(filename=('../../../documentation/gfx/steadystate_solver_workflow.png'))
fig
"""
Explanation: AMICI documentation example of the steady state solver logic
This is an example to document the internal logic of the steady state solver, which is used in preequilibration and po... |
jinntrance/MOOC | coursera/ml-classification/assignments/module-4-linear-classifier-regularization-assignment-blank.ipynb | cc0-1.0 | from __future__ import division
import graphlab
"""
Explanation: Logistic Regression with L2 regularization
The goal of this second notebook is to implement your own logistic regression classifier with L2 regularization. You will do the following:
Extract features from Amazon product reviews.
Convert an SFrame into a... |
robblack007/clase-dinamica-robot | Practicas/practica3/visualizacion.ipynb | mit | from robots.robots import Robot
from numpy import pi
"""
Explanation: Práctica 3 - Dinámica de manipuladores
En este documento se van a importar las librerias necesarias para graficar los datos simulados por medio de los métodos numéricos descritos en el documento (numerico.ipynb).
Este documento debe estar abierto a... |
sjqgithub/rquestions | Experiment.ipynb | mit | Y = experts_count.Label
X_title = experts_count.Title
print (type(Y),type(X_title))
X_title = tfv.fit_transform(list(X_title))
X_title
# for fun
from sklearn.cross_validation import train_test_split
X_train, X_test, Y_train, Y_test = train_test_split(X_title, Y, test_size=.10)
lr = LogisticRegression(C=2)
lr.fit(X_... |
AstroHackWeek/AstroHackWeek2017 | day1/notebooks/demo-Gaia.ipynb | mit | from os import path
import numpy as np
import astropy.coordinates as coord
import astropy.units as u
from astropy.io import fits
from astropy.table import Table
import matplotlib.pyplot as plt
plt.style.use('notebook.mplstyle')
%matplotlib inline
import numpy as np
data_path = '../data/'
"""
Explanation: Gaia TGAS +... |
ES-DOC/esdoc-jupyterhub | notebooks/bcc/cmip6/models/sandbox-3/atmos.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'bcc', 'sandbox-3', 'atmos')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmos
MIP Era: CMIP6
Institute: BCC
Source ID: SANDBOX-3
Topic: Atmos
Sub-Topics: Dynamical Core, Radiation, Turbulen... |
felipeeeantunes/DataScienceBR | chrimatocracy/Brazilian Chrimatocracy - Dep. Estadual Brasil.ipynb | mit | import pandas as pd
import networkx as nx
import seaborn as sns
import numpy as np
import benford as bf
pd.options.display.float_format = '{:.2f}'.format
import matplotlib.pyplot as plt
%matplotlib inline
rc={'savefig.dpi': 75, 'figure.autolayout': False, 'figure.figsize': [12, 8], 'axes.labelsize': 18,\
'axes.tit... |
sorig/shogun | doc/ipython-notebooks/statistical_testing/mmd_two_sample_testing.ipynb | bsd-3-clause | %pylab inline
%matplotlib inline
import os
SHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data')
import shogun as sg
import numpy as np
"""
Explanation: Kernel hypothesis testing in Shogun
Heiko Strathmann - heiko.strathmann@gmail.com - http://github.com/karlnapf - http://herrstrathmann.de
Soumyajit De - soumy... |
gip/quant | ripple/OrderbooksRipple.ipynb | mit | import matplotlib.pyplot as plt
%matplotlib inline
from pyripple.feed import syncfeed
feed = syncfeed.SyncFeed()
"""
Explanation: <br />
<br />
Gilles Pirio @ Ripple Research & Data Team
August 20, 2015
Visualizing order books on Ripple
Ripple is a distributed ledger that is not limited to one currency. The Ripple pro... |
nholtz/structural-analysis | matrix-methods/frame2d/Frame2D/Tables.ipynb | cc0-1.0 | from salib import extend
import pandas as pd
import os, os.path
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
import hashlib
from IPython.core.magic import register_cell_magic
import re
"""
Explanation: Data Input Tables and Sources
Module to simplify handling of input and outp... |
patrick-kidger/equinox | examples/score_based_diffusion.ipynb | apache-2.0 | import array
import functools as ft
import gzip
import os
import struct
import urllib.request
import diffrax as dfx # https://github.com/patrick-kidger/diffrax
import einops # https://github.com/arogozhnikov/einops
import jax
import jax.numpy as jnp
import jax.random as jr
import matplotlib.pyplot as plt
import opta... |
rongchuhe2/workshop_data_analysis_python | example_bridge_bike_counter.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
"""
Explanation: Unsupervised Analysis of Days of Week
Treating crossing each day as features to learn about the relatinships between various days.
End of explanation
"""
from urllib import request
FREMONT_URL = 'https://data.seattle.gov/api/views/65db-xm6k/rows.c... |
flohorovicic/pynoddy | docs/notebooks/2-Adjust-input.ipynb | gpl-2.0 | from IPython.core.display import HTML
css_file = 'pynoddy.css'
HTML(open(css_file, "r").read())
cd ../docs/notebooks/
%matplotlib inline
import sys, os
import matplotlib.pyplot as plt
import numpy as np
# adjust some settings for matplotlib
from matplotlib import rcParams
# print rcParams
rcParams['font.size'] = 15
... |
damontallen/SVG-Beam-gif-animation | Beam_equation.ipynb | mit | from sympy import symbols, collect, expand, latex, simplify
D, x, x_0, E, I, w, y_0, L, y, t = symbols('Delta x x_0 E I w y_0 L y t')
from sympy import init_printing
init_printing(use_unicode=True)
D = w/(2*E*I)*((x-x_0)**4/12-L*(x-x_0)**3/6+L**3/12*(x-x_0)+2*y_0*E*I/w)
D
E = expand(D)
E
F = collect(E,x)
F
latex(F... |
kfollette/ASTR200-Spring2017 | Lecture Notes/Binning.ipynb | mit | quarcs_data["PRE_SCORE"].hist(bins=24)
"""
Explanation: Binning - Basic Ideas
End of explanation
"""
quarcs_data["PRE_SCORE"].hist(bins=12)
quarcs_data["PRE_SCORE"].hist(bins=6)
"""
Explanation: Downsampling Data
For coarser view
End of explanation
"""
quarcs_data["PRE_SCORE"].hist(bins=49)
quarcs_data["PRE... |
JarnoRFB/qtpyvis | notebooks/caffe/inference.ipynb | mit | data = mnist.load_data()[1][0]
# Normalize data.
data = data / data.max()
plt.imshow(data[0, :, :])
"""
Explanation: Preprocess dataset.
End of explanation
"""
seven = data[0, :, :]
print(seven.shape)
seven = seven[np.newaxis, ...]
print(seven.shape)
"""
Explanation: Reshape the data so it fits into the caffe net.... |
umairacheema/authorship-attribution | author-attribution.ipynb | apache-2.0 | %matplotlib inline
import sys
import re
import os
import csv
import codecs
import string
import json
import boto
import pattern
import pandas as pd
import seaborn as sns
import numpy as np
import scipy as sp
import nltk as nl
import matplotlib as mpl
import matplotlib.cm as cm
import matplotlib.pyplot as plt
from matpl... |
BrownDwarf/ApJdataFrames | notebooks/Luhman2004b.ipynb | mit | import warnings
warnings.filterwarnings("ignore")
"""
Explanation: ApJdataFrames 002: Luhman2004b
Title: The First Discovery of a Wide Binary Brown Dwarf
Authors: Luhman K.L.
Data is from this paper:
http://iopscience.iop.org/0004-637X/614/1/398
End of explanation
"""
import pandas as pd
names = ["component", "RA",... |
mne-tools/mne-tools.github.io | stable/_downloads/00ac060e49528fd74fda09b97366af98/3d_to_2d.ipynb | bsd-3-clause | # Authors: Christopher Holdgraf <choldgraf@berkeley.edu>
# Alex Rockhill <aprockhill@mailbox.org>
#
# License: BSD-3-Clause
from mne.io.fiff.raw import read_raw_fif
import numpy as np
from matplotlib import pyplot as plt
from os import path as op
import mne
from mne.viz import ClickableImage # noqa: ... |
google/ldif | ldif_example_inference.ipynb | apache-2.0 | import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import importlib
import numpy as np
import tensorflow as tf
tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR)
import trimesh
from ldif.datasets import shapenet_np
importlib.reload(shapenet_np)
from ldif.util import geom_util
importlib.reload(geom_util)
fro... |
bayesimpact/bob-emploi | data_analysis/notebooks/datasets/imt/application_modes.ipynb | gpl-3.0 | import os
from os import path
import pandas as pd
import seaborn as _
DATA_FOLDER = os.getenv('DATA_FOLDER')
modes = pd.read_csv(path.join(DATA_FOLDER, 'imt/application_modes.csv'))
modes.head()
"""
Explanation: Author: Marie Laure, marielaure@bayesimpact.org
Application modes (IMT) Dataset retrieved from emploi-s... |
amueller/strata_singapore_2015 | 01 - Introduction to Scikit-learn.ipynb | cc0-1.0 | from sklearn.svm import LinearSVC
"""
Explanation: Really Simple API
0) Import your model class
End of explanation
"""
svm = LinearSVC(C=0.1)
"""
Explanation: 1) Instantiate an object and set the parameters
End of explanation
"""
svm.fit(X_train, y_train)
"""
Explanation: 2) Fit the model
End of explanation
"""
... |
GoogleCloudPlatform/asl-ml-immersion | notebooks/end-to-end-structured/solutions/4c_keras_wide_and_deep_babyweight.ipynb | apache-2.0 | import datetime
import os
import shutil
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
print(tf.__version__)
"""
Explanation: LAB 4c: Create Keras Wide and Deep model.
Learning Objectives
Set CSV Columns, label column, and column defaults
Make dataset of features and label from CSV file... |
QuantCrimAtLeeds/PredictCode | examples/Case Study Chicago South Side/Retrohotspot.ipynb | artistic-2.0 | %matplotlib inline
from common import *
datadir = os.path.join("//media", "disk", "Data")
#datadir = os.path.join("..", "..", "..", "..", "..", "Data")
south_side, points = load_data(datadir)
"""
Explanation: Retrospective hotspotting
Recall that the "retrospective hotspot" method has no sense of time (but often a sl... |
mcc-petrinets/formulas | spot/tests/python/testingaut.ipynb | mit | f = spot.formula('a U Gb')
a = f.translate('ba')
a
"""
Explanation: To translate a formula into a Testing Automaton
Start by building a Buchi automaton
End of explanation
"""
propset = spot.atomic_prop_collect_as_bdd(f, a)
ta = spot.tgba_to_ta(a, propset, True, True, False, False, True)
ta.show('.A')
"""
Explanatio... |
tensorflow/text | docs/guide/unicode.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... |
m2dsupsdlclass/lectures-labs | labs/01_keras/Intro Keras.ipynb | mit | import matplotlib.pyplot as plt
import numpy as np
from sklearn.datasets import load_digits
digits = load_digits()
digits.images.shape
digits.data.shape
digits.target.shape
sample_index = 45
plt.figure(figsize=(3, 3))
plt.imshow(digits.images[sample_index], cmap=plt.cm.gray_r,
interpolation='nearest')
p... |
AnthonyHorton/huntsman-specs | Huntsman Telephoto Array specifications.ipynb | mit | import math
from astropy import units as u
pixel_pitch = 5.4 * u.micron / u.pixel # STF-8300M pixel pitch
focal_length = 400 * u.millimeter # Canon EF 400 mm f/2.8L IS II USM focal length
resolution = (3326, 2504) * u.pixel # STF-8300M resolution in pixels, (x, y)
sampling = (pixel_pitch / focal_length).to(u.radian... |
H-E-L-P/XID_plus | docs/build/html/notebooks/examples/XID+example_run_script_profile.ipynb | mit | from astropy.io import ascii, fits
import pylab as plt
%matplotlib inline
from astropy import wcs
import numpy as np
import xidplus
from xidplus import moc_routines
import pickle
"""
Explanation: XID+ Example Run Script
(This is based on a Jupyter notebook, available in the XID+ package and can be interactively run ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.