repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
mdastro/UV_ETGs | Coding/Catalog Analysis.ipynb | mit | redshift = my_dictionary['Z_HELIO'].astype(float)
sns.boxplot(y=redshift)
plt.show()
sns.boxplot(y=redshift, showfliers=False)
plt.show()
"""
Explanation: Plot 01: Redshift distribution of our sample
End of explanation
"""
fuv_band = my_dictionary['MAG_AB_FUV'].astype(float)
nuv_band = my_dictionary['MAG_AB_NUV... |
computational-class/cjc2016 | code/03.python_intro.ipynb | mit | %matplotlib inline
import random, datetime
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
import statsmodels.api as sm
from scipy.stats import norm
from scipy.stats.stats import pearsonr
"""
Explanation: 数据科学的编程工具
Python使用简介
王成军
wangchengjun@nju.edu.cn
计算传播网 http://computational-communication.... |
1x0r/pspis | labs/demos-1.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
n = 19
print("Каждая цифра представлена матрицей формы ", digits.data[n, :].shape)
"""
Explanation: Какую задачу можно поставить для этого набора данных?
End of explanation
"""
digit = 255 - digits.data[n, :].reshape(8, 8)
plt.imshow(digit, cmap='gray', interpolatio... |
gabicfa/RedesSociais | .ipynb_checkpoints/encontro04-checkpoint.ipynb | gpl-3.0 | import numpy as np
import socnet as sn
import easyplot as ep
"""
Explanation: Encontro 04: Suporte para Análise Espectral de Grafos
Este guia foi escrito para ajudar você a atingir os seguintes objetivos:
lembrar conceitos básicos de geometria analítica e álgebra linear;
explicar conceitos básicos de matriz de adjacê... |
gwu-libraries/notebooks | 20150730-notebook-intro/Intro notebook.ipynb | mit | print "This is a python cell. It executes and its output renders below."
"""
Explanation: Intro to notebooks
Welcome to your first notebook. A notebook is a mixture of text, code, and code output captured from a live connection to a running instance of an environment like a Python shell.
This is a text cell, using ma... |
quantopian/research_public | notebooks/lectures/Maximum_Likelihood_Estimation/answers/notebook.ipynb | apache-2.0 | # Useful Libraries
import pandas as pd
import math
import matplotlib.pyplot as plt
import numpy as np
import scipy
import scipy.stats as stats
"""
Explanation: Exercises: Maximum Likelihood Estimation - Answer Key
By Christopher van Hoecke, Max Margenot, and Delaney Mackenzie
Lecture Link :
https://www.quantopian.com/... |
LSSTC-DSFP/LSSTC-DSFP-Sessions | Sessions/Session08/Day5/gpu_intro.ipynb | mit | import numpy as np
import math
from numba import vectorize, cuda
from matplotlib import pyplot as plt
%matplotlib inline
"""
Explanation: <a href="https://colab.research.google.com/github/evaneschneider/parallel-programming/blob/master/gpu_intro.ipynb" target="_parent"><img src="https://colab.research.google.com/asset... |
dietmarw/EK5312_ElectricalMachines | Chapman/Ch2-Problem_2-06.ipynb | unlicense | %pylab notebook
%precision 4
"""
Explanation: Excercises Electric Machinery Fundamentals
Chapter 2
Problem 2-6
End of explanation
"""
Voc = 115.0 # [V]
Ioc = 0.11 # [A]
Poc = 3.9 # [W]
Vsc = 17.1 # [V]
Isc = 8.7 # [A] replace with 4.35 so see alternative(correct solutions)
Psc = 38.1 # [W]
"""
Expl... |
molgor/spystats | notebooks/Sandboxes/spatial_autocorrelation_with_trend.ipynb | bsd-2-clause | new_data.crs = {'init':'epsg:4326'}
"""
Explanation: Let´s reproject to Alberts or something with distance
End of explanation
"""
new_data = new_data.to_crs("+proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=37.5 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs ")
new_data['newLon'] = new_data.apply(lam... |
tensorflow/docs-l10n | site/ja/hub/tutorials/bigbigan_with_tf_hub.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... |
duncanwp/python_for_climate_scientists | course_content/notebooks/pandas_introduction.ipynb | gpl-3.0 | import pandas as pd
"""
Explanation: Introduction to Pandas
Pandas (http://pandas.pydata.org) is great for data analysis, again we met it briefly in the software carpentry course, but it's worth revisiting.
Note the book on that website - 'Python for data analysis', this is a useful text which much of this section wa... |
ocefpaf/system-test | content/downloads/notebooks/2015-11-23-NGDC_CSW_QueryForIOOSRAs.ipynb | unlicense | from owslib.csw import CatalogueServiceWeb
endpoint = 'http://www.ngdc.noaa.gov/geoportal/csw'
csw = CatalogueServiceWeb(endpoint, timeout=30)
"""
Explanation: The goal of this post is to investigate if it is possible to query the NGDC CSW Catalog to extract records matching an IOOS RA acronym, like SECOORA for examp... |
bbfamily/abu | abupy_lecture/3-滑点策略与交易手续费(ABU量化使用文档).ipynb | gpl-3.0 | from __future__ import print_function
from __future__ import division
import warnings
warnings.filterwarnings('ignore')
warnings.simplefilter('ignore')
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
import os
import sys
# 使用insert 0即只使用github,避免交叉使用了pip安装的abupy,导致的版本不一致问题
s... |
statkraft/shyft-doc | notebooks/repository/repositories-intro.ipynb | lgpl-3.0 | # Pure python modules and jupyter notebook functionality
# first you should import the third-party python modules which you'll use later on
# the first line enables that figures are shown inline, directly in the notebook
%matplotlib inline
import os
import datetime as dt
import pandas as pd
from os import path
import s... |
nproctor/phys202-2015-work | days/day06/Matplotlib.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
"""
Explanation: Visualization with Matplotlib
Learning Objectives: Learn how to make basic plots using Matplotlib's pylab API and how to use the Matplotlib documentation.
This notebook focuses only on the Matplotlib API, rather that the broader que... |
harpolea/r3d2 | docs/tangential_change.ipynb | mit | from r3d2 import eos_defns, State, RiemannProblem
from IPython.display import display, display_png
eos = eos_defns.eos_gamma_law(5.0/3.0)
U_left_sod_modified = State(1.0, 0.5, 0.0, 1.5, eos)
U_right_sod_modified = State(0.125, 0.0, 0.0, 1.2, eos)
rp_sod_modified = RiemannProblem(U_left_sod_modified, U_right_sod_modifi... |
miykael/nipype_tutorial | notebooks/introduction_quickstart_non-neuroimaging.ipynb | bsd-3-clause | import os
from nipype import Workflow, Node, Function
"""
Explanation: Nipype Quickstart
This is a very quick non-imaging introduction to Nipype workflows. For a more comprehensive introduction, check the next section of the tutorial.
Existing documentation
Visualizing the evolution of Nipype
This notebook is ... |
dereneaton/RADmissing | emp_and_sims_nb_pgls.ipynb | mit | ## import Python libraries
from scipy.optimize import fminbound
import numpy as np
import pandas as pd
import itertools
import ete3
import rpy2
import copy
import glob
import gzip
import os
"""
Explanation: Phylogenetic generalized least squares model fit for quartet data
Manuscript: "Misconceptions on Missing Data i... |
Aggieyixin/cjc2016 | code/18.network analysis of tianya bbs.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
dtt = []
with open('/Users/chengjun/github/cjc2016/data/tianya_bbs_threads_network.txt', 'r') as f:
for line in f:
pnum, link, time, author_id, author, content = line.replace('\n', '').split('\t')
dtt.append([pnum, link, time, author_id, author, co... |
javoweb/deep-learning | first-neural-network/dlnd-your-first-neural-network.ipynb | mit | %matplotlib inline
%config InlineBackend.figure_format = 'retina'
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
"""
Explanation: Your first neural network
In this project, you'll build your first neural network and use it to predict daily bike rental ridership. We've provided some of the code... |
mrustl/flopy | examples/Notebooks/flopy3_WatertableRecharge_example.ipynb | bsd-3-clause | %matplotlib inline
from __future__ import print_function
import sys
import os
import platform
import numpy as np
import matplotlib.pyplot as plt
import flopy
import flopy.utils as fputl
#Set name of MODFLOW exe
# assumes executable is in users path statement
exe_name = 'mfnwt'
if platform.system() == 'Windows':
... |
igabr/Metis_Projects_Chicago_2017 | 05-project-kojack/Notebook_2_Duplicate_removal_techniques.ipynb | mit | import pandas as pd
import arrow # way better than datetime
import numpy as np
import random
import re
%run helper_functions.py
import string
new_df = unpickle_object("new_df.pkl") # this loads up the dataframe from our previous notebook
new_df.head() #sorted first on date and then time!
new_df.iloc[0, 3]
#we need ... |
gsvijayraajaa/workshop | 3.PCA.ipynb | mit | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
plt.style.use('fivethirtyeight')
plt.rcParams['figure.figsize'] = (10, 6)
"""
Explanation: Principle Component Analysis (PCA)
Key Equation: $Ax = \lambda b ~~ \text{for} ~~ n \times n $
PCA is an orthogonal... |
markovmodel/molPX | molpx/notebooks/3.molPX_TICA_Ala2.ipynb | lgpl-3.0 | from os.path import exists
import molpx
from matplotlib import pylab as plt
%matplotlib ipympl
import pyemma
import numpy as np
"""
Explanation: molPX Di-Ala example
<pre>
Guillermo Pérez-Hernández guille.perez@fu-berlin.de
</pre>
In this notebook we will be using a trajectory of Di-Ala-peptide to easily identify... |
AEW2015/PYNQ_PR_Overlay | Pynq-Z1/notebooks/Video_PR/Overlay_Image_256Color_Filter.ipynb | bsd-3-clause | from pynq.drivers.video import HDMI
from pynq import Bitstream_Part
from pynq.board import Register
from pynq import Overlay
Overlay("demo.bit").download()
"""
Explanation: Don't forget to delete the hdmi_out and hdmi_in when finished
Image Overlay 256 Color Filter Example
In this notebook, we will overlay an image o... |
neurodata/synaptome-stats | Code2/Python/Annotation_Notebook.ipynb | apache-2.0 | import itertools
import configparser
import csv
import morton
import sys
import os
import numpy as np
import requests
import argparse
import time
import tifffile
from numpy import genfromtxt
from numpy import linalg as LA
from PIL import Image
"""
Explanation: Annotation creation tool
Jesse Leigh Patsolic For Neuro... |
mne-tools/mne-tools.github.io | 0.20/_downloads/38f243960dd98f9910f9b981f0b54dd0/plot_fdr_stats_evoked.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License: BSD (3-clause)
import numpy as np
from scipy import stats
import matplotlib.pyplot as plt
import mne
from mne import io
from mne.datasets import sample
from mne.stats import bonferroni_correction, fdr_correction
print(__doc__)
"""
Explanation:... |
vlahm/TrafficCruising-DSSG2017 | models/Training_Cruising_Identification.ipynb | mit | import pandas as pd
import numpy as np
import matplotlib as plt
import json
%pylab inline
"""
Explanation: Training: Cruising Identification
Written by Orysya Stus
End of explanation
"""
data = !ls *.json
one_week = []
for d in data:
with open(d) as f:
resulting_json = json.load(f)
one_week.appen... |
netmanchris/PYHPEIMC | examples/Working with IP Address Management Scope Objects.ipynb | apache-2.0 | import csv
import time
from pyhpeimc.auth import *
from pyhpeimc.objects import *
auth = IMCAuth("http://", "10.101.0.203", "8080", "admin", "admin")
"""
Explanation: Working with IP Scope Objects
So now we're going to look at the recently implemented IP Scope Objects and supporting capabilities in the pyhpeimc libra... |
tpin3694/tpin3694.github.io | sql/automatically_add_keys_to_rows.ipynb | mit | # Ignore
%load_ext sql
%sql sqlite://
%config SqlMagic.feedback = False
"""
Explanation: Title: Automatically Add Keys To Rows
Slug: automatically_add_keys_to_rows
Summary: Automatically Add Keys To Rows in SQL.
Date: 2016-05-01 12:00
Category: SQL
Tags: Basics
Authors: Chris Albon
Note: This tutorial was written u... |
ES-DOC/esdoc-jupyterhub | notebooks/test-institute-1/cmip6/models/sandbox-1/land.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'test-institute-1', 'sandbox-1', 'land')
"""
Explanation: ES-DOC CMIP6 Model Properties - Land
MIP Era: CMIP6
Institute: TEST-INSTITUTE-1
Source ID: SANDBOX-1
Topic: Land
Sub-Topics: Soil, Snow, ... |
andrzejkrawczyk/python-course | part_1/02.Liczby_Stringi.ipynb | apache-2.0 | a = 5
b = 2
c = 5.5
d = 3+2j
e = 3e+4
print(a, b, c, d, e)
a, b = 5, 2
print(a, b)
a, b = b, a
print(a, b)
"""
Explanation: Liczby
End of explanation
"""
print(5 / 2)
print(5 // 2)
print(5 / 2.0)
print(5 % 2)
print(5 ** 2)
"""
Explanation: Python 3
End of explanation
"""
a, b, c = abs(-2), pow(5, 2), pow(5, 2, 1... |
ledeprogram/algorithms | class10/donow/palrogg_donow_10.ipynb | gpl-3.0 | import pg8000
conn = pg8000.connect(host='training.c1erymiua9dx.us-east-1.rds.amazonaws.com', database="training", port=5432, user='dot_student', password='qgis')
import pandas as pd
df = pd.read_sql("select * from winequality", conn)
df.head()
import numpy as np
data = df.as_matrix()
len(data)
"""
Explanation: Crea... |
vitojph/kschool-nlp | notebooks-py3/pos-tagger-es.ipynb | gpl-3.0 | import nltk
from nltk.corpus import cess_esp
cess_esp = cess_esp.tagged_sents()
print(cess_esp[5])
"""
Explanation: PoS tagging en Español
En este ejercicio vamos a jugar con uno de los corpus en español que está disponible desde NLTK: CESS_ESP, un treebank anotado a partir de una colección de noticias en español.
... |
microsoft/dowhy | docs/source/example_notebooks/dowhy-simple-iv-example.ipynb | mit | %load_ext autoreload
%autoreload 2
import numpy as np
import pandas as pd
import patsy as ps
from statsmodels.sandbox.regression.gmm import IV2SLS
import os, sys
from dowhy import CausalModel
"""
Explanation: Simple example on using Instrumental Variables method for estimation
End of explanation
"""
n_points = 100... |
Esri/gis-stat-analysis-py-tutor | notebooks/.ipynb_checkpoints/PythonFeatureIO-checkpoint.ipynb | apache-2.0 | import arcpy as ARCPY
import numpy as NUM
import SSDataObject as SSDO
"""
Explanation: Using the Spatial Statistics Data Object (SSDataObject) Makes Feature IO Simple
SSDataObject does the read/write and accounting of feature/attribute and NumPy Array order
Write/Utilize methods that take NumPy Arrays
Using NumPy as... |
florianwittkamp/FD_ACOUSTIC | JupyterNotebook/1D/FD_1D_DX4_DT4_LW.ipynb | gpl-3.0 | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
"""
Explanation: FD_1D_DX4_DT4_LW 1-D acoustic Finite-Difference modelling
GNU General Public License v3.0
Author: Florian Wittkamp
Finite-Difference acoustic seismic wave simulation
Discretization of the first-order acoustic wave equation
Temporal ... |
ES-DOC/esdoc-jupyterhub | notebooks/thu/cmip6/models/ciesm/ocean.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'thu', 'ciesm', 'ocean')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocean
MIP Era: CMIP6
Institute: THU
Source ID: CIESM
Topic: Ocean
Sub-Topics: Timestepping Framework, Advection, Lateral ... |
tylere/ee-jupyter-examples | 1 - Authorize Earth Engine.ipynb | apache-2.0 | # Code to check the IPython Widgets library.
try:
import ipywidgets
print('The IPython Widgets library (version {0}) is available on this server.'.format(
ipywidgets.__version__
))
except ImportError:
print('The IPython Widgets library is not available on this server.\n'
'Please see https://gith... |
hunterherrin/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
"""
import os
assert os.path.isfile('open_exoplanet_catalogue.txt')
!head -n 30 open_exoplanet_catalogue.txt
"""
Explanation: Exoplanet properties
Over the past few decades, ast... |
myinxd/agn-ae | code-sdss/calc_reconstruction.ipynb | mit | import kcorrect as kc
import numpy as np
import os
import pandas as pd
# load the unLRG sample list
listpath = "./BH_SDSS_cross_checked.xlsx"
data = pd.read_excel(listpath, "Sheet2")
def calc_maggies(mag, ext, band_id):
"""Calc flux from magnitude"""
# extinction correction
mag = mag - ext
# AB calibr... |
scottprahl/miepython | docs/01_basics.ipynb | mit | #!pip install --user miepython
import importlib.resources
import numpy as np
import matplotlib.pyplot as plt
try:
import miepython
except ModuleNotFoundError:
print('miepython not installed. To install, uncomment and run the cell above.')
print('Once installation is successful, rerun this cell again.')
... |
martinjrobins/hobo | examples/toy/distribution-multimodal-gaussian.ipynb | bsd-3-clause | import pints
import pints.toy
import numpy as np
import matplotlib.pyplot as plt
# Create log pdf
log_pdf = pints.toy.MultimodalGaussianLogPDF()
# Contour plot of pdf
levels = np.linspace(-3,12,20)
num_points = 100
x = np.linspace(-5, 15, num_points)
y = np.linspace(-5, 15, num_points)
X, Y = np.meshgrid(x, y)
Z = np... |
gevero/py_gmm | examples/Stockman Silver Nanolens.ipynb | gpl-3.0 | #------Library loading------
# numpy for matrix computations
import numpy as np; import numpy.ma as ma
# system libraries
import sys
# plotting libraries
%matplotlib inline
import matplotlib.pylab as plt
from matplotlib.patches import Circle, Ellipse
# Generalized Multiparticle Mie import
sys.path.append('../')
imp... |
mabevillar/rmtk | rmtk/vulnerability/derivation_fragility/equivalent_linearization/lin_miranda_2008/lin_miranda_2008.ipynb | agpl-3.0 | import lin_miranda_2008
from rmtk.vulnerability.common import utils
%matplotlib inline
"""
Explanation: Lin and Miranda (2008)
This method, described in Lin and Miranda (2008), estimates the maximum inelastic displacement of an existing structure based on the maximum elastic displacement response of its equivalent li... |
rthadani/coursera-ml | notebooks/classification/module-6-decision-tree-practical-assignment-pandas.ipynb | epl-1.0 | import pandas as pd
import numpy as np
"""
Explanation: Decision Trees in Practice
In this assignment we will explore various techniques for preventing overfitting in decision trees. We will extend the implementation of the binary decision trees that we implemented in the previous assignment. You will have to use your... |
szitenberg/ReproPhyloVagrant | notebooks/Tutorials/Basic/3.9 Reconstructing trees.ipynb | mit | from reprophylo import *
pj = unpickle_pj('outputs/my_project.pkpj', git=False)
"""
Explanation: Tree reconstruction can be done with RAxML or Phylobayes. This section will cover one example in which we will build a supermatrix tree using RAxML, and a single gene tree using Phylobayes.
End of explanation
"""
raxml =... |
evanmiltenburg/python-for-text-analysis | Assignments-colab/ASSIGNMENT_1.ipynb | apache-2.0 | %%capture
!wget https://github.com/cltl/python-for-text-analysis/raw/master/zips/Data.zip
!wget https://github.com/cltl/python-for-text-analysis/raw/master/zips/images.zip
!wget https://github.com/cltl/python-for-text-analysis/raw/master/zips/Extra_Material.zip
!unzip Data.zip -d ../
!unzip images.zip -d ./
!unzip Ext... |
google/applied-machine-learning-intensive | content/xx_misc/dimensionality_reduction/colab.ipynb | apache-2.0 | # 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 the L... |
bmorris3/friedrich | hat11/depths.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
fig, ax1 = plt.subplots(figsize=(14, 6))
errs = np.vstack([depth_err_low, depth_err_high])
quarter_times = [np.mean(np.array(times)[np.argwhere(np.array(quarters) == i)]) for i in set(quarters)]
for t, d, e, q in zip(times, depths, errs.T, quarters):
e2 = [[e[0]],... |
justinfinkle/pydiffexp | ipynb/plots_demo.ipynb | gpl-3.0 | # Imports
import pandas as pd
from pydiffexp import DEAnalysis, volcano_plot, tsplot
import matplotlib.pyplot as plt
%matplotlib inline
# Load the data
test_path = "/Users/jfinkle/Documents/Northwestern/MoDyLS/Python/sprouty/data/raw_data/all_data_formatted.csv"
raw_data = pd.read_csv(test_path, index_col=0)
"""
Expl... |
Caranarq/01_Dmine | Datasets/CLEU/CLEU.ipynb | gpl-3.0 | descripciones = {
'P0702' : 'Restricción al paso de automóviles',
'P0703' : 'Restricción al paso a peatones',
'P0704' : 'Vialidades con recubrimiento de la calle',
'P0705' : 'Vialidades con banqueta',
'P0706' : 'Vialidades con guarnición',
'P0713' : 'vialidades con rampa para silla de ruedas',
}
# Librerias utilizadas... |
ageron/ml-notebooks | extra_autodiff.ipynb | apache-2.0 | # To support both python 2 and python 3
from __future__ import absolute_import, division, print_function, unicode_literals
"""
Explanation: Appendix D – Autodiff
This notebook contains toy implementations of various autodiff techniques, to explain how they works.
<table align="left">
<td>
<a target="_blank" href... |
amcdawes/QMlabs | Lab 4 - Measurements.ipynb | mit | import matplotlib.pyplot as plt
from numpy import sqrt,pi,cos,sin,arange,random
from qutip import *
H = Qobj([[1],[0]])
V = Qobj([[0],[1]])
P45 = Qobj([[1/sqrt(2)],[1/sqrt(2)]])
M45 = Qobj([[1/sqrt(2)],[-1/sqrt(2)]])
R = Qobj([[1/sqrt(2)],[-1j/sqrt(2)]])
L = Qobj([[1/sqrt(2)],[1j/sqrt(2)]])
def sim_transform(o_basis1... |
tomfaulkenberry/courses | summer2019/mathpsychREU/lecture3.ipynb | mit | import matplotlib.pyplot as plt
import numpy as np
from scipy.optimize import minimize
# assign data to arrays
T = np.array([1, 3, 6, 9, 12, 18])
Y = np.array([0.94, 0.77, 0.40, 0.26, 0.24, 0.16])
X = 100*Y
# plot raw data
plt.plot(T, Y, 'o')
plt.xlabel('Retention interval (sec.)')
plt.ylabel('Proportion recalled')
... |
MSRDL/TSA | sls_demo.ipynb | bsd-3-clause | %pylab inline
rcParams['figure.figsize'] = [16, 3]
import pandas as pd
from AnomalyDetection import detect_anomalies
"""
Explanation: Time-series Anomaly Detection
This demo shows how to use a novel SLS (Streaming Least Squares) anomaly detection algorithm and how it performs
End of explanation
"""
df = pd.read_csv... |
sadahanu/Capstone | NLP/review_breed_analysis.ipynb | mit | # 52 base classes:
# source 2: classified dog names
breed_classes = pd.read_csv("s3://dogfaces/tensor_model/output_labels_20170907.txt",names=['breed'])
base_breeds = breed_classes['breed'].values
base_breeds
with open('breed_lookup.pickle', 'rb') as handle:
rev_to_breed = pickle.load(handle)
len(rev_to_breed)
w... |
atulsingh0/MachineLearning | HandsOnML/code/04_training_linear_models.ipynb | gpl-3.0 | # To support both python 2 and python 3
from __future__ import division, print_function, unicode_literals
# Common imports
import numpy as np
import os
# to make this notebook's output stable across runs
np.random.seed(42)
# To plot pretty figures
%matplotlib inline
import matplotlib
import matplotlib.pyplot as plt
... |
edinburghlivinglab/dds-notebooks | mudr_notebooks/TwitterSentiment.ipynb | cc0-1.0 | 3 + 4
"""
Explanation: Sentiment Analysis for Twitter
Overview
This tutorial is going to introduce some simple tools for detecting sentiment in Tweets. We will be using a set of tools called the Natural Language Toolkit (NLTK). This is collection of software written in the Python programming language. An important des... |
mcflugen/bmi-tutorial | notebooks/waves_example.ipynb | mit | %matplotlib inline
"""
Explanation: <img src="images/csdms_logo.jpg">
Using a BMI: Waves
This example explores how to use a BMI implementation using the Waves model as an example.
Links
Waves source code: Look at the files that have waves in their name.
Waves description on CSDMS: Detailed information on the Waves mo... |
kgrodzicki/machine-learning-specialization | course-2-regression/notebooks/week-1-simple-regression-assignment.ipynb | mit | import graphlab
"""
Explanation: Regression Week 1: Simple Linear Regression
In this notebook we will use data on house sales in King County to predict house prices using simple (one input) linear regression. You will:
* Use graphlab SArray and SFrame functions to compute important summary statistics
* Write a functio... |
ES-DOC/esdoc-jupyterhub | notebooks/mri/cmip6/models/sandbox-2/toplevel.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'mri', 'sandbox-2', 'toplevel')
"""
Explanation: ES-DOC CMIP6 Model Properties - Toplevel
MIP Era: CMIP6
Institute: MRI
Source ID: SANDBOX-2
Sub-Topics: Radiative Forcings.
Properties: 85 (42 re... |
wcmckee/wcmckee.com | posts/curschopanda.ipynb | mit | crcom = pd.read_csv('/home/wcmckee/Downloads/List of CC schools - Sheet1.csv', skiprows=5, index_col=0, usecols=[0,1,2])
"""
Explanation: <h3>Current School Panda</h3>
Working with directory school data
Creative Commons in all schools
This script uses a csv file from Creative Commons New Zealand and csv file from Min... |
tpin3694/tpin3694.github.io | machine-learning/hyperparameter_tuning_using_random_search.ipynb | mit | # Load libraries
from scipy.stats import uniform
from sklearn import linear_model, datasets
from sklearn.model_selection import RandomizedSearchCV
"""
Explanation: Title: Hyperparameter Tuning Using Random Search
Slug: hyperparameter_tuning_using_random_search
Summary: How to conduct random search for hyperparameter t... |
ES-DOC/esdoc-jupyterhub | notebooks/cams/cmip6/models/sandbox-2/ocean.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'cams', 'sandbox-2', 'ocean')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocean
MIP Era: CMIP6
Institute: CAMS
Source ID: SANDBOX-2
Topic: Ocean
Sub-Topics: Timestepping Framework, Advection... |
tpin3694/tpin3694.github.io | machine-learning/accuracy.ipynb | mit | # Load libraries
from sklearn.model_selection import cross_val_score
from sklearn.linear_model import LogisticRegression
from sklearn.datasets import make_classification
"""
Explanation: Title: Accuracy
Slug: accuracy
Summary: How to evaluate a Python machine learning using accuracy.
Date: 2017-09-15 12:00
Category:... |
ES-DOC/esdoc-jupyterhub | notebooks/nerc/cmip6/models/sandbox-2/aerosol.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'nerc', 'sandbox-2', 'aerosol')
"""
Explanation: ES-DOC CMIP6 Model Properties - Aerosol
MIP Era: CMIP6
Institute: NERC
Source ID: SANDBOX-2
Topic: Aerosol
Sub-Topics: Transport, Emissions, Conce... |
weiquan/NGSTraining | Alignment/FMindex/FM-index based alignment.ipynb | mit | from Bio import SeqIO, pairwise2
handle = open("../data/Reads.fa", "r")
records = list(SeqIO.parse(handle, "fasta"))
handle.close()
for record in records:
print record.id
print record.seq
"""
Explanation: 基于FM-index的序列比对算法
1. 什么是序列比对?
为确定两个或多个序列之间的相似性以至于同源性,而将它们按照一定的规律排列。
用个例子来看一下吧!
先看看数据是个啥。
读取Reads.fq文件,这是一个... |
statsmodels/statsmodels.github.io | v0.13.2/examples/notebooks/generated/stationarity_detrending_adf_kpss.ipynb | bsd-3-clause | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import statsmodels.api as sm
"""
Explanation: Stationarity and detrending (ADF/KPSS)
Stationarity means that the statistical properties of a time series i.e. mean, variance and covariance do not change over time. Many statistical... |
mne-tools/mne-tools.github.io | dev/_downloads/e1c3654f77f904db443b548e9d93b8f9/50_decoding.ipynb | bsd-3-clause | import numpy as np
import matplotlib.pyplot as plt
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import LogisticRegression
import mne
from mne.datasets import sample
from mne.decoding import (SlidingEstimator, GeneralizingEstimator, Scaler,
... |
bjshaw/phys202-2015-work | assignments/assignment05/MatplotlibEx03.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
"""
Explanation: Matplotlib Exercise 3
Imports
End of explanation
"""
import math as math
def well2d(x, y, nx, ny, L=1.0):
"""Compute the 2d quantum well wave function."""
wave_funct = (2/L)*np.sin((nx*math.pi*x)/L)*np.sin((ny*math.pi*y)/... |
CoreSecurity/pysap | docs/fileformats/SAPSSFS.ipynb | gpl-2.0 | from pysap.SAPSSFS import *
from pysap.utils.crypto import rsec_decrypt
from IPython.display import display
"""
Explanation: SAP SSFS
The following subsections show a representation of the file format portions and how to generate them.
First we need to perform some setup to import the packet classes:
End of explanatio... |
jjehl/poppy_education | poppy-torso/poppy-torso_find_motors.ipynb | gpl-2.0 | from poppy.creatures import PoppyTorso
"""
Explanation: Activité - Faire danser PoppyTorso
Première partie : en utilisant, le simulateur V-REP :
Compétences visées par cette activité :
Savoir utiliser des modules en y récupérant des classes. Instancier un objet à partir d'une classe. Utiliser une méthode et un attrib... |
Radiomics/pyradiomics | notebooks/RadiomicsExample.ipynb | bsd-3-clause | # Radiomics package
from radiomics import featureextractor
import six, numpy as np
"""
Explanation: PyRadiomics toolbox in Python
In this notebook, we will load 2 brain datasets with segmentations of brain tumors. The radiomics package will be used to extract a set of features, and the "signatures" will be compared.... |
qiu997018209/MachineLearning | 七月在线机器学习在bat工业中应用项目实战/泰坦尼克号项目/Kaggle_Titanic_Example.ipynb | apache-2.0 | # 这个ipython notebook主要是我解决Kaggle Titanic问题的思路和过程
import pandas as pd #数据分析
import numpy as np #科学计算
from pandas import Series,DataFrame
data_train = pd.read_csv("Train.csv")
data_train.columns
#data_train[data_train.Cabin.notnull()]['Survived'].value_counts()
"""
Explanation: 经典又兼具备趣味性的Kaggle案例泰坦尼克号问题
大家都熟悉的『Jack an... |
davenovelli/SDPAKaggle | python/Titanic_SDPA_meetUp-Copy1.ipynb | mit | import pandas as pd
"""
Explanation: <h1 align = center> Titanic - survival probability </h1>
<hr>
The following notebook is a compilation of the analysis steps described in DataCamp
First quest:
Using machine learning and identify the greatest set of factors (Age, Sex, demographic, status, cabin location, etc.) th... |
karlstroetmann/Artificial-Intelligence | Python/1 Search/Bidirectional-BFS.ipynb | gpl-2.0 | def search(start, goal, next_states):
FrontierA = { start }
ParentA = { start: start}
FrontierB = { goal }
ParentB = { goal: goal}
while FrontierA and FrontierB:
NewFrontier = set()
for s in FrontierA:
for ns in next_states(s):
if ns not in Pa... |
joonasfo/python | Assignment_04.ipynb | mit | # Import required libraries
%matplotlib notebook
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.pyplot import *
from numpy import *
"""
Explanation: Introduction to Numerical Problem Solving TX00BY09-3007
Assignment: 04 Graphical analysis<br />
Description: From the exercises 04, solve the proble... |
aattaran/Machine-Learning-with-Python | finding_donors/untitl.ipynb | bsd-3-clause | # Import libraries necessary for this project
import numpy as np
import pandas as pd
from time import time
from IPython.display import display # Allows the use of display() for DataFrames
# Import supplementary visualization code visuals.py
import visuals as vs
# Pretty display for notebooks
%matplotlib inline
# Loa... |
cfcdavidchan/Deep-Learning-Foundation-Nanodegree | seq2seq/sequence_to_sequence_implementation.ipynb | mit | import numpy as np
import time
import helper
source_path = 'data/letters_source.txt'
target_path = 'data/letters_target.txt'
source_sentences = helper.load_data(source_path)
target_sentences = helper.load_data(target_path)
"""
Explanation: Character Sequence to Sequence
In this notebook, we'll build a model that ta... |
tensorflow/docs-l10n | site/ja/hub/tutorials/tf_hub_generative_image_module.ipynb | apache-2.0 | # Copyright 2018 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... |
statsmodels/statsmodels.github.io | v0.12.2/examples/notebooks/generated/exponential_smoothing.ipynb | bsd-3-clause | import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from statsmodels.tsa.api import ExponentialSmoothing, SimpleExpSmoothing, Holt
%matplotlib inline
data = [446.6565, 454.4733, 455.663 , 423.6322, 456.2713, 440.5881, 425.3325, 485.1494, 506.0482, 526.792 , 514.2689, 494.211 ]
in... |
szitenberg/ReproPhyloVagrant | notebooks/Tutorials/Basic/3.8 Building a supermatrix.ipynb | mit | from reprophylo import *
pj = unpickle_pj('outputs/my_project.pkpj', git=False)
"""
Explanation: This section shows how to build a supermatrix by providing minimal requirements for gene content per taxon (OTU). This approach is more suited for small scale analysis, because it relies on manual decisions, whereas large ... |
RealPolitiX/mpes | examples/Tutorial_05_Axes Calibration.ipynb | mit | # axes = ['t']
# bins = [800]
# ranges = [(65000, 90000)]
# barr = []
# for i in range(101, 105):
# fdir = r'../data/data_20180605_'+str(i)+'.h5'
# hp = fp.hdf5Processor(fdir)
# resdict = hp.localBinning(axes=axes, nbins=bins, ranges=ranges, jittered=True)
# barr.append(resdict['binned'])
# edcs = np.... |
tensorflow/docs-l10n | site/en-snapshot/datasets/overview.ipynb | apache-2.0 | !pip install -q tfds-nightly tensorflow matplotlib
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
import tensorflow_datasets as tfds
"""
Explanation: TensorFlow Datasets
TFDS provides a collection of ready-to-use datasets for use with TensorFlow, Jax, and other Machine Learning frameworks... |
quantumlib/Cirq | cirq-core/cirq/contrib/quimb/Contract-a-Grid-Circuit.ipynb | apache-2.0 | import numpy as np
import networkx as nx
import cirq
import quimb
import quimb.tensor as qtn
from cirq.contrib.svg import SVGCircuit
import cirq.contrib.quimb as ccq
%matplotlib inline
from matplotlib import pyplot as plt
import seaborn as sns
sns.set_style('ticks')
plt.rc('axes', labelsize=16, titlesize=16)
plt.r... |
nicoguaro/AdvancedMath | notebooks/sympy/sympy_in_10_minutes.ipynb | mit | %matplotlib notebook
import numpy as np
import matplotlib.pyplot as plt
from sympy import *
init_session()
plt.style.use("seaborn-notebook")
"""
Explanation: Tutorial - SymPy in 10 minutes
Introduction
In this tutorial we will learn the basics of Jupyter and SymPy. SymPy is a Python library for symbolic computation. ... |
ES-DOC/esdoc-jupyterhub | notebooks/cmcc/cmip6/models/cmcc-cm2-hr5/atmos.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'cmcc', 'cmcc-cm2-hr5', 'atmos')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmos
MIP Era: CMIP6
Institute: CMCC
Source ID: CMCC-CM2-HR5
Topic: Atmos
Sub-Topics: Dynamical Core, Radiation, ... |
probml/pyprobml | notebooks/book2/22/two_moons_normalizingFlow.ipynb | mit | !pip install -qq -U dm-haiku distrax optax
import matplotlib.pyplot as plt
from IPython.display import clear_output
from sklearn import datasets, preprocessing
try:
import distrax
except ModuleNotFoundError:
%pip install -qq distrax
import distrax
import jax
import jax.numpy as jnp
import numpy as np
try... |
claudiuskerth/PhDthesis | Data_analysis/SNP-indel-calling/BAM_dedup/coverage_filter.ipynb | mit | % ll
! zcat ParEry.noSEgt2.noDUST.noTGCAGG.depth.gz | wc -l
"""
Explanation: Table of Contents
<p><div class="lev2 toc-item"><a data-toc-modified-id="check-output-01" href="#check-output"><span class="toc-item-num">0.1 </span>check output</a></div><div class="lev2 toc-item"><a data-toc-modified-id="Code-op... |
gautam1858/tensorflow | tensorflow/lite/g3doc/tutorials/model_maker_question_answer.ipynb | apache-2.0 | #@title Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under... |
ES-DOC/esdoc-jupyterhub | notebooks/awi/cmip6/models/sandbox-3/ocnbgchem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'awi', 'sandbox-3', 'ocnbgchem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem
MIP Era: CMIP6
Institute: AWI
Source ID: SANDBOX-3
Topic: Ocnbgchem
Sub-Topics: Tracers.
Properties: 6... |
statsmodels/statsmodels.github.io | v0.13.2/examples/notebooks/generated/interactions_anova.ipynb | bsd-3-clause | %matplotlib inline
from urllib.request import urlopen
import numpy as np
np.set_printoptions(precision=4, suppress=True)
import pandas as pd
pd.set_option("display.width", 100)
import matplotlib.pyplot as plt
from statsmodels.formula.api import ols
from statsmodels.graphics.api import interaction_plot, abline_plot
... |
jcchoiling/learningPython | coursera/python-intro/wk2/assignment2.ipynb | gpl-3.0 | import pandas as pd
df = pd.read_csv('olympics.csv', index_col=0, skiprows=1)
for col in df.columns:
if col[:2]=='01':
df.rename(columns={col:'Gold'+col[4:]}, inplace=True)
if col[:2]=='02':
df.rename(columns={col:'Silver'+col[4:]}, inplace=True)
if col[:2]=='03':
df.rename(columns... |
ilanman/gdi | week3/03_Week3_II_numpy.ipynb | mit | def double_me(x):
return 2*x
x = range(10)
map(double_me, range(10))
map(sum, [map(double_me, filter(lambda x: x%2 == 1, range(10)))]) # what does this do?
A = [[1,2,3,4],[4,3,2,1]]
B = [[-1,2,4],[8,5,5],[9,-4,2],[0,0,4]]
# matrix multiplication in 1 line
## SOLUTION
def dot_product(A, B):
rows = l... |
napsternxg/ipython-notebooks | Programming assignments.ipynb | apache-2.0 | graph = {'A': set(['B', 'C']),
'B': set(['A', 'D', 'E']),
'C': set(['A', 'F']),
'D': set(['B']),
'E': set(['B', 'F']),
'F': set(['C', 'E'])}
def dfs(graph, start):
visited, stack = (set(), [start])
while stack:
curr = stack.pop()
print "Outside: ", c... |
KKTT/time-series-python-exp | edge-detection/streaming_edge_detection.ipynb | gpl-3.0 | # To support both python 2 and python 3
from __future__ import division, print_function, unicode_literals
import json
from pandas import Series
from pandas import Timedelta
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import scipy
from scipy import signal
from scipy import stats
%matplotlib ... |
zhuwei05/ml-basic | matplotlib_user_guide.ipynb | mit | # 导入 matplotlib 的所有内容(nympy 可以用 np 这个名字来使用)
from pylab import *
# 创建一个 8 * 6 点(point)的图,并设置分辨率为 80
figure(figsize=(8,6), dpi=80)
# 创建一个新的 1 * 1 的子图,接下来的图样绘制在其中的第 1 块(也是唯一的一块)
subplot(1,1,1)
X = np.linspace(-np.pi, np.pi, 256,endpoint=True)
C,S = np.cos(X), np.sin(X)
# 绘制余弦曲线,使用蓝色的、连续的、宽度为 1 (像素)的线条
plot(X, C, color... |
DTOcean/dtocean-core | notebooks/DTOcean Wave Hydrodynamics + Environmental Example.ipynb | gpl-3.0 | %matplotlib inline
from IPython.display import display, HTML
import matplotlib.pyplot as plt
plt.rcParams['figure.figsize'] = (14.0, 8.0)
import numpy as np
from dtocean_core import start_logging
from dtocean_core.core import Core
from dtocean_core.menu import ModuleMenu, ProjectMenu, ThemeMenu
from dtocean_core.pi... |
sandeepkrjha/pgmpy | examples/Learning from data.ipynb | mit | # Generate data
import numpy as np
import pandas as pd
raw_data = np.array([0] * 30 + [1] * 70) # Representing heads by 0 and tails by 1
data = pd.DataFrame(raw_data, columns=['coin'])
print(data)
# Defining the Bayesian Model
from pgmpy.models import BayesianModel
from pgmpy.estimators import MaximumLikelihoodEstima... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.