repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
Vvkmnn/books
ThinkBayes/13_Simulation.ipynb
gpl-3.0
# time between discharge and diagnosis, in days interval = 3291.0 # doubling time in linear measure is doubling time in volume * 3 dt = 811.0 * 3 # number of doublings since discharge doublings = interval / dt # how big was the tumor at time of discharge (diameter in cm) d1 = 15.5 d0 = d1 / 2.0 ** doublings """ Ex...
sdpython/ensae_teaching_cs
_doc/notebooks/td1a_home/2020_numpy.ipynb
mit
from jyquickhelper import add_notebook_menu add_notebook_menu() %matplotlib inline """ Explanation: Tech - calcul matriciel avec numpy numpy est la librairie incontournable pour faire des calculs en Python. Ces fonctionnalités sont disponibles dans tous les langages et utilisent les optimisations processeurs. Il est ...
zephirefaith/AI_Fall15_Assignments
A6/hmm_notebook.ipynb
mit
def part_1_a(): #(20 pts) # TODO: Fill in below ! # Fill in the matrix below with state probabilities at each time step, P(High) being the value at the 0th index part_a_avalanche_trellis = [[0.4,0], [0.096,0.016], [0.00576,0.01536], [0.0006,0.003], [0.00012,0.0006], [0.000096,0.00003], [0.000023,0.000...
salma1601/aspp2015
Advanced NumPy Patterns.ipynb
bsd-3-clause
gene0 = [100, 200, 50, 400] gene1 = [50, 0, 0, 100] gene2 = [350, 100, 50, 200] expression_data = [gene0, gene1, gene2] """ Explanation: Intro Juan Nunez-Iglesias Victorian Life Sciences Computation Initiative (VLSCI) University of Melbourne Quick example: gene expression, without numpy | | Cell type A | Cell...
tensorflow/text
docs/tutorials/bert_glue.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...
AaronCWong/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='Assignment04b.png') """ Explanation: Violations of graphical excellence and integrity Find a data-focused visualizat...
AMICI-developer/AMICI
python/examples/example_petab/petab.ipynb
bsd-2-clause
from amici.petab_import import import_petab_problem from amici.petab_objective import simulate_petab import petab import os """ Explanation: Using PEtab This notebook illustrates how to use PEtab with AMICI. End of explanation """ !git clone --depth 1 https://github.com/Benchmarking-Initiative/Benchmark-Models-PEta...
JackDi/phys202-2015-work
assignments/assignment10/ODEsEx01.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np import seaborn as sns from scipy.integrate import odeint from IPython.html.widgets import interact, fixed """ Explanation: Ordinary Differential Equations Exercise 1 Imports End of explanation """ def solve_euler(derivs, y0, x): """Solve a 1d ...
krishnan-r/sparkmonitor
notebooks/Testing Extension.ipynb
apache-2.0
print(conf.toDebugString()) #Instance of SparkConf with options set by the extension """ Explanation: Testing SparkMonitor Extension The configuration object SparkConf is provided by the extension, added to the namespace as 'conf'. The user passes this to the SparkContext End of explanation """ conf.setAppName('Exte...
othersite/document
machinelearning/deep-learning-book/code/model_zoo/saving-and-reloading-models.ipynb
apache-2.0
%load_ext watermark %watermark -a 'Sebastian Raschka' -v -p tensorflow """ Explanation: Accompanying code examples of the book "Introduction to Artificial Neural Networks and Deep Learning: A Practical Guide with Applications in Python" by Sebastian Raschka. All code examples are released under the MIT license. If you...
tensorflow/docs
site/en/guide/sparse_tensor.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...
sns-chops/multiphonon
tests/notebooks/getdos2.ipynb
mit
workdir = '/SNS/users/lj7/reduction/ARCS/getdos-demo-test' !mkdir -p {workdir} %cd {workdir} """ Explanation: Density of States Analysis Example Given sample and empty-can data, compute phonon DOS To use this notebook, first click jupyter menu File->Make a copy Click the title of the copied jupyter notebook and chang...
CamDavidsonPilon/lifelines
examples/Modelling time-lagged conversion rates.ipynb
mit
%matplotlib inline %config InlineBackend.figure_format = 'retina' from matplotlib import pyplot as plt import autograd.numpy as np from autograd.scipy.special import expit, logit import pandas as pd plt.style.use('bmh') N = 200 U = np.random.rand(N) T = -(logit(-np.log(U) / 0.5) - np.random.exponential(2, N) - 6.00)...
VictorQuintana91/Thesis
notebooks/000_data_inspection.ipynb
mit
import cufflinks as cf print(cf.__version__) import pandas as pd import numpy as np import gzip # Configure cufflings cf.set_config_file(offline=False, world_readable=True, theme='pearl') """ Explanation: Plotly & Cufflinks At this point you will need to isntall cufflinks. Cufflinks binds Plotly directly to pandas d...
hongguangguo/shogun
doc/ipython-notebooks/multiclass/KNN.ipynb
gpl-3.0
import numpy as np from scipy.io import loadmat, savemat from numpy import random from os import path mat = loadmat('../../../data/multiclass/usps.mat') Xall = mat['data'] Yall = np.array(mat['label'].squeeze(), dtype=np.double) # map from 1..10 to 0..9, since shogun # requires multiclass labels to be # 0,...
jdsanch1/SimRC
02. Parte 2/09. Clase 9/09Class NB.ipynb
mit
#importar los paquetes que se van a usar import pandas as pd import pandas_datareader.data as web import numpy as np import datetime from datetime import datetime import scipy.stats as stats import scipy as sp import scipy.optimize as scopt import matplotlib.pyplot as plt import seaborn as sns import sklearn.covariance...
ozorich/phys202-2015-work
assignments/assignment05/InteractEx01.ipynb
mit
%matplotlib inline from matplotlib import pyplot as plt import numpy as np from IPython.html.widgets import interact, interactive, fixed from IPython.display import display """ Explanation: Interact Exercise 01 Import End of explanation """ def print_sum(a, b): """Print the sum of the arguments a and b.""" ...
vitojph/kschool-nlp
notebooks-py2/word2vec.ipynb
gpl-3.0
import gensim, logging, os logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) """ Explanation: Ejemplo de word2vec con gensim En la siguiente celda, importamos las librerías necesarias y configuramos los mensajes de los logs. End of explanation """ class Corpus(object): '...
4DGenome/Chromosomal-Conformation-Course
Notebooks/A3-Compare_and_merge_Hi-C_experiments.ipynb
gpl-3.0
from pytadbit.mapping.analyze import eig_correlate_matrices, correlate_matrices from pytadbit import load_hic_data_from_reads from cPickle import load from matplotlib import pyplot as plt reso = 200000 base_path = 'results/fragment/{0}/03_filtering/valid_reads12_{0}.tsv' bias_path = 'results/fragment/{1}/04_normalizin...
wuafeing/Python3-Tutorial
01 data structures and algorithms/01.01 unpack sequence into separate variables.ipynb
gpl-3.0
p = (4, 5) x, y = p x y data = ["ACME", 50, 91.1, (2012, 12, 21)] name, shares, price, date = data name date name, shares, price, (year, mon, day) = data name year mon day """ Explanation: Previous 1.1 解压序列赋值给多个变量 问题 现在有一个包含 N 个元素的元组或者是序列,怎样将它里面的值解压后同时赋值给 N 个变量? 解决方案 任何的序列(或者是可迭代对象)可以通过一个简单的赋值语句解压并赋值给多个变量。 唯...
ffmmjj/intro_to_data_science_workshop
solutions/03-Delimitação de grupos de flores.ipynb
apache-2.0
import pandas as pd iris = pd.read_csv('../datasets/iris_without_classes.csv') # Carregue o arquivo 'datasets/iris_without_classes.csv' # Exiba as primeiras cinco linhas usando o método head() para checar que não existe mais a coluna "Class" iris.head() """ Explanation: Suponha que não soubéssemos quantas espécies ...
cmawer/pycon-2017-eda-tutorial
notebooks/2-Aquastat-EDA/5-Aquastat-Multivariate.ipynb
mit
# must go first %matplotlib inline %config InlineBackend.figure_format='retina' # plotting import matplotlib as mpl from matplotlib import pyplot as plt import seaborn as sns sns.set_context("poster", font_scale=1.3) import folium # system packages import os, sys import warnings warnings.filterwarnings('ignore') ...
robertoalotufo/ia898
master/tutorial_numpy_1_5a.ipynb
mit
# download image from github: -q quiet mode; -N overwrite on the next download !wget -q -N https://github.com/robertoalotufo/ia898/raw/830a0f5f6e6a1ddd459127631bf9c0c750bf1f58/data/cameraman.tif !wget -q -N https://github.com/robertoalotufo/ia898/raw/830a0f5f6e6a1ddd459127631bf9c0c750bf1f58/data/keyb.tif !wget -q -N ht...
LSSTDESC/LSSTDarkMatter
stronglens/SubstructureLikelihood.ipynb
mit
# General imports %matplotlib inline import logging import numpy as np import pylab as plt from scipy import stats from scipy import integrate from scipy.integrate import simps,trapz,quad,nquad from scipy.interpolate import interp1d from scipy.misc import factorial """ Explanation: Dark Matter Substructure from Stron...
throx66/deep-learning
dcgan-svhn/DCGAN.ipynb
mit
%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...
mne-tools/mne-tools.github.io
0.24/_downloads/9e70404d3a55a6b6d1c1877784347c14/mixed_source_space_inverse.ipynb
bsd-3-clause
# Author: Annalisa Pascarella <a.pascarella@iac.cnr.it> # # License: BSD-3-Clause import os.path as op import matplotlib.pyplot as plt from nilearn import plotting import mne from mne.minimum_norm import make_inverse_operator, apply_inverse # Set dir data_path = mne.datasets.sample.data_path() subject = 'sample' da...
tpin3694/tpin3694.github.io
regex/match_dates.ipynb
mit
# Load regex package import re """ Explanation: Title: Match Dates Slug: match_dates Summary: Match Dates Date: 2016-05-01 12:00 Category: Regex Tags: Basics Authors: Chris Albon Based on: Regular Expressions Cookbook Preliminaries End of explanation """ # Create a variable containing a text string text = 'My birt...
astroumd/GradMap
notebooks/Lectures2020/Lecture2/Lecture2_Instructor.ipynb
gpl-3.0
ourList = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] """ Explanation: Review from the previous lecture In the previous lecture we covered basic mathematical operations, variables, and lists. We also introduced you to conditional statements, loops, and basic plotting using matplotlib. Before we move forward, we'll do a quick revie...
hchauvet/beampy
doc-src/auto_tutorials/first_slide.ipynb
gpl-3.0
from beampy import * # We first create a new document for our presentation # Remove quiet=True to see Beampy compiler output doc = document(quiet=True) # Then we create a new slide with the title "My first new slide" with slide('My first slide title'): # All the slide contents are functions added inside the with...
ksooklall/deep_learning_foundation
reinforcement/Q-learning-cart.ipynb
mit
import gym import tensorflow as tf import numpy as np """ Explanation: Deep Q-learning In this notebook, we'll build a neural network that can learn to play games through reinforcement learning. More specifically, we'll use Q-learning to train an agent to play a game called Cart-Pole. In this game, a freely swinging p...
wedelljd/wedelljd.github.io
billboard post_files/billboard post.ipynb
mit
#importing packages and libraries needed import pandas as pd import numpy as np import matplotlib.pyplot as plt import datetime import seaborn as sns import matplotlib.cm as cm sns.set_palette(sns.color_palette(None)) sns.set_style("darkgrid") %matplotlib inline billboard = pd.read_csv("./billboard.csv") #import da...
nickmckay/LiPD-utilities
Examples/.ipynb_checkpoints/Welcome LiPD - Quickstart-checkpoint.ipynb
gpl-2.0
import lipd """ Explanation: <div class="clearfix" style="padding: 10px; padding-left: 0px; padding-top: 40px"> <img src="https://www.dropbox.com/s/y8dd1z3sl4uofep/lipd_logo.png?raw=1" width="700px" class="pull-right" style="display: inline-block; margin: 0px;"> </div> Welcome to the LiPD Quickstart Notebook! This No...
nick-youngblut/SIPSim
ipynb/bac_genome/fullCyc/trimDataset/.ipynb_checkpoints/rep3-checkpoint.ipynb
mit
import os import glob import re import nestly %load_ext rpy2.ipython %load_ext pushnote %%R library(ggplot2) library(dplyr) library(tidyr) library(gridExtra) library(phyloseq) """ Explanation: Goal Simulating a fullCyc control gradient Not simulating incorporation (all 0% isotope incorp.) Don't know how much true i...
csaladenes/csaladenes.github.io
present/mcc/jupyter/1-DimensionalityReduction-PCA.ipynb
mit
from __future__ import print_function, division %matplotlib inline import numpy as np import matplotlib.pyplot as plt from scipy import stats plt.style.use('seaborn') """ Explanation: Dénes Csala, MCC, Kolozsvár, 2021 <small><i>This notebook was put together by Jake Vanderplas. Source and license info is on GitHub.<...
arnaldog12/Manual-Pratico-Deep-Learning
Rede Neural_Intuição.ipynb
mit
import numpy as np """ Explanation: Neste notebook, vamos codificar Redes Neurais de forma manual para tentar entender intuitivamente como elas são implementadas na prática. Sumário Exemplo 1 Exemplo 2 O que precisamos para implementar uma Rede Neural? Referências Imports e Configurações End of explanation """ def...
paulu/deepart
LFWDMT.ipynb
mit
from glob import glob import csv import dmt import numpy as np import time from IPython.display import Image """ Explanation: Deep Manifold Traversal with LFW This Python notebook describes how to run Deep Manifold Traversal to age Aaron Eckhart (as an example). If you have already cloned the deepmanifold github repos...
dismalpy/dismalpy
doc/notebooks/dfm_coincident.ipynb
bsd-2-clause
%matplotlib inline import numpy as np import pandas as pd import statsmodels.api as sm import dismalpy as dp import matplotlib.pyplot as plt np.set_printoptions(precision=4, suppress=True, linewidth=120) from pandas.io.data import DataReader # Get the datasets from FRED start = '1979-01-01' end = '2014-12-01' indpr...
mbakker7/timml
notebooks/timml_notebook4_sol.ipynb
mit
%matplotlib inline import numpy as np import matplotlib.pyplot as plt from timml import * figsize = (6, 6) z = [20, 15, 10, 8, 6, 5.5, 5.2, 4.8, 4.4, 4, 2, 0] ml = Model3D(kaq=10, z=z, kzoverkh=0.1) ls1 = LineSinkDitch(ml, x1=-100, y1=0, x2=100, y2=0, Qls=10000, order=5, layers=6) ls2 = HeadLineSinkString(ml, [(200, -...
wutienyang/facebook_fanpage_analysis
Facebook粉絲頁分析三部曲-爬取篇(comments).ipynb
mit
# 載入python 套件 import requests import datetime import time import pandas as pd """ Explanation: 如何爬取Facebook粉絲頁資料 (comments) ? 基本上是透過 Facebook Graph API 去取得粉絲頁的資料,但是使用 Facebook Graph API 還需要取得權限,有兩種方法 : 第一種是取得 Access Token 第二種是建立 Facebook App的應用程式,用該應用程式的帳號,密碼當作權限 兩者的差別在於第一種會有時效限制,必須每隔一段時間去更新Access Token,才能使用 Access To...
GoogleCloudPlatform/ml-pipeline-generator-python
examples/getting_started_notebook.ipynb
apache-2.0
# Use the latest major GA version of the framework. ! pip install --upgrade ml-pipeline-gen PyYAML """ Explanation: End to End Workflow with ML Pipeline Generator <table align="left"> <td> <a href="https://colab.sandbox.google.com/github/GoogleCloudPlatform/ml-pipeline-generator-python/blob/master/examples/getti...
massimo-nocentini/simulation-methods
notes/matrices-functions/riordan-arrays-ctors.ipynb
mit
from sympy import * from sympy.abc import n, i, N, x, lamda, phi, z, j, r, k, a, t, alpha from sequences import * init_printing() m = 8 d_fn, h_fn = Function('d'), Function('h') d, h = IndexedBase('d'), IndexedBase('h') """ Explanation: <p> <img src="http://www.cerm.unifi.it/chianti/images/logo%20unifi_positivo.jp...
brian-rose/env-415-site
notes/EBM_notes.ipynb
mit
# We start with the usual import statements %matplotlib inline import numpy as np import matplotlib.pyplot as plt import climlab # create a new model with all default parameters (except the grid size) mymodel = climlab.EBM_annual(num_lat = 30) # What did we just do? print mymodel """ Explanation: Using climlab...
csieber/yt-dataset
notebooks/avg_quality.ipynb
mit
import warnings warnings.filterwarnings("ignore") %matplotlib inline """ Explanation: Average video quality The basic example shows how to plot the shaping to average quality level plot from the IFIP Networking 2016 publication. Reading the dataset with pandas Remove warnings and show plots inline: End of explanation ...
opencobra/cobrapy
documentation_builder/dfba.ipynb
gpl-2.0
import numpy as np from tqdm import tqdm from scipy.integrate import solve_ivp import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Dynamic Flux Balance Analysis (dFBA) in COBRApy The following notebook shows a simple, but slow example of implementing dFBA using COBRApy and scipy.integrate.solve_ivp. ...
JJINDAHOUSE/deep-learning
embeddings/Skip-Grams-Solution.ipynb
mit
import time import numpy as np import tensorflow as tf import utils """ Explanation: Skip-gram word2vec In this notebook, I'll lead you through using TensorFlow to implement the word2vec algorithm using the skip-gram architecture. By implementing this, you'll learn about embedding words for use in natural language p...
root-mirror/training
SoftwareCarpentry/09-rdataframe-advanced.ipynb
gpl-2.0
import numpy import ROOT np_dict = {colname: numpy.random.rand(100) for colname in ["a","b","c"]} df = ROOT.RDF.MakeNumpyDataFrame(np_dict) print(f"Columns in the RDataFrame: {df.GetColumnNames()}") co = df.Count() m_a = df.Mean("a") fil1 = df.Filter("c < 0.7") def1 = fil1.Define("d", "a+b+c") h = def1.Histo1D("d"...
dfm/KeplerHack
keplerhack.ipynb
mit
import os import requests import numpy as np import pandas as pd from io import BytesIO # Python 3 only! import matplotlib.pyplot as pl def get_catalog(name, basepath="data"): """ Download a catalog from the Exoplanet Archive by name and save it as a Pandas HDF5 file. :param name: the table name...
frazer-lab/cardips-ipsc-eqtl
notebooks/RNA-Seq Analysis.ipynb
mit
import copy import cPickle import os import subprocess import cdpybio as cpb import matplotlib.pyplot as plt import numpy as np import pandas as pd from scipy.linalg import svd import scipy.stats as stats import seaborn as sns import statsmodels.formula.api as smf import cardipspy as cpy import ciepy %matplotlib inl...
ES-DOC/esdoc-jupyterhub
notebooks/messy-consortium/cmip6/models/emac-2-53-aerchem/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-aerchem', 'atmos') """ Explanation: ES-DOC CMIP6 Model Properties - Atmos MIP Era: CMIP6 Institute: MESSY-CONSORTIUM Source ID: EMAC-2-53-AERCHEM Topic: Atmos Sub-T...
ekergy/jupyter_notebooks
curso/5-Pandas.ipynb
gpl-3.0
import pandas as pd import numpy as np trends = pd.read_csv('./data/20160819_OlympicSportsByCountries.csv', header=1) trends.head() trends[trends.Country == "Spain"].sort_values(by="Search Interest", ascending=False) trends[trends.Sport == "Tennis"]....
csaladenes/csaladenes.github.io
present/bi/2020/jupyter/6_pdf_ocr_excel.ipynb
mit
!pip install Pillow !pip install pdf2image """ Explanation: PDF táblázatok pandas-ba való alakítása. Olyan PDF-ekre, amelyek képekből vannak - tehát fényképek, szkennelések, vagy hasonló. Ez magában foglalja a sima fényképek (JPG, PNG) szövegfelismerését is. Az átalakítási folyamat három lépéses: 1. PDF oldalainak k...
duttashi/Data-Analysis-Visualization
scripts/general/Taarifa_EDA.ipynb
mit
sub1.describe() """ Explanation: Distribution Analysis of the data Now that we have familarity with the basic characterstics, lets look at the distribution of various variables starting with the continuous variable Distribution analysis of continuous variable using the describe() End of explanation """ sub1['extract...
LDSSA/learning-units
units/05-summary-statistics/practice/Exercises Summary Statistics.ipynb
mit
import pandas as pd import numpy as np from IPython.display import display, HTML CSS = """ .output { flex-direction: row; } """ patient_data = pd.read_csv("../data/Exercises_Summary_Statistics_Data.csv") patient_data.head() """ Explanation: Summary Statistics - Exercises In these exercises you'll use a real lif...
sz2472/foundations-homework
homework 11/11-homework-data/zhao_shengying_homework 11.ipynb
mit
df.dtypes #dtype: Data type for data or columns print("The data type is",(type(df['Plate ID'][0]))) """ Explanation: 1. I want to make sure my Plate ID is a string. Can't lose the leading zeroes! End of explanation """ df['Vehicle Year'] = df['Vehicle Year'].replace("0","NaN") #str.replace(old, new[, max]) df.head(...
aattaran/Machine-Learning-with-Python
MNIST/0410 - MNIST Project 6 - The ROC Curve/MNIST.ipynb
bsd-3-clause
import numpy as np from sklearn.datasets import fetch_mldata mnist = fetch_mldata('MNIST original') mnist len(mnist['data']) """ Explanation: Classification Based Machine Learning Algorithm An introduction to machine learning with scikit-learn Scikit-learn Definition: Supervised learning, in which the data comes wi...
adrienhenry/characteristicTimesNetwork
time_real_networks.ipynb
mit
from imp import reload import re import numpy as np from scipy.integrate import ode import NetworkComponents """ Explanation: Characteristic times in real networks End of explanation """ chassagnole = NetworkComponents.Network("chassagnole2002") chassagnole.readSBML("./published_models/Chassagnole2002.xml") chassag...
LucaCanali/Miscellaneous
Spark_Physics/LHCb_opendata/LHCb_OpenData_Spark_CERNSWAN_Version.ipynb
apache-2.0
# Start the Spark Session # When Using Spark on CERN SWAN, use this and do not select to connect to a CERN Spark cluster # If you want to use a cluster, please copy the data to a cluster filesystem first from pyspark.sql import SparkSession spark = (SparkSession.builder .appName("LHCb opendata") .mas...
cgre-aachen/gempy
notebooks/Getting_started.ipynb
lgpl-3.0
# Importing GemPy import gempy as gp # Importing aux libraries from ipywidgets import interact import numpy as np import matplotlib.pyplot as plt import matplotlib.image as mpimg # Embedding matplotlib figures in the notebooks %matplotlib qt5 """ Explanation: Getting started Importing used libraries End of explanati...
PyLadiesCZ/pyladies.cz
original/v1/s003-looping/ostrava/Feedback k domácím projektům 2.ipynb
mit
for radek in range(4): radek += 1 for value in range(radek): print('X', end=' ') print('') """ Explanation: Feedback k domácím projektům Jde tento kód napsat jednodušeji, aby ale dělal úplně totéž? End of explanation """ for radek in range(1, 5): print('X ' * radek) """ Explanation: Ano, lze :-) End of ...
smorton2/think-stats
code/chap13soln.ipynb
gpl-3.0
from __future__ import print_function, division %matplotlib inline import warnings warnings.filterwarnings('ignore', category=FutureWarning) import numpy as np import pandas as pd import random import thinkstats2 import thinkplot """ Explanation: Examples and Exercises from Think Stats, 2nd Edition http://thinkst...
mdbloice/Machine-Learning-for-Health-Informatics
Assignment2.ipynb
mit
import urllib2 import csv import pandas as pd import numpy as np from scipy import stats import matplotlib.pyplot as plt %matplotlib inline url_X_train = 'http://statweb.stanford.edu/~tibs/ElemStatLearn/datasets/14cancer.xtrain' url_y_train = 'http://statweb.stanford.edu/~tibs/ElemStatLearn/datasets/14cancer.ytrain' u...
Danghor/Algorithms
Python/Chapter-05/Stack.ipynb
gpl-2.0
class Stack: pass S = Stack() S """ Explanation: Implementing a Stack Class First, we define an empty class Stack. End of explanation """ def stack(S): S.mStackElements = [] """ Explanation: Next we define a constructor for this class. The function stack(S) takes an uninitialized, empty object S and init...
besser82/shogun
doc/ipython-notebooks/neuralnets/neuralnets_digits.ipynb
bsd-3-clause
%pylab inline %matplotlib inline import os SHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data') from scipy.io import loadmat from shogun import features, MulticlassLabels, Math # load the dataset dataset = loadmat(os.path.join(SHOGUN_DATA_DIR, 'multiclass/usps.mat')) Xall = dataset['data'] # the usps dataset...
Diyago/Machine-Learning-scripts
general studies/task_nn.ipynb
apache-2.0
# Выполним инициализацию основных используемых модулей %matplotlib inline import random import matplotlib.pyplot as plt from sklearn.preprocessing import normalize import numpy as np """ Explanation: Нейронные сети: зависимость ошибки и обучающей способности от числа нейронов В этом задании вы будете настраивать двус...
bureaucratic-labs/yargy
docs/ref.ipynb
mit
from yargy.tokenizer import RULES RULES """ Explanation: Справочник Токенизатор Токенизатор в Yargy реализован на регулярных выражениях. Для каждого типа токена есть правило с регуляркой: End of explanation """ from yargy.tokenizer import Tokenizer text = 'a@mail.ru' tokenizer = Tokenizer() list(tokenizer(text))...
adriaanvuik/solid_state_physics
semiconductor_dos_numerics.ipynb
bsd-2-clause
fermi_gas_1D """ Explanation: Free electron model By Anton Akhmerov (also it's my very first lecture ever today!) This lecture: * Fermi surface * Fermi energy * Fermi velocity * Electron heat capacitance Next lecture: Scattering and magnetic field Electrons Q: In which ways are electrons different from phonons? They ...
jonathanmorgan/msu_phd_work
analysis/step-2-filter-network-relations-dev.ipynb
lgpl-3.0
me = "filter-network-relations-dev" """ Explanation: <h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#notes-and-questions" data-toc-modified-id="notes-and-questions-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>notes and questions</a></span></li><li>...
tpin3694/tpin3694.github.io
machine-learning/preprocessing_categorical_features.ipynb
mit
from sklearn import preprocessing from sklearn.pipeline import Pipeline import pandas as pd """ Explanation: Title: Preprocessing Categorical Features Slug: preprocessing_categorical_features Summary: Preprocessing Categorical Features Date: 2016-11-01 12:00 Category: Machine Learning Tags: Preprocessing Structured Da...
olifre/root
bindings/pyroot/cppyy/cppyy/doc/tutorial/GSLPythonizationTutorial.ipynb
lgpl-2.1
import cppyy """ Explanation: GSL Pythonization Tutorial (Hat tip to Neil Dhir for the idea.) This tutorial introduces pythonizations and how they can be used to solve low-level problems. The setup: imagine you want to use numpy, but are given a C or C++ library that is based on the GNU Scientific Library (GSL). How d...
andijcr/andijcr.github.io
assets/hashcode/HashCode Integer Programming Solution.ipynb
mit
#size is the capacity of the cache in Mb, ID is an integer class Cache: def __init__(self, size, ID): self.size = size self.ID = ID #like Cache, size is dimension in Mb, ID is an integer class Video: def __init__(self, size, ID): self.size = size self.ID = ID #Endpoint represen...
PyLadiesCZ/pyladies.cz
original/v1/s003-looping/ostrava/Feedback k domácím projektům.ipynb
mit
for radek in range(4): radek += 1 for value in range(radek): print('X', end=' ') print('') """ Explanation: Feedback k domácím projektům Jde tento kód napsat jednodušeji, aby ale dělal úplně totéž? End of explanation """ for radek in range(1, 5): print('X ' * radek) """ Explanation: Ano, lze :-) End of ...
syednasar/datascience
deeplearning/tv-script-generation/dlnd_tv_script_generation.ipynb
mit
""" DON'T MODIFY ANYTHING IN THIS CELL """ import helper data_dir = './data/simpsons/moes_tavern_lines.txt' text1 = helper.load_data(data_dir) # Ignore notice, since we don't use it for analysing the data text = text1[81:] print(text1[:81]) print(text[:1000]) """ Explanation: TV Script Generation In this project, yo...
lvphj/mappy
map_postcodes_to_shp_file.ipynb
mit
%matplotlib inline import pandas as pd import epydemiology as epy import geopandas as gpd from pathlib import Path import glob import matplotlib.pyplot as plt import os from shapely.geometry import Point """ Explanation: Code to map postcodes to shp files May 2020 Postcode definition file (version 02-2020) downloaded...
mikelseverson/Udacity-Deep_Learning-Nanodegree
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...
wasat/JupyTEPIDE
notebooks/grass/bash/import.ipynb
apache-2.0
!v.in.ascii input=points.txt output=test_ascii separator=comma x=1 y=2 """ Explanation: Import and export of data from different sources in GRASS GIS GRASS GIS Location can contain data only in one coordinate reference system (CRS) in order to have full control over reprojection and avoid issues coming from on-the-fly...
mne-tools/mne-tools.github.io
0.13/_downloads/plot_label_from_stc.ipynb
bsd-3-clause
# Author: Luke Bloy <luke.bloy@gmail.com> # Alex Gramfort <alexandre.gramfort@telecom-paristech.fr> # License: BSD (3-clause) import numpy as np import matplotlib.pyplot as plt import mne from mne.minimum_norm import read_inverse_operator, apply_inverse from mne.datasets import sample print(__doc__) data_pa...
sebastiandres/mat281
clases/Unidad4-MachineLearning/Clase05-Clasificacion-RegresionLogistica/ClasificacionRegresionLogistica.ipynb
cc0-1.0
%%bash cat data/Challenger.txt """ Explanation: <header class="w3-container w3-teal"> <img src="images/utfsm.png" alt="" height="100px" align="left"/> <img src="images/mat.png" alt="" height="100px" align="right"/> </header> <br/><br/><br/><br/><br/> MAT281 Aplicaciones de la Matemática en la Ingeniería Sebastián Flor...
tensorflow/docs
site/en/guide/advanced_autodiff.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...
petebachant/ALM-turbulence-injection
notebook.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np import pandas as pd from pxl.styleplot import set_sns set_sns() import os from scipy.interpolate import interp1d import scipy.stats dataset_name = "NACA0021_2.0e+05.csv" dataset_url = "https://raw.githubusercontent.com/petebachant/NACAFoil-OpenFOAM/...
michael-isaev/cse6040_qna
PythonQnA_5_pythonic_code.ipynb
apache-2.0
# Task: Concatenate a list of strings into a single string # delimited by spaces. list_of_words = ['the', 'quick', 'brown', 'fox', 'jumped', 'over', 'the', 'lazy', 'dog'] i = 0 # A counter to maintain the current position in the list new_string = '' # String to hold the output while i < len(list_of_words): # Iterate ...
mohanprasath/Course-Work
coursera/python_for_data_science/2.3_Dictionaries.ipynb
gpl-3.0
Dict={"key1":1,"key2":"2","key3":[3,3,3],"key4":(4,4,4),('key5'):5,(0,1):6} Dict """ Explanation: <a href="http://cocl.us/topNotebooksPython101Coursera"><img src = "https://ibm.box.com/shared/static/yfe6h4az47ktg2mm9h05wby2n7e8kei3.png" width = 750, align = "center"></a> <a href="https://www.bigdatauniversity.com"><im...
MingChen0919/learning-apache-spark
notebooks/02-data-manipulation/2.8-sql-functions-to-extend-column-expressions.ipynb
mit
from pyspark.sql import functions as F """ Explanation: pyspark.sql.functions functions pyspark.sql.functions is collection of built-in functions for creating column expressions. These functions largely increase methods that we can use to manipulate DataFrame and DataFrame columns. There are many sql functions from th...
SimonBiggs/electroninserts_bundle
Model an insert shape.ipynb
agpl-3.0
energy = 6 applicator = 10 ssd = 100 x = [0.99, -0.14, -1.0, -1.73, -2.56, -3.17, -3.49, -3.57, -3.17, -2.52, -1.76, -1.04, -0.17, 0.77, 1.63, 2.36, 2.79, 2.91, 3.04, 3.22, 3.34, 3.37, 3.08, 2.54, 1.88, 1.02, 0.99] y = [5.05, 4.98, 4.42, 3.24, 1.68, 0.6, -0.64, -1.48, -2.38, -3.77, -4.81, -5.26, -5.51, -5....
mbohlool/client-python
examples/notebooks/create_secret.ipynb
apache-2.0
from kubernetes import client, config """ Explanation: How to create and use a Secret A Secret is an object that contains a small amount of sensitive data such as a password, a token, or a key. In this notebook, we would learn how to create a Secret and how to use Secrets as files from a Pod as seen in https://kubern...
Alex-Ian-Hamilton/solarbextrapolation
docs/auto_examples/define_and_run_trivial_preprocessor_and_extrapolator.ipynb
mit
# Define a trivial preprocessor class PreZeros(Preprocessors): def __init__(self, map_magnetogram): super(PreZeros, self).__init__(map_magnetogram) def _preprocessor(self): # Adding in custom parameters to the meta self.meta['preprocessor_routine'] = 'Zeros Preprocessor' # Crea...
drphilmarshall/StatisticalMethods
tutorials/Week2/Xray_mock.ipynb
gpl-2.0
import astropy.io.fits as pyfits import numpy as np import matplotlib.pyplot as plt %matplotlib inline from astropy.visualization import LogStretch logstretch = LogStretch() from io import StringIO # StringIO behaves like a file object import scipy.stats class SolutionMissingError(Exception): def __init__(self):...
mintcloud/deep-learning
autoencoder/Convolutional_Autoencoder_Solution.ipynb
mit
%matplotlib inline 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', validation_size=0) img = mnist.train.images[2] plt.imshow(img.reshape((28, 28)), cmap='Greys_r') """ Explanation: C...
ES-DOC/esdoc-jupyterhub
notebooks/cmcc/cmip6/models/sandbox-1/landice.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'cmcc', 'sandbox-1', 'landice') """ Explanation: ES-DOC CMIP6 Model Properties - Landice MIP Era: CMIP6 Institute: CMCC Source ID: SANDBOX-1 Topic: Landice Sub-Topics: Glaciers, Ice. Properties:...
kimkipyo/dss_git_kkp
통계, 머신러닝 복습/160518수_5일차_미적분Calculus과 최적화Optimization/4.SciPy 시작하기.ipynb
mit
rv = sp.stats.norm(loc=10, scale=10) rv.rvs(size=(3, 10), random_state=1) sns.distplot(rv.rvs(size=10000, random_state=1)) xx = np.linspace(-40, 60, 1000) pdf = rv.pdf(xx) plt.plot(xx, pdf) cdf = rv.cdf(xx) plt.plot(xx, cdf) """ Explanation: SciPy 시작하기 SciPy란 과학기술계산용 함수 및 알고리즘 제공 Home http://www.scipy.org/ Documen...
sueiras/training
tensorflow_old/03-text_use_cases/03_word_tagging/00_identify_tags_in_airline_database_embedings - SOLVED.ipynb
gpl-3.0
from __future__ import print_function import os import numpy as np import tensorflow as tf print(tf.__version__) os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID" os.environ["CUDA_VISIBLE_DEVICES"]="0" """ Explanation: Identify tags in airline database Minimal code - Read dataset - transform data - Minimal model ...
samstav/scipy_2015_sklearn_tutorial
notebooks/02.3 Unsupervised Learning - Transformations and Dimensionality Reduction.ipynb
cc0-1.0
from sklearn.datasets import load_iris iris = load_iris() X, y = iris.data, iris.target print(X.shape) """ Explanation: Unsupervised Learning Many instances of unsupervised learning, such as dimensionality reduction, manifold learning and feature extraction, find a new representation of the input data without any add...
pschragger/big-data-python-class
tutorials/Python_Basics.ipynb
mit
a=5 print ("a") a """ Explanation: Python Tutorial - Some of the basics Notes on the content of this tutorial This tutorial is a composite of a number of sources: [1]Python for Data analysis: Appendix Python Essentials [2] https://developers.google.com/edu/python/introduction I reccommend making a copy of this notebo...
ShinjiKatoA16/UCSY-sw-eng
python-2.ipynb
mit
x = 1 print('x =', x, type(x)) x = 'abc' print('x =', x, type(x)) """ Explanation: Python 2nd step: Variables and Data type In case of C or other compile langueage, variables need to be declared with data type. In Python, Object have data type, variables just refer Object. Following sequence is valid in Python. End of...
dataventureutc/Kaggle-HandsOnLab
Machine Learning - Hands on Lab - Session #3 - Feature Engineering.ipynb
gpl-3.0
import os from datetime import datetime import numpy as np import pandas as pd import sklearn as sk """ Explanation: Machine Learning - Hands on Lab - Session #1 Lecturer: Jonathan DEKHTIAR Date: 2017-03-13 <br/><br/> Contact: contact@jonathandekhtiar.eu Twitter: @born2data LinkedIn: JonathanDEKHTIAR Personal Websi...
phoebe-project/phoebe2-docs
2.1/examples/rossiter_mclaughlin.ipynb
gpl-3.0
!pip install -I "phoebe>=2.1,<2.2" %matplotlib inline """ Explanation: Rossiter-McLaughlin Effect Setup Let's first make sure we have the latest version of PHOEBE 2.1 installed. (You can comment out this line if you don't use pip for your installation or don't want to update to the latest release). End of explanation...
kellyrowland/openmc
docs/source/pythonapi/examples/tally-arithmetic.ipynb
mit
%load_ext autoreload %autoreload 2 import glob from IPython.display import Image import numpy as np import openmc from openmc.statepoint import StatePoint from openmc.summary import Summary from openmc.source import Source from openmc.stats import Box %matplotlib inline """ Explanation: This notebook shows the how ...
farr/emcee
docs/_static/notebooks/quickstart.ipynb
mit
import emcee emcee.__version__ """ Explanation: Quickstart This notebook was made with the following version of emcee: End of explanation """ import numpy as np """ Explanation: The easiest way to get started with using emcee is to use it for a project. To get you started, here’s an annotated, fully-functional exam...
ctroupin/OceanData_NoteBooks
PythonNotebooks/PlatformPlots/Read_TimeSeries_3.ipynb
gpl-3.0
%matplotlib inline import cf import netCDF4 import matplotlib.pyplot as plt """ Explanation: Reading a file using CF module The main difference with the previous example is the way we will read the data from the file. Instead of the netCDF4 module, we will use the cf-python package, which implements the CF data model ...
hetaodie/hetaodie.github.io
assets/media/uda-ml/supervisedlearning/jc/为慈善机构寻找捐助者/finding_donors.ipynb
mit
# TODO:总的记录数 n_records = len(data) # # TODO:被调查者 的收入大于$50,000的人数 n_greater_50k = len(data[data.income.str.contains('>50K')]) # # TODO:被调查者的收入最多为$50,000的人数 n_at_most_50k = len(data[data.income.str.contains('<=50K')]) # # TODO:被调查者收入大于$50,000所占的比例 greater_percent = (n_greater_50k / n_records) * 100 # 打印结果 print ("To...
InsightSoftwareConsortium/SimpleITK-Notebooks
Python/02_Pythonic_Image.ipynb
apache-2.0
%matplotlib inline import matplotlib.pyplot as plt import matplotlib as mpl mpl.rc("image", aspect="equal") import SimpleITK as sitk # Download data to work on %run update_path_to_download_script from downloaddata import fetch_data as fdata """ Explanation: Pythonic Syntactic Sugar <a href="https://mybinder.org/v2/g...