repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
swirlingsand/deep-learning-foundations
gans/batch-norm/Batch_Normalization_Solutions.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 – Solutions Batch normalization is most useful when building deep neural networks. To demonstrate this, we'll create a co...
pwer21c/pwer21c.github.io
python/pythoncodes/.ipynb_checkpoints/3_preview_for_10022021-checkpoint.ipynb
mit
fruits = ["apple", "banana", "cherry"] for x in fruits: print(x) """ Explanation: 리스트 공부할때 fruits라는 리스트 이름에 과일을 저장했어요. 이제 하나하나의 과일을 출력해 봅시다. End of explanation """ fruits = ["apple", "banana", "cherry"] for abc in fruits: print(x) """ Explanation: 사과, 바나나, 체리 순서로 출력이 됩니다. for 다음에 한칸 띄우고 x라는 이름을 썼어요. 이건 아무거나 써도...
AllenDowney/ThinkStats2
code/chap05ex.ipynb
gpl-3.0
from os.path import basename, exists def download(url): filename = basename(url) if not exists(filename): from urllib.request import urlretrieve local, _ = urlretrieve(url, filename) print("Downloaded " + local) download("https://github.com/AllenDowney/ThinkStats2/raw/master/code/th...
astroumd/GradMap
notebooks/Lectures2019/Lecture1/L1_challenge_problem_stars_student.ipynb
gpl-3.0
# These are your stellar temperatures, you're welcome! temperatures = [5809, 16589, 4698, 1869, 37809, 8634] """ Explanation: Stellar Classification Background The Harvard Spectral Classification system for stars classifies stars based on their spectral type - where the type of a star is designated as a letter that c...
AllenDowney/ProbablyOverthinkingIt
ess5.ipynb
mit
from __future__ import print_function, division import string import random import cPickle as pickle import numpy as np import pandas as pd import statsmodels.formula.api as smf import thinkstats2 import thinkplot import matplotlib.pyplot as plt import ess # colors by colorbrewer2.org BLUE1 = '#a6cee3' BLUE2 = '#1...
Dans-labs/dariah
static/tools/.ipynb_checkpoints/from_filemaker-checkpoint.ipynb
mit
import os,sys,re,collections,json from os.path import splitext, basename from functools import reduce from glob import glob from lxml import etree from datetime import datetime from pymongo import MongoClient from bson.objectid import ObjectId """ Explanation: Importing InKind from FileMaker We use an XML export of th...
AllenDowney/ModSim
python/soln/examples/kitten_soln.ipynb
gpl-2.0
# install Pint if necessary try: import pint except ImportError: !pip install pint # download modsim.py if necessary from os.path import exists filename = 'modsim.py' if not exists(filename): from urllib.request import urlretrieve url = 'https://raw.githubusercontent.com/AllenDowney/ModSim/main/' ...
samueljrowell/UVM-ME249-CFD
ME249-Lecture-0.ipynb
gpl-2.0
%matplotlib inline # plots graphs within the notebook %config InlineBackend.figure_format='svg' # not sure what this does, may be default images to svg format import matplotlib.pyplot as plt #calls the plotting library hereafter referred as to plt import numpy as np """ Explanation: Figure 1. Sketch of a cell (top...
HumanCompatibleAI/imitation
examples/5_train_preference_comparisons.ipynb
mit
from imitation.algorithms import preference_comparisons from imitation.rewards.reward_nets import BasicRewardNet from imitation.util.networks import RunningNorm from imitation.policies.base import FeedForward32Policy, NormalizeFeaturesExtractor import seals import gym from stable_baselines3.common.vec_env import DummyV...
dalonlobo/GL-Mini-Projects
TweetAnalysis/Final/Q6/Dalon_4_RTD_MiniPro_Tweepy_Q6.ipynb
mit
import logging # python logging module # basic format for logging logFormat = "%(asctime)s - [%(levelname)s] (%(funcName)s:%(lineno)d) %(message)s" # logs will be stored in tweepy.log logging.basicConfig(filename='tweepylang.log', level=logging.INFO, format=logFormat, datefmt="%Y-%m-%d %H:%M:%S") ...
csyhuang/hn2016_falwa
examples/simple/Example_barotropic.ipynb
mit
from hn2016_falwa.wrapper import barotropic_eqlat_lwa # Module for plotting local wave activity (LWA) plots and # the corresponding equivalent-latitude profile from math import pi from netCDF4 import Dataset import numpy as np import matplotlib.pyplot as plt %matplotlib inline # --- Parameters...
yongtang/tensorflow
tensorflow/lite/g3doc/guide/authoring.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...
flowmatters/veneer-py
doc/examples/nodes/WorkingWithDemandModels.ipynb
isc
v.model.node.water_users.names() v.model.node.water_users.demands() v.model.node.water_users.demands(nodes='IrrigationOnlyForestWU') """ Explanation: Finding water users and demands End of explanation """ v.model.node.water_users.add_timeseries? v.model.node.water_users.add_irrigator? v.model.node.water_users.ad...
vkuznet/rep
howto/00-intro-ROOT.ipynb
apache-2.0
%pylab inline """ Explanation: Allowing inline plots End of explanation """ import numpy import root_numpy # generating random data data = numpy.random.normal(size=[10000, 2]) # adding names of columns data = data.view([('first', float), ('second', float)]) # root_numpy.array2root(data, filename='./toy_datasets/ran...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/structured/solutions/4a_sample_babyweight.ipynb
apache-2.0
!sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst %%bash pip freeze | grep google-cloud-bigquery==1.6.1 || \ pip install google-cloud-bigquery==1.6.1 """ Explanation: LAB 4a: Creating a Sampled Dataset. Learning Objectives Setup up the environment. Sample the natality dataset to create train/eval/t...
tpin3694/tpin3694.github.io
sql/commenting_sql_code.ipynb
mit
# Ignore %load_ext sql %sql sqlite:// %config SqlMagic.feedback = False """ Explanation: Title: Commenting SQL Code Slug: commenting_sql_code Summary: Commenting code in SQL. Date: 2017-01-16 12:00 Category: SQL Tags: Basics Authors: Chris Albon Note: This tutorial was written using Catherine Devlin's SQL in Jupyt...
podondra/bt-spectraldl
notebooks/02-data-to-hdf5.ipynb
gpl-3.0
%matplotlib inline import os import glob import random import h5py import astropy.io.fits import numpy as np import matplotlib.pyplot as plt # find the normalized spectra in data_path directory # add all filenames to the list fits_paths FITS_DIR = 'data/ondrejov/' fits_paths = glob.glob(FITS_DIR + '*.fits') len(fits_...
gojomo/gensim
docs/notebooks/online_w2v_tutorial.ipynb
lgpl-2.1
from gensim.corpora.wikicorpus import WikiCorpus from gensim.models.word2vec import Word2Vec, LineSentence from pprint import pprint from copy import deepcopy from multiprocessing import cpu_count from smart_open import smart_open """ Explanation: Online word2vec tutorial So far, word2vec cannot increase the size of v...
betoesquivel/comment_summarization
.ipynb_checkpoints/Lab1 Text processing with python-checkpoint.ipynb
mit
import sklearn import numpy as np import matplotlib.pyplot as plt data = np.array([[1,2], [2,3], [3,4], [4,5], [5,6]]) x = data[:,0] y = data[:,1] data, x, y """ Explanation: Basic usage of Sklearn End of explanation """ from sklearn.feature_extraction.text import CountVectorizer vectorizer = CountVectorizer(min_d...
jphall663/GWU_data_mining
02_analytical_data_prep/src/py_part_2_encoding.ipynb
apache-2.0
import pandas as pd # pandas for handling mixed data sets """ Explanation: License Copyright (C) 2017 J. Patrick Hall, jphall@gwu.edu Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software...
arnoldlu/lisa
ipynb/examples/utils/testenv_example.ipynb
apache-2.0
# One initial cell for imports import json import time import os import logging from conf import LisaLogging LisaLogging.setup() # For debug information use: # LisaLogging.setup(level=logging.DEBUG) """ Explanation: Test environment API - TestEnv The test environment is primarily defined by the target configuration (...
jeffheaton/aifh
math/Untitled.ipynb
apache-2.0
import numpy as np i = np.arange(1,11) # 11, because arange is not inclusive s = np.sum(2*i) print(s) More traditional looping (non-Numpy) would perform the summation as follows: s = 0 for i in range(1,11): s += 2*i print(s) """ Explanation: Artificial Intelligence for Humans Introduction to the Math of N...
WNoxchi/Kaukasos
FADL1/vgg16_lesson1.ipynb
mit
%reload_ext autoreload %autoreload 2 %matplotlib inline from fastai.imports import * from fastai.transforms import * from fastai.conv_learner import * from fastai.model import * from fastai.dataset import * from fastai.sgdr import * from fastai.plots import * PATH = "data/dogscats/" sz=224 ARCH = vgg16 bs = 16 # Un...
jquacinella/TutoringSnippets
Histogram.ipynb
gpl-3.0
%pylab inline import numpy as np import pandas as pd import matplotlib.pyplot as plt """ Explanation: Histogram of one column by binning on another continuous End of explanation """ # Class label would be categorical variable derived from binning the continuous column x = ['Class1']*300 + ['Class2']*400 + ['Class3']...
sraejones/phys202-2015-work
assignments/assignment04/MatplotlibEx02.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np """ Explanation: Matplotlib Exercise 2 Imports End of explanation """ !head -n 30 open_exoplanet_catalogue.txt """ Explanation: Exoplanet properties Over the past few decades, astronomers have discovered thousands of extrasolar planets. The follo...
gabriel-astudillo/jupyter
Rendimiento Computacional.ipynb
gpl-3.0
import pandas as pd import numpy as np import scipy as sp import plotly.plotly as py import plotly.figure_factory as ff import plotly from plotly.graph_objs import * plotly.tools.set_credentials_file(username='gastudillo', api_key='OiqcwUGj4Jmtn1KtY6oR') """ Explanation: Descripción del software Diagrama de Estados <i...
AaronCWong/phys202-2015-work
assignments/assignment11/OptimizationEx01.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np import scipy.optimize as opt """ Explanation: Optimization Exercise 1 Imports End of explanation """ def hat(x,a,b): v = (-a*(x**2))+(b*(x**4)) return v assert hat(0.0, 1.0, 1.0)==0.0 assert hat(0.0, 1.0, 1.0)==0.0 assert hat(1.0, 10.0, 1...
cranium/deep-learning
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...
getsmarter/bda
module_4/M4_NB2_PeerNetworkAnalysis.ipynb
mit
# Load the relevant libraries to your notebook. import pandas as pd # Processing csv files and manipulating the DataFrame. import networkx as nx # Graph-like object representation and manipulation module. import matplotlib.pylab as plt # Plotting and data visualization module. ...
landlab/landlab
notebooks/tutorials/network_sediment_transporter/nst_scaling_profiling.ipynb
mit
import cProfile import io import pstats import time import warnings from pstats import SortKey import matplotlib.pyplot as plt import numpy as np import pandas as pd import xarray as xr from landlab.components import FlowDirectorSteepest, NetworkSedimentTransporter from landlab.data_record import DataRecord from land...
ES-DOC/esdoc-jupyterhub
notebooks/ipsl/cmip6/models/ipsl-cm6a-lr/atmos.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'ipsl', 'ipsl-cm6a-lr', 'atmos') """ Explanation: ES-DOC CMIP6 Model Properties - Atmos MIP Era: CMIP6 Institute: IPSL Source ID: IPSL-CM6A-LR Topic: Atmos Sub-Topics: Dynamical Core, Radiation, ...
paulvangentcom/heartrate_analysis_python
examples/4_smartring_data/Analysing_Smart_Ring_Data.ipynb
mit
#Let's import some packages first import numpy as np import matplotlib.pyplot as plt import heartpy as hp sample_rate = 32 #load the example file data = hp.get_data('ring_data.csv') """ Explanation: Analysing PPG signals from smart rings There's a range of Smart Rings that recently hit the market. Among other thing...
martysyuk/PY-3-Learning
homeworks/lesson4-1-docs.ipynb
mit
import pandas as pd import os.path as path """ import numpy as np import matplotlib.pyplot as plt %matplotlib inline """ """ Explanation: Домашнее задание по уроку 4.1 Выполнил Мартысюк Илья. End of explanation """ PATH = '/Users/martysyuk/Documents/Python 3 Coding/Repositorys/PY-3-Learning/homeworks/names/' names...
tensorflow/docs-l10n
site/en-snapshot/guide/migrate/tflite.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...
arcyfelix/Courses
17-09-17-Python-for-Financial-Analysis-and-Algorithmic-Trading/04-Visualization-Matplotlib-Pandas/04b-Pandas Visualization/01 - Pandas Built-in Data Visualization.ipynb
apache-2.0
import numpy as np import pandas as pd %matplotlib inline """ Explanation: <a href='http://www.pieriandata.com'> <img src='../../Pierian_Data_Logo.png' /></a> Pandas Built-in Data Visualization In this lecture we will learn about pandas built-in capabilities for data visualization! It's built-off of matplotlib, but i...
alansaul/ods
notebooks/pods/datasets/google_trends.ipynb
bsd-3-clause
import pods %matplotlib inline # calling without arguments uses the default query terms data = pods.datasets.google_trends() """ Explanation: Datasets: Downloading Data from Google Trends 28th May 2014 Neil Lawrence This data set collection was inspired by a ipython notebook from sahuguet which made queries to googl...
VectorBlox/PYNQ
Pynq-Z1/notebooks/examples/mxp_filters_hdmi.ipynb
bsd-3-clause
from pynq import Overlay Overlay("vbx.bit").download() """ Explanation: OpenCV Filters HDMI In this notebook, several filters will be applied to HDMI input images. Those input sources and applied filters will then be displayed either directly in the notebook or on HDMI output. To run all cells in this notebook a HDMI...
mne-tools/mne-tools.github.io
0.17/_downloads/275d6fecfc61c14ad9e91bb36b7359e0/plot_stats_cluster_erp.ipynb
bsd-3-clause
import numpy as np import matplotlib.pyplot as plt from scipy.stats import ttest_ind import mne from mne.channels import find_ch_connectivity, make_1020_channel_selections from mne.stats import spatio_temporal_cluster_test np.random.seed(0) # Load the data path = mne.datasets.kiloword.data_path() + '/kword_metadata-...
kenjisato/intro-macro
doc/python/Optimal Growth (DP).ipynb
mit
%matplotlib inline import numpy as np import matplotlib.pyplot as plt """ Explanation: Computing the Optimal Growth Model by Dynamic Programming End of explanation """ alpha = 0.3 delta = 0.05 theta = 5.0 rho = alpha * delta * theta - delta A = 1 def u(c): """utility function""" if theta == 1: retur...
joekasp/spectro
DEMO.ipynb
mit
%matplotlib inline from ipywidgets import * from IPython.display import display import matplotlib.pyplot as plt import numpy as np from scipy.optimize import curve_fit from util import * from analysis import * import fits from plot import * from plot3d import * """ Explanation: Analysis of 2D-IR spectroscopy This fir...
valentina-s/GLM_PythonModules
notebooks/.ipynb_checkpoints/Filters-checkpoint.ipynb
bsd-2-clause
import numpy as np import scipy as sp from scipy import linalg import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Filters for Neural Encoding This notebook discusses the construction of filters for neural encoding via Generalized Linear Models. The basis for the filters consists of raised cosine func...
Upward-Spiral-Science/grelliam
code/classification_simulation.ipynb
apache-2.0
import numpy as np import matplotlib.pyplot as plt import os import csv import igraph as ig from sklearn import cross_validation from sklearn.cross_validation import LeaveOneOut from sklearn.neighbors import KNeighborsClassifier from sklearn.ensemble import RandomForestClassifier from sklearn.svm import SVC from sklea...
Spaxe/pyconau2017-messy-sensor-data
Messy Sensor Data - A Programmer's Cleaning Guide.ipynb
mit
import pandas as pd # Open a comma-separated values (CSV) file as a DataFrame weather_observations = pd.read_csv('observations/Canberra_observations.csv') # Print the first 5 entries weather_observations.head() """ Explanation: Messy Sensor Data: A Programmer's Cleaning Guide @Xavier_Ho, #pyconau <small>Feel free t...
timnon/pyschedule
example-notebooks/sports-scheduling.ipynb
apache-2.0
import sys;sys.path.append('../src') from pyschedule import Scenario, solvers, plotters, alt n_teams = 12 # Number of teams n_fields = int(n_teams/2) # Num of fields n_rounds = n_teams-1 # Number of rounds # Create scenario S = Scenario('sport_scheduling',horizon=n_rounds) # Game tasks Games = { (i,j) : S.Task('Game...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/time_series_prediction/solutions/optional_2_feature_engineering.ipynb
apache-2.0
PROJECT = 'your-gcp-project' # Replace with your project ID. import pandas as pd from google.cloud import bigquery from IPython.core.magic import register_cell_magic from IPython import get_ipython bq = bigquery.Client(project = PROJECT) # Allow you to easily have Python variables in SQL query. @register_cell_magi...
ercius/openNCEM
ncempy/notebooks/example_peakFind.ipynb
gpl-3.0
%matplotlib notebook import numpy as np import matplotlib.pyplot as plt # Import these from ncempy.algo from ncempy.algo import gaussND from ncempy.algo import peakFind """ Explanation: Example of how to find peaks in a synthetic image Create a set of 2D Gaussians Find the center of the Guassian to integer accuracy...
serenejiang/MrOS_VitaminD
notebooks/3.1 PD alpha diversity analysis (Linear Regression).ipynb
gpl-3.0
import pandas as pd import numpy as np import statsmodels.formula.api as smf from statsmodels.compat import lzip import statsmodels.stats.api as sms import statsmodels.api as sm import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline """ Explanation: output: 'mapping_PDalpha.txt'(mapping file with PD...
abhi1509/deep-learning
intro-to-tflearn/TFLearn_Digit_Recognition.ipynb
mit
# Import Numpy, TensorFlow, TFLearn, and MNIST data import numpy as np import tensorflow as tf import tflearn import tflearn.datasets.mnist as mnist """ Explanation: Handwritten Number Recognition with TFLearn and MNIST In this notebook, we'll be building a neural network that recognizes handwritten numbers 0-9. This...
Santana9937/Intro_to_recommender_systems
week_4/Week_4_Assign_User-User_Collaborative_Filtering.ipynb
mit
import numpy as np import pandas as pd """ Explanation: Assignment 3: User-User Collaborative Filtering Importing Libraries End of explanation """ mov_user_data = pd.read_excel('Assign_3_data.xlsx') """ Explanation: Loading the Data Loading the movie data from Excel into a DataFrame. End of explanation """ mov_us...
eds-uga/csci1360e-su17
assignments/A5/A5_Q2.ipynb
mit
truth = "This is some text.\nMore text, but on a different line!\nInsert your favorite meme here.\n" pred = read_file_contents("q1data/file1.txt") assert truth == pred retval = -1 try: retval = read_file_contents("nonexistent/path.txt") except: assert False else: assert retval is None """ Explanation: Q2 ...
ML4DS/ML4all
P5.Data preprocessing/Intro5_DataNormalization_student.ipynb
mit
# Some libraries that will be used along the notebook. import numpy as np import matplotlib.pyplot as plt """ Explanation: Data preprocessing methods: Normalization Notebook version: * 1.0 (Sep 15, 2020) - First version * 1.1 (Sep 15, 2021) - Exercises Authors: Jesús Cid Sueiro (jcid@ing.uc3m.es) End of explanation ...
ewulczyn/talk_page_abuse
src/figshare/Wikipedia Talk Data - Getting Started.ipynb
apache-2.0
import pandas as pd import urllib from sklearn.pipeline import Pipeline from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import TfidfTransformer from sklearn.linear_model import LogisticRegression from sklearn.metrics import roc_auc_score # download annotated comments an...
masonlab/labdrivers
example_nbs/example_2d_gate_bias_conductance.ipynb
mit
from labdrivers.ni import bnc2110 from labdrivers.keithley import keithley2400 from labdrivers.srs import sr830 """ Explanation: Importing drivers End of explanation """ daq = bnc2110(device='Dev1') keithley = keithley2400(GPIBaddr=22) lockin = sr830(GPIBaddr=8) """ Explanation: Object instantiation End of explanat...
YuguangTong/AY250-hw
hw_3/homework.ipynb
mit
# you need to install the following package to continue: # pip3 install SpeechRecognition # load monty class from monty import Monty """ Explanation: Interaction with the World Homework (#3) Python Computing for Data Science (c) J Bloom, UC Berkeley, 2016 1) Monty: The Python Siri Let's make a Siri-like program w...
Yu-Group/scikit-learn-sandbox
jupyter/backup_deprecated_nbs/07_tree_traversal_function.ipynb
mit
# Setup %matplotlib inline import matplotlib.pyplot as plt from sklearn.datasets import load_iris from sklearn.cross_validation import train_test_split from sklearn.ensemble import RandomForestClassifier from sklearn.metrics import confusion_matrix from sklearn.datasets import load_iris from sklearn import tree import ...
bjlange/csss-nlp-workshop
NLP Workshop (complete).ipynb
mit
csvfile = open('bernie-sanders-announces.csv','r') reader = csv.reader(csvfile) data = [] for line in reader: line[3] = line[3].decode('utf-8') data.append(line) len(data) data[0] data[1] comment_text = data[1][-1] """ Explanation: Getting data into Python (basic python i/o) End of explanation """ commen...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/explainable_ai/labs/xai_structured_caip.ipynb
apache-2.0
import os PROJECT_ID = "dougkelly-sandbox" # TODO: your PROJECT_ID here. os.environ["PROJECT_ID"] = PROJECT_ID BUCKET_NAME = "xai-labs" # TODO: your BUCKET_NAME here. REGION = "us-central1" os.environ['BUCKET_NAME'] = BUCKET_NAME os.environ['REGION'] = REGION """ Explanation: AI Explanations: Explaining a tabular ...
airanmehr/bio
notebooks/KGZ/QC.ipynb
mit
%matplotlib inline import matplotlib import numpy as np import matplotlib.pyplot as plt import sys,os path='/'.join(os.getcwd().split('/')[:-4]) sys.path.insert(1,path) import Utils.Util as utl import pandas as pd pd.options.display.max_rows = 20; pd.options.display.expand_frame_repr = True from IPython.display import ...
bioe-ml-w18/bioe-ml-winter2018
homeworks/Week3-Fitting.ipynb
mit
% matplotlib inline import matplotlib.pyplot as plt import numpy as np from scipy.special import binom from scipy.optimize import brentq np.seterr(over='raise') def StoneMod(Rtot, Kd, v, Kx, L0): ''' Returns the number of mutlivalent ligand bound to a cell with Rtot receptors, granted each epitope of the...
usantamaria/iwi131
ipynb/19-Diccionarios/Diccionarios.ipynb
cc0-1.0
d = {"alpha":1, "beta":[1,1,3,5], (0,1):"beta"} print d # No hay orden!! """ Explanation: <header class="w3-container w3-teal"> <img src="images/utfsm.png" alt="" align="left"/> <img src="images/inf.png" alt="" align="right"/> </header> <br/><br/><br/><br/><br/> IWI131 Programación de Computadores Sebastián Flores htt...
google/flax
examples/sst2/sst2.ipynb
apache-2.0
example_directory = 'examples/sst2' editor_relpaths = ('configs/default.py', 'train.py', 'models.py') # (If you run this code in Jupyter[lab], then you're already in the # example directory and nothing needs to be done.) #@markdown **Fetch newest Flax, copy example code** #@markdown #@markdown **If you select no** b...
bloomberg/bqplot
examples/Marks/Object Model/Pie.ipynb
apache-2.0
data = np.random.rand(3) pie = Pie(sizes=data, display_labels="outside", labels=list(string.ascii_uppercase)) fig = Figure(marks=[pie], animation_duration=1000) fig """ Explanation: Basic Pie Chart End of explanation """ n = np.random.randint(1, 10) pie.sizes = np.random.rand(n) """ Explanation: Update Data End of ...
csaladenes/csaladenes.github.io
test/eis-metadata-validation/Planon metadata validation4-Copy1.ipynb
mit
import pandas as pd import numpy as np import matplotlib.pyplot as plt %matplotlib inline """ Explanation: EIS metadata validation script Used to validate Planon output with spreadsheet input 1. Data import End of explanation """ planon=pd.read_excel('EIS Assets.xlsx',index_col = 'Code') master_loggerscontrollers = ...
vascotenner/holoviews
doc/Tutorials/Pandas_Seaborn.ipynb
bsd-3-clause
import itertools import numpy as np import pandas as pd import seaborn as sb import holoviews as hv np.random.seed(9221999) """ Explanation: In this notebook we'll look at interfacing between the composability and ability to generate complex visualizations that HoloViews provides, the power of pandas library datafra...
justinfinkle/pydiffexp
ipynb/example_diffexp.ipynb
gpl-3.0
import pandas as pd from pydiffexp import DEAnalysis """ Explanation: Pydiffexp The pydiffexp package is meant to provide an interface between R and Python to do differential expression analysis. Imports End of explanation """ test_path = "/Users/jfinkle/Documents/Northwestern/MoDyLS/Python/sprouty/data/raw_data/all...
JaviMerino/lisa
ipynb/utils/testenv_example.ipynb
apache-2.0
# Setup a target configuration conf = { # Platform and board to target "platform" : "linux", "board" : "juno", # Login credentials "host" : "192.168.0.1", "username" : "root", "password" : "", # Local installation path "tftp" : { "folder" : "/var/...
amitkaps/hackermath
Module_2d_Distributions.ipynb
mit
import pandas as pd import seaborn as sns sns.set(color_codes=True) %matplotlib inline #Import the data cars = pd.read_csv("cars_v1.csv", encoding="ISO-8859-1") #Replace missing values in Mileage with mean cars.Mileage.fillna(cars.Mileage.mean(), inplace=True) sns.distplot(cars.Mileage, kde=False) """ Explanation: ...
davidrpugh/pyCollocation
examples/auction-models.ipynb
mit
import functools class SymmetricIPVPModel(pycollocation.problems.IVP): def __init__(self, f, F, params): rhs = self._rhs_factory(f, F) super(SymmetricIPVPModel, self).__init__(self._initial_condition, 1, 1, params, rhs) @staticmethod def _initial_condition(v, sigma, v_lower, ...
dereneaton/ipyrad
testdocs/analysis/cookbook-tetrad-ipcoal.ipynb
gpl-3.0
# conda install ipyrad -c conda-forge -c bioconda # conda install tetrad -c conda-forge import ipyrad.analysis as ipa import toytree import ipcoal """ Explanation: <h1><span style="color:gray">ipyrad-analysis toolkit:</span> tetrad</h1> The tetrad tool is a framework for inferring a species tree topology using quart...
tensorflow/docs-l10n
site/zh-cn/tutorials/keras/save_and_load.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under...
simkovic/simkovic.github.io
_ipynb/No Way Anova - A theoretical paper reports completely redundant Anova.ipynb
mit
%pylab inline x=[1,2,5] y=np.array([[0.41,0.44,0.47],[0.25,0.22,0.21]]).T plt.errorbar(x,y[:,0],yerr=0.7/9.3,fmt='d-b') plt.errorbar(x,y[:,1],yerr=0.7/9.3,fmt='o-g') plt.legend(['focal','non-focal'],loc=7) plt.grid(False,axis='x') plt.xlabel('Time pressure');plt.ylabel('choice probability') plt.title('Figure 1') plt.xl...
arokem/seaborn
doc/docstrings/FacetGrid.ipynb
bsd-3-clause
tips = sns.load_dataset("tips") sns.FacetGrid(tips) sns.FacetGrid(tips, col="time", row="sex") g = sns.FacetGrid(tips, col="time", row="sex") g.map(sns.scatterplot, "total_bill", "tip") g = sns.FacetGrid(tips, col="time", row="sex") g.map_dataframe(sns.histplot, x="total_bill") g = sns.FacetGrid(tips, col="time",...
amandersillinois/landlab
notebooks/teaching/surface_water_hydrology_exercises/overland_flow_notebooks/hydrograph_class_notebook.ipynb
mit
## only needed for plotting in a jupyter notebook. %matplotlib inline ## Code Block 1 import copy import numpy as np from matplotlib import pyplot as plt from landlab import imshow_grid from landlab.components import OverlandFlow, FlowAccumulator from landlab.io import read_esri_ascii """ Explanation: <a href="htt...
Naereen/notebooks
Demonstration of numpy.polynomial.Polynomial and nice display with LaTeX and MathJax (python3).ipynb
mit
from numpy.polynomial import Polynomial as P """ Explanation: Table of Contents 1. Demonstration of the numpy.polynomial package 1.1 And especially a small hand-made pretty printing function for Polynomial objects 1.2 First goal: pretty print in ASCII text 1.3 Second goal: pretty-print in $\LaTeX{}$ code 1.4 A bonus ...
snowch/movie-recommender-demo
notebooks/Step 03 - Predict ratings.ipynb
apache-2.0
from pyspark.mllib.recommendation import Rating new_user_ID = 0 new_user_ratings = [ Rating(0,260,9), # Star Wars (1977) Rating(0,1,8), # Toy Story (1995) Rating(0,16,7), # Casino (1995) Rating(0,25,8), # Leaving Las Vegas (1995) Rating(0,32,9), # Twelve Monkeys (a.k.a. 12 Monk...
ES-DOC/esdoc-jupyterhub
notebooks/test-institute-2/cmip6/models/sandbox-2/ocnbgchem.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'test-institute-2', 'sandbox-2', 'ocnbgchem') """ Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem MIP Era: CMIP6 Institute: TEST-INSTITUTE-2 Source ID: SANDBOX-2 Topic: Ocnbgchem Sub-Topic...
johnbachman/emcee
docs/_static/notebooks/autocorr.ipynb
mit
import numpy as np import matplotlib.pyplot as plt np.random.seed(1234) # Build the celerite model: import celerite from celerite import terms kernel = terms.RealTerm(log_a=0.0, log_c=-6.0) kernel += terms.RealTerm(log_a=0.0, log_c=-2.0) # The true autocorrelation time can be calculated analytically: true_tau = sum...
google-research/ott
docs/notebooks/LRSinkhorn.ipynb
apache-2.0
import jax.numpy as jnp import jax import matplotlib.pyplot as plt plt.rcParams.update({'font.size': 18}) import ott def create_points(rng, n, m, d): rngs = jax.random.split(rng, 4) x = jax.random.normal(rngs[0], (n,d)) + 1 y = jax.random.uniform(rngs[1], (m,d)) a = jax.random.uniform(rngs[2], (n,)) b = jax...
letsgoexploring/teaching
winter2017/econ129/python/Econ129_Winter2017_Homework1_Complete.ipynb
mit
# Question 1.1 A = 1 alpha = 0.35 k = np.arange(0,10,0.001) y = A*k**alpha plt.plot(k,y,lw=3,alpha = 0.65) plt.xlabel('capital') plt.ylabel('output') plt.title('Cobb-Douglas production function') plt.grid() # Question 1.2 def cobbDouglas(A,k,alpha): return A*k**alpha A = 1 alpha = 0.35 k = np.arange(0,10,0.001...
climberwb/pycon-pandas-tutorial
Exercises-3.ipynb
mit
t = titles t.groupby(t.year // 10 * 10).size().plot(kind='bar') """ Explanation: Using groupby(), plot the number of films that have been released each decade in the history of cinema. End of explanation """ t = titles[titles.title == "Hamlet"] t.groupby(t.year // 10 * 10).size().plot(kind='bar') """ Explanation: U...
CompPhysics/MachineLearning
doc/pub/week34/ipynb/week34.ipynb
cc0-1.0
import numpy as np """ Explanation: <!-- HTML file automatically generated from DocOnce source (https://github.com/doconce/doconce/) doconce format html week34.do.txt --no_mako --> <!-- dom:TITLE: Week 34: Introduction to the course, Logistics and Practicalities --> Week 34: Introduction to the course, Logistics and ...
dsquareindia/gensim
docs/notebooks/word2vec.ipynb
lgpl-2.1
# import modules & set up logging import gensim, logging logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) sentences = [['first', 'sentence'], ['second', 'sentence']] # train word2vec on the two sentences model = gensim.models.Word2Vec(sentences, min_count=1) """ Explanation:...
phanrahan/magmathon
notebooks/tutorial/icestick/FullAdder.ipynb
mit
import magma as m m.set_mantle_target('ice40') import mantle """ Explanation: FullAdder - Combinational Circuits This notebook walks through the implementation of a basic combinational circuit, a full adder. This example introduces many of the features of Magma including circuits, wiring, operators, and the type syste...
infilect/ml-course1
keras-notebooks/Transfer-Learning/5.1 HyperParameter Tuning.ipynb
mit
import numpy as np np.random.seed(1337) # for reproducibility from keras.datasets import mnist from keras.models import Sequential from keras.layers import Dense, Dropout, Activation, Flatten from keras.layers import Conv2D, MaxPooling2D from keras.utils import np_utils from keras.wrappers.scikit_learn import KerasCl...
tuanvu216/udacity-course
deep_learning/examples/1_notmnist.ipynb
mit
# These are all the modules we'll be using later. Make sure you can import them # before proceeding further. %matplotlib inline import matplotlib.pyplot as plt import numpy as np import os import tarfile import urllib from IPython.display import display, Image from scipy import ndimage from sklearn.linear_model import ...
ishakaur/sandbox
enron_email_analysis/Enron Data Exploration Part 1.ipynb
mit
from IPython.display import display import pandas as pd from enrondatahandling import EnronEmailDataset """ Explanation: Handling and analysis of the Enron Email Dataset - Part 1 The class definitions EnronEmailParser class Parser for the emails included in the Enron Email Dataset. This particular implementation tre...
gfeiden/Notebook
Projects/ngc2516_spots/bolometric_corrections.ipynb
mit
# change directory %cd ../../../Projects/starspot/starspot/ from color import bolcor as bc """ Explanation: Bolometric Corrections Details about the bolometric correction package can be found in the GitHub repository starspot. End of explanation """ bc.utils.log_init('table_limits.log') # initialize bolometric cor...
paulthulstrup/moose
modules/thermopower_diffusion/thermopower_analysis.ipynb
lgpl-2.1
# Library import %matplotlib inline import pandas as pd import numpy as np import matplotlib.pyplot as plt # Data Import T_hot = np.arange(0.010,0.5, 0.005) T_fridge = np.arange(0.005,0.495, 0.005) df = pd.read_csv("./data/TVar_Thot-0.01-0.495-step0.005_Tcold-0.005-0.49.csv", ) data = df.values """ Explanation: The...
TrinVeerasiri/presta_to_woo_migration
generate_wp_users_and_wp_usermeta.ipynb
gpl-3.0
import pandas as pd import numpy as np """ Explanation: Customer migration from Prestashop to Woocommerce part 2 : Generate wp_users and wp_usermeta End of explanation """ #Load a raw information raw_information = pd.read_csv('sql_prestashop/raw_information.csv', index_col='id_customer') raw_information = raw_inform...
ianozsvald/ipython_memory_usage
src/ipython_memory_usage/examples/example_usage_np_pd.ipynb
bsd-2-clause
import ipython_memory_usage help(ipython_memory_usage) # or ipython_memory_usage? %ipython_memory_usage_start """ Explanation: Short demo of using ipython_memory_usage to diagnose numpy and Pandas RAM usage Author Ian uses this tool in his Higher Performance Python training (https://ianozsvald.com/training/) and it i...
ES-DOC/esdoc-jupyterhub
notebooks/cmcc/cmip6/models/cmcc-cm2-vhr4/ocean.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'cmcc', 'cmcc-cm2-vhr4', 'ocean') """ Explanation: ES-DOC CMIP6 Model Properties - Ocean MIP Era: CMIP6 Institute: CMCC Source ID: CMCC-CM2-VHR4 Topic: Ocean Sub-Topics: Timestepping Framework, A...
Rotvig/cs231n
Project/RNN-TF.ipynb
mit
import tensorflow as tf import numpy as np import random """ Explanation: Recurrent Neural Networks for Beginners (in TensorFlow) This iPython notebook is designed to serve as a walkthrough for beginners on how to implement a simple recurrent neural network using Python and Tensorflow. The code in this notebook is bas...
LSSTC-DSFP/LSSTC-DSFP-Sessions
Sessions/Session09/Day1/ExtractingPeriodicSignals.ipynb
mit
def gen_periodic_data(x, period=1, amplitude=1, phase=0, noise=0): '''Generate periodic data given the function inputs y = A*cos(x/p - phase) + noise Parameters ---------- x : array-like input values to evaluate the array period : float (default=1) period of the pe...
tensorflow/docs-l10n
site/ja/probability/examples/Gaussian_Copula.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License"); { display-mode: "form" } # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, sof...
xesscorp/pygmyhdl
examples/3_pwm/pwm.ipynb
mit
from pygmyhdl import * @chunk def pwm_simple(clk_i, pwm_o, threshold): ''' Inputs: clk_i: PWM changes state on the rising edge of this clock input. threshold: Bit-length determines counter width and value determines when output goes low. Outputs: pwm_o: PWM output starts and stays h...
CCI-Tools/cate-core
notebooks/heal-cci-sea-level.ipynb
mit
ds = ds0.rename(time='time_step') ds.time_step """ Explanation: We observe two issues here which make it hard to work with this data in the current version of Cate: Cate can only display dataset variables whose last dimensions are lat and lon, in this order; there is a dimension and coordinate variable time, which is...
kkhenriquez/python-for-data-science
Week-4-Pandas/Introduction to Pandas.ipynb
mit
import pandas as pd """ Explanation: <p style="font-family: Arial; font-size:3.75em;color:purple; font-style:bold"><br> Pandas</p> <br> pandas is a Python library for data analysis. It offers a number of data exploration, cleaning and transformation operations that are critical in working with data in Python. pandas ...
ellisztamas/faps
docs/.ipynb_checkpoints/04 Sibship clustering-checkpoint.ipynb
mit
from faps import * import numpy as np np.random.seed(867) allele_freqs = np.random.uniform(0.3,0.5,50) adults = make_parents(100, allele_freqs, family_name='a') """ Explanation: Sibship clustering Tom Ellis, March 2017 FAPS uses information in a paternityArray to generate plausible full-sibship configurations. This i...
avtlearns/automatic_text_summarization
TextRank_Automatic_Summarization_for_Medical_Articles.ipynb
gpl-3.0
from nltk.tokenize.punkt import PunktSentenceTokenizer from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import TfidfTransformer import networkx as nx import re import urllib2 from bs4 import BeautifulSoup import pandas as pd # -*- coding: utf-8 -*- """ Explanation: Autom...
feststelltaste/software-analytics
demos/20210630_WeAreDevelopersWorldCongress/jQAssistant Demo.ipynb
gpl-3.0
%load_ext cypher """ Explanation: jQAssistant Demo Clone https://github.com/JavaOnAutobahn/spring-petclinic Build software mvn install Start Neo4j server mvn jqassistant:server Open browser http://localhost:7474/browser/ jQAssistant documentation: https://jqassistant.github.io/jqassistant/doc/1.10.0/manual/index.html...