repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
ffmmjj/desafio-dados-2016 | experiments/Diplomas x Desempenho.ipynb | apache-2.0 | quest_professor_df = pd.read_csv('/Users/bonifacio/projects/desafio-dados-2016/dados/microdados_saeb_2011/Dados/TS_QUEST_PROFESSOR.csv', sep=';')
pedagogia = quest_professor_df['TX_RESP_Q004'] == 'D'
matematica = quest_professor_df['TX_RESP_Q004'] == 'E'
letras = quest_professor_df['TX_RESP_Q004'] == 'F'
normal = ques... |
andersonamaral/Sao-Paulo-Crime-Study | Sao_Paulo_Homicidios_Dolosos.ipynb | apache-2.0 | list = ['HomicÃdio qualificado (art. 121, §2o.)']
list
df.head()
"""
Explanation: Vou selecionar homicídio qualificado, Lesão Corporal seguida de morte, que são os 2 crimes com dolo que resultam em morte.
End of explanation
"""
for i in list:
df = df[df['RUBRICA']==i]
df.head(3)
df['DATA_OCORRENC... |
ES-DOC/esdoc-jupyterhub | notebooks/ncc/cmip6/models/noresm2-lmec/atmoschem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'ncc', 'noresm2-lmec', 'atmoschem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmoschem
MIP Era: CMIP6
Institute: NCC
Source ID: NORESM2-LMEC
Topic: Atmoschem
Sub-Topics: Transport, Emissi... |
afronski/playground-notes | introduction-to-big-data-with-apache-spark/solutions/lab1_word_count_student.ipynb | mit | wordsList = ['cat', 'elephant', 'rat', 'rat', 'cat']
wordsRDD = sc.parallelize(wordsList, 4)
# Print out the type of wordsRDD
print type(wordsRDD)
"""
Explanation: +
Word Count Lab: Building a word count application
This lab will build on the techniques covered in the Spark tutorial to develop a simple word count app... |
pycrystem/pycrystem | doc/demos/09 Angular Correlations of Amorphous Materials.ipynb | gpl-3.0 | data_path = "data/09/PdNiP_test.hspy"
%matplotlib inline
import pyxem as pxm
import hyperspy.api as hs
pxm.__version__
data = hs.load("./data/09/PdNiP_test.hspy")
"""
Explanation: Angular Correlations of Amorphous Materials
This notebook demonstrates caclulating the angular correlation of diffraction patterns recor... |
NuGrid/NuPyCEE | regression_tests/temp/RTS_plot_functions.ipynb | bsd-3-clause | #from imp import *
#s=load_source('sygma','/home/nugrid/nugrid/SYGMA/SYGMA_online/SYGMA_dev/sygma.py')
#import mpld3
#mpld3.enable_notebook()
import sygma as s
reload(s)
import matplotlib.pyplot as plt
%matplotlib inline
s1=s.sygma(iniZ=0.02,dt=1e7,tend=2e7)
"""
Explanation: Regression test suite: Test of all plotti... |
roebius/deeplearning_keras2 | nbs2/seq2seq-translation.ipynb | apache-2.0 | import unicodedata, string, re, random, time, math, torch, torch.nn as nn
from torch.autograd import Variable
from torch import optim
import torch.nn.functional as F
import keras, numpy as np
from keras.preprocessing import sequence
"""
Explanation: Requirements
End of explanation
"""
SOS_token = 0
EOS_token = 1
c... |
FunOnTheUpfield/DataVicGovAuPTDataCleaner | TramBoardingAlighting_DataCleaner.ipynb | gpl-3.0 | import pandas as pd
rawtram = './raw/Tram Boardings and Alightings 2011 - data.XLS'
df = pd.read_excel(rawtram,sheetname='Data', header=0,converters={'Route_Number':str,'Tram_Tracker_ID':str, 'Metlink_Stop_ID':str, 'VicgridX':str, 'VicgridY':str})
df
"""
Explanation: Tram Boarding and Alighting Data Cleaner
Data Sou... |
mne-tools/mne-tools.github.io | 0.22/_downloads/d0650bb5ca9f8c789ed4763f3c3f895e/plot_linear_model_patterns.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Romain Trachel <trachelr@gmail.com>
# Jean-Remi King <jeanremi.king@gmail.com>
#
# License: BSD (3-clause)
import mne
from mne import io, EvokedArray
from mne.datasets import sample
from mne.decoding import Vectorizer, get_coef
from sklea... |
GoogleCloudPlatform/vertex-ai-samples | notebooks/community/sdk/sdk_automl_image_classification_online_export_edge.ipynb | apache-2.0 | import os
# Google Cloud Notebook
if os.path.exists("/opt/deeplearning/metadata/env_version"):
USER_FLAG = "--user"
else:
USER_FLAG = ""
! pip3 install --upgrade google-cloud-aiplatform $USER_FLAG
"""
Explanation: Vertex SDK: AutoML training image classification model for export to edge
<table align="left">
... |
dipanjank/ml | data_analysis/acute_inflammations.ipynb | gpl-3.0 | import numpy as np
import pandas as pd
%pylab inline
pylab.style.use('ggplot')
import seaborn as sns
data_df = pd.read_csv('diagnosis.csv', sep='\t', decimal=',', header=None)
data_df.head()
"""
Explanation: Acute Inflammations Dataset - UCI
Analysis of the UCI dataset https://archive.ics.uci.edu/ml/datasets/Acute+I... |
AllenDowney/ThinkBayes2 | examples/double_dice.ipynb | mit | # Configure Jupyter so figures appear in the notebook
%matplotlib inline
# Configure Jupyter to display the assigned value after an assignment
%config InteractiveShell.ast_node_interactivity='last_expr_or_assign'
import numpy as np
import pandas as pd
from fractions import Fraction
"""
Explanation: The double dice ... |
arcyfelix/Courses | 17-09-17-Python-for-Financial-Analysis-and-Algorithmic-Trading/04-Visualization-Matplotlib-Pandas/04a-Matplotlib/01 - Matplotlib Concepts Lecture.ipynb | apache-2.0 | import matplotlib.pyplot as plt
"""
Explanation: <a href='http://www.pieriandata.com'> <img src='../../Pierian_Data_Logo.png' /></a>
Matplotlib Overview Lecture
Introduction
Matplotlib is the "grandfather" library of data visualization with Python. It was created by John Hunter. He created it to try to replicate MatL... |
slundberg/shap | notebooks/api_examples/plots/text.ipynb | mit | import shap
import transformers
import nlp
import torch
import numpy as np
import scipy as sp
# load a BERT sentiment analysis model
tokenizer = transformers.DistilBertTokenizerFast.from_pretrained("distilbert-base-uncased")
model = transformers.DistilBertForSequenceClassification.from_pretrained(
"distilbert-base... |
arnoldlu/lisa | ipynb/examples/android/workloads/Android_Recents_Fling.ipynb | apache-2.0 | import logging
from conf import LisaLogging
LisaLogging.setup()
%pylab inline
import os
from time import sleep
# Support to access the remote target
import devlib
from env import TestEnv
# Import support for Android devices
from android import Screen, Workload
from devlib.utils.android import adb_command
# Suppor... |
phoebe-project/phoebe2-docs | 2.3/tutorials/latex_repr.ipynb | gpl-3.0 | #!pip install -I "phoebe>=2.3,<2.4"
import phoebe
from phoebe import u # units
import numpy as np
logger = phoebe.logger()
"""
Explanation: Advanced: Parameter Latex Representation
Setup
Let's first make sure we have the latest version of PHOEBE 2.3 installed (uncomment this line if running in an online notebook ses... |
UCBerkeleySETI/blimpy | tutorial/blimpy_voyager_tour.ipynb | bsd-3-clause | %matplotlib inline
import blimpy as bl
import numpy as np
import pylab as plt
# For the purposes of illustration, I will assume that the Voyager files have been placed in /opt/voyager_data/.
# Here is a link to the web folder holding Voyager files: http://blpd0.ssl.berkeley.edu/Voyager_data/
VOYAGER_DIR = '/opt/voyag... |
DavidNorman/tensorflow | tensorflow/lite/g3doc/models/style_transfer/overview.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... |
statsmodels/statsmodels.github.io | v0.13.1/examples/notebooks/generated/distributed_estimation.ipynb | bsd-3-clause | import numpy as np
from scipy.stats.distributions import norm
from statsmodels.base.distributed_estimation import DistributedModel
def _exog_gen(exog, partitions):
"""partitions exog data"""
n_exog = exog.shape[0]
n_part = np.ceil(n_exog / partitions)
ii = 0
while ii < n_exog:
jj = int(m... |
leoferres/prograUDD | clases/05-Control-Flow.ipynb | mit | x = -15
if x == 0:
print(x, "es cero")
elif x > 0:
print(x, "es positivo")
elif x < 0:
print(x, "es negativo")
else:
print(x, "es algo que ni idea...")
"""
Explanation: Control de flujo de programas
Bueno, al fin y al cabo llegamos al punto fundamental de la programación. Sin fors o ifs, los programas... |
mne-tools/mne-tools.github.io | 0.13/_downloads/plot_compute_covariance.ipynb | bsd-3-clause | import os.path as op
import mne
from mne.datasets import sample
"""
Explanation: Computing covariance matrix
End of explanation
"""
data_path = sample.data_path()
raw_empty_room_fname = op.join(
data_path, 'MEG', 'sample', 'ernoise_raw.fif')
raw_empty_room = mne.io.read_raw_fif(raw_empty_room_fname, add_eeg_ref... |
dsacademybr/PythonFundamentos | Cap08/DesafioDSA_Solucao/Missao2/missao2.ipynb | gpl-3.0 | import math
class PrimeGenerator(object):
def generate_primes(self, max_num):
# Implemente aqui sua solução
def _cross_off(self, array, prime):
# Implemente aqui sua solução
def _next_prime(self, array, prime):
# Implemente aqui sua solução
"""
Explanation: <font color='blue'>Da... |
par2/lamana | docs/_demo_pinned.ipynb | bsd-3-clause | #------------------------------------------------------------------------------
import pandas as pd
import lamana as la
#import LamAna as la
%matplotlib inline
#%matplotlib nbagg
# PARAMETERS ------------------------------------------------------------------
# Build dicts of geometric and material parameters
load_par... |
yyl/btc-price-analysis | notes/news_prediction.ipynb | gpl-2.0 | score_data = pd.read_csv("../data/indico_nyt_bitcoin.csv", index_col='time',
parse_dates=[0], date_parser=lambda x: datetime.datetime.strptime(x, time_format))
score_data.head()
"""
Explanation: Indico.io sentiment score analysis
End of explanation
"""
weekly_score = score_data.resample('w', how='... |
phoebe-project/phoebe2-docs | 2.3/tutorials/compute.ipynb | gpl-3.0 | #!pip install -I "phoebe>=2.3,<2.4"
"""
Explanation: Compute
Now that we have datasets added to our Bundle, our next step is to run the forward model and compute a synthetic model for each of these datasets.
Setup
Let's first make sure we have the latest version of PHOEBE 2.3 installed (uncomment this line if running ... |
miky-kr5/Presentations | EVI - 2018/EVI 04/Modulo3.ipynb | cc0-1.0 | datos1 = pd.DataFrame([24, np.nan, np.nan, 23,np.nan, 12, np.nan, 17, np.nan, 2 ,5], columns = list('A'))
datos1
"""
Explanation: Manipulación y Análisis de Datos con Python
<br>
Pre-procesamiento de datos
<br>
Manejo de datos faltantes
End of explanation
"""
datos1.dropna(subset=['A'], axis= 0, inplace= True)
dato... |
astro313/REU2017 | Exercises.ipynb | mit | # Put your code here
pass
# only run this cell after you finished writing your code
%load beginner_soln.py
"""
Explanation: Part 2: Demonstration Exercises
Here are some sample exercises to work through. They demonstrate many techniques that we use all the time.
Beginner Level
This exercise is designed for those who ... |
google/eng-edu | ml/testing-debugging/testing-debugging-classification.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... |
jonathanmorgan/msu_phd_work | data/article_loading/proquest_hnp/ChristianScienceMonitor/proquest_hnp-article_loading-ChristianScienceMonitor.ipynb | lgpl-3.0 | debug_flag = False
"""
Explanation: <h1>Table of Contents<span class="tocSkip"></span></h1>
<div class="toc"><ul class="toc-item"><li><span><a href="#Introduction" data-toc-modified-id="Introduction-1"><span class="toc-item-num">1 </span>Introduction</a></span></li><li><span><a href="#Setup" data-toc-modifi... |
mne-tools/mne-tools.github.io | dev/_downloads/c69e0120935518121b8298ecac72eed8/35_dipole_orientations.ipynb | bsd-3-clause | import mne
import numpy as np
from mne.datasets import sample
from mne.minimum_norm import make_inverse_operator, apply_inverse
data_path = sample.data_path()
meg_path = data_path / 'MEG' / 'sample'
evokeds = mne.read_evokeds(meg_path / 'sample_audvis-ave.fif')
left_auditory = evokeds[0].apply_baseline()
fwd = mne.rea... |
oasis-open/cti-python-stix2 | docs/guide/creating.ipynb | bsd-3-clause | from stix2 import Indicator
indicator = Indicator(name="File hash for malware variant",
pattern="[file:hashes.md5 = 'd41d8cd98f00b204e9800998ecf8427e']",
pattern_type="stix")
print(indicator.serialize(pretty=True))
"""
Explanation: Creating STIX Content
Creating STIX Domain... |
zhiyzuo/python-scopus | Quick-Start.ipynb | mit | import pyscopus
pyscopus.__version__
from pyscopus import Scopus
key = 'YOUR_OWN_API'
scopus = Scopus(key)
"""
Explanation: PyScopus: Quick Start
PyScopus is a Python wrapper of Elsevier Scopus API. More details of this Python package can be found here.
<hr>
Import Scopus class and initialize with your own API Key... |
greenelab/GCB535 | 30_ML-III/ML_3_Inclass_Homework.ipynb | bsd-3-clause | # numpy provides python tools to easily load comma separated files.
import numpy as np
# use numpy to load disease #1 data
d1 = np.loadtxt(open("../30_Data_ML-III/D1.csv", "rb"), delimiter=",")
# features are all rows for columns before 200
# The canonical way to name this is that X is our matrix of
# examples by fea... |
dkirkby/quantum-demo | jupyter/WavePacket.ipynb | mit | %pylab inline
import matplotlib.animation
from IPython.display import HTML
"""
Explanation: Wave Packets
End of explanation
"""
def solve(k0=10., sigmax=0.25, V0=0., mass=1., tmax=0.25, nwave=15, nx=500, nt=10):
"""
Solve for the evolution of a 1D Gaussian wave packet.
Parameters
----------
... |
adukic/nd101 | 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'
text = helper.load_data(data_dir)
# Ignore notice, since we don't use it for analysing the data
text = text[81:]
"""
Explanation: TV Script Generation
In this project, you'll generate your own Simpsons TV scrip... |
apryor6/apryor6.github.io | visualizations/seaborn/.ipynb_checkpoints/colors-checkpoint.ipynb | mit | %matplotlib inline
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
plt.rcParams['figure.figsize'] = (20.0, 10.0)
df = pd.read_csv('../../datasets/movie_metadata.csv')
df.head()
"""
Explanation: seaborn.countplot
Bar graphs are useful for displaying relationships between categorical data an... |
tpin3694/tpin3694.github.io | python/creating_counts_of_items.ipynb | mit | from collections import Counter
"""
Explanation: Title: Create Counts Of Items
Slug: creating_counts_of_items
Summary: Create Counts Of Items in Python.
Date: 2016-01-23 12:00
Category: Python
Tags: Basics
Authors: Chris Albon
Interesting in learning more? Check out Fluent Python
Preliminaries
End of explanation... |
QuantStack/quantstack-talks | 2019-06-26-GeoPython/notebooks/vaex.ipynb | bsd-3-clause | import vaex
import numpy as np
np.warnings.filterwarnings('ignore')
dstaxi = vaex.open('src/nyc_taxi2015.hdf5') # mmapped, doesn't cost extra memory
dstaxi.plot_widget("pickup_longitude", "pickup_latitude", f="log", backend="ipyleaflet", shape=600)
dstaxi.plot_widget("dropoff_longitude", "dropoff_latitude", f="log", ... |
ES-DOC/esdoc-jupyterhub | notebooks/fio-ronm/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', 'fio-ronm', 'sandbox-2', 'toplevel')
"""
Explanation: ES-DOC CMIP6 Model Properties - Toplevel
MIP Era: CMIP6
Institute: FIO-RONM
Source ID: SANDBOX-2
Sub-Topics: Radiative Forcings.
Properties:... |
massimo-nocentini/PhD | notebooks/pascal-array-doubly-indexed-unfolding.ipynb | apache-2.0 | %run "../src/start_session.py"
%run "../src/recurrences.py"
import oeis
"""
Explanation: <p>
<img src="http://www.cerm.unifi.it/chianti/images/logo%20unifi_positivo.jpg"
alt="UniFI logo" style="float:left;width:20%;height:20%;">
<div align="right"> Massimo Nocentini<br>
<small>
<br>September 27, 2016: refact... |
akhambhati/rs-NMF_CogControl | Analysis_Notebooks/e02-Detect_Dynamic_Subgraphs.ipynb | gpl-3.0 | try:
%load_ext autoreload
%autoreload 2
%reset
except:
print 'NOT IPYTHON'
from __future__ import division
import os
os.environ['MKL_NUM_THREADS'] = '1'
os.environ['NUMEXPR_NUM_THREADS'] = '1'
os.environ['OMP_NUM_THREADS'] = '1'
import sys
import glob
import numpy as np
import pandas as pd
import sea... |
luisvalesilva/digitre | digitre/digitre.ipynb | mit | # Standard library
import datetime
import time
# Third party libraries
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
# Digitre code
import digitre_preprocessing as prep
import digitre_model
import digitre_classifier
# Reload digitre code in the same session (during development)
import imp
imp... |
turbomanage/training-data-analyst | courses/machine_learning/deepdive2/structured/labs/5b_deploy_keras_ai_platform_babyweight.ipynb | apache-2.0 | import os
"""
Explanation: LAB 5b: Deploy and predict with Keras model on Cloud AI Platform.
Learning Objectives
Setup up the environment
Deploy trained Keras model to Cloud AI Platform
Online predict from model on Cloud AI Platform
Batch predict from model on Cloud AI Platform
Introduction
In this notebook, we'll ... |
YaniLozanov/Software-University | Python/Jupyter notebook/06.Drawing Figures with Loops/Jupyter notebook/Drawing Figures with Loops.ipynb | mit | asterisk = 10
for i in range(0,10):
print("*" * asterisk)
"""
Explanation: <h1 align="center">Drawing Figures with Loops</h1>
<h2>01.Rectangle of 10 x 10 Stars</h2>
Problem:
Write a program that draws a rectangle of 10 x 10 asterisks on the console.
End of explanation
"""
n = int(input())
for i in range(0, n)... |
raazesh-sainudiin/scalable-data-science | _360-in-525/2018/02/SimonLindgren/MeTooInJupyterIpythonNBAction/Simon_MetooStep3.ipynb | unlicense | import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
"""
Explanation: Simon #metoo step 3
End of explanation
"""
df = pd.DataFrame.from_csv("topicmodel.csv", index_col=None)
df = df.sort_index()
df.rename(columns={'Unnamed: 0': 'day'}, inplace=True)
df = df.se... |
mroberge/hydrofunctions | docs/notebooks/Data_Catalog.ipynb | mit | import hydrofunctions as hf
karthaus = hf.NWIS('01542500', 'iv', period='P1D')
"""
Explanation: Requesting A Data Catalog
Almost every site or 'station' in the NWIS network collects more than one type of data. A simple way to find out what gets collected at a station would be to request everything collected over the p... |
cvxgrp/cvxpylayers | examples/torch/tutorial.ipynb | apache-2.0 | import cvxpy as cp
import matplotlib.pyplot as plt
import numpy as np
import torch
from cvxpylayers.torch import CvxpyLayer
torch.set_default_dtype(torch.double)
np.set_printoptions(precision=3, suppress=True)
"""
Explanation: Cvxpylayers tutorial
End of explanation
"""
n = 7
# Define variables & parameters
x = cp... |
iurilarosa/thesis | scritti/slides/tf summary/.ipynb_checkpoints/presentation_template-checkpoint.ipynb | gpl-3.0 | <image>
<section data-background="img/cover.jpg" data-state="img-transparent no-title-footer">
<div class="intro-body">
<div class="intro_h1"><h1>Title</h1></div>
<h3>Subtitle of the Presentation</h3>
<p><strong><span class="a">Speaker 1</span></strong> <span class="b"></span> <span>Job Title</span></p>
<p><strong><spa... |
jegibbs/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 derivs(yvec, t, h, f, ):
x = yvec[0]
y... |
fonnesbeck/PyMC3_Oslo | notebooks/3. Theano.ipynb | cc0-1.0 | from theano import function, shared
from theano import tensor as T
import theano
x = T.dscalar('x')
y = T.dscalar('y')
"""
Explanation: Theano
While most of PyMC3's user-facing features are written in pure Python, it leverages Theano (Bergstra et al., 2010) to transparently transcode models to C and compile them to m... |
graphistry/pygraphistry | demos/demos_databases_apis/arango/arango_tutorial.ipynb | bsd-3-clause | !pip install python-arango --user -q
from arango import ArangoClient
import pandas as pd
import graphistry
def paths_to_graph(paths, source='_from', destination='_to', node='_id'):
nodes_df = pd.DataFrame()
edges_df = pd.DataFrame()
for graph in paths:
nodes_df = pd.concat([ nodes_df, pd.DataFrame... |
rescu/brainstorm | simple_harmonic_oscillator/simple_harmonic_oscillator.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
def undamped_oscillator_euler(x0,v0,k,m,tmax,dt):
"""
Numerically integrate the equation of motion for an undamped harmonic oscillator
using a simple euler method.
"""
# calculate the number of time steps
num_tim... |
vitojph/2016progpln | notebooks/12-word2vec.ipynb | mit | 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):
'... |
JungeAlexander/dl | chapter_9_cnn.ipynb | mit | import matplotlib.cm as cm
import matplotlib.pyplot as plt
import tensorflow.contrib.keras as keras
%matplotlib inline
"""
Explanation: Convolutional neural networks (CNNs) in keras
Lots of keras examples, some including CNNs available here: https://github.com/fchollet/keras/tree/master/examples
Specifically, this no... |
gcgruen/homework | foundations-homework/05/homework-05-gruen-spotify.ipynb | mit | import requests
lil_response = requests.get ('https://api.spotify.com/v1/search?query=Lil&type=artist&country=US&limit=50')
lil_data = lil_response.json()
print(type(lil_data))
lil_data.keys()
lil_data['artists'].keys()
lil_artists = lil_data['artists']['items']
#check on what elements are in that list:
#print (lil_... |
CPernet/LanguageDecision | notebooks/exploratory/2017-07-16-ddm-mixed-data.ipynb | gpl-3.0 | %matplotlib inline
%cd ..
import warnings; warnings.filterwarnings('ignore')
"""
Explanation: Mixed Data DDM
DDM using both patient and matched control data
End of explanation
"""
from utils import matparser, data_compiler
import glob
data_dir = 'data/controls/'
matparser.parse_dir(data_dir)
out_dir = "data/cont... |
gdementen/larray | doc/source/tutorial/tutorial_sessions.ipynb | gpl-3.0 | %xmode Minimal
from larray import *
"""
Explanation: Working With Sessions
Import the LArray library:
End of explanation
"""
# define some scalars, axes and arrays
variant = 'baseline'
country = Axis('country=Belgium,France,Germany')
gender = Axis('gender=Male,Female')
time = Axis('time=2013..2017')
population = ... |
quantumlib/ReCirq | docs/guide/data_analysis.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... |
vzygouras/personal | Reciprocity Analysis Data Cleaning.ipynb | mit | import pandas as pd
import glob
import os
import matplotlib.pyplot as plt
import seaborn as sns
import warnings
import numpy as np
import statsmodels.api as sm
warnings.filterwarnings('ignore')
pd.set_option("display.max_rows", None, "display.max_columns", None)
"""
Explanation: Reciprocity Analysis: Data Cleaning
V... |
jwjohnson314/data-803 | notebooks/multiclass-classification-random-forests-cv.ipynb | mit | multinom = LogisticRegressionCV(n_jobs=-1, refit=True, multi_class='multinomial', random_state=0)
multinom.fit(Xtr, ytr)
multinom_preds = multinom.predict(Xte)
print(accuracy_score(yte, multinom_preds))
# untuned (default) random forest model
rf_model_1 = RF(n_jobs = -1, random_state = 0)
rf_model_1.fit(Xtr, ytr)
rf_... |
vprusso/youtube_tutorials | data_structures/bloom_filter/Bloom Filters and Pokemon.ipynb | gpl-3.0 | bit_vector = [0] * 20
print(bit_vector)
"""
Explanation: In this post, we will briefly go over the probabilistic data structure referred to as a Bloom filter. We'll be using Pokemon to help us in understanding the general concept of how to make use of such a data structure.
TL;DR
Bloom filters: "Lightweight" version... |
therealAJ/python-sandbox | data-science/learning/ud1/DataScience/MeanMedianMode.ipynb | gpl-3.0 | import numpy as np
incomes = np.random.normal(27000, 15000, 10000)
np.mean(incomes)
"""
Explanation: Mean, Median, Mode, and introducing NumPy
Mean vs. Median
Let's create some fake income data, centered around 27,000 with a normal distribution and standard deviation of 15,000, with 10,000 data points. (We'll discuss... |
karthikrangarajan/intro-to-sklearn | Notebook_anatomy.ipynb | bsd-3-clause | print('hello world!')
"""
Explanation: Basic Anatomy of a Notebook and General Guide
Note this a is Python 3-flavored Jupyter notebook
My Disclaimers:
Notebooks are no substitute for an IDE for developing apps.
Notebooks are not suitable for debugging code (yet).
They are no substitute for publication quality publi... |
par2/lamana | docs/demo.ipynb | bsd-3-clause | #------------------------------------------------------------------------------
import pandas as pd
import lamana as la
#import LamAna as la
%matplotlib inline
#%matplotlib nbagg
# PARAMETERS ------------------------------------------------------------------
# Build dicts of geometric and material parameters
load_par... |
fierval/KaggleMalware | Learning/1DLBP with CUDA.ipynb | mit | from numba import *
from timeit import default_timer as timer
import numpy as np
import matplotlib.pylab as plt
"""
Explanation: Extracting a 1D Local Binary Pattern Histogram on NVIDIA GPU with CUDA and Numbapro
This was done for the Microsoft Malware competition on Kaggle.
In this contest, a bunch of malware files... |
ComputationalModeling/spring-2017-danielak | past-semesters/fall_2016/day-by-day/day15-Schelling-1-dimensional-segregation-day2/Day_15_Pre_Class_Notebook.ipynb | agpl-3.0 | # Put your code here, using additional cells if necessary.
"""
Explanation: Getting ready to implement the Schelling model
Goal for this assignment
The goal of this assignment is to finish up the two functions that you started in class on the first day of this project, to ensure that you're ready to hit the ground ... |
massimo-nocentini/on-python | calculus-I/Untitled.ipynb | mit | dis
"""
Explanation: $${{15}\over{0}} \quad\leftrightarrow\quad 15 = 0m + r = r \quad m, r\in\mathbb{Z} \wedge r < 15$$
Se scelgo
$$m=1, r=0 \quad\rightarrow\quad 15 \not = 0*1 + 0 = 0$$
Ritornando al nostro problema iniziale, il denominatore $x+4\not=0$ per ogni $x\in\mathbb{R}$, quindi $x\not=-4$.
End of explanatio... |
DominikDitoIvosevic/Uni | STRUCE/2018/.ipynb_checkpoints/SU-2018-LAB04-Ansambli-i-procjena-parametara-checkpoint.ipynb | mit | # Učitaj osnovne biblioteke...
import sklearn
import mlutils
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
%pylab inline
"""
Explanation: Sveučilište u Zagrebu
Fakultet elektrotehnike i računarstva
Strojno učenje 2018/2019
http://www.fer.unizg.hr/predmet/su
Laboratorijska vježba 4: Ansambli ... |
Kunstenpunt/datakunstjes | corpusanalyse uitdatabank/corpusanalyse.ipynb | apache-2.0 | from pandas import read_excel, read_csv, DataFrame, Series, concat
from datetime import datetime
from codecs import open
from re import compile
from json import dumps
from datetime import datetime
from random import sample
from collections import Counter
from itertools import combinations
"""
Explanation: Corpusanalys... |
tensorflow/docs-l10n | site/ja/guide/keras/rnn.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... |
thisisbasil/SarcasmDetectionTwitter | plot_roc.ipynb | gpl-3.0 | print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from itertools import cycle
from sklearn import svm, datasets
from sklearn.metrics import roc_curve, auc
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import label_binarize
from sklearn.multiclass import OneVsRestClass... |
craigrshenton/home | notebooks/notebook6.ipynb | mit | # code written in py_3.0
import pandas as pd
import numpy as np
"""
Explanation: Load data from http://media.wiley.com/product_ancillary/6X/11186614/DOWNLOAD/ch06.zip, RetailMart.xlsx
End of explanation
"""
# find path to your RetailMart.xlsx
df_accounts = pd.read_excel(open('C:/Users/craigrshenton/Desktop/Dropbox/... |
sdpython/actuariat_python | _doc/notebooks/sessions/seance5_cube_multidimensionnel_correction.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
plt.style.use('ggplot')
import pyensae
from pyquickhelper.helpgen import NbImage
from jyquickhelper import add_notebook_menu
add_notebook_menu()
"""
Explanation: Cube multidimensionnel - correction
Manipulation de tables de mortalités façon OLAP, correction des exerci... |
angelmtenor/data-science-keras | titanic.ipynb | mit | import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import helper
import keras
helper.info_gpu()
helper.reproducible(seed=0) # Setup reproducible results from run to run using Keras
%matplotlib inline
"""
Explanation: Titanic Survival with DNN
Predicting survival on... |
anhaidgroup/py_entitymatching | notebooks/guides/.ipynb_checkpoints/Down Sampling-checkpoint.ipynb | bsd-3-clause | import py_entitymatching as em
"""
Explanation: This IPython notebook illustrates how to down sample two large tables that are loaded in the memory
End of explanation
"""
# Read the CSV files
A = em.read_csv_metadata('./citeseer.csv',low_memory=False) # setting the parameter low_memory to False to speed up loading.... |
chemelnucfin/tensorflow | tensorflow/contrib/autograph/examples/notebooks/dev_summit_2018_demo.ipynb | apache-2.0 | # Install TensorFlow; note that Colab notebooks run remotely, on virtual
# instances provided by Google.
!pip install -U -q tf-nightly
import os
import time
import tensorflow as tf
from tensorflow.contrib import autograph
import matplotlib.pyplot as plt
import numpy as np
import six
from google.colab import widgets... |
kazzz24/deep-learning | 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'
text = helper.load_data(data_dir)
# Ignore notice, since we don't use it for analysing the data
text = text[81:]
"""
Explanation: TV Script Generation
In this project, you'll generate your own Simpsons TV scrip... |
molgor/spystats | notebooks/Sandboxes/GMRF/.ipynb_checkpoints/Stationary_with_fft-checkpoint.ipynb | bsd-2-clause | # Load Biospytial modules and etc.
%matplotlib inline
import sys
sys.path.append('/apps')
sys.path.append('..')
#sys.path.append('../../spystats')
import django
django.setup()
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
## Use the ggplot style
plt.style.use('ggplot')
from external_plugins.sp... |
Elucidation/tensorflow_chessbot | tensorflow_learn.ipynb | mit | # Init and helper functions
import tensorflow as tf
import numpy as np
import PIL
import urllib, cStringIO
import glob
from IPython.core.display import Markdown
from IPython.display import Image, display
import helper_functions as hf
import tensorflow_chessbot
np.set_printoptions(precision=2, suppress=True)
"""
Expl... |
undercertainty/ou_nlp | semeval_experiments/fnn_beetles.ipynb | apache-2.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
def reset_graph(seed=42):
tf.reset_default_graph()
tf.set_random_seed(seed)
np.random.seed(seed)
# To... |
tpin3694/tpin3694.github.io | machine-learning/create_baseline_classification_model.ipynb | mit | # Load libraries
from sklearn.datasets import load_iris
from sklearn.dummy import DummyClassifier
from sklearn.model_selection import train_test_split
"""
Explanation: Title: Create Baseline Classification Model
Slug: create_baseline_classification_model
Summary: How to create a baseline classification model in scikit... |
mkcor/datavis-tut | solutions/1D_solutions.ipynb | cc0-1.0 | df = pd.read_csv('data/coherence_timeseries.csv', header=None)
df.columns = ['time', 'signal']
df.head()
import matplotlib
%matplotlib inline
matplotlib.style.use('ggplot')
import matplotlib.pyplot as plt
plt.plot(df['time'], df['signal'])
plt.xlabel('time (fs)')
plt.ylabel('signal (a.u.)')
plt.title('Decoherence')... |
granttremblay/Meg_Urry_NSFprop | meg_plots.ipynb | mit | import os
import glob
import math
import numpy as np
import matplotlib.pyplot as plt
from astropy.io import ascii
from astropy.table import vstack
from astropy import units as u
from astropy import constants as const
"""
Explanation: Plots for Fig. 1 and Fig. 4b for Meg Urry's 2016 NSF Proposal
Grant Tremblay, Yale ... |
Aniruddha-Tapas/Applied-Machine-Learning | Miscellaneous/Student-Performance-Evaluation-Classification-Regression.ipynb | mit | import os
from sklearn.tree import DecisionTreeClassifier, export_graphviz
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
from sklearn.cross_validation import train_test_split
from sklearn import cross_validation, metrics
from sklearn.ensemble import RandomForestClassifier
fro... |
temmeand/scikit-rf | doc/source/examples/circuit/Lumped Element Circuits.ipynb | bsd-3-clause | import numpy as np # for np.allclose() to check that S-params are similar
import skrf as rf
rf.stylely()
"""
Explanation: Lumped Elements Circuits
In this notebook, we construct various network from basic lumped elements (resistor, capacitor, inductor), with the 'classic' and the Circuit approach. Generally the Circu... |
mas-dse-greina/neon | luna16/old_code/AugmentCandidates.ipynb | apache-2.0 | ## Create new candidates file
import pandas as pd
import numpy as np
DATA_DIR = "/Volumes/data/tonyr/dicom/LUNA16/"
cand_path = 'CSVFILES/candidates_V2.csv'
annotations_path = 'CSVFILES/annotations.csv'
dfAnnotations = pd.read_csv(DATA_DIR+annotations_path).reset_index()
dfAnnotations = dfAnnotations.rename(columns=... |
tongwang01/tensorflow | tensorflow/examples/udacity/3_regularization-TongCopy1.ipynb | apache-2.0 | # These are all the modules we'll be using later. Make sure you can import them
# before proceeding further.
from __future__ import print_function
import numpy as np
import tensorflow as tf
from six.moves import cPickle as pickle
import math
"""
Explanation: Deep Learning
Assignment 3
Previously in 2_fullyconnected.ip... |
Lstyle1/Deep_learning_projects | transfer-learning/Transfer_Learning_Solution.ipynb | mit | from urllib.request import urlretrieve
from os.path import isfile, isdir
from tqdm import tqdm
vgg_dir = 'tensorflow_vgg/'
# Make sure vgg exists
if not isdir(vgg_dir):
raise Exception("VGG directory doesn't exist!")
class DLProgress(tqdm):
last_block = 0
def hook(self, block_num=1, block_size=1, total_s... |
poppy-project/community-notebooks | tutorials-education/poppy-torso__vrep_Prototype d'ininitiation à l'informatique pour les lycéens/dialogue/Dialogue TP1.ipynb | lgpl-3.0 | import pypot,time
from poppy.creatures import PoppyHumanoid
messager = PoppyHumanoid(simulator='vrep')
time.sleep(1)
messager.r_shoulder_x.goto_position(-5,0.5)
messager.l_shoulder_x.goto_position(5,0.5)
messager.head_z.goto_position(30,1,wait=True)
messager.l_shoulder_x.goto_position(90,2)
messager.l_arm_z.goto_positi... |
tensorflow/docs-l10n | site/en-snapshot/quantum/tutorials/barren_plateaus.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... |
VectorBlox/PYNQ | Pynq-Z1/notebooks/examples/pmod_grove_adc.ipynb | bsd-3-clause | from pynq import Overlay
Overlay("base.bit").download()
from pynq.iop import Grove_ADC
from pynq.iop import PMODA
from pynq.iop import PMOD_GROVE_G4
grove_adc = Grove_ADC(PMODA, PMOD_GROVE_G4)
print("{} V".format(round(grove_adc.read(),4)))
"""
Explanation: Grove ADC Example
This example shows how to use the Grove ... |
ljvmiranda921/pyswarms | docs/examples/usecases/electric_circuit_problem.ipynb | mit | # Import modules
import sys
import numpy as np
import matplotlib.pyplot as plt
# Import PySwarms
import pyswarms as ps
print('Running on Python version: {}'.format(sys.version))
"""
Explanation: Solving an electric circuit using Particle Swarm Optimization
Introduction
PSO can be utilized in a wide variety of fields... |
tensorflow/docs | site/en/tutorials/generative/adversarial_fgsm.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... |
ktakagaki/kt-2015-DSPHandsOn | MedianFilter/.ipynb_checkpoints/Basic Test Error of the Median filter with different wave number-checkpoint.ipynb | gpl-2.0 | import numpy as np
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
% matplotlib inline
"""
Explanation: Basic Test: Error rate with different wave number and window length 5
End of explanation
"""
def ErrorPlot( wavenumber,windowLength ):
data = np.fromfunction( lambda x... |
brandoncgay/deep-learning | first-neural-network/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... |
GoogleCloudPlatform/vertex-ai-samples | community-content/pytorch_image_classification_distributed_data_parallel_training_with_vertex_sdk/multi_node_ddp_nccl_vertex_training_with_custom_container.ipynb | apache-2.0 | PROJECT_ID = "YOUR PROJECT ID"
BUCKET_NAME = "gs://YOUR BUCKET NAME"
REGION = "YOUR REGION"
SERVICE_ACCOUNT = "YOUR SERVICE ACCOUNT"
! gsutil ls -al $BUCKET_NAME
content_name = "pt-img-cls-multi-node-ddp-cust-cont"
"""
Explanation: PyTorch Image Classification Multi-Node Distributed Data Parallel Training on GPU usi... |
mikekestemont/wuerzb15 | Chapter 3 - First steps in sklearn.ipynb | mit | clf = SomeClassifier(arg1='foo', arg2='foo2')
clf.fit(X_train, y_train)
predictions = clf.predict(X_test)
"""
Explanation: Chapter 3 - First steps in Sklearn
In this chapter, we make our first steps using scikit-learn (commonly abbreviated to sklearn), a marvellous Python library for Machine Learning, which is activel... |
rfinn/LCS | notebooks/GIM2DvsNSA.ipynb | gpl-3.0 | import numpy as np
from matplotlib import pyplot as plt
%matplotlib inline
import warnings
warnings.filterwarnings('ignore')
import sys
sys.path.append("/Users/rfinn/Dropbox/pythonCode/")
sys.path.append("/anaconda/lib/python2.7/site-packages")
sys.path.append("/Users/rfinn/Ureka/variants/common/lib/python2.7/site-pack... |
metpy/MetPy | v0.8/_downloads/Simple_Sounding.ipynb | bsd-3-clause | import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import metpy.calc as mpcalc
from metpy.cbook import get_test_data
from metpy.plots import add_metpy_logo, SkewT
from metpy.units import units
# Change default to be better for skew-T
plt.rcParams['figure.figsize'] = (9, 9)
# Upper air data can be... |
peendebak/SPI-rack | examples/S5k_Low_Level.ipynb | mit | from spirack import SPI_rack, S5k_module, version
import numpy as np
from scipy import signal
import matplotlib.pyplot as plt
%matplotlib notebook
#assert version.__version__ >= '0.1.4', 'spirack version needs to be >= 0.1.4'
print("SPI-rack Code Version: " + version.__version__)
"""
Explanation: S5k example/demo no... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.