repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
TorbjornT/pyAccuRT | examples/Plot_radiance_and_IOPS.ipynb | mit | d.plot_rad_contour(wl=341,z=1e5)
"""
Explanation: Plot radiance
At the moment only a rather simple polar contour plot is available.
End of explanation
"""
d.plot_rad_contour(wl_index=5,z_index=1)
"""
Explanation: If the wavelength is specified with the wl keyword, as above, the closest wavelength is chosen. Similar... |
statsmodels/statsmodels.github.io | v0.12.2/examples/notebooks/generated/statespace_arma_0.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
from scipy import stats
import pandas as pd
import matplotlib.pyplot as plt
import statsmodels.api as sm
from statsmodels.graphics.api import qqplot
"""
Explanation: Autoregressive Moving Average (ARMA): Sunspots data
This notebook replicates the existing ARMA notebook using th... |
Bio204-class/bio204-notebooks | inclass-2016-03-02-t-distribution.ipynb | cc0-1.0 | # standard imports
%matplotlib inline
import numpy as np
import scipy.stats as stats
import matplotlib.pyplot as plt
import matplotlib
matplotlib.style.use('bmh')
"""
Explanation: The t-distribution
Author: Paul M. Magwene
Date: 03 Mar 2016
In our last lecture on hypothesis testing, we introduced the idea of compa... |
mldbai/mldb | container_files/demos/Benchmarking MLDB.ipynb | apache-2.0 | from pymldb import Connection
mldb = Connection("http://localhost/")
"""
Explanation: Benchmarking MLDB
This notebook contains the code to run "The Absolute Minimum Benchmark" for a machine learning tool.
First we load the Python MLDB helper library
End of explanation
"""
mldb.put('/v1/procedures/import_bench_train_... |
mne-tools/mne-tools.github.io | 0.12/_downloads/plot_compute_mne_inverse_epochs_in_label.ipynb | bsd-3-clause | # Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: BSD (3-clause)
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne.datasets import sample
from mne.minimum_norm import apply_inverse_epochs, read_inverse_operator
from mne.minimum_norm import apply_inverse
print(__... |
Migal/opt_ctrl_lab_1 | lab_1/tests/lab_1_test.ipynb | bsd-3-clause | # Плотность источников тепла
def func(s, t):
#return 0.
return s + t * 4.
# Температура внешней среды
def p(t):
return math.cos(2 * t * math.pi)
#return t
def array(f, numval, numdh):
"""Создать N-мерный массив.
param: f - функция, которая приминает N аргументов.
param: numval... |
ultiyuan/test0 | lessons/.ipynb_checkpoints/SeparationPrediction-checkpoint.ipynb | gpl-2.0 | import numpy
from matplotlib import pyplot
%matplotlib inline
from VortexPanel import Panel,solve_gamma_kutta,plot_flow,make_jukowski,make_circle
alpha = numpy.pi/16
N = 64
foil = make_jukowski(N)
solve_gamma_kutta(foil,alpha)
plot_flow(foil,alpha)
"""
Explanation: Separation prediction on general bodies
In this fina... |
computational-class/computational-communication-2016 | code/.ipynb_checkpoints/8.analyzing_tianya_thread_network-checkpoint.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
"""
Explanation: 计算传播与统计初步
分析天涯论坛的帖子
王成军
wangchengjun@nju.edu.cn
计算传播网 http://computational-communication.com
End of explanation
"""
import pandas as pd
"""
Explanation:
End of explanation
"""
df = pd.read_csv('/Users/chengjun/github/cjc2016/data/tianya_bb... |
eigendreams/TensorFlow-Tutorials | 02_Convolutional_Neural_Network.ipynb | mit | from IPython.display import Image
Image('images/02_network_flowchart.png')
"""
Explanation: TensorFlow Tutorial #02
Convolutional Neural Network
by Magnus Erik Hvass Pedersen
/ GitHub / Videos on YouTube
Introduction
The previous tutorial showed that a simple linear model had about 91% classification accuracy for reco... |
padipadou/CADL | session-5/session-5-part-2.ipynb | apache-2.0 | # First check the Python version
import sys
if sys.version_info < (3,4):
print('You are running an older version of Python!\n\n',
'You should consider updating to Python 3.4.0 or',
'higher as the libraries built for this course',
'have only been tested in Python 3.4 and higher.\n')
... |
nsrchemie/code_guild | wk2/extras/arrays_strings/rotation/rotation_challenge.ipynb | mit | def is_substring(s1, s2):
# TODO: Implement me
pass
def is_rotation(s1, s2):
# TODO: Implement me
# Call is_substring only once
pass
"""
Explanation: <small><i>This notebook was prepared by Donne Martin. Source and license info is on GitHub.</i></small>
Challenge Notebook
Problem: Determine if a ... |
daniestevez/jupyter_notebooks | Lucy/Lucy frames EB3FRN.ipynb | gpl-3.0 | def timestamps(packets):
epoch = np.datetime64('2000-01-01T12:00:00')
t = np.array([struct.unpack('>I', p[ccsds.SpacePacketPrimaryHeader.sizeof():][:4])[0]
for p in packets], 'uint32')
return epoch + t * np.timedelta64(1, 's')
def load_frames(path):
frame_size = 223 * 5 - 2
frames... |
DfAC/MiningMassiveDatasets | week01.ipynb | gpl-2.0 | import math
import numpy as np
#returns converge r, require web matrix M
def PowerIteration (M,allowedIterations=300):
iterationIdx = 0
#init r as (n,1) matrix
numPages= M.shape[0]
r = np.asmatrix(np.ones(numPages)/float(numPages)).T #[1/N...]
#iterate until converge
iterationDiff = 1
while iter... |
ssamot/ce888 | labs/lab3/facebook_regression.ipynb | gpl-3.0 | df = pd.read_csv("./dataset_Facebook.csv", delimiter = ";")
features = ["Category",
"Page total likes",
"Type",
"Post Month",
"Post Hour",
"Post Weekday",
"Paid"]
df[features].head()
outcomes= ["Lifetime Post Total Reach",
"Lifeti... |
asazo/CC2 | 3_IVP/linearstabilityanalysis.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Tópicos en Análisis de Estabilidad Lineal
End of explanation
"""
# Plot of many regions!
l1, l2 = -3.5, 3.5
resolution = 0.01
[X, Y] = np.meshgrid(np.arange(-l2,l2,resolution), np.arange(-l2,l2,resolution))
Z = X + 1j*Y
def plot_... |
hethapu/big-data-python-class | Lectures/Lecture 11 - Machine Learning/Lecture 11 - Machine learning - Intro Tutorial.ipynb | mit | from sklearn import datasets
#install test sets that come wiht sklearn
iris = datasets.load_iris()
digits = datasets.load_digits()
print(digits.data)
digits.target
digits.images[0]
#Predict which digit is being represented by an image
from sklearn import svm
clf = svm.SVC(gamma=0.001, C=100.)
#gamma was set manuall... |
MachineLearner10/Kaggle-Right-Whale-Recognition-Challenge | code/1. Visualization and Data Selection.ipynb | mit | %matplotlib inline
#the above call us to display the seaborn plots within the IPython notebook
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
data = pd.read_csv("/Users/.../Machine Learning Competitions/Kaggle/Right Whale Recognition Challenge/features/rgbHistogramsTrainSet8Bins.csv", sep ... |
vidaspd/prophet-example | fb-prophet-play.ipynb | mit | from fbprophet import Prophet
import pandas as pd
%matplotlib notebook
import matplotlib
"""
Explanation: Simple example of using Facebook's Prophet
We will use public road traffic data to train the model and forecast future road traffic.
Main intention is to show how simple Prophet usage is, forecast itself is very s... |
MTgeophysics/mtpy | examples/workshop/Workshop Exercises Analysis.ipynb | gpl-3.0 | from mtpy.core.mt import MT
import matplotlib.pyplot as plt
# Define the path to your edi file and save path
edi_file = r"C:/mtpywin/mtpy/examples/data/edi_files_2/Synth00.edi"
mt_obj = MT(edi_file)
# look at the skew values as a histogram
plt.hist(mt_obj.pt.beta,bins=50)
plt.xlabel('Skew angle (degree)')
plt.ylabel... |
turbomanage/training-data-analyst | courses/machine_learning/deepdive/09_sequence/sinewaves.ipynb | apache-2.0 | # You must update BUCKET, PROJECT, and REGION to proceed with the lab
BUCKET = 'cloud-training-demos-ml'
PROJECT = 'cloud-training-demos'
REGION = 'us-central1'
SEQ_LEN = 50
import os
os.environ['BUCKET'] = BUCKET
os.environ['PROJECT'] = PROJECT
os.environ['REGION'] = REGION
os.environ['SEQ_LEN'] = str(SEQ_LEN)
os.env... |
ijpulidos/solar-physics-ex | rotation/Acquiring_Data.ipynb | mit | # defining datetime range and number of samples
dates = [] # where the dates pairs are going to be stored
date_start = datetime(2012,7,1,0,0,0)
date_end = datetime(2012,7,3,23,59,59)
date_samples = 35 # Number of samples to take between dates
date_delta = (date_end - date_start)/date_samples # How frequent to take ... |
brian-rose/ClimateModeling_courseware | Lectures/Lecture13 -- TransientWarming.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import xarray as xr
import climlab
# Get the water vapor data
#datapath = "http://ramadda.atmos.albany.edu:8080/repository/opendap/latest/Top/Users/BrianRose/CESM_runs/"
datapath = "http://thredds.atmos.albany.edu:8080/thredds/dodsC/cesm/"
#endstr ... |
infilect/ml-course1 | week3/seq2seq/language-translation-notebook/dlnd_language_translation_partial_solution.ipynb | mit | """
DON'T MODIFY ANYTHING IN THIS CELL
"""
import helper
import problem_unittests as tests
source_path = 'data/small_vocab_en'
target_path = 'data/small_vocab_fr'
source_text = helper.load_data(source_path)
target_text = helper.load_data(target_path)
"""
Explanation: Language Translation
In this project, you’re going... |
datactive/bigbang | examples/organizations/Full Archive Study.ipynb | mit | number = r"^[0-9]"
arxs = {}
for file in os.listdir(CONFIG.mail_path):
if file.endswith(".csv") and not re.match(number, file):
name = file[:-4]
try:
arxs[name] = Archive(name)
except Exception as e:
print(name + ": " + str(e))
print("Total number of Archives: " + ... |
jiarong/SSUsearch | notebooks-pc-linux/ssu-search-Copy3.ipynb | bsd-3-clause | cd ~/Desktop/SSUsearch/
mkdir -p ./workdir
#check seqfile files to process in data directory (make sure you still remember the data directory)
!ls ./data/test/data
"""
Explanation: Set up working directory
End of explanation
"""
Seqfile='./data/test/data/2c.fa'
"""
Explanation: README
This part of pipeline search... |
mwickert/scikit-dsp-comm | docs/source/nb_examples/Convolutional_Codes.ipynb | bsd-2-clause | cc1 = fec.FECConv(('111','101'),10)
"""
Explanation: Convolutional Coding
Rate 1/2
A convolutional encoder object can be created with the fec.FECConv method. The rate of the object will be determined by the number of generator polynomials used. Right now, only rate 1/2 and rate 1/3 are supported, so 2 or three generat... |
SHDShim/pytheos | examples/2_eos_conversion_from_bm3_to_vinet.ipynb | apache-2.0 | import numpy as np
import matplotlib.pyplot as plt
import pytheos as eos
import uncertainties as uct
from uncertainties import unumpy as unp
"""
Explanation: 0. General note
Even for the same data, Birch-Murnaghan equation and Vinet equation yield different $K_0$ and $K_0'$ values.
This notebook shows how to conv... |
quantopian/research_public | notebooks/tutorials/2_pipeline_lesson11/notebook.ipynb | apache-2.0 | from quantopian.pipeline.data import Fundamentals
from quantopian.pipeline.filters.fundamentals import IsPrimaryShare
"""
Explanation: Putting It All Together
Now that we've covered the basic components of the Pipeline API, let's construct a pipeline that we might want to use in an algorithm.
To start, let's first cre... |
samgoodgame/sf_crime | iterations/misc/Cha_Goodgame_Kao_Moore_W207_Final_Project_updated_08_18_1636.ipynb | mit | # Import relevant libraries:
import time
import numpy as np
import pandas as pd
from sklearn.neighbors import KNeighborsClassifier
from sklearn import preprocessing
from sklearn.preprocessing import MinMaxScaler
from sklearn.preprocessing import StandardScaler
from sklearn.naive_bayes import BernoulliNB
from sklearn.na... |
fweik/espresso | doc/tutorials/ferrofluid/ferrofluid_part2.ipynb | gpl-3.0 | import espressomd
espressomd.assert_features('DIPOLES', 'LENNARD_JONES')
from espressomd.magnetostatics import DipolarP3M
from espressomd.magnetostatic_extensions import DLC
import numpy as np
"""
Explanation: Ferrofluid - Part 2
Table of Contents
Applying an external magnetic field
Magnetization curve
Remark: The... |
getsmarter/bda | module_3/M3_NB1_BSSID.ipynb | mit | from os import path
import pandas as pd
import matplotlib
import matplotlib.pylab as plt
%matplotlib inline
matplotlib.rcParams['figure.figsize'] = (10, 8)
"""
Explanation: <div align="right">Python 3.6 Jupyter Notebook</div>
Data exploration: Test your intuition about BSSIDs
<div class="alert alert-warning">
**This... |
bjackman/trappy | doc/Plotter.ipynb | apache-2.0 | l = trappy.LinePlot(trace1, signals=["thermal:temp"])
l.view()
"""
Explanation: Usage of Signals
A signal is a string which represents a combination of a TRAPpy event and a column. The format of the signal is, "event_name:column". e.g, thermal:temp.
The Plotter API can accept either a list of signals as an input or ... |
pbutenee/ml-tutorial | release/1/notebook_intro.ipynb | mit | print('Hello world!')
print(list(range(5)))
"""
Explanation: Jupyter Notebook and NumPy introduction
Jupyter notebook is often used by data scientists who work in Python. It is loosely based on Mathematica and combines code, text and visual output in one page.
Basic Jupyter Notebook commands
Some relevant short cuts:
... |
nick-youngblut/SIPSim | ipynb/bac_genome/priming_exp/priming_exp_info.ipynb | mit | baseDir = '/home/nick/notebook/SIPSim/dev/priming_exp/'
workDir = os.path.join(baseDir, 'exp_info')
otuTableFile = '/var/seq_data/priming_exp/data/otu_table.txt'
otuTableSumFile = '/var/seq_data/priming_exp/data/otu_table_summary.txt'
metaDataFile = '/var/seq_data/priming_exp/data/allsample_metadata_nomock.txt'
#otu... |
ES-DOC/esdoc-jupyterhub | notebooks/cmcc/cmip6/models/sandbox-2/landice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'cmcc', 'sandbox-2', 'landice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Landice
MIP Era: CMIP6
Institute: CMCC
Source ID: SANDBOX-2
Topic: Landice
Sub-Topics: Glaciers, Ice.
Properties:... |
pycomlink/pycomlink | notebooks/Wet antenna attenuation.ipynb | bsd-3-clause | R = np.arange(0, 100, 0.01)
fig, ax = plt.subplots()
for f in [10, 20, 27, 50, 70]:
waa = pycml.processing.wet_antenna.waa_leijnse_2008(f_Hz=f*1e9, R=R)
ax.plot(R, waa, label='%2.1f GHz' % f)
ax.legend()
ax.set_xlabel('R in mm/h')
ax.set_ylabel('WAA in dB')
plt.show()
"""
Explanation: Rain rate dependent WAA... |
sdpython/ensae_teaching_cs | _doc/notebooks/td1a_algo/td1a_plus_grande_somme_correction.ipynb | mit | from jyquickhelper import add_notebook_menu
add_notebook_menu()
"""
Explanation: 1A.algo - la plus grande sous-séquence croissante - correction
Un exercice classique : trouver la plus grande sous-séquence croissante. Celle-ci n'est pas nécessairement un bloc contigü de la liste initiale mais les entiers apparaissent d... |
NuGrid/NuPyCEE | regression_tests/temp/SYGMA_SSP_CNO_yield_input.ipynb | bsd-3-clause | #from imp import *
#s=load_source('sygma','/home/nugrid/nugrid/SYGMA/SYGMA_online/SYGMA_dev/sygma.py')
%pylab nbagg
import sygma as s
reload(s)
s.__file__
from scipy.integrate import quad
from scipy.interpolate import UnivariateSpline
#import matplotlib.pyplot as plt
#%matplotlib inline
import numpy as np
#import mpld3... |
ergosimulation/mpslib | scikit-mps/examples/mpslib_in_google_colab.ipynb | lgpl-3.0 | module_name='mpslib'
try:
__import__(module_name)
print('%s allready installed. skipping installation.' % module_name)
exe_folder = ''
except ImportError:
import sys
is_colab = 'google.colab' in sys.modules
print (is_colab)
if is_colab:
print('%s cannot be loaded. trying to ... |
QuantStack/quantstack-talks | 2018-06-18-IFPEN-Tech/notebooks/vaex.ipynb | bsd-3-clause | %%time
ds = vaex.open("/Users/maartenbreddels/datasets/nytaxi/nyc_taxi2015.hdf5")
!ls -lh /Users/maartenbreddels/datasets/nytaxi/nyc_taxi2015.hdf5
ds
ds.trip_distance
np.log10(ds.trip_distance)
"""
Explanation: Step 0: reading in data
vaex reads 'anything':
* ds = vaex.open('super_fast.hdf5')
* ds = vaex.open('ga... |
lithiumdenis/MLSchool | 6. Голодающие дети Африки 2 - Ансамблирование, стекинг, блэндинг.ipynb | mit | train_X, train_y = pd.read_csv( # путь к вашему файлу train.csv
'data/WaterTable/train.csv'
), pd.read_csv( # путь к вашему файлу trainLabels.csv
'data/WaterTable/trainLabels.csv'
)
df = pd.merge(train_X, train_y, how='left')
df_test = pd.read_csv( # путь к вашему файлу test.csv
'data/WaterTable/test.csv'
... |
VVard0g/ThreatHunter-Playbook | docs/notebooks/windows/06_credential_access/WIN-170105221010.ipynb | mit | from openhunt.mordorutils import *
spark = get_spark()
"""
Explanation: LSASS Access from Non System Account
Metadata
| Metadata | Value |
|:------------------|:---|
| collaborators | ['@Cyb3rWard0g'] |
| creation date | 2017/01/05 |
| modification date | 2020/08/05 |
| playbook related | ['WIN-190... |
joannekoong/neuroscience_tutorials | basic/1. Load EEG data and plot ERP.ipynb | bsd-2-clause | %pylab inline
"""
Explanation: Loading EEG data and plotting an ERP
Welcome to this IPython notebook. This page is a live interface to a running Python instance, where we create 'cells'. A cell is either some text (which can include images and formulas) or code, in which case we can execute that code by pressing shift... |
RaspberryJamBe/ipython-notebooks | notebooks/nl-be/.ipynb_checkpoints/101 - Intro - Python leren kennen en IPython gebruiken-checkpoint.ipynb | cc0-1.0 | 5+11
"""
Explanation: Hm, zullen we maar beginnen?
Deze applicatie heet IPython en je kan er Python code mee uitvoeren (Python is een soort programmeertaal; een manier om aan een computer uit te leggen wat die computer voor jou moet doen).
Selecteer de cel met de som hieronder (er komt dan een groene kader omheen staa... |
Kaggle/learntools | notebooks/data_viz_to_coder/raw/ex6.ipynb | apache-2.0 | import pandas as pd
pd.plotting.register_matplotlib_converters()
import matplotlib.pyplot as plt
%matplotlib inline
import seaborn as sns
print("Setup Complete")
"""
Explanation: In this exercise, you'll explore different chart styles, to see which color combinations and fonts you like best!
Setup
Run the next cell to... |
survey-methods/samplics | docs/source/tutorial/ssu_selection.ipynb | mit | %%capture
%run psu_selection.ipynb
"""
Explanation: Selection of secondary sampling units (SSUs) <a name="section2"></a>
To select the second stage sample, we need the second stage frame which is the list of all the households in the 10 selected clusters (psus). DHS, PHIA, MICS and other large scale surveys visit the ... |
msadegh97/machine-learning-course | 08-text-mining.ipynb | gpl-3.0 | import pandas as pd
import numpy as np
import tweepy
from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
from tweepy import Stream
access_token = "8397390582---------------------------------"
access_token_secret = "dr5L3QHHkIls6Rbffz-------------------"
consumer_key = "U1eVHGzL-----------------... |
NeuroDataDesign/pan-synapse | pipeline_1/background/SLIC_Algorithms.md.ipynb | apache-2.0 | from skimage.segmentation import slic
from skimage.segmentation import mark_boundaries
from skimage.util import img_as_float
# load the image and convert it to a floating point data type
image = img_as_float(io.imread(args["image"]))
#creates an image for the overlaying superpixels
segments = slic(image, n_segments =... |
leyhline/vix-term-structure | classification.ipynb | mit | def get_categories(y):
y = y.dropna()
plus = (0.1 < y)
zero = (-0.1 <= y) & (y <= 0.1)
minus = (y < -0.1)
return plus, zero, minus
def get_count(plus, zero, minus):
return pd.concat(map(operator.methodcaller("sum"), [plus, zero, minus]), axis=1, keys=["plus", "zero", "minus"])
plus, zero, minu... |
mne-tools/mne-tools.github.io | 0.12/_downloads/plot_artifacts_detection.ipynb | bsd-3-clause | import mne
from mne.datasets import sample
from mne.preprocessing import create_ecg_epochs, create_eog_epochs
# getting some data ready
data_path = sample.data_path()
raw_fname = data_path + '/MEG/sample/sample_audvis_raw.fif'
raw = mne.io.read_raw_fif(raw_fname, preload=True)
"""
Explanation: .. _tut_artifacts_dete... |
hsaghir/hsaghir.github.io | _posts/_code/RBC-DeepLearning-Notebooks/01 - ScientificPython.ipynb | mit | print "hello world"
print "hello world", 1, 2, 1 + 2
a = 1
b = 1
print "hello world", a + b
a = 1
b = "hello"
print "hello world", a + b
b = "world"
print "hello %s" % b
"""
Explanation: Attribution: this notebook is based on slides created by Roland Memisevic. Some of the material related to classes was taken fro... |
iutzeler/Introduction-to-Python-for-Data-Sciences | 1_Basics.ipynb | mit | 2 + 2 + 1 # comment
a = 4
print(a)
print(type(a))
a,x = 4, 9000
print(a)
print(x)
"""
Explanation: <table>
<tr>
<td width=15%><img src="./img/UGA.png"></img></td>
<td><center><h1>Introduction to Python for Data Sciences</h1></center></td>
<td width=15%><a href="http://www.iutzeler.org" style="font-size: 16px; font-w... |
barjacks/foundations-homework | 05/.ipynb_checkpoints/Spotify_Homework_5_Skinner-checkpoint.ipynb | mit | response = requests.get('https://api.spotify.com/v1/search?query=Lil&type=artist&limit=50&market=US')
Lil_data = response.json()
Lil_data.keys()
Lil_data['artists'].keys()
"""
Explanation: These are the search queries for the Spotify Web API
End of explanation
"""
Lil_artists = Lil_data['artists']['items']
for art... |
c22n/ion-channel-ABC | docs/examples/human-atrial/nygren_ical_unified.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... |
dlegor/Tutorial-Pandas-Python | Code/Capítulo_4-Eficiancia_Terminal.ipynb | cc0-1.0 | %matplotlib inline
import matplotlib
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
matplotlib.style.use('ggplot')
plt.rcParams['figure.figsize']=(20,7)
import sys
reload(sys)
sys.setdefaultencoding('utf8')
Mujeres=pd.read_csv('/Datos/Mujeres_ingeniería_y_tecnología.csv'... |
AeroPython/Taller-PyConEs-2015 | Ejercicios/Laberinto/Laberinto.ipynb | mit | %matplotlib inline
import laberinto.algen as ag
import laberinto.laberinto as lab
import numpy as np
import matplotlib.pyplot as plt
mapa1 = lab.Map()
"""
Explanation: Resolviendo un Laberinto
El problema es muy sencillo: tenemos un laberinto, y deseamos que nuestro algoritmo genético encuentre la salida
Empecemos im... |
jpilgram/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... |
animesh-garg/dtw | simple example.ipynb | gpl-3.0 | %pylab inline
"""
Explanation: DTW simple example
End of explanation
"""
from dtw import dtw
"""
Explanation: The dtw module contains a single function named dtw as well.
End of explanation
"""
x = array([0, 0, 1, 1, 2, 4, 2, 1, 2, 0]).reshape(-1, 1)
y = array([1, 1, 1, 2, 2, 2, 2, 3, 2, 0]).reshape(-1, 1)
plot(... |
jpn--/larch | book/example/109-swissmetro-nl.ipynb | gpl-3.0 | # TEST
import larch
import os
import pandas as pd
pd.set_option("display.max_columns", 999)
pd.set_option('expand_frame_repr', False)
pd.set_option('display.precision', 3)
larch._doctest_mode_ = True
import larch.numba as lx
import pandas as pd
import larch.numba as lx
"""
Explanation: 109: Swissmetro Nested Logit Mo... |
sujitpal/polydlot | src/keras/05-char-lstm-gen.ipynb | apache-2.0 | from __future__ import division, print_function
from keras.callbacks import ModelCheckpoint
from keras.layers.core import Dense, Activation
from keras.layers.recurrent import LSTM
from keras.models import Sequential, load_model
from keras.optimizers import RMSprop
from urllib import urlopen
import numpy as np
import ma... |
hilljb/spark-jupyter | ipynb/Streaming Data.ipynb | gpl-3.0 | sc
sqlContext
"""
Explanation: Make Sure Contexts are Loaded
End of explanation
"""
import time
import simplejson as json
filename = '/home/anaconda/md0/data/2016_potus/stream/tweets.json'
langs = {}
start_time = time.time()
f_p = open(filename,'r')
for line in f_p:
tweet = json.loads(line)
if 'lang' in ... |
nelson-liu/lectures | 2016-2017.Meetings/fall/02.hello_machine2.ipynb | mit | from __future__ import print_function
%matplotlib inline
from sklearn.datasets import load_digits
from matplotlib import pyplot as plt
import numpy as np
np.random.seed(42) # for reproducibility
digits = load_digits()
X = digits.data
y = digits.target
"""
Explanation: Crash Course in Supervised Learning with scikit-... |
juneeseo/foundations-homework | 05/homework5.ipynb | mit | response = requests.get('https://api.spotify.com/v1/search?q=lil&type=artist&?country=US&limit=50')
data = response.json()
type(data)
data.keys()
data['artists'].keys()
artists = data['artists']['items']
for artist in artists:
print(artist['name'], artist['popularity'])
"""
Explanation: 1) With "Lil Wayne" a... |
rishuatgithub/MLPy | nlp/UPDATED_NLP_COURSE/01-NLP-Python-Basics/03-Lemmatization.ipynb | apache-2.0 | # Perform standard imports:
import spacy
nlp = spacy.load('en_core_web_sm')
doc1 = nlp(u"I am a runner running in a race because I love to run since I ran today")
for token in doc1:
print(token.text, '\t', token.pos_, '\t', token.lemma, '\t', token.lemma_)
"""
Explanation: <a href='http://www.pieriandata.com'> <... |
zhuanxuhit/deep-learning | batch-norm/my_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... |
ComputationalModeling/spring-2017-danielak | past-semesters/fall_2016/day-by-day/day11-random-walks-and-random-numbers/Random_Walks_SOLUTIONS.ipynb | agpl-3.0 | # put your code here.
import random
# feed it a random seed so we get the same numbers each time
random.seed(8675309)
# function step1d takes no arguments and returns +1 or -1
def step1d():
a = random.randint(0,1)
if a == 0:
return -1
else:
return 1
# loop several times to give me ... |
linsalrob/crAssphage | Metagenomes/IdentifyingStrains/strains_depth_statistics.ipynb | mit | #instantiate our environment
import os
import sys
%matplotlib inline
import pandas as pd
import statsmodels.api as sm
# read the data into a pandas dataframe
df = pd.read_csv("read_depth.strains.tsv", header=0, delimiter="\t")
print("Shape: {}".format(df.shape))
df.head()
"""
Explanation: Compare the read depth and n... |
ES-DOC/esdoc-jupyterhub | notebooks/cams/cmip6/models/sandbox-2/land.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'cams', 'sandbox-2', 'land')
"""
Explanation: ES-DOC CMIP6 Model Properties - Land
MIP Era: CMIP6
Institute: CAMS
Source ID: SANDBOX-2
Topic: Land
Sub-Topics: Soil, Snow, Vegetation, Energy Balan... |
OpenDSA/Analysis | Yusuf/Test_Clustering_Results.ipynb | mit | all_scores = pd.read_excel("Grades/Book1.xlsx")
all_scores["Is A"] = all_scores["Final Score"] >= 90
# https://courses.cs.vt.edu/~cs1604/grading.html
letter_grade = []
for grade in all_scores["Final Score"]:
if grade >= 90:
letter_grade.append("A")
elif grade >= 80:
letter_grade.append("B")
... |
jfosorio/plldesigner | notebooks/Sigma_delta_noise_in_fractional_PLLs.ipynb | mit | # Compatibility with python 3.0
from __future__ import division
# Array fast operation
import numpy as np
from numpy import (ones, pi, log10)
# Signal processing routines
import scipy.signal as sig
# Plotting
import matplotlib.pyplot as plt
import matplotlib as mpl
%matplotlib inline
mpl.rcParams['font.size'] = 12... |
phenology/infrastructure | applications/notebooks/examples/python/plot_kmeans_clusters_widget.ipynb | apache-2.0 | import sys
sys.path.append("/usr/lib/spark/python")
sys.path.append("/usr/lib/spark/python/lib/py4j-0.10.4-src.zip")
sys.path.append("/usr/lib/python3/dist-packages")
import os
os.environ["HADOOP_CONF_DIR"] = "/etc/hadoop/conf"
import os
os.environ["PYSPARK_PYTHON"] = "python3"
os.environ["PYSPARK_DRIVER_PYTHON"] = "... |
atulsingh0/MachineLearning | MasteringML_wSkLearn/04b_Logistic_Regression.ipynb | gpl-3.0 | # reading the data
df = pd.read_csv("data/fertility_Diagnosis.txt", delimiter=',', header=None)
df.iloc[:4,0:9]
X_train, X_test, y_train, y_test = train_test_split(df.iloc[:,0:9], df[9], test_size=0.1)
pipeline = Pipeline([('clf', LogisticRegression())])
parameters = {
'clf__penalty': ('l1', 'l2'),
'clf__C': (0... |
samuelsinayoko/kaggle-housing-prices | research/modern_pandas2.ipynb | mit | df.arr_time - df.crs_arr_time
import numpy as np
import pandas as pd
def read(fp):
df = (pd.read_csv(fp)
.rename(columns=str.lower)
.drop('unnamed: 36', axis=1)
.pipe(extract_city_name)
.pipe(time_to_datetime, ['dep_time', 'arr_time', 'crs_arr_time', 'crs_dep_time'... |
WikiWatershed/model-my-watershed | doc/MMW_API_GWLF-E_demo.ipynb | apache-2.0 | MMW_API_URL = 'https://modelmywatershed.org/api'
MMW_API_TOKEN = '<YOUR TOKEN HERE>'
"""
Explanation: Modeling with GWLF-E using the Model My Watershed API
This notebook demos modeling a shape with GWLF-E using the Model My Watershed (MMW) API. For this, you'll need an MMW account, which you can sign up for free of co... |
anthonyng2/Machine-Learning-For-Finance | Classification Based Machine Learning for Algorithmic Trading/Classification Based Machine Learning Algorithm.ipynb | mit | 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 with additional attrib... |
DS-100/sp17-materials | sp17/hw/hw5/hw5_solution.ipynb | gpl-3.0 | import numpy as np
import pandas as pd
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
from IPython.display import display, Latex, Markdown
!pip install -U okpy
from client.api.notebook import Notebook
ok = Notebook('hw5.ok')
"""
Explanation: Homework 5
End of explanation
"""
# Use this cel... |
jvbalen/cover_id | draft_notebooks/main_draft.ipynb | mit | # %run main.py
"""
Explanation: Test Main
End of explanation
"""
cliques_by_name, cliques_by_uri = SHS_data.read_cliques()
# ratio = (1, 10, 90)
ratio = (5, 15, 80)
# ratio = (10, 25, 65)
train_cliques, test_cliques, val_cliques = util.split_train_test_validation(cliques_by_name, ratio=ratio)
reload(main)
reload(f... |
GoogleCloudPlatform/training-data-analyst | quests/endtoendml/labs/serving/python_streaming.ipynb | apache-2.0 | TIME_FORMAT = '%Y-%m-%d %H:%M:%S'
DATASET = 'playground_ds'
TABLE = 'babyweight_estimates'
PROJECT = 'cloud-training-demos'
STG_BUCKET = 'cloud-training-demos-ml'
REGION = 'us-central1'
TOPIC = 'babyweights'
SUBSCRIPTION='babyweights-sub'
MODEL_NAME='babyweight_estimator'
VERSION='v1'
%%bash
pip install apache-bea... |
jlawman/jlawman.github.io | content/.ipynb_checkpoints/Kleinberg Impossibility Theorem for Clustering-checkpoint.ipynb | mit | import seaborn as sns
import matplotlib.pyplot as plt
%matplotlib inline
from sklearn.datasets import make_blobs
data, labels = make_blobs(n_samples=100, n_features=2, centers=2,cluster_std=4,random_state=2)
plt.scatter(data[:,0], data[:,1], c = labels, cmap='coolwarm');
import seaborn as sns
import matplotlib.py... |
mahmoodm2/appsensor | TFIDF.ipynb | mit | '''
Created on Feb 21, 2017
@author: mmoham12
'''
import csv
import collections as c
import math
import operator
import numpy as np
import pandas as pd
import collections as c
from scipy import spatial
"""
Explanation: To See the Results:
1-Scroll down to the end of the page in and select (by click) the cell after t... |
rainyear/pytips | Tips/2016-05-11-Floating-Point-Arithmetic.ipynb | mit | 0.1 == 0.10000000000000000000001
0.1+0.1+0.1 == 0.3
"""
Explanation: Python 浮点数运算
浮点数用来存储计算机中的小数,与现实世界中的十进制小数不同的是,浮点数通过二进制的形式来表示一个小数。在深入了解浮点数的实现之前,先来看几个 Python 浮点数计算有意思的例子:
End of explanation
"""
(0.1).as_integer_ratio()
"""
Explanation: IEEE 浮点数表示法
这些看起来违反常识的“错误”并非 Python 的错,而是由浮点数的规则所决定的,即使放到其它语言中结果也是这样的。要理解计算机中... |
eyurtsev/FlowCytometryTools | FlowCytometryTools/tests/notebooks/api_tests.ipynb | mit | import matplotlib
%load_ext autoreload
%autoreload 2
from FlowCytometryTools import FCPlate, FCMeasurement
"""
Explanation: Quick Introduction to FlowCytometryTools
<pre>
Author: Jonathan Friedman & Eugene Yurtsev
Last Updated Date: 2013-October-06
</pre>
<pre>
Please read the instructions on the webpage (https://bi... |
mne-tools/mne-tools.github.io | 0.20/_downloads/963786e591fc03946ca0f3b819f12772/plot_xdawn_denoising.ipynb | bsd-3-clause | # Authors: Alexandre Barachant <alexandre.barachant@gmail.com>
#
# License: BSD (3-clause)
from mne import (io, compute_raw_covariance, read_events, pick_types, Epochs)
from mne.datasets import sample
from mne.preprocessing import Xdawn
from mne.viz import plot_epochs_image
print(__doc__)
data_path = sample.data_pa... |
tpin3694/tpin3694.github.io | machine-learning/find_best_preprocessing_steps_during_model_selection.ipynb | mit | # Load libraries
import numpy as np
from sklearn import datasets
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import GridSearchCV
from sklearn.pipeline import Pipeline, FeatureUnion
from sklearn.decomposition import PCA
from sklearn.preprocessing import StandardScaler
# Set random s... |
FordyceLab/AcqPack | examples/.ipynb_checkpoints/Calibrate-checkpoint.ipynb | mit | import numpy as np
plate = np.array([0,0,0,1])
W = np.array([[0,1,0],
[1,0,0],
[0,0,1],
[0,0,0],
])
# Wi=np.linalg.inv(W)
hardware = np.matmul(plate,W)
hardware
np.matmul(y,Wi)
"""
Explanation: Reference coordinate system: hardware
Deck and plates should s... |
yidawang/brainiak | examples/funcalign/rsrm_synthetic_reconstruction.ipynb | apache-2.0 | %matplotlib inline
import scipy.io
from scipy.stats import stats
import numpy as np
import brainiak.funcalign.srm as srm
import brainiak.funcalign.rsrm as rsrm
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
"""
Explanation: This example replicates the synthetic experiment in the paper
"Capturi... |
fredhusser/winpython_afterdoc | examples/installing_julia_and_ijulia.ipynb | mit | import os
import sys
import io
# downloading julia (32Mo, may take 1 minute or 2)
try:
import urllib.request as urllib2 # Python 3
except:
import urllib2 # Python 2
if 'amd64' in sys.version.lower():
julia_binary="julia-0.3.7-win64.exe"
julia_url="http://s3.amazonaws.com/julialang/bin/winnt/x64/0.3/j... |
cougarTech2228/Scouting-2016 | robocop.ipynb | mit | def test():
print "testing to see if migrated repository works"
def dash():
print "-" * 20
# import libraries
import pandas as pd
import matplotlib.pyplot as plot
import matplotlib
matplotlib.style.use('ggplot')
import random as rng
import numpy as np
%matplotlib inline
# take a url of the csv or can read th... |
tensorflow/docs-l10n | site/ko/tutorials/estimator/boosted_trees.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... |
QuantumTechDevStudio/RUDNEVGAUSS | archive/fem/fem1d/FiniteElements2.ipynb | gpl-3.0 | import numpy
import matplotlib.pyplot as plt
from matplotlib import rc
from scipy import linalg
from scipy.integrate import simps
%matplotlib inline
def f(x):
return x * numpy.sin(3 * numpy.pi * x / 2) + (9/4) * (numpy.pi ** 2) * numpy.sin(3 * numpy.pi * x /2)
def expected_solution_calc(x):
return numpy.sin(3... |
km-Poonacha/python4phd | Session 3/ipython/.ipynb_checkpoints/Lesson 6 - Supervised learning-Copy1-checkpoint.ipynb | gpl-3.0 | import csv
sentiment_csv = ""
def feature_extractor(word):
last_l = word[-1]
first_l = word[0]
return { 'first_letter' : first_l, 'last_letter' : last_l}
def main():
i_word = input("Enter the word ").lower()
features = feature_extractor(i_word)
print(features)
main()
"""
Explanation: Le... |
dipanjank/ml | text_classification_and_clustering/step_1_data_prep.ipynb | gpl-3.0 | %%time
# flag to indicate whether we're inside a <text> tag as we iterate over the file line by line
in_text = False
# Set of tags to remove
text_to_remove = set(['<code>', '</code>', '<code/>', '<br>', '<br/>', '</br>'])
with open('EFWritingData.xml') as f_in, open('EFWritingData_new.xml', 'w') as f_out:
for li... |
GoogleCloudPlatform/vertex-ai-samples | notebooks/community/migration/UJ3 legacy Custom Training Custom Container TF Keras.ipynb | apache-2.0 | ! pip3 install google-cloud-storage
"""
Explanation: Vertex Custom Training Custom Container TF Keras
Installation
Install the Google cloud-storage library as well.
End of explanation
"""
import os
if not os.getenv("AUTORUN"):
# Automatically restart kernel after installs
import IPython
app = IPython.A... |
dashee87/blogScripts | Jupyter/2018-01-10-home-advantage-in-football-leagues-around-the-world.ipynb | mit | # importing the tools required for the Poisson regression model
import statsmodels.api as sm
import statsmodels.formula.api as smf
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import seaborn
def get_home_team_advantage(goals_df, pval=0.05):
# extract relevant columns
model_goals_... |
Serulab/Py4Bio | notebooks/Chapter 13 - Regular Expressions.ipynb | mit | !curl https://raw.githubusercontent.com/Serulab/Py4Bio/master/samples/samples.tar.bz2 -o samples.tar.bz2
!mkdir samples
!tar xvfj samples.tar.bz2 -C samples
import re
mo = re.search('hello', 'Hello world, hello Python!')
mo.group()
mo.span()
'Hello world, hello Python!'.index('hello')
import re
mo = re.search('[... |
fja05680/pinkfish | examples/A00.update-cache-symbols/update-cache-symbols.ipynb | mit | import pandas as pd
import pinkfish as pf
"""
Explanation: Update Cache Symbols
A useful utility for demonstating the use of the update/remove cache symbols functions. You can use this notebook to periodically update all of the timeseries in your symbol cache.
End of explanation
"""
pf.update_cache_symbols(symbols=... |
xMyrst/BigData | python/ejercicios/ucm_comprehensions_ej.ipynb | gpl-3.0 | pob = [2718768, 1299633, 973132, 908263, 663173, 610887, 372256, 364710, 322511, 298957]
d = { 1: 'Roma', 2: 'Milán', 3:'Nápoles', 4:'Turín', 5:'Palermo' ,6: 'Génova', 7:'Bolonia', 8:'Florencia', 9:'Bari', 10:'Catania'}
# Sol
# El primer elemento ha de ser 1: ['Roma', 2718768]
cpob = { i : [ ciudad, pob[ i - 1 ] ] for ... |
tiagoantao/biopython-notebook | notebooks/12 - Bio.PopGen - Population Genetics.ipynb | mit | from copy import deepcopy
from Bio.PopGen import GenePop
handle = open("data/example.gen")
master_rec = GenePop.read(handle)
handle.close()
"""
Explanation: Bio.PopGen: Population genetics
Bio.PopGen is a Biopython module supporting population genetics, available in Biopython 1.44 onwards.
The medium term objective f... |
urgedata/pythondata | fbprophet/fbprophet_changepoints.ipynb | mit | market_df = pd.read_csv('../examples/SP500.csv', index_col='DATE', parse_dates=True)
market_df.head()
"""
Explanation: Load data
Let's load our data to analyze. For this example, I'm going to use some stock market data to be able to show some clear trend changes. This data can be downloaded from FRED (https://fred.st... |
Danghor/Formal-Languages | Ply/Exam-Evaluation.ipynb | gpl-2.0 | data = '''Class: Algorithms and Complexity
Group: TIT09AID
MaxPoints = 60
Exercise: 1. 2. 3. 4. 5. 6.
Jim Smith: 9 12 10 6 6 0
John Slow: 4 4 2 0 - -
Susi Sorglos: 9 12 12 9 9 6
'''
"""
Explanation: Evaluating an Exam Using... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.