repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
kaleoyster/nbi-data-science | Bridge Life-Cycle Models/CDF+Probability+Reconstruction+vs+Age+of+Bridges+in+the+West+United+States.ipynb | gpl-2.0 | import pymongo
from pymongo import MongoClient
import time
import pandas as pd
import numpy as np
import seaborn as sns
from matplotlib.pyplot import *
import matplotlib.pyplot as plt
import folium
import datetime as dt
import random as rnd
import warnings
import datetime as dt
import csv
%matplotlib inline
"""
Explan... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/computer_vision_fun/solutions/classifying_images_with_pre-built_tf_container_on_vertex_ai.ipynb | apache-2.0 | from datetime import datetime
import os
REGION = 'us-central1'
PROJECT = !(gcloud config get-value core/project)
PROJECT = PROJECT[0]
BUCKET = PROJECT
MODEL_TYPE = "cnn" # "linear", "dnn", "dnn_dropout", or "cnn"
# Do not change these
os.environ["PROJECT"] = PROJECT
os.environ["BUCKET"] = BUCKET
os.environ["REGION"... |
datapolitan/lede_algorithms | class2_1/.ipynb_checkpoints/EDA_Review-checkpoint.ipynb | gpl-2.0 | df = pd.read_csv('data/ontime_reports_may_2015_ny.csv')
df.describe()
"""
Explanation: Loading data
Simple stuff. We're loading in a CSV here, and we'll run the describe function over it to get the lay of the land.
End of explanation
"""
df.sort('ARR_DELAY', ascending=False).head(1)
"""
Explanation: In journalism,... |
vamsisakh/Kaggle-SF-Crime | W207-Carin_Mahmud_Sakhamuri.ipynb | apache-2.0 | # This tells matplotlib not to try opening a new window for each plot.
%matplotlib inline
# General libraries.
import numpy as np
import matplotlib.pyplot as plt
# SK-learn libraries for learning.
from sklearn.pipeline import Pipeline
from sklearn.neighbors import KNeighborsClassifier
from sklearn.grid_search import ... |
nansencenter/nansat-lectures | notebooks/13 Django introduction.ipynb | gpl-3.0 | # models.py
from django.db import models
class Human(models.Model):
''' Description of any Human'''
name = models.CharField(max_length=200)
age = models.IntegerField()
objects = models.Manager()
def __str__(self):
''' Nicely print Human object '''
return u"I'm %s, %d years old" %... |
ehongdata/Network-Analysis-Made-Simple | 2. Network(X) Basics (Student).ipynb | mit | G = nx.read_gpickle('Synthetic Social Network.pkl') #If you are Python 2.7, read in Synthetic Social Network 27.pkl
nx.draw(G)
"""
Explanation: Nodes and Edges: How do we represent relationships between individuals using NetworkX?
As mentioned earlier, networks, also known as graphs, are comprised of individual entiti... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/end_to_end_ml/solutions/prepare_data_babyweight.ipynb | apache-2.0 | !sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst
!pip install --user google-cloud-bigquery==1.25.0
"""
Explanation: Prepare babyweight dataset
Learning Objectives
Setup up the environment
Preprocess natality dataset
Augment natality dataset
Create the train and eval tables in BigQuery
Export data f... |
alshedivat/tensorflow | tensorflow/contrib/eager/python/examples/nmt_with_attention/nmt_with_attention.ipynb | apache-2.0 | from __future__ import absolute_import, division, print_function
# Import TensorFlow >= 1.10 and enable eager execution
import tensorflow as tf
tf.enable_eager_execution()
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
import unicodedata
import re
import numpy as np
import os
i... |
d-k-b/udacity-deep-learning | transfer-learning/Transfer_Learning.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... |
HCsoft-RD/shaolin | examples/Shaolin Colors.ipynb | agpl-3.0 | from IPython.display import Image #this is for displaying the widgets in the web version of the notebook
Image(filename='colors_data/new_cmappicker.png')
"""
Explanation: Disclaimer:
This notebook is a little oudated. The ColormapPicker now has been revamped with a new interface and includes all the colormaps from the... |
dmittov/misc | Heroes of Might and Magic III.ipynb | apache-2.0 | import scipy.optimize
import numpy as np
import pandas as pd
gold = int(2 * 1e5)
gems = 115
mercury = 80
distant_min_health = 4000
air_min_health = 2000
gem_price = 500
units = [
{'name': 'titan', 'health': 300, 'gold': 5000, 'mercury': 1, 'gems': 3, 'available': 10},
{'name': 'naga', 'health': 120, 'gold': 1... |
AntArch/Presentations_Github | 20160202_Nottingham_GIServices_Lecture3_Beck_InteroperabilitySemanticsAndOpenData/20160202_Nottingham_GIServices_Lecture3_Beck_InteroperabilitySemanticsAndOpenData_localised.ipynb | cc0-1.0 | from IPython.display import YouTubeVideo
YouTubeVideo('F4rFuIb1Ie4')
## PDF output using pandoc
import os
### Export this notebook as markdown
commandLineSyntax = 'ipython nbconvert --to markdown 20160202_Nottingham_GIServices_Lecture3_Beck_InteroperabilitySemanticsAndOpenData.ipynb'
print (commandLineSyntax)
os.s... |
google/eng-edu | ml/testing-debugging/testing-debugging-regression.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... |
blua/deep-learning | autoencoder/Simple_Autoencoder.ipynb | mit | %matplotlib inline
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('MNIST_data', validation_size=0)
"""
Explanation: A Simple Autoencoder
We'll start off by building a simple autoencoder to compres... |
googledatalab/notebooks | tutorials/Storage/Storage APIs.ipynb | apache-2.0 | import google.datalab.storage as storage
"""
Explanation: Storage APIs
Google Cloud Datalab provides an easy environment for working with your data. This includes data that is being managed within Google Cloud Storage. This notebook introduces some of the APIs that Datalab provides for working with Google Cloud Storag... |
rcrehuet/Python_for_Scientists_2017 | notebooks/extras/Text_parsing_authors.ipynb | gpl-3.0 | def get_val(line):
"""
Get the value after the key for a RIS formatted line
>>> get_val('AU - Garcia-Pino, Abel')
'Garcia-Pino, Abel'
>>> get_val('AU - Uversky, Vladimir N.')
'Uversky, Vladimir N.'
>>> get_val('SP - 6933')
'6933'
>>> get_val('EP - 6947')
'6947'
"""
... |
fmaschler/networkit | Doc/Notebooks/Sparsification.ipynb | mit | G = readGraph("../../input/jazz.graph", Format.METIS)
G.indexEdges()
G.size()
"""
Explanation: All considered sparsification algorithm implementations rely on edge scores, so do not forget to call indexEdges() on the graph you want to work on.
End of explanation
"""
sparsificationAlgorithm = sparsification.LocalDegr... |
piyueh/SEM-Toolbox | solutions/chapter02/exercise01.ipynb | mit | import numpy
from matplotlib import pyplot
% matplotlib inline
import os, sys
sys.path.append(os.path.split(os.path.split(os.getcwd())[0])[0])
import utils.quadrature as quad
"""
Explanation: Exercise 1
End of explanation
"""
def f(x):
"""the integrand: x**6"""
return x**6
print("The exact solution i... |
saga-survey/saga-code | ipython_notebooks/Miscellaneous-completeness.ipynb | gpl-2.0 | dirtytab = Table.read('SAGADropbox/data/saga_spectra_dirty.fits.gz')
print len(dirtytab)
dirtytab[:5].show_in_notebook()
"""
Explanation: Load the data table and have a quick look at its format
End of explanation
"""
np.unique(dirtytab['ZQUALITY'])
np.sum(dirtytab['ZQUALITY'].mask)
"""
Explanation: Some quality/... |
wegamekinglc/alpha-mind | notebooks/Quick Start 1 - Factor Preprocess.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
from alphamind.data.winsorize import winsorize_normal
# 假设有50只股票,每只股票有1个因子,构成一个矩阵
factors = np.random.rand(50, 1)
# 为了展示方便,取一个标准差为上下界
clean_factors = winsorize_normal(factors, num_stds=1)
%matplotlib inline
plt.plot(factors)
plt.plot(clean_factors)
"""
Explanation... |
antoniomezzacapo/qiskit-tutorial | community/aqua/chemistry/h2o.ipynb | apache-2.0 | from qiskit_aqua_chemistry import AquaChemistry
# Input dictionary to configure Qiskit Aqua Chemistry for the chemistry problem.
aqua_chemistry_dict = {
'problem': {'random_seed': 50},
'driver': {'name': 'PYSCF'},
'PYSCF': {'atom': 'O 0.0 0.0 0.0; H 0.757 0.586 0.0; H -0.757 0.586 0.0', 'basis': 'sto-3g'},... |
ericmjl/Network-Analysis-Made-Simple | archive/7-game-of-thrones-case-study-instructor.ipynb | mit | import pandas as pd
import networkx as nx
import matplotlib.pyplot as plt
import community
import numpy as np
import warnings
warnings.filterwarnings('ignore')
%matplotlib inline
"""
Explanation: Let's change gears and talk about Game of thrones or shall I say Network of Thrones.
It is suprising right? What is the re... |
muniri92/Echo-Pod | Statistical Titanic - Step 1.ipynb | mit | import numpy as np
import pandas as pd
titanic_data = pd.read_csv('train.csv')
titanic_data.head(5)
"""
Explanation: Statistical Problems: Step 1
Question 1
What are the columns and what do they mean?
```
VARIABLE DESCRIPTIONS:
survival Survival
(0 = No; 1 = Yes)
pclass Passenger Class... |
jgdwyer/nn-convection | notebooks/Code snippets.ipynb | apache-2.0 | out_test = r_mlp.predict(x3)
out_test = scaler_y.inverse_transform(out_test)
w1 = r_mlp.get_parameters()[0].weights
w2 = r_mlp.get_parameters()[1].weights
w3 = r_mlp.get_parameters()[2].weights
b1 = r_mlp.get_parameters()[0].biases
b2 = r_mlp.get_parameters()[1].biases
b3 = r_mlp.get_parameters()[2].biases
xscale_min ... |
gregmedlock/Medusa | docs/parallel_fba.ipynb | mit | from medusa.flux_analysis import flux_balance
from medusa.test import create_test_ensemble
ensemble = create_test_ensemble("Staphylococcus aureus")
"""
Explanation: Parallelized simulations
In medusa, ensemble Flux Balance Analysis (FBA) can be sped up thanks to the multiprocessing Python module. With this approach, e... |
bearing/dosenet-analysis | weather_station_data.ipynb | mit | CSV_URL = 'https://www.wunderground.com/weatherstation/WXDailyHistory.asp?\
ID=KCABERKE22&day=24&month=06&year=2018&graphspan=day&format=1'
df = pd.read_csv(CSV_URL, index_col=False)
df
# remove every other row from the data because they contain `<br>` only
dg = df.drop([2*i + 1 for i in range(236)])
dg
def get_clean... |
felipescobarv/notebooks | laplace/2D_Laplace_equation.ipynb | bsd-3-clause | from matplotlib import pyplot
import numpy
%matplotlib inline
from matplotlib import rcParams
rcParams['font.family'] = 'serif'
rcParams['font.size'] = 16
"""
Explanation: Relax and hold steady
Many problems in physics have no time dependence, yet are rich with physical meaning: the gravitational field produced by a m... |
kabrapratik28/Stanford_courses | cs231n/assignment1/two_layer_net.ipynb | apache-2.0 | # A bit of setup
import numpy as np
import matplotlib.pyplot as plt
from cs231n.classifiers.neural_net import TwoLayerNet
%matplotlib inline
plt.rcParams['figure.figsize'] = (10.0, 8.0) # set default size of plots
plt.rcParams['image.interpolation'] = 'nearest'
plt.rcParams['image.cmap'] = 'gray'
# for auto-reloadi... |
ES-DOC/esdoc-jupyterhub | notebooks/fio-ronm/cmip6/models/sandbox-2/atmos.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'fio-ronm', 'sandbox-2', 'atmos')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmos
MIP Era: CMIP6
Institute: FIO-RONM
Source ID: SANDBOX-2
Topic: Atmos
Sub-Topics: Dynamical Core, Radiation... |
carltoews/tennis | notebooks/tennis_predictions.ipynb | gpl-3.0 | pickle_dir = '../pickle_files/'
odds_file = 'odds.pkl'
matches_file = 'matches.pkl'
"""
Explanation: <p style="text-align: center"> Predicting Professional Tennis Match Outcomes</p>
Author: Carl Toews
Project Description: This project explores various machine learning techniques on professional tennis data. The... |
Diyago/Machine-Learning-scripts | statistics/Двухвыборочные непараметрические критерии (независимые выборки) stat.non_parametric_tests_ind.ipynb | apache-2.0 | import numpy as np
import pandas as pd
import itertools
from scipy import stats
from statsmodels.stats.descriptivestats import sign_test
from statsmodels.stats.weightstats import zconfint
from statsmodels.stats.weightstats import *
%pylab inline
"""
Explanation: Непараметрические криетрии
Критерий | Одновыборочный |... |
yakovenkodenis/websockets_secure_chat | Bpid.ipynb | mit | import bitarray
import itertools
from collections import deque
class DES(object):
_initial_permutation = [
58, 50, 42, 34, 26, 18, 10, 2,
60, 52, 44, 36, 28, 20, 12, 4,
62, 54, 46, 38, 30, 22, 14, 6,
64, 56, 48, 40, 32, 24, 16, 8,
57, 49, 41, 33, 25, 17, 9, 1,
59, ... |
vterron/Taller-Optimizacion-Python-Pyomo | 01_Intro-Python-IPython.ipynb | mit | import this
"""
Explanation: <img src="static/pybofractal.png" alt="Pybonacci" style="width: 200px;"/>
<img src="static/cacheme_logo.png" alt="CAChemE" style="width: 300px;"/>
Introducción a Jupyter e IPython
En esta clase haremos una rápida introducción al lenguaje Python y al intérprete IPython, así como a su Notebo... |
MRod5/pyturb | notebooks/Perfect and Semiperfect gas models.ipynb | mit | from pyturb.gas_models import ThermoProperties
tp = ThermoProperties()
print(tp.species_list[850:875])
tp.is_available('Air')
"""
Explanation: Gases: Perfect and Semiperfect Models
In this Notebook we will use PerfectIdealGas and SemiperfectIdealGas classes from pyTurb, to access the thermodynamic properties with a ... |
yassineAlouini/visualizing-pixar-roller-coaster | pixar-data-exploration.ipynb | mit | # Import some libraries
import pandas as pd
import numpy as np
import matplotlib.pylab as plt
import seaborn as sns
%matplotlib inline
"""
Explanation: Exploration of the Pixar movies
End of explanation
"""
pixar_data = pd.read_csv("data/PixarMovies.csv")
## Data description
pixar_data.tail(3)
pixar_data.info()
... |
QuantScientist/Deep-Learning-Boot-Camp | day02-PyTORCH-and-PyCUDA/PyTorch/18-PyTorch-NUMER.AI-Binary-Classification-BCELoss-0.691839667509 .ipynb | mit | import torch
import sys
import torch
from torch.utils.data.dataset import Dataset
from torch.utils.data import DataLoader
from torchvision import transforms
from torch import nn
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import Variable
from sklearn import cross_validation
from skl... |
bashtage/statsmodels | examples/notebooks/linear_regression_diagnostics_plots.ipynb | bsd-3-clause | import statsmodels
import statsmodels.formula.api as smf
import pandas as pd
"""
Explanation: Linear regression diagnostics
In real-life, relation between response and target variables are seldom linear. Here, we make use of outputs of statsmodels to visualise and identify potential problems that can occur from fittin... |
msampathkumar/kaggle-quora-tensorflow | references/starters/unusual_meaning_map.ipynb | apache-2.0 | import csv
import pip
from gensim import corpora, models, similarities
import pandas as pd
import numpy as np
train_file = "../input/train.csv"
df = pd.read_csv(train_file, index_col="id")
df
import matplotlib.pylab as plt
"""
Explanation: Unusual meaning map: Treating question pairs as image / surface
Other people h... |
zindy/Imaris | tutorials/tracking_maggots.ipynb | apache-2.0 | %reload_ext XTIPython
%matplotlib inline
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
"""
Explanation: Tracking maggots from videos in Imaris
End of explanation
"""
from ipywidgets import FloatProgress
from IPython.display import display
import subprocess,sys,os,json
FFPROBE_BIN = ... |
gaufung/PythonStandardLibrary | DateAndTimes/time.ipynb | mit | import textwrap
import time
available_clocks = [
('clock', time.clock),
('monotonic', time.monotonic),
('perf_counter', time.perf_counter),
('process_time', time.process_time),
('time', time.time),
]
for clock_name, func in available_clocks:
print(textwrap.dedent('''\
{name}:
adjus... |
krosaen/ml-study | kaggle/predicting-red-hat-business-value/predicting-red-hat-business-value.ipynb | mit | import pandas as pd
people = pd.read_csv('people.csv.zip')
people.head(3)
actions = pd.read_csv('act_train.csv.zip')
actions.head(3)
"""
Explanation: Kaggle's Predicting Red Hat Business Value
This is a first quick & dirty attempt at Kaggle's Predicting Red Hat Business Value competition.
Loading in the data
End of ... |
jgarciab/wwd2017 | class1/class_1a_data_types.ipynb | gpl-3.0 | pd.read_
"../class2/"
"data/Fatality.csv"
##Some code to run at the beginning of the file, to be able to show images in the notebook
##Don't worry about this cell
#Print the plots in this screen
%matplotlib inline
#Be able to plot images saved in the hard drive
from IPython.display import Image
#Make the notebo... |
mayankjohri/LetsExplorePython | Section 3 - Machine Learning/ThirdParty-scikit-learn-videos-master/06_linear_regression.ipynb | gpl-3.0 | # conventional way to import pandas
import pandas as pd
# read CSV file directly from a URL and save the results
data = pd.read_csv('http://www-bcf.usc.edu/~gareth/ISL/Advertising.csv', index_col=0)
# display the first 5 rows
data.head()
"""
Explanation: Data science pipeline: pandas, seaborn, scikit-learn
From the ... |
dtamayo/rebound | ipython_examples/PrimordialEarth.ipynb | gpl-3.0 | import rebound
import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
"""
Explanation: Primordial Earth
There are a wide variety of problems in the conext of the Solar System requiring accurate integration of N-bodies undergoing close encounters and/or collisions. Standard integrators such as IAS15 and ... |
nickdavidhaynes/python-data-science-intro | week_2/your_turn_solutions.ipynb | mit | def to_binary(x):
the_sum = 0
# enumerate returns pairs of values from `x`
# as well as the index of each value
for index, value in enumerate(x):
the_sum += value * 2**index
return the_sum
my_list = [1, 1]
to_binary(my_list)
my_list = [1, 0, 0, 0, 1, 1, 0, 1]
to_binary(my_list)
"""
E... |
chseifert/tutorials | data-science/Agglomerative_Clustering.ipynb | apache-2.0 | import sklearn.metrics as sm
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import sklearn.metrics as sm
from sklearn import datasets
from sklearn.cluster import AgglomerativeClustering
iris = datasets.load_iris()
x = pd.DataFrame(iris.data)
x.columns = ['SepalLength','SepalWidth','PetalLength... |
ES-DOC/esdoc-jupyterhub | notebooks/csiro-bom/cmip6/models/sandbox-3/toplevel.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'csiro-bom', 'sandbox-3', 'toplevel')
"""
Explanation: ES-DOC CMIP6 Model Properties - Toplevel
MIP Era: CMIP6
Institute: CSIRO-BOM
Source ID: SANDBOX-3
Sub-Topics: Radiative Forcings.
Propertie... |
SatoshiNakamotoGeoscripting/SatoshiNakamotoGeoscripting | Lecture 11/Satoshi Nakamoto Lecture 11 Jupyter Notebook.ipynb | mit | from numpy import mean
import os
from os import makedirs,chdir
from os.path import exists
"""
Explanation: Team: Satoshi Nakamoto <br>
Names: Alex Levering & Hèctor Muro <br>
Lesson 10 Exercise solution
Import standard libraries
End of explanation
"""
from osgeo import ogr,osr
import folium
import simplekml
"""
Exp... |
redst4r/RC2015 | Session2/Session2_primer.ipynb | apache-2.0 | # ensure that plots are shown inline
%matplotlib inline
import numpy as np # <- efficient vector/matrix operations (similar to MATLAB)
# the next ones are not required here, but might become useful later on, check if they're installed
import matplotlib as plt # <- basic plotting
import seaborn as sns # <- fancy plo... |
jasag/Phytoliths-recognition-system | code/notebooks/Prototypes/BoW/Bag_of_Words.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
"""
Explanation: Bag of Words
Bag of Words obtiene las características de una imagen, es decir, las formas, texturas, etc., como palabras [1]. Así, se describe la imagen en función de la frecuencia de cada una de estas palabras o características.
E... |
sysid/nbs | lstm/Understanding_LSTM_alphabet.ipynb | mit | import numpy
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
from keras.utils import np_utils
# fix random seed for reproducibility
numpy.random.seed(7)
# define the raw dataset
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
# create mapping of characters to integers (0-25) a... |
zhouqifanbdh/liupengyuan.github.io | chapter2/homework/computer/4-5/201611680697-4.5.ipynb | mit | import random,math
def fuc(i,a,b):
j=0
total_1=0
total_2=0
while j<i:
j=j+1
number=random.randint(a,b)
print(number)
total_1=total_1+math.ceil(math.log(number, 2))
total_2=total_2+1/math.ceil(math.log(number, 2))
print('西格玛log(随机整数为):',total_1)
print('西格玛1... |
nborggren/zipline | docs/notebooks/tutorial.ipynb | apache-2.0 | !tail ../../zipline/examples/buyapple.py
"""
Explanation: Zipline beginner tutorial
Basics
Zipline is an open-source algorithmic trading simulator written in Python.
The source can be found at: https://github.com/quantopian/zipline
Some benefits include:
Realistic: slippage, transaction costs, order delays.
Stream-ba... |
adico-somoto/deep-learning | gan_mnist/Intro_to_GANs_Exercises.ipynb | mit | %matplotlib inline
import pickle as pkl
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('MNIST_data')
"""
Explanation: Generative Adversarial Network
In this notebook, we'll be building a generativ... |
domino14/macondo | notebooks/superleaves/generate_superleaves.ipynb | gpl-3.0 | import csv
from datetime import date
from itertools import combinations
import numpy as np
import pandas as pd
import pickle as pkl
import seaborn as sns
from string import ascii_uppercase
import time as time
%matplotlib inline
maximum_superleave_length = 6
log_file = '../logs/log_20200514.csv'
# log_file = '../logs... |
Kaggle/learntools | notebooks/ethics/raw/ex4.ipynb | apache-2.0 | # Set up feedback system
from learntools.core import binder
binder.bind(globals())
from learntools.ethics.ex4 import *
import pandas as pd
from sklearn.model_selection import train_test_split
# Load the data, separate features from target
data = pd.read_csv("../input/synthetic-credit-card-approval/synthetic_credit_car... |
datahac/jup | candidates results/.ipynb_checkpoints/Bugrov_test-checkpoint.ipynb | apache-2.0 | path = 'Sessions_Page.json'
path2 = 'Goal1CompletionLocation_Goal1Completions.json'
with open(path, 'r') as f:
sessions_page = json.loads(f.read())
with open(path2, 'r') as f:
goals_page = json.loads(f.read())
"""
Explanation: .загружаем файлы .json
End of explanation
"""
type (sessions_page)
sessions_page... |
benbovy/cosmogenic_dating | Bayes_test_4params.ipynb | mit | import math
import numpy as np
import pandas as pd
import pymc
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
"""
Explanation: Bayesian approach - Test case - 4 free parameters
An example of applying the Bayesian approach with 4 free parameters, using the PyMC package.
For more info about t... |
greg-ashby/deep-learning-nanodegree | face_generation/dlnd_face_generation.ipynb | mit | data_dir = './data'
# FloydHub - Use with data ID "R5KrjnANiKVhLWAkpXhNBe"
#data_dir = '/input'
"""
DON'T MODIFY ANYTHING IN THIS CELL
"""
import helper
helper.download_extract('mnist', data_dir)
helper.download_extract('celeba', data_dir)
"""
Explanation: Face Generation
In this project, you'll use generative adv... |
HCsoft-RD/shaolin | examples/Creating complex Dashboards.ipynb | agpl-3.0 | from IPython.display import Image #this is for displaying the widgets in the web version of the notebook
import numpy as np
from shaolin.core.dashboard import Dashboard
class ArrayScaler(Dashboard):
def __init__(self,
data,
funcs=None,
min=-100.,
... |
ANNarchy/ANNarchy | examples/tensorboard/BayesianOptimization.ipynb | gpl-2.0 | from ANNarchy import *
from ANNarchy.extensions.tensorboard import Logger
clear()
setup(dt=0.1)
COBA = Neuron(
parameters="""
El = -60.0 : population
Vr = -60.0 : population
Erev_exc = 0.0 : population
Erev_inh = -80.0 : population
Vt = -50.0 ... |
ZoranPandovski/al-go-rithms | machine_learning/Linear Regression/Linear Regression .ipynb | cc0-1.0 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
"""
Explanation: Linear Regression
The dataset USA_Housing.csv contains the following columns:
'Avg. Area Income': Avg. Income of residents of the city house is located in.
'Avg. Area House Age': Avg Age of... |
andressotov/News-Categorization-MNB | News_Categorization_MNB.ipynb | mit | %matplotlib inline
import pandas as pd
"""
Explanation: News Categorization using Multinomial Naive Bayes
by Andrés Soto
Once upon a time, while searching by internet, I discovered this site, where I found this challenge:
* Using the News Aggregator Data Set, can we predict the category (business, entertainment, etc... |
jinzishuai/learn2deeplearn | deeplearning.ai/C4.CNN/week3_ObjectDetection/hw/Car detection for Autonomous Driving/Autonomous+driving+application+-+Car+detection+-+v1.ipynb | gpl-3.0 | import argparse
import os
import matplotlib.pyplot as plt
from matplotlib.pyplot import imshow
import scipy.io
import scipy.misc
import numpy as np
import pandas as pd
import PIL
import tensorflow as tf
from keras import backend as K
from keras.layers import Input, Lambda, Conv2D
from keras.models import load_model, Mo... |
jseabold/statsmodels | examples/notebooks/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(mi... |
janusnic/21v-python | unit_20/parallel_ml/notebooks/08 - Large Scale Text Classification for Sentiment Analysis.ipynb | mit | from sklearn.feature_extraction.text import CountVectorizer
vectorizer = CountVectorizer(min_df=1)
vectorizer.fit([
"The cat sat on the mat.",
])
vectorizer.vocabulary_
"""
Explanation: Large Scale Text Classification for Sentiment Analysis
Outline of the Session
Limitations of the Vocabulary-Based Vectorizer
T... |
sorig/shogun | doc/ipython-notebooks/multiclass/KNN.ipynb | bsd-3-clause | import numpy as np
import os
SHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data')
from scipy.io import loadmat, savemat
from numpy import random
from os import path
mat = loadmat(os.path.join(SHOGUN_DATA_DIR, 'multiclass/usps.mat'))
Xall = mat['data']
Yall = np.array(mat['label'].squeeze(), dtype=n... |
mne-tools/mne-tools.github.io | dev/_downloads/f47934a488455dcef7b3567776837d1a/limo_data.ipynb | bsd-3-clause | # Authors: Jose C. Garcia Alanis <alanis.jcg@gmail.com>
#
# License: BSD-3-Clause
import numpy as np
import matplotlib.pyplot as plt
from mne.datasets.limo import load_data
from mne.stats import linear_regression
from mne.viz import plot_events, plot_compare_evokeds
from mne import combine_evoked
print(__doc__)
# ... |
PythonFreeCourse/Notebooks | week03/5_Mutability_and_Tuples.ipynb | mit | print(9876543)
"""
Explanation: <img src="images/logo.jpg" style="display: block; margin-left: auto; margin-right: auto;" alt="לוגו של מיזם לימוד הפייתון. נחש מצויר בצבעי צהוב וכחול, הנע בין האותיות של שם הקורס: לומדים פייתון. הסלוגן המופיע מעל לשם הקורס הוא מיזם חינמי ללימוד תכנות בעברית.">
<span style="text-align: r... |
junhwanjang/DataSchool | Lecture/13. 데이터 전처리/1) Scikit-Learn의 전처리 기능.ipynb | mit | from sklearn.preprocessing import scale, robust_scale, minmax_scale, maxabs_scale
x = (np.arange(10, dtype=np.float) - 3).reshape(-1, 1)
df = pd.DataFrame(np.hstack([x, scale(x), robust_scale(x), minmax_scale(x), maxabs_scale(x)]),
columns=["x", "scale(x)", "robust_scale(x)", "minmax_scale(x)", "max... |
minh-doan/deepometry | STEP_2_Digest_data.ipynb | bsd-3-clause | # Define labels of the classes and location of raw data :
data = {
'Class_1': '/raw/Class_1/',
'Class_2': '/raw/Class_2/',
'Class_3': '/raw/Class_3/',
}
# Define which filetype to be used in this raw data location:
filetype = 'cif'
# Select which channels to be included in the digested data:
channels = [3... |
google/applied-machine-learning-intensive | content/02_data/06_project_data_processing/colab.ipynb | apache-2.0 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the L... |
mldbai/mldb | drafts/Cell Magic Tutorial.ipynb | apache-2.0 | %reload_ext pymldb
"""
Explanation: Cell Magic Tutorial
Interactions with MLDB occurs via a REST API. Interacting with a REST API over HTTP from a Notebook interface can be a little bit laborious if you're using a general-purpose Python library like requests directly, so MLDB comes with a Python library called pymldb ... |
hamed/WCN3 | 1-intro-to-brian-neurons.ipynb | gpl-3.0 | tau =
eqs = '''
'''
"""
Explanation: Introduction to Brian part 1: Neurons
Adapted form brian2 tutorial
All Brian scripts start with the following. If you're trying this notebook out in IPython, you should start by running this cell.
Later we'll do some plotting in the notebook, so we activate inline plotting in the... |
akohlmey/lammps | python/examples/pylammps/simple.ipynb | gpl-2.0 | from lammps import IPyLammps
L = IPyLammps()
"""
Explanation: Example 1: Using LAMMPS with PyLammps
The LAMMPS Python package provides multiple interfaces. The PyLammps interface is a high-level abstration of the low-level lammps interface. IPyLammps further extends this interface with functions that are useful for Ju... |
aboSamoor/polyglot | notebooks/NamedEntityRecognition.ipynb | gpl-3.0 | from polyglot.downloader import downloader
print(downloader.supported_languages_table("ner2", 3))
"""
Explanation: Named Entity Extraction
Named entity extraction task aims to extract phrases from plain text that correpond to entities.
Polyglot recognizes 3 categories of entities:
Locations (Tag: I-LOC): cities, coun... |
ES-DOC/esdoc-jupyterhub | notebooks/cccma/cmip6/models/sandbox-2/seaice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'cccma', 'sandbox-2', 'seaice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Seaice
MIP Era: CMIP6
Institute: CCCMA
Source ID: SANDBOX-2
Topic: Seaice
Sub-Topics: Dynamics, Thermodynamics, Ra... |
Centre-Alt-Rendiment-Esportiu/att | notebooks/Hit Processor.ipynb | gpl-3.0 | import sys
#sys.path.insert(0, '/home/asanso/workspace/att-spyder/att/src/python/')
sys.path.insert(0, 'i:/dev/workspaces/python/att-workspace/att/src/python/')
"""
Explanation: <h1>Hit Processor</h1>
<hr style="border: 1px solid #000;">
<span>
<h2>ATT raw Hit processor.</h2>
</span>
<br>
<span>
This notebook shows ho... |
csaladenes/csaladenes.github.io | test/eroeiccs6.ipynb | mit | CFs=[50,55,60,65,70,75,80,85,90]
EROEI_els=[[8.8,9.2,8.8,10.7,11,26],
[9.2,9.6,9.2,11.2,11.5,27],
[9.6,10.1,9.7,11.6,12,27.8],
[10,10.5,10.1,12,12.4,28.6],
[10.3,10.8,10.5,12.4,12.8,29.3],
[10.7,11.1,10.8,12.7,13.2,29.9],
[11,11.5,11.2,13,13.5,30.5],
[11.2,11.7,11.5,13.3,13.8,31],
[11.5,12,11.8,13.5,14.1,31.5]]
df=pd.... |
pombredanne/https-gitlab.lrde.epita.fr-vcsn-vcsn | doc/notebooks/automaton.coaccessible.ipynb | gpl-3.0 | import vcsn
"""
Explanation: automaton.coaccessible
Create a new automaton from the coaccessible part of the input, i.e., the subautomaton whose states can be reach a final state.
Preconditions:
- None
Postconditions:
- Result.is_coaccessible
See also:
- automaton.is_coaccessible
- automaton.accessible
- automaton.tri... |
rawrgulmuffins/presentation_notes | pycon2016/tutorials/computation_statistics/sampling_soln.ipynb | mit | from __future__ import print_function, division
import numpy
import scipy.stats
import matplotlib.pyplot as pyplot
from ipywidgets import interact, interactive, fixed
import ipywidgets as widgets
# seed the random number generator so we all get the same results
numpy.random.seed(18)
# some nicer colors from http:/... |
feststelltaste/software-analytics | notebooks/SWOT analysis for spotting worthless code.ipynb | gpl-3.0 | import pandas as pd
coverage = pd.read_csv("datasets/jacoco_production_coverage_spring_petclinic.csv")
coverage.head()
"""
Explanation: Introduction
In this short blog post, I want to show you an idea where you take some very detailed datasets from a software project and transform it into a representation where manag... |
undercertainty/ou_nlp | semeval_experiments/Building a dataframe from a core file v.2.ipynb | apache-2.0 | filename='semeval2013-task7/semeval2013-Task7-5way/beetle/train/Core/FaultFinding-BULB_C_VOLTAGE_EXPLAIN_WHY1.xml'
"""
Explanation: A simple (ie. no error checking or sensible engineering) notebook to extract the student answer data from a single xml file.
I'll also export the data to a csv file at the end of this, s... |
hannorein/variations | Figure1.ipynb | gpl-3.0 | import rebound
import numpy as np
%matplotlib inline
import matplotlib
import matplotlib.pyplot as plt
"""
Explanation: Figure 1
This notebook recreates Figure 1 in Rein & Tamayo 2016. The figure illustrates the use of second order variational equations in an $N$-body simulation.
We start by import the REBOUND, numpy ... |
griffinfoster/fundamentals_of_interferometry | 1_Radio_Science/1_4_radio_regime.ipynb | gpl-2.0 | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
from IPython.display import HTML
HTML('../style/course.css') #apply general CSS
"""
Explanation: Outline
Glossary
1. Radio Science using Interferometric Arrays
Previous: 1.3 Radiation transport
Next: 1.5 Black body radiation
Section status: <s... |
GoogleCloudPlatform/covid-19-open-data | examples/exponential_modeling.ipynb | apache-2.0 | ESTIMATE_DAYS = 3
data_key = 'IT'
date_limit = '2020-03-17'
import pandas as pd
import seaborn as sns
sns.set()
df = pd.read_csv(f'https://storage.googleapis.com/covid19-open-data/v3/location/{data_key}.csv').set_index('date')
"""
Explanation: Exponential Modeling of COVID-19 Confirmed Cases
This notebook explores m... |
FZJ-IEK3-VSA/tsam | examples/predefined_sequence_example.ipynb | mit | %load_ext autoreload
%autoreload 2
import copy
import os
import pandas as pd
import matplotlib.pyplot as plt
import tsam.timeseriesaggregation as tsam
%matplotlib inline
"""
Explanation: tsam - 2. Example
Example usage of the time series aggregation module (tsam)
Date: 29.06.2019
Author: Maximilian Hoffmann
Import pan... |
gaoshuming/udacity | language-translation/dlnd_language_translation.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... |
WomensCodingCircle/CodingCirclePython | Lesson07_ListsandTuples/Lists and Tuples.ipynb | mit | sushi_order = ['unagi', 'hamachi', 'otoro']
prices = [6.50, 5.50, 15.75]
print(sushi_order)
print(prices)
"""
Explanation: Lists and Tuples
Lists Recap
A list is a sequence of values. These values can be anything: strings, numbers, booleans, even other lists.
To make a list you put the items separated by commas betwee... |
harmsm/pythonic-science | labs/00.0_python-practice/intro-to-python-homework_key.ipynb | unlicense | import numpy as np
y = np.arctan(5)
"""
Explanation: Intro to Python Homework
Write a line of code that stores the value of the $atan(5)$ in the variable y.
End of explanation
"""
x = 2
y = 5*(x**4) - 3*x**2 + 0.5*x - 20
"""
Explanation: In words, what the math.ceil and math.floor functions do?
They return round ... |
transcranial/keras-js | notebooks/layers/convolutional/Conv1D.ipynb | mit | data_in_shape = (5, 2)
conv = Conv1D(4, 3, strides=1, padding='valid', dilation_rate=1, activation='linear', use_bias=True)
layer_0 = Input(shape=data_in_shape)
layer_1 = conv(layer_0)
model = Model(inputs=layer_0, outputs=layer_1)
# set weights to random (use seed for reproducibility)
weights = []
for w in model.get... |
ES-DOC/esdoc-jupyterhub | notebooks/miroc/cmip6/models/nicam16-9d-l78/seaice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'miroc', 'nicam16-9d-l78', 'seaice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Seaice
MIP Era: CMIP6
Institute: MIROC
Source ID: NICAM16-9D-L78
Topic: Seaice
Sub-Topics: Dynamics, Thermody... |
ES-DOC/esdoc-jupyterhub | notebooks/ncc/cmip6/models/noresm2-hh/toplevel.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'ncc', 'noresm2-hh', 'toplevel')
"""
Explanation: ES-DOC CMIP6 Model Properties - Toplevel
MIP Era: CMIP6
Institute: NCC
Source ID: NORESM2-HH
Sub-Topics: Radiative Forcings.
Properties: 85 (42 ... |
mayank-johri/LearnSeleniumUsingPython | Section 3 - Machine Learning/UnSupervised Learning Algorithm/2. Clustering performance evaluation.ipynb | gpl-3.0 | actual = [1, 2, 3 , 5, 10, 11]
predicted = [1, 10, 11, 3, 2, 5 ]
"""
Explanation: Clustering performance evaluation
Evaluating the performance of a clustering algorithm is not as trivial as counting the number of errors or the precision and recall of a supervised classification algorithm. In particular any evaluation... |
sbussmann/sensor-fusion | Code/Rotate Sensor Data to Vehicle Reference Frame.ipynb | mit | import pandas as pd
%matplotlib inline
# load the raw data
df = pd.read_csv('../Data/shaneiphone_exp2.csv')
"""
Explanation: Goal: rotate XYZ signals to vehicle reference frame
Experiment: I drove my car from home to Censio and back. My phone rested on my seat facing forwards for the trip to Censio. Nick was in the... |
GoogleCloudPlatform/ml-design-patterns | 05_resilience/batch_serving.ipynb | apache-2.0 | !find export/probs/
%%bash
LOCAL_DIR=$(find export/probs | head -2 | tail -1)
BUCKET=ai-analytics-solutions-kfpdemo
gsutil rm -rf gs://${BUCKET}/mlpatterns/batchserving
gsutil cp -r $LOCAL_DIR gs://${BUCKET}/mlpatterns/batchserving
gsutil ls gs://${BUCKET}/mlpatterns/batchserving
"""
Explanation: Batch Serving Design... |
ematvey/tensorflow-seq2seq-tutorials | 1-seq2seq.ipynb | mit | x = [[5, 7, 8], [6, 3], [3], [1]]
"""
Explanation: Simple dynamic seq2seq with TensorFlow
This tutorial covers building seq2seq using dynamic unrolling with TensorFlow.
I wasn't able to find any existing implementation of dynamic seq2seq with TF (as of 01.01.2017), so I decided to learn how to write my own, and docum... |
CyberCRI/dataanalysis-herocoli-redmetrics | v1.52/Tests/2.1 Game sessions tests.ipynb | cc0-1.0 | %run "../Functions/2. Game sessions.ipynb"
import unidecode
"""
Explanation: Preparation
End of explanation
"""
accented_string = "Enormément"
# accented_string is of type 'unicode'
unaccented_string = unidecode.unidecode(accented_string)
unaccented_string
# unaccented_string contains 'Malaga'and is of type 'str'
... |
leonhardbrenner/buckysoap | AtomAndElement.ipynb | mit | import sys
sys.path += ['/home/lbrenner/buckysoap/src']
import buckysoap as bs
from buckysoap import Atom, Element, Ring, Field
#Monkey patch Element to display rows
element_display = Element.display
def display(element, *a, **kw):
element_display(element, *a, **kw)
print "(%s rows)" % len(element)
return ... |
mne-tools/mne-tools.github.io | stable/_downloads/299b3deaa8eb66e88d34f06090d06628/evoked_ers_source_power.ipynb | bsd-3-clause | # Authors: Luke Bloy <luke.bloy@gmail.com>
# Eric Larson <larson.eric.d@gmail.com>
#
# License: BSD-3-Clause
import os.path as op
import numpy as np
import mne
from mne.cov import compute_covariance
from mne.datasets import somato
from mne.time_frequency import csd_morlet
from mne.beamformer import (make_dic... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.