repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
imatge-upc/activitynet-2016-cvprw
notebooks/17 Visualization of Results with Feedback.ipynb
mit
import random import os import numpy as np from work.dataset.activitynet import ActivityNetDataset dataset = ActivityNetDataset( videos_path='../dataset/videos.json', labels_path='../dataset/labels.txt' ) videos = dataset.get_subset_videos('validation') videos = random.sample(videos, 8) examples = [] for v in...
Astrohackers-TW/IANCUPythonAdventure
notebooks/notebooks4beginners/01_python_tutorial_basics1.ipynb
mit
# ←此為Python的註解符號,在這之後的文字不會被當作程式碼執行 # Python不用宣告變數型態,在指定變數的值時即會動態決定其型態 n_solar_mass = 10 # 整數 MASS_SUN = 1.99 * 10 ** 30 # 浮點數 z = complex(3., -1.) # 複數 unit = "kg" ...
FFroehlich/AMICI
python/examples/example_steadystate/ExampleSteadystate.ipynb
bsd-2-clause
# SBML model we want to import sbml_file = 'model_steadystate_scaled_without_observables.xml' # Name of the model that will also be the name of the python module model_name = 'model_steadystate_scaled' # Directory to which the generated model code is written model_output_dir = model_name import libsbml import importli...
VictorQuintana91/Thesis
notebooks/005_filtering_nouns.ipynb
mit
import pandas as pd # For monitoring duration of pandas processes from tqdm import tqdm, tqdm_pandas # To avoid RuntimeError: Set changed size during iteration tqdm.monitor_interval = 0 # Register `pandas.progress_apply` and `pandas.Series.map_apply` with `tqdm` # (can use `tqdm_gui`, `tqdm_notebook`, optional kwarg...
statsmodels/statsmodels.github.io
v0.12.2/examples/notebooks/generated/generic_mle.ipynb
bsd-3-clause
import numpy as np from scipy import stats import statsmodels.api as sm from statsmodels.base.model import GenericLikelihoodModel """ Explanation: Maximum Likelihood Estimation (Generic models) This tutorial explains how to quickly implement new maximum likelihood models in statsmodels. We give two examples: Probit ...
masve/saav-deliveries
app/notebooks/2d.ipynb
mit
data_path = '../../SFPD_Incidents_-_from_1_January_2003.csv' data = pd.read_csv(data_path) """ Explanation: Creating datasets for 2D We begin by reading the csv file, into a data frame. This makes it easier to create. End of explanation """ mask = (data.Category == 'PROSTITUTION') & (data.Y != 90) filterByCat = da...
metpy/MetPy
v1.0/_downloads/8532b75251585046a16f04a9afaef079/Advanced_Sounding.ipynb
bsd-3-clause
import matplotlib.pyplot as plt import pandas as pd import metpy.calc as mpcalc from metpy.cbook import get_test_data from metpy.plots import add_metpy_logo, SkewT from metpy.units import units """ Explanation: Advanced Sounding Plot a sounding using MetPy with more advanced features. Beyond just plotting data, this ...
VadimMalykh/courses
deeplearning1/my/redux/Dogs vs Cats redux.ipynb
apache-2.0
import zipfile import tempfile import os tmp_dir = tempfile.mkdtemp() tmp_dir zf = zipfile.ZipFile("../data/redux/train.zip") zf.extractall(tmp_dir) zf.close zf = zipfile.ZipFile("../data/redux/test.zip") zf.extractall(tmp_dir) zf.close import sys sys.path.append('../../nbs') import utils from utils import * impor...
tensorflow/federated
docs/tutorials/federated_learning_for_text_generation.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...
duttashi/Data-Analysis-Visualization
scripts/general/Taarifa_Regression.ipynb
mit
import pandas as pd # for data import and dissection import numpy as np # for data analysis import statsmodels.formula.api as smf import statsmodels.api as sm import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline """ Explanation: Load the relevant libraries End of explanation """ plt.interactive(F...
pfschus/fission_bicorrelation
methods/slices_bhp_by_t.ipynb
mit
%%javascript $.getScript('https://kmahelona.github.io/ipython_notebook_goodies/ipython_notebook_toc.js') """ Explanation: <div id="toc"></div> End of explanation """ import numpy as np import scipy.io as sio import os import sys import matplotlib.pyplot as plt import matplotlib.colors from matplotlib.pyplot import c...
graphistry/pygraphistry
demos/demos_databases_apis/umap_learn/umap_learn.ipynb
bsd-3-clause
# Already installed in Graphistry & RAPIDS distros # ! pip install --user umap-learn # ! pip install --user graphistry import graphistry, pandas as pd, umap # To specify Graphistry account & server, use: # graphistry.register(api=3, username='...', password='...', protocol='https', server='hub.graphistry.com') # For ...
gsentveld/lunch_and_learn
notebooks/Data_Exploration_Sample_Child.ipynb
mit
import os from dotenv import load_dotenv, find_dotenv # find .env automagically by walking up directories until it's found dotenv_path = find_dotenv() # load up the entries as environment variables load_dotenv(dotenv_path) """ Explanation: Exploring the files with Pandas Many statistical Python packages can deal wit...
phnmnl/workflow-demo
Jupyter/DeleteCvJobs.ipynb
apache-2.0
control=input() """ Explanation: Delete CV jobs at once Deleting multiple jobs using the Chonos UI may be tedious. Run this script to delete all of the CV jobs at once. Prerequisites Instert your control node address End of explanation """ import getpass password=getpass.getpass() """ Explanation: Insert your admi...
wgong/open_source_learning
projects/Open_Food/open-food-5k.ipynb
apache-2.0
from jyquickhelper import add_notebook_menu add_notebook_menu() """ Explanation: Motivation <br> <font color=red size=+3>Know what you eat, </font> <font color=green size=+3> Gain insight into food.</font> <a href=https://world.openfoodfacts.org/> <img src=https://static.openfoodfacts.org/images/misc/openfoodfacts-log...
quantumlib/OpenFermion
docs/fqe/tutorials/diagonal_coulomb_evolution.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...
dereneaton/ipyrad
tests/ipyparallel-tutorial.ipynb
gpl-3.0
## conda install ipyrad -c ipyrad """ Explanation: Parallelization in ipyrad using ipyparallel One of the real strenghts of ipyrad is the advanced parallelization methods that it uses to distribute work across arbitrarily large computing clusters, and to be able to do so when working interactively and remotely. This i...
ypeleg/Deep-Learning-Keras-Tensorflow-PyCon-Israel-2017
2.3 Deep Convolutional Neural Networks.ipynb
mit
from keras.applications import VGG16 from keras.applications.imagenet_utils import preprocess_input, decode_predictions import os # -- Jupyter/IPython way to see documentation # please focus on parameters (e.g. include top) VGG16?? vgg16 = VGG16(include_top=True, weights='imagenet') """ Explanation: Deep CNN Models ...
ereodeereigeo/dataTritiumWS22
numero_de_datos_perdidos.ipynb
gpl-2.0
import pandas as pd import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Número de datos obtenidos y perdidos Importamos las librerías necesarias End of explanation """ import ext_datos as ext import procesar as pro import time_plot as tplt """ Explanation: Importamos las librerías creadas para tra...
msampathkumar/data_science_sessions
Session-2-Hands-Experience-for-ML/DataScience_Presentation2.ipynb
mit
import numpy as np """ Explanation: Data Science Workshop Goal: To learn, how to start implementing ML. Recap Machine Learning is a sub feild of Artificial Intelligence, which is focused on self learning. Data Science is not single step process Model Building: Linear Models, Support Vector Machines, Random Forest M...
mikekestemont/leyden-workshop
Digital Text Analysis.ipynb
mit
text = 'It is a truth, universally acknowledged.' """ Explanation: Digital Text Analysis Present-day society is flooded with digital texts: never before, humankind has produced more text than now. To efficiently cope with the vast amounts of text that are published nowadays, industry and academia alike increasingly tu...
arsenovic/clifford
docs/tutorials/apollonius-cga-augmented.ipynb
bsd-3-clause
from clifford import ConformalLayout, BasisVectorIds, MultiVector, transformations class OurCustomLayout(ConformalLayout): def __init__(self, ndims): self.ndims = ndims euclidean_vectors = [str(i + 1) for i in range(ndims)] conformal_vectors = ['m2', 'm1'] # Construct our ...
mrcinv/matpy
02a_zaporedja.ipynb
gpl-2.0
# zaporedje definiramo kot funkcijo a = lambda n: n**10/2**n for n in range(10): print("%f" % a(n)) from matplotlib import pyplot as plt %matplotlib inline n = range(30) plt.plot(n,[a(k) for k in n],'*') #plt.semilogy(n,[a(k) for k in n],'*') plt.title("prvih %d členov zaporedja" % len(n)) plt.show() """ Explanat...
edjdavid/adventures
python/rpy2 DataFrames.ipynb
mit
try: base.summary(df) except NotImplementedError as e: print(e) """ Explanation: rpy2 doesn't convert pd.DataFrames by default End of explanation """ pd.DataFrame(r_df) """ Explanation: Do not use pd.DataFrame on R DataFrame, the results are transposed and not indexed correctly End of explanation """ with...
pfschus/fission_bicorrelation
methods/singles_correction.ipynb
mit
import os import sys import matplotlib.pyplot as plt import numpy as np import imageio import pandas as pd import seaborn as sns sns.set(style='ticks') sys.path.append('../scripts/') import bicorr as bicorr import bicorr_e as bicorr_e import bicorr_plot as bicorr_plot import bicorr_sums as bicorr_sums import bicorr...
gaufung/PythonStandardLibrary
FileSystem/Path.ipynb
mit
import os.path PATHS = [ '/one/two/three', '/one/two/three/', '/', '.', '', ] for path in PATHS: print('{!r:>17} : {}'.format(path, os.path.split(path))) for path in PATHS: print('{!r:>17}:{}'.format(path, os.path.basename(path))) for path in PATHS: print('{!r:>17}:{}'.format(path, o...
keras-team/keras-io
examples/vision/ipynb/super_resolution_sub_pixel.ipynb
apache-2.0
import tensorflow as tf import os import math import numpy as np from tensorflow import keras from tensorflow.keras import layers from tensorflow.keras.preprocessing.image import load_img from tensorflow.keras.preprocessing.image import array_to_img from tensorflow.keras.preprocessing.image import img_to_array from t...
jhillairet/scikit-rf
doc/source/tutorials/Networks.ipynb
bsd-3-clause
import skrf as rf from pylab import * """ Explanation: Networks Introduction This tutorial gives an overview of the microwave network analysis features of skrf. For this tutorial, and the rest of the scikit-rf documentation, it is assumed that skrf has been imported as rf. Whether or not you follow this convention ...
brandoncgay/deep-learning
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...
darkomen/TFG
ipython_notebooks/01_pid_extrusora/.ipynb_checkpoints/modelado-checkpoint.ipynb
cc0-1.0
#Importamos las librerías utilizadas import numpy as np import pandas as pd import seaborn as sns import matplotlib.pylab as plt #Mostramos las versiones usadas de cada librerías print ("Numpy v{}".format(np.__version__)) print ("Pandas v{}".format(pd.__version__)) print ("Seaborn v{}".format(sns.__version__)) #Mostr...
DOV-Vlaanderen/pydov
docs/notebooks/search_informele_hydrostratigrafie.ipynb
mit
%matplotlib inline import inspect, sys # check pydov path import pydov """ Explanation: Example of DOV search methods for interpretations (informele hydrogeologische stratigrafie) Use cases explained below Get 'informele hydrogeologische stratigrafie' in a bounding box Get 'informele hydrogeologische stratigrafie' ...
chengsoonong/mclass-sky
projects/jakub/kernel_density/kde.ipynb
bsd-3-clause
DATA_PATH = '~/Desktop/sdss_dr7_photometry_source.csv.gz' import itertools import matplotlib.pyplot as plt import numpy as np import pandas as pd import sklearn.neighbors %matplotlib inline PSF_COLS = ('psfMag_u', 'psfMag_g', 'psfMag_r', 'psfMag_i', 'psfMag_z') """ Explanation: Careful, these constants may be diff...
lakshmanok/nexradaws
nexrad_sample.ipynb
apache-2.0
%matplotlib inline import matplotlib.pyplot as plt import numpy.ma as ma import numpy as np import pyart.graph import tempfile import pyart.io import boto """ Explanation: <h2> How to read and display Nexrad on AWS using Python </h2> <h4> Valliappa Lakshmanan, The Climate Corporation, lak@climate.com </h4> Amazon We...
tensorflow/federated
docs/tutorials/simulations.ipynb
apache-2.0
#@test {"skip": true} !pip install --quiet --upgrade tensorflow-federated !pip install --quiet --upgrade nest-asyncio import nest_asyncio nest_asyncio.apply() import collections import time import tensorflow as tf import tensorflow_federated as tff source, _ = tff.simulation.datasets.emnist.load_data() def map_f...
eford/rebound
ipython_examples/CloseEncounters.ipynb
gpl-3.0
import rebound import numpy as np def setupSimulation(): sim = rebound.Simulation() sim.integrator = "ias15" # IAS15 is the default integrator, so we don't need this line sim.add(m=1.) sim.add(m=1e-3,a=1.) sim.add(m=5e-3,a=1.25) sim.move_to_com() return sim """ Explanation: Catching close e...
MehtapIsik/assaytools
examples/competition-fluorescence-assay/3-Competition-Assay-Data-Plotting.ipynb
lgpl-2.1
#import needed libraries import re import os from lxml import etree import pandas as pd import pymc import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline """ Explanation: Competition assay analysis and thoughts Here we will analyze two competition assay co...
pierreg/tensorflow
tensorflow/tools/docker/notebooks/3_mnist_from_scratch.ipynb
apache-2.0
from __future__ import print_function from IPython.display import Image import base64 Image(data=base64.decodestring("iVBORw0KGgoAAAANSUhEUgAAAMYAAABFCAYAAAARv5krAAAYl0lEQVR4Ae3dV4wc1bYG4D3YYJucc8455yCSSIYrBAi4EjriAZHECyAk3rAID1gCIXGRgIvASIQr8UTmgDA5imByPpicTcYGY+yrbx+tOUWpu2e6u7qnZ7qXVFPVVbv2Xutfce+q7hlasmTJktSAXrnn8...
adolfoguimaraes/machinelearning
UnsupervisedLearning/Exercicio01_ClusterizacaoDocumentos.ipynb
mit
# Imports necessários para este exercício from __future__ import print_function import nltk import re import pandas as pd from sklearn.cluster import KMeans from imdbpie import Imdb from nltk.stem.snowball import SnowballStemmer from sklearn.externals import joblib from IPython.display import YouTubeVideo, Image """ E...
ewulczyn/talk_page_abuse
src/analysis/Prevalence and Efficacy of Moderation (paper).ipynb
apache-2.0
# Load scored diffs and moderation event data d = load_diffs() df_block_events, df_blocked_user_text = load_block_events_and_users() df_warn_events, df_warned_user_text = load_warn_events_and_users() moderated_users = [('warned', df_warned_user_text), ('blocked', df_blocked_user_text), ...
HaebinShin/tensorflow
tensorflow/examples/tutorials/deepdream/deepdream.ipynb
apache-2.0
# boilerplate code import os from io import BytesIO import numpy as np from functools import partial import PIL.Image from IPython.display import clear_output, Image, display, HTML from __future__ import print_function import tensorflow as tf """ Explanation: DeepDreaming with TensorFlow Loading and displaying the m...
queirozfcom/python-sandbox
python3/notebooks/pandas-pivot/pivot-stack-unstack-melt.ipynb
mit
columns = pd.MultiIndex.from_tuples([ ('A', 'cat', 'long'), ('B', 'cat', 'long'), ('A', 'dog', 'short'), ('B', 'dog', 'short') ], names=['exp', 'animal', 'hair_length'] ) df = pd.DataFrame(np.random.randn(4, 4), columns=columns) df df.columns stacked = df.stack(level=['exp'...
ES-DOC/esdoc-jupyterhub
notebooks/mohc/cmip6/models/sandbox-3/aerosol.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'mohc', 'sandbox-3', 'aerosol') """ Explanation: ES-DOC CMIP6 Model Properties - Aerosol MIP Era: CMIP6 Institute: MOHC Source ID: SANDBOX-3 Topic: Aerosol Sub-Topics: Transport, Emissions, Conce...
modin-project/modin
examples/spreadsheet/tutorial.ipynb
apache-2.0
# Please install the required packages using `pip install -r requirements.txt` in the current directory # For all ways to install Modin see official documentation at: # https://modin.readthedocs.io/en/latest/installation.html import modin.pandas as pd import modin.spreadsheet as mss """ Explanation: modin.spreadsheet ...
stsouko/CGRtools
doc/tutorial/5_transformation_rules.ipynb
lgpl-3.0
import pkg_resources if pkg_resources.get_distribution('CGRtools').version.split('.')[:2] != ['4', '0']: print('WARNING. Tutorial was tested on 4.0 version of CGRtools') else: print('Welcome!') # load data for tutorial from pickle import load from traceback import format_exc with open('molecules.dat', 'rb') a...
tritemio/PyBroMo
notebooks/PyBroMo - B.2 Disk-single-core - Generate smFRET data files.ipynb
gpl-2.0
%matplotlib inline from pathlib import Path import numpy as np import tables import matplotlib.pyplot as plt import seaborn as sns import pybromo as pbm print('Numpy version:', np.__version__) print('PyTables version:', tables.__version__) print('PyBroMo version:', pbm.__version__) """ Explanation: PyBroMo - B.2 Disk-...
hrjn/ISLR_reading_group
notebooks/chap_2_knn.ipynb
gpl-3.0
import numpy as np import matplotlib.pyplot as plt from scipy.spatial.distance import euclidean from tqdm import tqdm from time import sleep %matplotlib inline LARGE_SIZE = (12,8) """ Explanation: The K-nearest neighbor algorithm In this notebook we focus on reproducing the result of Fig. 2.15. End of explanation """...
ML4DS/ML4all
U1.KMeans/KMeans_professor.ipynb
mit
%matplotlib inline import numpy as np import matplotlib.pyplot as plt from scipy import stats from scipy.spatial.distance import cdist from fig_code import plot_kmeans_interactive from sklearn.datasets import make_blobs, load_digits, load_sample_image from sklearn.decomposition import PCA from sklearn.metrics import c...
Merinorus/adaisawesome
Homework/02 - Data from the Web/Question 2.ipynb
gpl-3.0
# Requests : make http requests to websites import requests # BeautifulSoup : parser to manipulate easily html content from bs4 import BeautifulSoup # Regular expressions import re # Aren't pandas awesome ? import pandas as pd """ Explanation: Obtain all the data for the Master students, starting from 2007. Compute ho...
liuhanfei0615/liupengyuan.github.io
chapter2/homework/computer/middle/201611680433.ipynb
mit
def dayin(m,n): for i in range(n): print(' '*(n-i-1)+(m+' ')*(i+1)) m=input('请给定符号:') n=int(input('请给定行数:')) dayin(m,n) """ Explanation: 1、写函数,给定符号和行数,如’*’,5,可打印相应行数的如下图形: End of explanation """ for i in range(1, 10): for j in range(1,10): if j<=i: print('{}*{}={:2}'.format(i,j,...
mne-tools/mne-tools.github.io
0.13/_downloads/plot_visualize_evoked.ipynb
bsd-3-clause
import os.path as op import numpy as np import matplotlib.pyplot as plt import mne """ Explanation: Visualize Evoked data End of explanation """ data_path = mne.datasets.sample.data_path() fname = op.join(data_path, 'MEG', 'sample', 'sample_audvis-ave.fif') evoked = mne.read_evokeds(fname, baseline=(None, 0), proj=...
SJSlavin/phys202-2015-work
days/day08/Display.ipynb
mit
class Ball(object): pass b = Ball() b.__repr__() print(b) """ Explanation: Display of Rich Output In Python, objects can declare their textual representation using the __repr__ method. End of explanation """ class Ball(object): def __repr__(self): return 'TEST' b = Ball() print(b) """ Explanatio...
ricklupton/sankeyview
docs/cookbook/us-energy-consumption.ipynb
mit
from floweaver import * """ Explanation: US energy consumption This example is based on the Sankey diagrams of US energy consumption from the Lawrence Livermore National Laboratory (thanks to John Muth for the suggestion and transcribing the data). We jump straight to the final result – for more explanation of the ste...
mne-tools/mne-tools.github.io
dev/_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 &lt;epochs&gt; data. It introduces the :class:~mne.Epochs data structure in detail, including how to load, query, subselect, export, and plot data from an :clas...
garciparedes/python-examples
numerical/math/stats/stochastic_processes/entrega-01.ipynb
mpl-2.0
transition_ruiz = np.array([[0.0, 1.0, 0.0, 0.0, 0.0], [0.3, 0.0, 0.7, 0.0, 0.0], [0.3, 0.0, 0.0, 0.7, 0.0], [0.3, 0.0, 0.0, 0.0, 0.7], [1.0, 0.0, 0.0, 0.0, 0.0]]) """ Explanation: Exercise: Ruiz Family La f...
tensorflow/datasets
docs/keras_example.ipynb
apache-2.0
import tensorflow as tf import tensorflow_datasets as tfds """ Explanation: Training a neural network on MNIST with Keras This simple example demonstrates how to plug TensorFlow Datasets (TFDS) into a Keras model. Copyright 2020 The TensorFlow Datasets Authors, Licensed under the Apache License, Version 2.0 <table cla...
ES-DOC/esdoc-jupyterhub
notebooks/miroc/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', 'miroc', 'sandbox-2', 'ocnbgchem') """ Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem MIP Era: CMIP6 Institute: MIROC Source ID: SANDBOX-2 Topic: Ocnbgchem Sub-Topics: Tracers. Propertie...
napjon/krisk
notebooks/legend-title-toolbox.ipynb
bsd-3-clause
df = pd.read_csv('../krisk/tests/data/gapminderDataFiveYear.txt',sep='\t') p = kk.bar(df,'year',y='pop',how='mean',c='continent') p.set_size(width=800) p.set_title('GapMinder Average Population Across Continent') p.set_toolbox(save_format='png',restore=True) """ Explanation: Before we added talk about each of these f...
AC209ConsumerConfidence/AC209ConsumerConfidence.github.io
ARIMAmodel_BaselineFinal.ipynb
gpl-3.0
fig = plt.figure(figsize = (15, 15)) ax1 = fig.add_subplot(2, 1, 1) ax1 = plt.plot(df) ax1 = plt.title('Consumer Confidence Index \n Monthly Score') ax1 = plt.xlabel('Date') ax1 = plt.ylabel('CCI') ax1 = fig.add_subplot(2, 1, 2) ax1 = plt.plot(df.diff()) ax1 = plt.title('Consumer Confidence Index \n Monthly Score Dif...
tensorflow/lattice
docs/tutorials/aggregate_function_models.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...
gururajl/deep-learning
gan_mnist/Intro_to_GANs_Exercises.ipynb
mit
%matplotlib inline import pickle as pkl import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets('MNIST_data') """ Explanation: Generative Adversarial Network In this notebook, we'll be building a generativ...
ALEXKIRNAS/DataScience
Coursera/Machine-learning-data-analysis/Course 2/Week_02/OverfittingTask.ipynb
mit
import pandas as pd import numpy as np from matplotlib import pyplot as plt %matplotlib inline """ Explanation: Практическое задание к уроку 1 (2 неделя). Линейная регрессия: переобучение и регуляризация В этом задании мы на примерах увидим, как переобучаются линейные модели, разберем, почему так происходит, и выясним...
Vvkmnn/books
ThinkBayes/02_Computational_Statistics.ipynb
gpl-3.0
import sys sys.path.insert(0, './code') # Go into the subdirectory from thinkbayes import Pmf # Grab the thinkbayes script """ Explanation: Computational Statistics Distributions In statistics a <span>distribution</span> is a set of values and their corresponding probabilities. For example, if you roll a six-sided d...
Meena-Mani/SECOM_class_imbalance
secomdata_rf.ipynb
mit
import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline from sklearn.preprocessing import Imputer from sklearn.model_selection import train_test_split as tts # sklearn 0.18.1 from sklearn.model_selection import GridSearchCV # sklearn 0.18.1 from sklearn.ensemble...
evanmiltenburg/python-for-text-analysis
Assignments/ASSIGNMENT-4a.ipynb
apache-2.0
def read_csv(input_file, delimiter=","): # your code here # test your function here filename = "../Data/csv_data/trump_facebook.tsv" status_updates = read_csv(filename, delimiter="\t") status_updates[0:2] """ Explanation: Assignment 4a: Data structures (CSV/TSV and JSON) Deadline for Assignment 4a+b: Friday, Oc...
jasag/Phytoliths-recognition-system
code/notebooks/Phytoliths_Classifier/Phytoliths_Recognition.ipynb
bsd-3-clause
# Imports import pickle %matplotlib inline #para dibujar en el propio notebook import numpy as np #numpy como np import matplotlib.pyplot as plt #matplotlib como plot from skimage import io from skimage.transform import rescale from skimage.color import rgb2gray from skimage.io import imshow from skimage.feature i...
jinntrance/MOOC
coursera/ml-regression/assignments/week-4-ridge-regression-assignment-1-blank.ipynb
cc0-1.0
import graphlab """ Explanation: Regression Week 4: Ridge Regression (interpretation) In this notebook, we will run ridge regression multiple times with different L2 penalties to see which one produces the best fit. We will revisit the example of polynomial regression as a means to see the effect of L2 regularization....
seanjh/venmovac
match_instagram/VenmoTransAndInstagram.ipynb
mit
import os import string from datetime import datetime, date, timedelta import unicodedata import pymongo from instagram.client import InstagramAPI from instagram.bind import InstagramAPIError from nltk.corpus import stopwords from nltk.metrics import edit_distance from nltk.corpus import wordnet as wn from gensim im...
mne-tools/mne-tools.github.io
dev/_downloads/89667e881398db43faecc03a232e53a5/40_whitened.ipynb
bsd-3-clause
import mne from mne.datasets import sample """ Explanation: Plotting whitened data This tutorial demonstrates how to plot :term:whitened &lt;whitening&gt; evoked data. Data are whitened for many processes, including dipole fitting, source localization and some decoding algorithms. Viewing whitened data thus gives a di...
xiongzhenggang/xiongzhenggang.github.io
data-science/00-matalib几种基本图形.ipynb
gpl-3.0
# 导入绘图模块 import matplotlib.pyplot as plt # 构建数据 GDP = [12406.8,13908.57,9386.87,9143.64] # 中文乱码的处理 plt.rcParams['font.sans-serif'] =['Microsoft YaHei'] plt.rcParams['axes.unicode_minus'] = False # 绘图 plt.bar(range(4),GDP, align = 'center',color='steelblue', alpha = 0.8) # 添加轴标签 plt.ylabel('GDP') # 添加标题 plt.title('四个直...
mne-tools/mne-tools.github.io
0.20/_downloads/c569084177bc9cce4e0419ab10cfd45d/plot_dipole_fit.ipynb
bsd-3-clause
from os import path as op import numpy as np import matplotlib.pyplot as plt import mne from mne.forward import make_forward_dipole from mne.evoked import combine_evoked from mne.simulation import simulate_evoked from nilearn.plotting import plot_anat from nilearn.datasets import load_mni152_template data_path = mne...
tuanavu/coursera-university-of-washington
machine_learning/3_classification/assigment/week2/module-3-linear-classifier-learning-assignment-blank-graphlab.ipynb
mit
import graphlab """ Explanation: Implementing logistic regression from scratch The goal of this notebook is to implement your own logistic regression classifier. You will: Extract features from Amazon product reviews. Convert an SFrame into a NumPy array. Implement the link function for logistic regression. Write a f...
bMzi/ML_in_Finance
0208_LDA-QDA.ipynb
mit
%matplotlib inline import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn import metrics plt.rcParams['font.size'] = 14 plt.style.use('seaborn-whitegrid') # Default data set is not available online. Data was extracted from R package "ISLR" df = pd.read_csv('Data/Default.csv', sep=',') # F...
stefanthaler/tf-spikes
vampprior/AES deep template attack.ipynb
apache-2.0
import tensorflow as tf assert(tf.__version__=="1.2.0") # make sure we have the right tensorflow version import numpy as np import os import logging import library.helper as h from IPython.display import Image # displaying images in ipython # configure numpy np.set_printoptions(precision=2) np.random.seed(0) # con...
ThyrixYang/LearningNotes
MOOC/stanford_cnn_cs231n/assignment2/BatchNormalization.ipynb
gpl-3.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...
zlpure/CS231n
assignment2/Dropout.ipynb
mit
# As usual, a bit of setup 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.solver import Solver %matplotlib inline ...
tensorflow/docs-l10n
site/zh-cn/hub/tutorials/cord_19_embeddings.ipynb
apache-2.0
# Copyright 2019 The TensorFlow Hub Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
opesci/tutorial-hands-on
02b_scipy_optimize.ipynb
mit
#NBVAL_IGNORE_OUTPUT from examples.seismic import Model, demo_model import numpy as np # Define the grid parameters def get_grid(): shape = (101, 101) # Number of grid point (nx, nz) spacing = (10., 10.) # Grid spacing in m. The domain size is now 1km by 1km origin = (0., 0.) # Need origin to defin...
opesci/devito
examples/seismic/tutorials/09_viscoelastic.ipynb
mit
# Required imports: import numpy as np import sympy as sp from devito import * from examples.seismic.source import RickerSource, TimeAxis from examples.seismic import ModelViscoelastic, plot_image """ Explanation: Viscoelastic wave equation implementation on a staggered grid This is a first attempt at implementing th...
wem3/gems_vs_bomb
rez/.ipynb_checkpoints/all_bandits-checkpoint.ipynb
mit
# imports / display plots in cell output %matplotlib inline import matplotlib.pyplot as plt import numpy as np import scipy.stats as ss import pandas as pd import seaborn as sns import statsmodels """ Explanation: Reinforcement Learning Models of Social Group Preferences Bandit Experiments 1-7 End of explanation """ ...
gonmolina/CCE_ProblemasResueltos
ProbsVVEE/Python Control Notebook/.ipynb_checkpoints/rlocus_test-checkpoint.ipynb
mit
sys1 = ctrl.tf([1, 1], [1, 10, 1]) print(sys1) r, k = ctrl.rlocus(sys1) plt.show() r, k = ctrl.rlocus(sys1, grid=True) """ Explanation: Simple example that is not OK End of explanation """ r, k = ctrl.rlocus(sys1, grid=True, ylim=[-10, 10]) """ Explanation: However, when I plot the grid the figure looks not so goo...
ES-DOC/esdoc-jupyterhub
notebooks/cccma/cmip6/models/sandbox-2/atmos.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'cccma', 'sandbox-2', 'atmos') """ Explanation: ES-DOC CMIP6 Model Properties - Atmos MIP Era: CMIP6 Institute: CCCMA Source ID: SANDBOX-2 Topic: Atmos Sub-Topics: Dynamical Core, Radiation, Turb...
c22n/ion-channel-ABC
docs/examples/human-atrial/standardised_isus.ipynb
gpl-3.0
import os, tempfile import logging import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sns import numpy as np from ionchannelABC import theoretical_population_size from ionchannelABC import IonChannelDistance, EfficientMultivariateNormalTransition, IonChannelAcceptor from ionchannelABC.experimen...
mne-tools/mne-tools.github.io
0.18/_downloads/fc5b371c8954994307927cbc590118e1/plot_mne_inverse_envelope_correlation.ipynb
bsd-3-clause
# sphinx_gallery_thumbnail_number = 2 # Authors: Eric Larson <larson.eric.d@gmail.com> # Sheraz Khan <sheraz@khansheraz.com> # Denis Engemann <denis.engemann@gmail.com> # # License: BSD (3-clause) import os.path as op import numpy as np import matplotlib.pyplot as plt import mne from mne.connectiv...
cavalcantetreinamentos/curso_python
Primeiros_passos_Google_Colab.ipynb
apache-2.0
print('Olá seja bem vindo!!') """ Explanation: <a href="https://colab.research.google.com/github/cavalcantetreinamentos/curso_python/blob/master/Primeiros_passos_Google_Colab.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> Aprendendo Google Colab - ...
SalikWarsi/data-512-a2
hcds-a2-bias_demo.ipynb
mit
## getting the data from the CSV files and converting into a list import csv import pandas as pd data = [] with open('page_data.csv', encoding='utf8') as csvfile: reader = csv.reader(csvfile) for row in reader: data.append([row[0],row[1],row[2]]) """ Explanation: Bias on Wikipedia The aim of this expe...
gzuidhof/nn-transfer
example.ipynb
mit
import torch from torch.autograd import Variable import torch.nn as nn import torch.nn.functional as F class LeNet(nn.Module): def __init__(self): super(LeNet, self).__init__() self.conv1 = nn.Conv2d(1, 6, 5) self.conv2 = nn.Conv2d(6, 16, 5) self.fc1 = nn.Linear(16*5*5, 120) ...
zhaojijet/UdacityDeepLearningProject
examples/DCGAN.ipynb
apache-2.0
%matplotlib inline import pickle as pkl import matplotlib.pyplot as plt import numpy as np from scipy.io import loadmat import tensorflow as tf !mkdir data """ Explanation: Deep Convolutional GANs In this notebook, you'll build a GAN using convolutional layers in the generator and discriminator. This is called a De...
swails/mdtraj
examples/centroids.ipynb
lgpl-2.1
from __future__ import print_function %matplotlib inline import mdtraj as md import numpy as np """ Explanation: Finding centroids In this example, we're going to find a "centroid" (representitive structure) for a group of conformations. This group might potentially come from clustering, using method like Ward hierarc...
Upward-Spiral-Science/spect-team
Code/Assignment-11/AdvancedFeatureSelection.ipynb
apache-2.0
# Standard import pandas as pd import numpy as np %matplotlib inline import matplotlib.pyplot as plt # Dimensionality reduction and Clustering from sklearn.decomposition import PCA from sklearn.cluster import KMeans from sklearn import manifold, datasets from itertools import cycle # Plotting tools and classifiers fr...
JonasWallin/BayesFlow
script/running_bayesflow_starcluster.ipynb
gpl-2.0
%%bash . ~/.bashrc pip install --upgrade git+https://git@github.com/JonasWallin/linkingEC2 from linkingEC2 import LinkingHandler from ConfigParser import ConfigParser config = ConfigParser() starfigconfig_folder = "/Users/jonaswallin/.starcluster/" config.read(starfigconfig_folder + "config") acess_key_id = con...
sergpolly/FluUtils
FluDB_coding_aln/getting_loci_interest.ipynb
mit
%matplotlib inline import os import sys from Bio import SeqRecord from Bio import AlignIO import numpy as np import pandas as pd import matplotlib.pyplot as plt """ Explanation: We'll try to desribe our loci of interest procedure with details and illustrations here. Let's start with some modules: End of explanation ""...
cristhro/Machine-Learning
ejercicio 2/Ejercicio_2.ipynb
gpl-3.0
import sys #only needed to determine Python version number # Handle table-like data and matrices import numpy as np import pandas as pd # Visualisation import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.pylab as pylab import seaborn as sns # Enable inline plotting %matplotlib inline # Modelo...
atulsingh0/MachineLearning
python_DC/Data_Wrangling_#1.ipynb
gpl-3.0
import pandas as pd import numpy as np df1 = pd.DataFrame({'key': ['b', 'b', 'a', 'c', 'a', 'a', 'b'], 'data1': range(7)}) df2 = pd.DataFrame({'key': ['a', 'b', 'd'], 'data2': range(3)}) print(df1, "\n\n", df2) pd.merge(df1, df2) pd.merge(df1, df2, on='key') # if column name are d...
gfrias/udacity
1_lines/P1.ipynb
mit
#importing some useful packages import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np import cv2 %matplotlib inline #reading in an image image = mpimg.imread('test_images/solidWhiteRight.jpg') #printing out some stats and plotting print('This image is:', type(image), 'with dimesions:', im...
Ensembl/cttv024
tests/__reports__/postgap.20180817.asthma.txt.gz.REPORT.20190110105809.ipynb
apache-2.0
from reports import helpers helpers.calc_run_str() # pg = pd.read_csv(filename, sep='\t', na_values=['None']) pg = helpers.load_file(filename) """ Explanation: POSTGAP Report This notebook was automatically generated as a summary of POSTGAP output. Setup Note that for command line usage (python reporter.py &lt;filen...
dsavransky/MAE2030
Notebooks/Moment of Inertia of a Crane.ipynb
mit
from miscpy.utils.sympyhelpers import * init_printing() M,h,m1,m2,th1,th2,b,l1,l2 = \ symbols('M,h,m_1,m_2,theta_1,theta_2,beta,l_1,l_2') """ Explanation: Preamble stuff (can ignore) End of explanation """ I_O_cab = M*2/3*h**2/4*eye(3); I_O_cab """ Explanation: Model the Cab as a Cube : $\left[\mathbb{I}O^\textrm{...
ES-DOC/esdoc-jupyterhub
notebooks/messy-consortium/cmip6/models/emac-2-53-vol/atmos.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'messy-consortium', 'emac-2-53-vol', 'atmos') """ Explanation: ES-DOC CMIP6 Model Properties - Atmos MIP Era: CMIP6 Institute: MESSY-CONSORTIUM Source ID: EMAC-2-53-VOL Topic: Atmos Sub-Topics: D...
drvinceknight/gt
nbs/chapters/07-Prisoners-Dilemma.ipynb
mit
%matplotlib inline import axelrod as axl axl.seed(0) # Make this reproducible players = [ axl.TitForTat(), axl.FirstByTidemanAndChieruzzi(), axl.FirstByNydegger(), axl.FirstByGrofman(), axl.FirstByShubik(), axl.FirstBySteinAndRapoport(), axl.Grudger(), axl.FirstByDavis(), axl.Firs...
kit-cel/wt
mloc/ch4_Autoencoders/Autoencoder_PolicyGradient_AWGN_AdHovReceiver.ipynb
gpl-2.0
import torch import torch.nn as nn import torch.optim as optim import numpy as np import matplotlib import matplotlib.pyplot as plt from ipywidgets import interactive import ipywidgets as widgets device = 'cuda' if torch.cuda.is_available() else 'cpu' print("We are using the following device for learning:",device) ""...
Jackie789/JupyterNotebooks
Testing Classifier Models.ipynb
gpl-3.0
%matplotlib inline import numpy as np import pandas as pd import scipy import sklearn import matplotlib.pyplot as plt import seaborn as sns from sklearn.model_selection import train_test_split from sklearn import svm from sklearn.metrics import confusion_matrix from sklearn.neighbors import KNeighborsClassifier from s...