repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
phasedchirp/Assorted-Projects | exercises/SlideRule-DS-Intensive/Data Wrangling/sliderule_dsi_json_exercise.ipynb | gpl-2.0 | import pandas as pd
"""
Explanation: JSON examples and exercise
get familiar with packages for dealing with JSON
study examples with JSON strings and files
work on exercise to be completed and submitted
reference: http://pandas-docs.github.io/pandas-docs-travis/io.html#json
data source: http://jsonstudio.com/re... |
mzszym/oedes | examples/ionic/electrochemical-doping-japplphys113.ipynb | agpl-3.0 | %matplotlib inline
import matplotlib.pylab as plt
from oedes import *
init_notebook()
"""
Explanation: Drift-diffusion simulation of electrochemical doping
This notebook reproduces published transient simulations of electrochemical doping.
Note that the simulation may not work for longer times than investigated in th... |
buschbapti/PokeLife | notebook/pokelife_examples.ipynb | gpl-3.0 | from pokelife.move import Move
from pokelife.pokemon import Pokemon
from pokelife.nature import Nature
"""
Explanation: Examples on how to use the API
The API allows to create objects to be used such as pokemon and moves. At the beginning of your scripts add the import to Move and Pokemon classes
End of explanation
""... |
acehanks/projects | classification of resturant images/final_notebook.ipynb | mit | def images(image_directory):
return [image_directory+image for image in os.listdir(image_directory)]
images(train_directory)
train_image_names = images(train_directory)
"""
Explanation: Getting the data
End of explanation
"""
# Function to extract labels
def extract_labels(file_names):
'''Create labels fro... |
vitojph/kschool-nlp | notebooks-py2/nltk-corpus.ipynb | gpl-3.0 | from __future__ import print_function
from __future__ import division
from nltk.corpus import gutenberg
"""
Explanation: Resumen NLTK: Acceso a corpus de texto y recursos léxicos
Este resumen se corresponde con el capítulo 2 del NLTK Book Accessing Text Corpora and Lexical Resources. La lectura del capítulo es muy re... |
lfairchild/PmagPy | data_files/iodp_magic/.ipynb_checkpoints/PmagPy_iodp_HOLE_template-checkpoint.ipynb | bsd-3-clause | # import a bunch of packages for use in the notebook
import pmagpy.pmag as pmag # a bunch of PmagPy modules
import pmagpy.pmagplotlib as pmagplotlib
import pmagpy.ipmag as ipmag
import pmagpy.contribution_builder as cb
from pmagpy import convert_2_magic as convert # conversion scripts for many lab formats
from pmagpy i... |
rishuatgithub/MLPy | nlp/UPDATED_NLP_COURSE/03-Text-Classification/01-Feature-Extraction-from-Text.ipynb | apache-2.0 | %%writefile 1.txt
This is a story about cats
our feline pets
Cats are furry animals
%%writefile 2.txt
This story is about surfing
Catching waves is fun
Surfing is a popular water sport
"""
Explanation: <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a>
This unit is divided into two sect... |
turbomanage/training-data-analyst | courses/machine_learning/deepdive/09_sequence_keras/reusable-embeddings.ipynb | apache-2.0 | # change these to try this notebook out# chang
BUCKET = 'cloud-training-demos-ml'
PROJECT = 'cloud-training-demos'
REGION = 'us-central1'
"""
Explanation: <h1>Using pre-trained embeddings with TensorFlow Hub</h1>
This notebook illustrates:
<ol>
<li>How to instantiate a TensorFlow Hub module</li>
<li>How to f... |
tommyogden/maxwellbloch | docs/usage/two-level.ipynb | mit | from maxwellbloch import field, ob_atom
"""
Explanation: Getting Started with the Two-Level Atom
The first model we'll consider is a medium of two-level atoms, coupled by a weak pulse.
____ |1>
|
| Ω
|
____ |0>
We'll need to define a field, and the two-level atom for the field to address.
Defining the Field a... |
krondor/nlp-dsx-pot | NLP Overview.ipynb | gpl-3.0 | noise_list = ["is", "a", "this", "..."]
def _remove_noise(input_text):
words = input_text.split()
noise_free_words = [word for word in words if word not in noise_list]
noise_free_text = " ".join(noise_free_words)
return noise_free_text
_remove_noise("this is a sample text")
"""
Explanation: Introd... |
ledeprogram/algorithms | class10/donow/benzaquen_mercy_10_donow.ipynb | gpl-3.0 | import pandas as pd
%matplotlib inline
from sklearn import datasets
from sklearn import tree
from sklearn import metrics
from sklearn.tree import DecisionTreeClassifier
from sklearn.cross_validation import cross_val_score
import matplotlib.pyplot as plt
import numpy as np
from numpy import array
"""
Explanation: Creat... |
darioizzo/d-CGP | doc/sphinx/notebooks/dCGPANNs_for_function_approximation.ipynb | gpl-3.0 | # Initial import
import dcgpy
# For plotting
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib.ticker import LinearLocator, FormatStrFormatter
# For scientific computing and more ...
import numpy as np
from tqdm import tqdm
from sklearn.utils import shuffl... |
mercybenzaquen/foundations-homework | databases_hw/db06/Homework_6_Graded.ipynb | mit | import requests
data = requests.get('http://localhost:5000/lakes').json()
print(len(data), "lakes")
for item in data[:10]:
print(item['name'], "- elevation:", item['elevation'], "m / area:", item['area'], "km^2 / type:", item['type'])
"""
Explanation: graded = 10/10
Homework 6: Web Applications
For this homework, ... |
sdpython/ensae_teaching_cs | _doc/notebooks/td1a_home/2020_graph.ipynb | mit | from jyquickhelper import add_notebook_menu
add_notebook_menu()
%matplotlib inline
"""
Explanation: Algo - Graphe - Composantes connexes
Les graphes sont un outil très utilisé pour modéliser un ensemble de relations entre personnes, entre produits, entre consommateurs. Les utilisations sont nombreuses, systèmes de re... |
Wei1234c/Elastic_Network_of_Things_with_MQTT_and_MicroPython | notebooks/demo/Network of Things demo.ipynb | gpl-3.0 | import os
import sys
import time
sys.path.append(os.path.abspath(os.path.join(os.path.pardir, os.path.sep.join(['..', 'codes']), 'client')))
sys.path.append(os.path.abspath(os.path.join(os.path.pardir, os.path.sep.join(['..', 'codes']), 'node')))
sys.path.append(os.path.abspath(os.path.join(os.path.pardir, os.path.se... |
akutuzov/gensim | docs/notebooks/topic_methods.ipynb | lgpl-2.1 | from gensim.corpora import Dictionary
from gensim.models import ldamodel
import numpy
%matplotlib inline
"""
Explanation: New Term Topics Methods and Document Coloring
End of explanation
"""
texts = [['bank','river','shore','water'],
['river','water','flow','fast','tree'],
['bank','water','fall','fl... |
sdpython/actuariat_python | _doc/notebooks/exemples/tables_avec_guillemets.ipynb | mit | texte = """
"Libellé","Produit","Prix","Quantite"
"L123","meuble","1000","1"
"L321","portable","500","2"
"L333","lampe","100","4"
"""
with open("exemple_fichier.txt", "w", encoding="utf8") as f:
f.write(texte)
"""
Explanation: Tables avec guillemets
Le fichier de données à gérer contient quelques désagrément ave... |
anthonyng2/FX-Trading-with-Python-and-Oanda | Oanda v1 REST-oandapy/01.02 Understanding the Documentations.ipynb | mit | import oandapy
"""
Explanation: <!--NAVIGATION-->
< Setting Up | Contents | Algorithmic Trading Architecture >
Understanding the Documentations
In order to make use of the API effective, we need to understand the input parameters and the corresponding output. Good thing Oanda provides a comprehensive API guide as show... |
ML4DS/ML4all | C_lab1 Clasificacion/Pract_classification_student.ipynb | mit | # Import some libraries that will be necessary for working with data and displaying plots
# To visualize plots in the notebook
%matplotlib inline
#import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import scipy.io # To read matlab files
from sklearn.preprocessing import PolynomialFeatures
from... |
eds-uga/csci1360e-su17 | assignments/A7/A7_Q1.ipynb | mit | np.testing.assert_allclose(flip(1.0), 1.0, rtol = 0.01)
np.testing.assert_allclose(flip(0.0), 0.0, rtol = 0.01)
results = np.zeros(10000, dtype = np.int)
for i in range(10000):
results[i] = flip(0.5)
np.testing.assert_allclose(results.mean(), 0.5, rtol = 0.1)
"""
Explanation: Q1
In this question, you'll work wit... |
mne-tools/mne-tools.github.io | 0.12/_downloads/plot_source_space_time_frequency.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: BSD (3-clause)
import matplotlib.pyplot as plt
import mne
from mne import io
from mne.datasets import sample
from mne.minimum_norm import read_inverse_operator, source_band_induced_power
print(__doc__)
"""
Explanation: Compute indu... |
alison-thaung/CodeForDC | DC Council Calendar Web Scrape.ipynb | mit | #title :DC Council Calendar Web Scrape (bs4)
#description :This will scrape a web page of calendar items listed in a table, place in a pandas DataFrame
# and export the DataFrame to a .csv file.
#author :alisonthaung
#date created :2017-07-10
#date las... |
rlnsanz/delft | tutorials/Titanic_Kaggle.ipynb | gpl-3.0 | # Import required libraries
from tpot import TPOT
from sklearn.cross_validation import train_test_split
import pandas as pd
import numpy as np
# Load the data
titanic = pd.read_csv('data/titanic_train.csv')
titanic.head(5)
"""
Explanation: TPOT tutorial on the Titanic dataset
The Titanic machine learning competition... |
oroszl/szamprob | notebooks/Package05/mintapelda05.ipynb | gpl-3.0 | %pylab inline
"""
Explanation: File-ok kezelése
Nagy mennyiségű adatok feldolgozásánál elengedthetetlen dolog a számítógépek memóriáján (RAM) kívűl a külső tárolókon (merevlemezek, egyéb adathordozók) tárolt file-ok használata is. Az alábbiakban a python alapértelmezett filekezelő függvényeivel ismerkedünk meg előszö... |
JamesSample/icpw | toc_trends_oct_2016_part2.ipynb | mit | # Import custom functions
# Connect to db
resa2_basic_path = (r'C:\Data\James_Work\Staff\Heleen_d_W\ICP_Waters\Upload_Template'
r'\useful_resa2_code.py')
resa2_basic = imp.load_source('useful_resa2_code', resa2_basic_path)
engine, conn = resa2_basic.connect_to_resa2()
# Import code for trends ana... |
NathanYee/ThinkBayes2 | code/chap07mine.ipynb | gpl-2.0 | from __future__ import print_function, division
% matplotlib inline
import warnings
warnings.filterwarnings('ignore')
import math
import numpy as np
from thinkbayes2 import Pmf, Cdf, Suite, Joint, MakeExponentialPmf, EvalExponentialCdf
import thinkplot
"""
Explanation: Think Bayes: Chapter 7
This notebook presents ... |
NYUDataBootcamp/Projects | UG_S16/Lee-Kim-Asia.ipynb | mit | import pandas as pd # data package
import matplotlib.pyplot as plt # graphics module
import numpy as np # foundation for Pandas
%matplotlib inline
'''
We downloaded the data from our sources (specific in the bottom) and uploaded them to our github accounts,
so that anyo... |
gwtsa/gwtsa | examples/groundwater_paper/Ex1_simple_model/Example1.ipynb | mit | import numpy as np
import pandas as pd
import os
import matplotlib.pyplot as plt
import pastas as ps
ps.set_log_level("ERROR")
%matplotlib inline
# This notebook has been developed using Pastas version 0.9.9 and Python 3.7
print("Pastas version: {}".format(ps.__version__))
print("Pandas version: {}".format(pd.__vers... |
camigord/Self-Driving-Car-Nanodegree | P3-Behavioral-Cloning/data_preprocessing.ipynb | mit | def preprocess_image(img):
'''
Adds gaussian blur and transforms BGR to YUV.
'''
new_img = cv2.GaussianBlur(img, (3,3), 0)
new_img = cv2.cvtColor(new_img, cv2.COLOR_BGR2YUV)
return new_img
def random_distortion(img):
'''
Adds random distortion to training dataset: random brightness, s... |
darcamo/python-and-numpy-course | jupyter_notebooks/Rich Output.ipynb | mit | from IPython.display import display
"""
Explanation: Rich Output
In Python, objects can declare their textual representation using the __repr__ method. IPython expands on this idea and allows objects to declare other, rich representations including:
HTML
JSON
PNG
JPEG
SVG
LaTeX
A single object can declare some or a... |
GoogleCloudPlatform/ai-notebooks-extended | dataproc-hub-example/build/infrastructure-builder/mig/files/gcs_working_folder/examples/Python/Python_Guide.ipynb | apache-2.0 | !pip install pymysql
"""
Explanation: Python Guide
Table of Contents:
1. Google Cloud Storage
2. BigQuery
3. Cloud SQL
4. Installing Python modules using pip
5. Authenticating Python API clients for GCS, Bigquery and Cloud SQL
6. Creating Pandas Dataframes
Google Cloud Storage
Refer to the storage directory in the sa... |
ruxi/ruxi.github.io | notebooks/.ipynb_checkpoints/TODO-checkpoint.ipynb | mit | import os.path, gitpath #pip install git+'https://github.com/ruxi/python-gitpath.git'
os.chdir(gitpath.root()) # changes path to .git root
#os.getcwd() #check current work directory
"""
Explanation: Required:
End of explanation
"""
py_commit_msg = """
templating py_commit_msg
"""
%%bash -s "$py_commit_msg"
echo $1
... |
hglanz/phys202-2015-work | assignments/assignment06/DisplayEx01.ipynb | mit | from IPython.display import Image
from IPython.display import HTML
from IPython.display import display
#raise NotImplementedError()
assert True # leave this to grade the import statements
"""
Explanation: Display Exercise 1
Imports
Put any needed imports needed to display rich output the following cell:
End of explan... |
alexgorban/models | research/slim/nets/mobilenet/mobilenet_example.ipynb | apache-2.0 | !git clone https://github.com/tensorflow/models
from __future__ import print_function
from IPython import display
checkpoint_name = 'mobilenet_v2_1.0_224' #@param
url = 'https://storage.googleapis.com/mobilenet_v2/checkpoints/' + checkpoint_name + '.tgz'
print('Downloading from ', url)
!wget {url}
print('Unpacking')
... |
kastnerkyle/kastnerkyle.github.io-nikola | blogsite/posts/using-pytables-for-larger-than-ram-data-processing.ipynb | bsd-3-clause | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: HDF5 is a direct, easy path to "big" (or just annoyingly larger than RAM) data in scientific python. Using the HDF5 file format and careful coding of your algorithms, it is quite possible to process "big-ish" data on modest hardware... |
thushear/MLInAction | kaggle/Feature_engineering_and_model_tuning/Feature-engineering_and_Parameter_Tuning_XGBoost/XGBoost models tuning.ipynb | apache-2.0 | import pandas as pd
import numpy as np
import xgboost as xgb
from xgboost.sklearn import XGBClassifier
from sklearn import cross_validation, metrics
from sklearn.grid_search import GridSearchCV
import matplotlib.pylab as plt
%matplotlib inline
from matplotlib.pylab import rcParams
rcParams['figure.figsize'] = 12, 4
"... |
jdhp-docs/python_notebooks | nb_dev_python/python_keras_toy_2d_binary_classification.ipynb | mit | import tensorflow as tf
tf.__version__
import keras
keras.__version__
import h5py
h5py.__version__
import pydot
pydot.__version__
"""
Explanation: Keras Toy 2D binary classification
Install Keras
https://keras.io/#installation
Install dependencies
Install TensorFlow backend: https://www.tensorflow.org/install/
pip ... |
fantasycheng/udacity-deep-learning-project | tutorials/embeddings/Skip-Gram_word2vec.ipynb | mit | import time
import numpy as np
import tensorflow as tf
import utils
"""
Explanation: Skip-gram word2vec
In this notebook, I'll lead you through using TensorFlow to implement the word2vec algorithm using the skip-gram architecture. By implementing this, you'll learn about embedding words for use in natural language p... |
dtamayo/MachineLearning | Day1/07_linear_regression.ipynb | gpl-3.0 | # imports
import pandas as pd
import seaborn as sns
#import statsmodels.formula.api as smf
from sklearn.linear_model import LinearRegression
from sklearn import metrics
import numpy as np
# allow plots to appear directly in the notebook
%matplotlib inline
"""
Explanation: UTSC Machine Learning Workshop
Introduction t... |
besser82/shogun | doc/ipython-notebooks/neuralnets/rbms_dbns.ipynb | bsd-3-clause | %pylab inline
%matplotlib inline
import os
SHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data')
import networkx as nx
G = nx.Graph()
pos = {}
for i in range(8):
pos['V'+str(i)] = (i,0)
pos['H'+str(i)] = (i,1)
for j in range(8): G.add_edge('V'+str(j),'H'+str(i))
figure(figsize=(7,2))
nx.dr... |
Merinorus/adaisawesome | Homework/04 - Applied ML/.ipynb_checkpoints/Homework04_Referees_teamawesome-checkpoint.ipynb | gpl-3.0 | import pandas as pd
import numpy as np
# Import the random forest package
from sklearn.ensemble import RandomForestClassifier
filename ="CrowdstormingDataJuly1st.csv"
Data = pd.read_csv(filename)
"""
Explanation: I. Setting up the Problem
End of explanation
"""
Data.ix[:10,:13]
#Data.ix[:10,13:28]
"""
Explanati... |
pascal-schetelat/teaching_material | Intro_Ipython_Numpy_Scipy_solution.ipynb | cc0-1.0 | import numpy as np # np est une convention d'import
print np.array([0,1,2])
"""
Explanation: Ipython notebook
Ipython est initialement un projet de console python spécialisé pour les applications scientifiques.
Avec le temps, le projet s'est élargi et inclus désormais un ensemble d'utilitaires pour les applications sc... |
cliburn/sta-663-2017 | homework/00_Homework_Sample_With_Solutions.ipynb | mit | scores = [ 84, 76, 67, 23, 83, 23, 50, 100, 32, 84, 22, 41, 27,
29, 71, 85, 47, 77, 39, 25, 85, 69, 22, 66, 100, 92,
97, 46, 81, 88, 67, 20, 52, 62, 39, 36, 79, 54, 74,
64, 33, 68, 85, 69, 84, 30, 68, 100, 71, 33, 21, 95,
92, 72, 53, 50, 3... |
FiryZeplin/deep-learning | embeddings/Skip-Gram_word2vec.ipynb | mit | import time
import numpy as np
import tensorflow as tf
import utils
"""
Explanation: Skip-gram word2vec
In this notebook, I'll lead you through using TensorFlow to implement the word2vec algorithm using the skip-gram architecture. By implementing this, you'll learn about embedding words for use in natural language p... |
probml/pyprobml | notebooks/book1/15/rnn_sentiment_torch.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
import math
from IPython import display
try:
import torch
except ModuleNotFoundError:
%pip install -qq torch
import torch
from torch import nn
from torch.nn import functional as F
from torch.utils import data
import collections
import re
import random
imp... |
sthuggins/phys202-2015-work | assignments/assignment04/.ipynb_checkpoints/MatplotlibEx02-checkpoint.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
"""
Explanation: Matplotlib Exercise 2
Imports
End of explanation
"""
!head -n 30 open_exoplanet_catalogue.txt
"""
Explanation: Exoplanet properties
Over the past few decades, astronomers have discovered thousands of extrasolar planets. The follo... |
GoogleCloudPlatform/vertex-ai-samples | notebooks/community/ml_ops/stage4/get_started_with_google_artifact_registry.ipynb | apache-2.0 | import os
# The Vertex AI Workbench Notebook product has specific requirements
IS_WORKBENCH_NOTEBOOK = os.getenv("DL_ANACONDA_HOME")
IS_USER_MANAGED_WORKBENCH_NOTEBOOK = os.path.exists(
"/opt/deeplearning/metadata/env_version"
)
# Vertex AI Notebook requires dependencies to be installed with '--user'
USER_FLAG = ... |
tensorflow/agents | docs/tutorials/7_SAC_minitaur_tutorial.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... |
NeuralEnsemble/libNeuroML | notebooks/CellMorphology.ipynb | bsd-3-clause | import neuroml
import neuroml.loaders as loaders
fn = '../neuroml/examples/test_files/pyr_4_sym.cell.nml'
doc = loaders.NeuroMLLoader.load(fn)
cell = doc.cells[0]
print("Loaded cell %s from: %s"%(cell.id,fn))
"""
Explanation: Examples of using libNeuroML to handle cell morphologies
First load a NeuroML file containin... |
tensorflow/tcav | Run_TCAV.ipynb | apache-2.0 | %pip install tensorflow
%pip install tcav
"""
Explanation: Running TCAV
This notebook walks you through an example application of the TCAV library step-by-step to understand which human interpretable concepts (e.g. stripes, dots, zigzags) are important to the image classifier GoogleNet's (a.k.a. Inception v1) predicti... |
sehqlr/datascience | datascience/notebooks/opendatastl-demo.ipynb | cc0-1.0 | ## MAGIC & IMPORTS
%matplotlib inline
import pandas as pd
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
print("pandas version: ", pd.__version__)
print("numpy version: ", np.__version__)
print("matplotlib version: ", matplotlib.__version__)
"""
Explanation: OpenDataSTL demo
This notebook is go... |
nick-youngblut/SIPSim | ipynb/theory/qPCR_error_propagation.ipynb | mit | %load_ext rpy2.ipython
%%R
library(ggplot2)
library(dplyr)
library(tidyr)
def neg_binom_err(m, r, negs=False):
"""Adding negative binomial distribuiton error, where variance
scales more with the mean than a poisson distribution if (r < inf).
Parameters
----------
m : float
Mean value
... |
ML4DS/ML4all | C4.Classification_SVM/.ipynb_checkpoints/RegresionLogistica-checkpoint.ipynb | mit | # To visualize plots in the notebook
%matplotlib inline
# Imported libraries
import csv
import random
import matplotlib
import matplotlib.pyplot as plt
import pylab
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
from sklearn.preprocessing import PolynomialFeatures
from sklearn import linear_model
"""
Ex... |
unmrds/cc-python | Programming Concepts.ipynb | apache-2.0 | # type your help commands in the box and
# execute the code in the box by typing shift-enter
# (hold down the shift key while hitting the enter/return key)
"""
Explanation: A Gentle Introduction to Programming Concepts - Using Python
Introduction
Play along at home
You can follow along and through the notebooks that... |
hmenke/espresso | doc/tutorials/02-charged_system/02-charged_system-2.ipynb | gpl-3.0 | from __future__ import print_function
from espressomd import System, assert_features, electrostatics, electrostatic_extensions
from espressomd.shapes import Wall
import espressomd
import numpy
"""
Explanation: Tutorial 2: A Simple Charged System, Part 2
7 2D Electrostatics and Constraints
In this section, we use the p... |
adamsteer/nci-notebooks | training/py3/Satellite_Imaging.ipynb | apache-2.0 | import datetime
import os.path
def himawari8_path(UTC_datetime, band):
base = "/g/data2/rr5/satellite/obs/himawari8/FLDK/{year:d}/{month:02d}/{day:02d}/{hour:02d}{minute:02d}/"
file_name = "{year:d}{month:02d}{day:02d}{hour:02d}{minute:02d}00-P1S-ABOM_BRF_B{band:02d}-PRJ_GEOS141_2000-HIMAWARI8-AHI.nc"
st ... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/feateng/feateng.ipynb | apache-2.0 | !sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst
!pip install --user apache-beam[gcp]==2.24.0
!pip install --user httplib2==0.12.0
"""
Explanation: <h1> Feature Engineering </h1>
In this notebook, you will learn how to incorporate feature engineering into your pipeline.
<ul>
<li> Working with fea... |
pschragger/big-data-python-class | Lectures/Week 6 - Linear Algebra, Statistics, and Probability/Linear Algebra Tutorial.ipynb | mit | # resources for the rest of the page
from __future__ import division # want 3 / 2 == 1.5
import re, math, random # regexes, math functions, random numbers
import matplotlib.pyplot as plt # pyplot
from collections import defaultdict, Counter
from functools import partial
"""
Explanation: Linear Algebra Tutorial
Based o... |
PmagPy/2017_MagIC_Workshop_PmagPy_Tutorial | .ipynb_checkpoints/Example_PmagPy_Notebook-checkpoint.ipynb | bsd-3-clause | import pmagpy.ipmag as ipmag
import pmagpy.pmag as pmag
"""
Explanation: Jupyter notebook illustrating the use of PmagPy for analysis of paleomagnetic data
Before you begin
You may be viewing this notebook as a rendered html webpage (which can be seen at this link: http://pmagpy.github.io/Example_PmagPy_Notebook.html)... |
tensorflow/examples | courses/udacity_intro_to_tensorflow_for_deep_learning/l07c01_saving_and_loading_models.ipynb | apache-2.0 | #@title Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under... |
sisl/Chimp | examples/atari_tutorial.ipynb | apache-2.0 | from chimp.memories import ReplayMemoryHDF5
from chimp.learners.dqn_learner import DQNLearner
from chimp.learners.chainer_backend import ChainerBackend
from chimp.simulators.atari import AtariSimulator
from chimp.agents import DQNAgent
"""
Explanation: Training DeepMind's Atari DQN with Chimp
Load Chimp modules
End... |
JAmarel/Phys202 | Numpy/NumpyEx04.ipynb | mit | import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
"""
Explanation: Numpy Exercise 4
Imports
End of explanation
"""
import networkx as nx
K_5=nx.complete_graph(5)
nx.draw(K_5)
"""
Explanation: Complete graph Laplacian
In discrete mathematics a Graph is a set of vertices or n... |
albahnsen/ML_RiskManagement | notebooks/11_Model_Deployment.ipynb | mit | import pandas as pd
import zipfile
with zipfile.ZipFile('../datasets/model_deployment/phishing.csv.zip', 'r') as z:
f = z.open('phishing.csv')
data = pd.read_csv(f, index_col=False)
data.head()
data.tail()
data.phishing.value_counts()
"""
Explanation: 07 - Model Deployment
by Alejandro Correa Bahnsen & Iván... |
M-R-Houghton/euroscipy_2015 | scikit_image/lectures/00_images_are_arrays.ipynb | mit | import numpy as np
from matplotlib import pyplot as plt, cm
random_image = np.random.random([500, 500])
plt.imshow(random_image, cmap=cm.gray, interpolation='nearest');
"""
Explanation: Images are numpy arrays
Images are represented in scikit-image using standard numpy arrays. This allows maximum inter-operability ... |
Kaggle/learntools | notebooks/intro_to_programming/raw/ex4.ipynb | apache-2.0 | from learntools.core import binder
binder.bind(globals())
from learntools.intro_to_programming.ex4 import *
print('Setup complete.')
"""
Explanation: In the tutorial, you learned about conditions and conditional statements. In this exercise, you will use what you learned to answer several questions.
Set up the noteboo... |
hashiprobr/redes-sociais | encontro02/4-dijkstra.ipynb | gpl-3.0 | import sys
sys.path.append('..')
import socnet as sn
"""
Explanation: Encontro 02, Parte 4: Algoritmo de Dijkstra
Este guia foi escrito para ajudar você a atingir os seguintes objetivos:
implementar o algoritmo de Dijkstra;
praticar o uso da biblioteca da disciplina.
Primeiramente, vamos importar a biblioteca:
End ... |
PMEAL/OpenPNM | examples/tutorials/network/manually_adding_pores_and_throats.ipynb | mit | import openpnm as op
%config InlineBackend.figure_formats = ['svg']
import matplotlib.pyplot as plt
import numpy as np
np.random.seed(10)
ws = op.Workspace()
ws.settings['loglevel'] = 50
"""
Explanation: Manually Adding and Removing Pores and Throats
End of explanation
"""
pn = op.network.Cubic(shape=[5, 5, 1], spac... |
widdowquinn/Teaching-SfAM-ECS | workshop/01a-correlations.ipynb | mit | # Define your group, for this exercise
mygroup = "A" # <- change the letter in quotes
# Import Python libraries
import os # This lets us interact with the operating system
import pandas as pd # This allows us to use dataframes
import seaborn as sns # This gives us pretty graphics options
# Load t... |
massimo-nocentini/simulation-methods | notes/matrices-functions/chapter-two.ipynb | mit | from sympy import *
from sympy.abc import n, i, N, x, lamda, phi, z, j, r, k, a
from commons import *
from matrix_functions import *
from sequences import *
import functions_catalog
init_printing()
M = define(Symbol(r'\mathcal{R}'), Matrix([[3, 1], [1, 3]]))
M
m = M.rhs.rows # degree of \Xi minimal polynomial
Phi_... |
baklarz/db2odata | jupyter/DB2 Jupyter Extensions Tutorial.ipynb | apache-2.0 | %run db2.ipynb
"""
Explanation: DB2 Jupyter Notebook Extensions Tutorial
The SQL code tutorials for DB2 rely on a Jupyter notebook extension, commonly refer to as a "magic" command. The beginning of all of the notebooks begin with the following command which will load the extension and allow the remainder of the noteb... |
elmaso/tno-ai | aind2-cnn/transfer-learning/bottleneck_features.ipynb | gpl-3.0 | from keras.applications.vgg16 import preprocess_input
from keras.preprocessing import image
import numpy as np
import glob
img_paths = glob.glob("images/*.jpg")
def path_to_tensor(img_path):
# loads RGB image as PIL.Image.Image type
img = image.load_img(img_path, target_size=(224, 224))
# convert PIL.Imag... |
marcinofulus/ProgramowanieRownolegle | MPI/ipyparallel_gpu4.ipynb | gpl-3.0 | c = ipp.Client(profile='gpu4')
c.ids
view = c[:]
view.activate()
%px --block
import os
import os
os.environ
c[:].apply_sync(lambda : "Hello, World")
"""
Explanation: Configure mpi profile first:
- http://ipyparallel.readthedocs.io/en/latest/process.html#parallel-process
End of explanation
"""
import mpi4py... |
ramseylab/networkscompbio | class07_clustcoeff_python3.ipynb | apache-2.0 | from igraph import Graph
from igraph import summary
import pandas
import numpy
import timeit
from pympler import asizeof
import bintrees
"""
Explanation: CS446/519 - Class Session 7 - Transitivity (Clustering Coefficients)
In this class session we are going to compute the local clustering coefficient of all vertices i... |
rdhyee/diversity-census-calc | 03_00_Intro_to_Census_API.ipynb | apache-2.0 | # import useful classes of pandas
import numpy as np
import pandas as pd
from pandas import Series, DataFrame, Index
"""
Explanation: Some Context
The US Census is complex....so it's good, even essential, to have a framing question to guide your explorations so that you don't get distracted or lost.
I got into thinki... |
jriehl/numba | examples/notebooks/Accessing C Struct Data.ipynb | bsd-2-clause | from cffi import FFI
src = """
/* Define the C struct */
typedef struct my_struct {
int i1;
float f2;
double d3;
float af4[7];
} my_struct;
/* Define a callback function */
typedef double (*my_func)(my_struct*, size_t);
"""
ffi = FFI()
ffi.cdef(src)
"""
Explanation: Accessing C Struct Data
Th... |
cwaldbieser/notebooks | media/Frequency Analysis.ipynb | gpl-2.0 | %matplotlib inline
"""
Explanation: Setup
Setup matplotlib to perform inline plots
End of explanation
"""
from matplotlib.ticker import MultipleLocator
import scipy
from scipy import interpolate
from scipy.interpolate import interp1d
import scipy.io.wavfile as wf
import matplotlib.pyplot as plt
import numpy as np
"... |
liufuyang/deep_learning_tutorial | course-deeplearning.ai/course5-rnn/Week 1/Jazz improvisation with LSTM/Improvise a Jazz Solo with an LSTM Network - v1.ipynb | mit | from __future__ import print_function
import IPython
import sys
from music21 import *
import numpy as np
from grammar import *
from qa import *
from preprocess import *
from music_utils import *
from data_utils import *
from keras.models import load_model, Model
from keras.layers import Dense, Activation, Dropout, Inp... |
theandygross/HIV_Methylation | HIV_Age_Advancement.ipynb | mit | import NotebookImport
from Setup.Imports import *
from Setup.MethylationAgeModels import *
from Setup.Read_HIV_Data import *
hiv = (duration=='Control').map({False: 'HIV+', True: 'HIV-'})
hiv.name = 'HIV Status'
hiv.value_counts()
"""
Explanation: HIV Methylation Age Advancement
End of explanation
"""
def model_... |
bauman/bsonsearch | libbson_vs_mongodb_list_namespace_issues.ipynb | mit | %%timeit
from bson import json_util
spec = {"main.sub.third":3}
doc = {"main":[{"sub":{"third":2}},{"sub":[{"third":2}, {"third":3}]}]}
doc_id = bc.generate_doc(doc)
newspec = bc.convert_to_and(spec, doc_id)['$and'][0]
matcher= bc.generate_matcher(newspec)
found = bc.match_doc(matcher, doc_id)
bc.destroy_matcher(bc.mat... |
kscottz/PythonFromSpace | MovieTime.ipynb | bsd-3-clause | # Basemap Mosaic (v1 API)
mosaicsSeries = 'global_quarterly_2017q1_mosaic'
# Planet tile server base URL (Planet Explorer Mosaics Tiles)
mosaicsTilesURL_base = 'https://tiles0.planet.com/experimental/mosaics/planet-tiles/' + mosaicsSeries + '/gmap/{z}/{x}/{y}.png'
# Planet tile server url
mosaicsTilesURL = mosaicsTiles... |
PyPSA/PyPSA | examples/notebooks/multi-investment-optimisation.ipynb | mit | import pypsa
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
"""
Explanation: Multi Investment Optimization
In the following, we show how PyPSA can deal with multi-investment optimization, also known as multi-horizon optimization.
Here, the total set of snapshots is divided into investment peri... |
JaviMerino/lisa | ipynb/android/benchmarks/Android_PCMark.ipynb | apache-2.0 | import logging
reload(logging)
log_fmt = '%(asctime)-9s %(levelname)-8s: %(message)s'
logging.basicConfig(format=log_fmt)
# Change to info once the notebook runs ok
logging.getLogger().setLevel(logging.INFO)
%pylab inline
import copy
import os
from time import sleep
from subprocess import Popen
import pandas as pd
... |
KUrushi/knocks | 03/Untitled.ipynb | mit | import pandas as pd
import json
def get_article(title):
for line in open('jawiki-country.json', 'r'):
data = json.loads(line)
if data['title'] == title:
return data['text'].split('\n')
England = get_article('イギリス')
print(type(England), England)
"""
Explanation: 正規表現
20. JSONデー... |
jnarhan/Breast_Cancer | src/img_processing/Image_Resizing.ipynb | mit | import os
from PIL import Image
from __future__ import division
in_dir1 = "E:/erikn/Dropbox (DATA698-S17)/DATA698-S17/data/ddsm/png/0/"
in_dir2 = "E:/erikn/Dropbox (DATA698-S17)/DATA698-S17/data/ddsm/png/1/"
in_dir3 = "E:/erikn/Dropbox (DATA698-S17)/DATA698-S17/data/ddsm/png/3/"
img_in = [in_dir1, in_dir2, in_dir3]
... |
iRipVanWinkle/ml | Data Science UA - September 2017/Lecture 07 - Simulation Modeling/Marketing_Campaign_Simulation.ipynb | mit | import pandas as pd
try:
from ggplot import *
except:
!pip install ggplot
from ggplot.scales.scale_color_gradient import *
%matplotlib inline
data = pd.read_csv('sale_probability.csv')
ggplot(aes(x='Sales probability'), data=pd.DataFrame({ 'Sales probability' : data['probabilities'] })) \
+ geom_histogram(... |
dereneaton/RADmissing | emp_nb_Finches.ipynb | mit | ### Notebook 6
### Data set 6 (Finches)
### Authors: DaCosta & Sorenson (2016)
### Data Location: SRP059199
"""
Explanation: Notebook 6:
This is an IPython notebook. Most of the code is composed of bash scripts, indicated by %%bash at the top of the cell, otherwise it is IPython code. This notebook includes code to do... |
jmschrei/pomegranate | tutorials/C_Feature_Tutorial_5_Custom_Distributions.ipynb | mit | %matplotlib inline
import time
import pandas
import random
import numpy
import matplotlib.pyplot as plt
import seaborn; seaborn.set_style('whitegrid')
import itertools
from pomegranate import *
random.seed(0)
numpy.random.seed(0)
numpy.set_printoptions(suppress=True)
%load_ext watermark
%watermark -m -n -p numpy,sci... |
khillion/ToolDog | experiments/protocol-08.05.2017.ipynb | mit | import subprocess
"""
Explanation: Protocol of experiments 08.05.2017
Goal: Provide proof of concept and working example for the idea of running ToolDog analyser in the Docker container
Requirements:
1. Installed Docker
1. Installed Python3, pip
First, we import a library for running bash commands from Python code.
En... |
amitkaps/weed | 2-Refine.ipynb | mit | # Load the libraries
import numpy as np
import pandas as pd
# Load the data again!
df = pd.read_csv("data/Weed_Price.csv", parse_dates=[-1])
"""
Explanation: 2. Refine the Data
"Data is messy"
Missing e.g. Check for missing or incomplete data
Quality e.g. Check for duplicates, accuracy, unusual data
Parse e.g. ext... |
laa-1-yay/SDC1-DetectLaneLines | Laav_Lane_Lines_Detection.ipynb | gpl-3.0 | #importing some useful packages
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
import cv2
%matplotlib inline
"""
Explanation: Self-Driving Car Engineer Nanodegree
Project: Finding Lane Lines on the Road
In this project, you will use the tools you learned about in the lesson to ide... |
mramanathan/pydiary_notes | sys_module_intro_and_mutable_sequence_handling.ipynb | gpl-3.0 | palPhrase = ['r', 'i', 's', 'e', 't', 'o', 'v', 'o', 't', 'e', 's', 'i', 'r']
newLoopCnt = 0
print "==" * 2 + "direct (in-place modification) operations on the list" + "==" * 2
print "Length of the list : %d" %(len(palPhrase))
for ee in palPhrase:
print "Counter {0}".format(newLoopCnt)
ff = palPhrase.pop()
... |
projectmesa/mesa-examples | examples/Tutorial-Boltzmann_Wealth_Model/.ipynb_checkpoints/Tutorial-Boltzmann_Wealth_Model-checkpoint.ipynb | apache-2.0 | from mesa import Model, Agent
class MoneyAgent(Agent):
""" An agent with fixed initial wealth."""
def __init__(self, unique_id):
# Each agent should have a unique identifier, stored in the unique_id field.
self.unique_id = unique_id
self.wealth = 1
class MoneyModel(Model):
"""A mod... |
1x0r/pspis | labs/PSPIS_lab_02.ipynb | mit | import numpy as np
import pandas as pd
"""
Explanation: Лабораторная работа №2
Тема работы: «Решение задачи регрессии»
Цели работы
исследование процесса решения задачи регрессии
изучение библиотек Python: scikit-learn и Pandas
Пояснения к работе
Ход работы
В своей рабочей папке открыть командное окно и запустить jup... |
jorisvandenbossche/DS-python-data-analysis | _solved/pandas_05_groupby_operations.ipynb | bsd-3-clause | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
plt.style.use('seaborn-whitegrid')
"""
Explanation: <p><font size="6"><b>06 - Pandas: "Group by" operations</b></font></p>
© 2021, Joris Van den Bossche and Stijn Van Hoey (jorisvandenb&#... |
tensorflow/docs-l10n | site/ko/addons/tutorials/layers_normalizations.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... |
Mashimo/datascience | 01-Regression/LogisticRegression.ipynb | apache-2.0 | import pandas as pd
data = pd.read_csv("datasets/ex2data1.txt", header=None,
names=['Exam1', 'Exam2', 'Admitted'])
data.head()
"""
Explanation: Example of Logistic regression
Predict student admission based on exams result
Data is taken from Andrew Ng's CS229 course on Machine Learning at Stanf... |
statsmodels/statsmodels | examples/notebooks/stl_decomposition.ipynb | bsd-3-clause | import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
from pandas.plotting import register_matplotlib_converters
register_matplotlib_converters()
sns.set_style("darkgrid")
plt.rc("figure", figsize=(16, 12))
plt.rc("font", size=13)
"""
Explanation: Seasonal-Trend decomposition using LOESS (STL)
Th... |
rishuatgithub/MLPy | torch/PYTORCH_NOTEBOOKS/00-Crash-Course-Topics/00-Crash-Course-NumPy/00-NumPy-Arrays.ipynb | apache-2.0 | import numpy as np
"""
Explanation: <a href='http://www.pieriandata.com'><img src='../Pierian_Data_Logo.png'/></a>
<center><em>Copyright Pierian Data</em></center>
<center><em>For more information, visit us at <a href='http://www.pieriandata.com'>www.pieriandata.com</a></em></center>
NumPy
NumPy is a powerful linear ... |
telescopeuser/workshop_blog | wechat_tool_py3_local/lesson_4_py3_local.ipynb | mit | import IPython.display
IPython.display.YouTubeVideo('4m44aPkLY2k')
"""
Explanation: <img src='https://www.iss.nus.edu.sg/Sitefinity/WebsiteTemplates/ISS/App_Themes/ISS/Images/branding-iss.png' width=15% style="float: right;">
<img src='https://www.iss.nus.edu.sg/Sitefinity/WebsiteTemplates/ISS/App_Themes/ISS/Images/br... |
rdempsey/python-for-sharing | pandas-for-noobs/.ipynb_checkpoints/Three Pandas Tips for Pandas Noobs-checkpoint.ipynb | mit | # Import the Python libraries we need
import pandas as pd
# Define a variable for the accidents data file
f = './data/accidents1k.csv'
# Use read_csv() to import the data
accidents = pd.read_csv(f,
sep=',',
header=0,
index_col=False,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.