repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
DB2-Samples/db2jupyter | Db2 Time and Date Functions.ipynb | apache-2.0 | %run db2.ipynb
"""
Explanation: <a id="top"></a>
Db2 11 Time and Date Functions
There are plenty of new date and time functions found in Db2 11. These functions allow you to extract portions from a date
and format the date in a variety of different ways. While Db2 already has a number of date and time functions, these... |
facundoq/facundoq.github.io | courses/images/res/material_resuelto/04_incrustacion/Tutorial de Composición de Imágenes.ipynb | gpl-2.0 | import skimage.io # para abrir imagenes
import numpy as np # procesamiento matricial
import matplotlib.pyplot as plt # para mostrar imagenes
%matplotlib inline
def dibujar_objeto_en_imagen_V1(img, objeto, posicion):
# dibuja el objeto pasado como argumento en la imagen "img"
# se espera que el objeto tenga c... |
tensorflow/docs-l10n | site/en-snapshot/hub/tutorials/semantic_similarity_with_tf_hub_universal_encoder.ipynb | apache-2.0 | # Copyright 2018 The TensorFlow Hub Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
renatocoutinho/ode_examples | Numerical Integration Tutorial.ipynb | mit | %matplotlib inline
from numpy import *
from matplotlib.pyplot import *
# time intervals
dt = 0.5
tt = arange(0, 10, dt)
# initial condition
xx = [0.1]
def f(x):
return x * (1.-x)
# loop over time
for t in tt[1:]:
xx.append(xx[-1] + dt * f(xx[-1]))
# plotting
plot(tt, xx, '.-')
ta = arange(0, 10, 0.01)
plot(... |
quole/gensim | docs/notebooks/Similarity_Queries.ipynb | lgpl-2.1 | import logging
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
import os
import tempfile
TEMP_FOLDER = tempfile.gettempdir()
print('Folder "{}" will be used to save temporary dictionary and corpus.'.format(TEMP_FOLDER))
"""
Explanation: Similarity Queries
Don't forget to se... |
charlesreid1/rejoyce | Lestrygonians Part 2.ipynb | mit | # In case we want to plot something:
%matplotlib inline
from __future__ import division
import nltk, re
import numpy as np
# The io module makes unicode easier to deal with
import io
def p():
print "-"*20
file_contents = io.open('txt/08lestrygonians.txt','r').read()
print type(file_contents)
# Tokenize the ch... |
feststelltaste/software-analytics | prototypes/Hierarchically set Bounded Contexts based on Java Annotations.ipynb | gpl-3.0 | import py2neo
import pandas as pd
graph = py2neo.Graph()
query = """
MATCH
(a:Artifact { name: "spring-petclinic"})-[*]->
(packageInfo:Java { name: "package-info"})-[:ANNOTATED_BY]->
(anno:Annotation)-[:OF_TYPE]->(annoType:Type { name: "TechnicalAspect"}),
(anno)-[:HAS]->(v:Value),
(packageInfo)<... |
TitasNandi/Summer_Project | gensim-0.12.4/docs/notebooks/deepir.ipynb | apache-2.0 | import re
contractions = re.compile(r"'|-|\"")
# all non alphanumeric
symbols = re.compile(r'(\W+)', re.U)
# single character removal
singles = re.compile(r'(\s\S\s)', re.I|re.U)
# separators (any whitespace)
seps = re.compile(r'\s+')
# cleaner (order matters)
def clean(text):
text = text.lower()
text = contr... |
smousavi05/EQTransformer | examples/downloading.ipynb | mit | from EQTransformer.utils.downloader import makeStationList, downloadMseeds
"""
Explanation: (I) Downloading Continuous Data
This notebook demonstrates the use of EQTransformer for downloading continuous data from seismic networks.
End of explanation
"""
help(makeStationList)
"""
Explanation: You can use help() to l... |
google-research/ott | docs/notebooks/gromov_wasserstein.ipynb | apache-2.0 | !pip install ott-jax
from IPython import display
import jax
from jax import numpy as jnp
from jax import random
import numpy as np
from matplotlib import animation
from matplotlib import cm
import matplotlib.pyplot as plt
import mpl_toolkits.mplot3d.axes3d as p3
import ott
from ott.core import gromov_wasserstein as g... |
amcdawes/QMlabs | Chapter 13 - Hydrogen Solutions.ipynb | mit | from sympy.physics.hydrogen import R_nl
from sympy.functions.special.spherical_harmonics import Ynm
from sympy import *
"""
Explanation: Hydrogen functions
Start with some imports fro Symbolic Python library:
End of explanation
"""
var("r theta phi t w1 w2")
"""
Explanation: Define some variables, radial, polar, az... |
UltronAI/Deep-Learning | CS231n/assignment1/.ipynb_checkpoints/two_layer_net-checkpoint.ipynb | mit | # A bit of setup
import numpy as np
import matplotlib.pyplot as plt
from cs231n.classifiers.neural_net import TwoLayerNet
from __future__ import print_function
%matplotlib inline
plt.rcParams['figure.figsize'] = (10.0, 8.0) # set default size of plots
plt.rcParams['image.interpolation'] = 'nearest'
plt.rcParams['im... |
srp33/ShinyLearner | Demo/Execute_Algorithms.ipynb | mit | %%bash
# This step may or may not be necessary on your system:
pip3 install --upgrade pip
# You only need to install these modules once
pip3 install pmlb pandas numpy
"""
Explanation: Example classification analysis using ShinyLearner
By Erica Suh and Stephen Piccolo
This notebook illustrates how to perform a benchm... |
jonahgolden/Jonah_Final_Project | src/.ipynb_checkpoints/solar_calculator-checkpoint.ipynb | mit | def Solar_Power_Calculator(Day_Of_Year,Lattitude,Hour_of_Day):
'''This function will tell you how much power the sun is '''
# Calculating Theta D
ThetaD = (2*np.pi*Day_Of_Year)/365
# Calculating distance
# Constants for calculating distance
Dis_n = [0,1,2]
Dis_an = [1.00011,0.034221,0.000719... |
NelisW/ComputationalRadiometry | 08-ModtranFileProcessing.ipynb | mpl-2.0 | # to set up the Python environment.
get_ipython().run_line_magic('matplotlib', 'inline')
import numpy as np
import pandas as pd
import pyradi.ryfiles as ryfiles
import pyradi.ryplot as ryplot
import pyradi.rymodtran as rymodtran
import pyradi.ryutils as ryutils
from IPython.display import display
from IPython.display ... |
RyanAlberts/Springbaord-Capstone-Project | Mini_Project_Linear_Regression.ipynb | mit | # special IPython command to prepare the notebook for matplotlib and other libraries
%pylab inline
import numpy as np
import pandas as pd
import scipy.stats as stats
import matplotlib.pyplot as plt
import sklearn
import seaborn as sns
# special matplotlib argument for improved plots
from matplotlib import rcParams
... |
mne-tools/mne-tools.github.io | 0.20/_downloads/b6ed91fbff318e8f41327003eca14299/plot_read_and_write_raw_data.ipynb | bsd-3-clause | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License: BSD (3-clause)
import mne
from mne.datasets import sample
print(__doc__)
data_path = sample.data_path()
fname = data_path + '/MEG/sample/sample_audvis_raw.fif'
raw = mne.io.read_raw_fif(fname)
# Set up pick list: MEG + STI 014 - bad channels
... |
tclaudioe/Scientific-Computing | SC1/Bonus_Finding_2_Chebyshev_Points_Graphically.ipynb | bsd-3-clause | import numpy as np
import matplotlib.pyplot as plt
from ipywidgets import interact
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
from matplotlib.ticker import LinearLocator, FormatStrFormatter
import matplotlib as mpl
mpl.rcParams['font.size'] = 14
mpl.rcParams['axes.labelsize'] = 20
mpl.rcParams['x... |
google-research/meta-dataset | Intro_to_Metadataset.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... |
zakandrewking/cobrapy | documentation_builder/faq.ipynb | lgpl-2.1 | from __future__ import print_function
import cobra.test
model = cobra.test.create_test_model()
for metabolite in model.metabolites:
metabolite.id = "test_" + metabolite.id
try:
model.metabolites.get_by_id(model.metabolites[0].id)
except KeyError as e:
print(repr(e))
"""
Explanation: FAQ
This document wil... |
mne-tools/mne-tools.github.io | 0.17/_downloads/f968268e52dac4491a98428e86c5c6e9/plot_introduction.ipynb | bsd-3-clause | import mne
"""
Explanation: Basic MEG and EEG data processing
MNE-Python reimplements most of MNE-C's (the original MNE command line utils)
functionality and offers transparent scripting.
On top of that it extends MNE-C's functionality considerably
(customize events, compute contrasts, group statistics, time-frequenc... |
turbomanage/training-data-analyst | courses/machine_learning/deepdive2/structured/solutions/4a_sample_babyweight.ipynb | apache-2.0 | %%bash
sudo pip freeze | grep google-cloud-bigquery==1.6.1 || \
sudo pip install google-cloud-bigquery==1.6.1
"""
Explanation: LAB 4a: Creating a Sampled Dataset.
Learning Objectives
Setup up the environment
Sample the natality dataset to create train/eval/test sets
Preprocess the data in Pandas dataframe
Introduct... |
kingmolnar/DataScienceProgramming | 09-Machine-Learning-II/HW09/README_orig.ipynb | cc0-1.0 | # Loading python packages and APD data file (this step does not have to be included in hw6_answers.py)
import pandas as pd
import numpy as np
df = pd.read_csv('/home/data/APD/COBRA-YTD2017.csv.gz')
"""
Explanation: Homework 6
Use this notebook to work on your answers and check solutions. You can then submit your fun... |
ES-DOC/esdoc-jupyterhub | notebooks/ec-earth-consortium/cmip6/models/ec-earth3-gris/toplevel.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'ec-earth-consortium', 'ec-earth3-gris', 'toplevel')
"""
Explanation: ES-DOC CMIP6 Model Properties - Toplevel
MIP Era: CMIP6
Institute: EC-EARTH-CONSORTIUM
Source ID: EC-EARTH3-GRIS
Sub-Topics: ... |
KitwareMedical/ITKUltrasound | examples/RFToBModeGeneration.ipynb | apache-2.0 | # Install notebook dependencies
import sys
#!{sys.executable} -m pip install itk itk-ultrasound numpy matplotlib itkwidgets
import itk
from matplotlib import pyplot as plt
from itkwidgets import view, compare
"""
Explanation: RF to B-Mode Generation
Ultrasound imaging employs acoustic pressure waves to gather informa... |
alsrgv/tensorflow | tensorflow/lite/tutorials/post_training_integer_quant.ipynb | apache-2.0 | ! pip uninstall -y tensorflow
! pip install -U tf-nightly
import tensorflow as tf
tf.enable_eager_execution()
! git clone --depth 1 https://github.com/tensorflow/models
import sys
import os
if sys.version_info.major >= 3:
import pathlib
else:
import pathlib2 as pathlib
# Add `models` to the python path.
mo... |
hparik11/Deep-Learning-Nanodegree-Foundation-Repository | intro-to-tflearn/TFLearn_Sentiment_Analysis.ipynb | mit | import pandas as pd
import numpy as np
import tensorflow as tf
import tflearn
from tflearn.data_utils import to_categorical
"""
Explanation: Sentiment analysis with TFLearn
In this notebook, we'll continue Andrew Trask's work by building a network for sentiment analysis on the movie review data. Instead of a network w... |
kcyu1993/ML_course_kyu | labs/ex01/template/taskB.ipynb | mit | np.random.seed(10)
p, q = (np.random.rand(i, 2) for i in (4, 5))
p_big, q_big = (np.random.rand(i, 80) for i in (100, 120))
print(p, "\n\n", q)
"""
Explanation: Data Generation
End of explanation
"""
def naive(p, q):
''' fill your code in here...
'''
"""
Explanation: Solution
End of explanation
"""
rows,... |
balarsen/pymc_learning | Inversion/Inversion1.ipynb | bsd-3-clause |
xtrue = 2 # this value is unknown in the real application
x = pymc.rnormal(0, 0.01, size=10000) # initial guess
for i in range(5):
X = pymc.Normal('X', x.mean(), 1./x.var())
Y = X*X # f(x) = x*x
OBS = pymc.Normal('OBS', Y, 0.1, value=xtrue*xtrue+pymc.rnormal(0... |
HrantDavtyan/Data_Scraping | 2018/Class2.ipynb | apache-2.0 | import numpy as np #for numeric operations
import pandas as pd #for dealing with dataframes
import matplotlib.pyplot as plt #for visualization
import requests #get html
from bs4 import BeautifulSoup #for scraping
from pprint import pprint #for pretty printing
"""
Explanation: Scraping HTML pages
This notebook provide... |
phobson/mpl-probscale | docs/tutorial/closer_look_at_plot_pos.ipynb | bsd-3-clause | %matplotlib inline
import warnings
warnings.simplefilter('ignore')
import numpy
from matplotlib import pyplot
from scipy import stats
import seaborn
clear_bkgd = {'axes.facecolor':'none', 'figure.facecolor':'none'}
seaborn.set(style='ticks', context='talk', color_codes=True, rc=clear_bkgd)
import probscale
def fo... |
karllessard/tensorflow | tensorflow/python/ops/numpy_ops/g3doc/TensorFlow_NumPy_Keras_and_Distribution_Strategy.ipynb | apache-2.0 | !pip install --quiet --upgrade tf-nightly
import tensorflow as tf
import tensorflow.experimental.numpy as tnp
# Creates 3 logical GPU devices for demonstrating distribution.
gpu_device = tf.config.list_physical_devices("GPU")[0]
tf.config.set_logical_device_configuration(
gpu_device, [tf.config.LogicalDeviceConfi... |
serge-sans-paille/talks | pyconfr2015/PythranFR 2015.ipynb | mit | import numpy
n = 10
A = numpy.random.random(n)
print(A)
"""
Explanation: We don't need your loop
by serge_sans_paille
Quarkslab / Télécom Bretagne / Namek
PyConFR 2015
Une brève histoire de la boucle
Assembleur
.L3:
addsd (%rsi), %xmm0
addq $8, %rsi
cmpq %rax, %rsi
jne .L3
FORTRAN
fortran
... |
ghvn7777/ghvn7777.github.io | content/fluent_python/15_with.ipynb | apache-2.0 | # for item in my_list:
# if item.flavor == 'banana':
# break
# else:
# raise ValueError('No banana flavor found!')
"""
Explanation: 本章讨论其他语言不常见的流程控制,用户可能会忽略这些特性:
with 语句和上下文管理器
for while 和 try 语句的 else 子句
with 语句会设置一个临时的上下文,交给上下文管理器对象控制,并负责清理上下文。这么做能避免错误并减少样板代码,因此 API 更安全,更易于使用。除了自动关闭文件之外,with 块还有很多用... |
rasbt/algorithms_in_ipython_notebooks | ipython_nbs/search/breadth-first-search.ipynb | gpl-3.0 | graph = {}
graph['You'] = ['Elijah', 'Marissa', 'Nikolai', 'Cassidy']
graph['Elijah'] = ['You']
graph['Marissa'] = ['You']
graph['Nikolai'] = ['John', 'Thomas', 'You']
graph['Cassidy'] = ['John', 'You']
graph['John'] = ['Cassidy', 'Nikolai']
graph['Thomas'] = ['Nikolai', 'Mario']
graph['Mario'] = ['Thomas']
"""
Expla... |
israelzuniga/spark_streaming_class | spark_streaming_class/TwitterTrends_Socket/Twitter_Trends_Completo.ipynb | mit | from pyspark import SparkContext
from pyspark.streaming import StreamingContext
from pyspark.sql import SQLContext
from pyspark.sql.functions import desc
from collections import namedtuple
# Namedtuple: https://pymotw.com/2/collections/namedtuple.html, http://stackoverflow.com/questions/2970608/what-are-named-tuples-i... |
M-R-Houghton/euroscipy_2015 | scikit_image/lectures/solutions_012.ipynb | mit | import matplotlib.pyplot as plt
import numpy as np
"""
Explanation: Color and exposure
End of explanation
"""
import skdemo
from skimage import data
color_image = data.chelsea()
red_image = np.zeros_like(color_image)
green_image = np.zeros_like(color_image)
blue_image = np.zeros_like(color_image)
red_image[:, :, 0... |
karlstroetmann/Artificial-Intelligence | Python/1 Search/A-Star-IDA-Star.ipynb | gpl-2.0 | import heapq
"""
Explanation: A$^$-IDA$^$ Search
End of explanation
"""
def search(start, goal, next_states, heuristic, size):
Parent = { start: start }
PrioQueue = [ (heuristic(start, goal), [start]) ]
while len(Parent) < size and PrioQueue:
_, Path = heapq.heappop(PrioQueue)
state ... |
nslatysheva/data_science_blogging | model_optimization/tricks_of_the_trade.ipynb | gpl-3.0 | import wget
import pandas as pd
import numpy as np
from sklearn.cross_validation import train_test_split
# Import the dataset
data_url = 'https://raw.githubusercontent.com/nslatysheva/data_science_blogging/master/datasets/spam/spam_dataset.csv'
dataset = wget.download(data_url)
dataset = pd.read_csv(dataset, sep=",")
... |
chetan51/nupic.research | projects/dynamic_sparse/notebooks/ExperimentAnalysis-Neurips-debug-hebbianonly.ipynb | gpl-3.0 | %load_ext autoreload
%autoreload 2
import sys
sys.path.append("../../")
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import glob
import tabulate
import pprint
import click
import numpy as np
import pandas as pd
from ray.tune.commands import *
... |
keras-team/keras-io | examples/keras_recipes/ipynb/antirectifier.ipynb | apache-2.0 | import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
"""
Explanation: Simple custom layer example: Antirectifier
Author: fchollet<br>
Date created: 2016/01/06<br>
Last modified: 2020/04/20<br>
Description: Demonstration of custom layer creation.
Introduction
This example shows how ... |
do-mpc/do-mpc | documentation/source/example_gallery/oscillating_masses_discrete.ipynb | lgpl-3.0 | import numpy as np
import sys
from casadi import *
# Add do_mpc to path. This is not necessary if it was installed via pip
sys.path.append('../../../')
# Import do_mpc package:
import do_mpc
"""
Explanation: Oscillating masses
In this Jupyter Notebook we illustrate the example oscillating_masses_discrete.
Open an in... |
mne-tools/mne-tools.github.io | 0.17/_downloads/d2225f0bc4afb15d68d5db10add352ca/plot_covariance_whitening_dspm.ipynb | bsd-3-clause | # Author: Denis A. Engemann <denis.engemann@gmail.com>
#
# License: BSD (3-clause)
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne import io
from mne.datasets import spm_face
from mne.minimum_norm import apply_inverse, make_inverse_operator
from mne.cov import compute_covariance
print(__doc__)... |
GEMScienceTools/rmtk | notebooks/vulnerability/derivation_fragility/R_mu_T_dispersion/ruiz_garcia_miranda/ruiz-garcia_miranda.ipynb | agpl-3.0 | from rmtk.vulnerability.derivation_fragility.R_mu_T_dispersion.ruiz_garcia_miranda import RGM2007
from rmtk.vulnerability.common import utils
import scipy.stats as stat
%matplotlib inline
"""
Explanation: Ruiz-García and Miranda (2007)
The aim of this procedure is the estimation of the median spectral acceleration v... |
AtmaMani/pyChakras | python_crash_course/seaborn_cheat_sheet_3.ipynb | mit | import seaborn as sns
%matplotlib inline
flights = sns.load_dataset('flights')
flights.head()
flights.shape
"""
Explanation: Seaborn - matrix and regression plots
End of explanation
"""
flights_pv = flights.pivot_table(index='month', columns='year', values='passengers')
flights_pv.head()
"""
Explanation: Let us pi... |
mathnathan/notebooks | Intro to PyTorch.ipynb | mit | import torch as t
# Tensors
a = t.tensor([1,2,3])
# Can specify type during construction
a = t.tensor([1,2,3], dtype=t.half)
# Can cast to different types once constructed
a
a.double()
a.float()
a.short()
a.long()
"""
Explanation: What is PyTorch?
It’s a Python based scientific computing package targeted at two ... |
tensorflow/lattice | docs/tutorials/keras_layers.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... |
mraty/applied-data-science | course-2_applied_plotting/Assignment4.ipynb | mit | import pandas as pd
import numpy as np
data_url = "https://fred.stlouisfed.org/graph/fredgraph.csv?chart_type=line&recession_bars=on&log_scales=&bgcolor=%23e1e9f0&graph_bgcolor=%23ffffff&fo=Open+Sans&ts=12&tts=12&txtcolor=%23444444&show_legend=yes&show_axis_titles=yes&drp=0&cosd=2015-12-26&coed=2017-01-30&height=450&s... |
MIT-LCP/mimic-code | mimic-iii/tutorials/data_viz/02_dashwebapp.ipynb | mit | # # Dash packages installation
# !conda install -c conda-forge dash-renderer -y
# !conda install -c conda-forge dash -y
# !conda install -c conda-forge dash-html-components -y
# !conda install -c conda-forge dash-core-components -y
# !conda install -c conda-forge plotly -y
import dash
import dash_core_components as dc... |
ledeprogram/algorithms | class7/homework/najmabadi_shannon_7_1.ipynb | gpl-3.0 | import numpy as np
import pandas as pd
import pydotplus
import matplotlib.pyplot as plt
%matplotlib inline
from pandas.tools.plotting import scatter_matrix
from sklearn import datasets
from sklearn import tree
from sklearn.cross_validation import train_test_split
from sklearn import metrics
from sklearn.externals.six ... |
pm4py/pm4py-core | notebooks/1_event_data.ipynb | gpl-3.0 | import pandas as pd
df = pd.read_csv('data/running_example.csv', sep=';')
df
"""
Explanation: Handling Event Data
by: Sebastiaan J. van Zelst
Process mining exploits Event Logs to generate knowledge of a process.
A wide variety of information systems, e.g., SAP, ORACLE, SalesForce, etc., allow us to extract, in one w... |
pierluigiferrari/fcn8s_tensorflow | fcn8s_tutorial.ipynb | gpl-3.0 | from fcn8s_tensorflow import FCN8s
from data_generator.batch_generator import BatchGenerator
from helpers.visualization_utils import print_segmentation_onto_image, create_video_from_images
from cityscapesscripts.helpers.labels import TRAINIDS_TO_COLORS_DICT, TRAINIDS_TO_RGBA_DICT
from math import ceil
import time
impo... |
mattiasostmar/wlm2wikidata | explore_bbr_data.ipynb | cc0-1.0 | cursor.execute("SELECT * FROM monuments_all WHERE country='se-bbr'")
all_bbr = pd.io.sql.read_sql('select * from monuments_all WHERE country="se-bbr"', conn)
all_bbr.shape
"""
Explanation: Monuments_all
End of explanation
"""
table_name = "se_bbr" # I've renamed monuments_se-bbr_(se) to 'se_bbr' in local database, c... |
JonathonBeauregardII/Advanced-Data-Mining-Project-IBM | IBM Data Science Experence IPython Notebooks/DataExploration copy 1.ipynb | gpl-3.0 | testdata['SOC_NAME'].value_counts()
"""
Explanation: Here, we transform some strings to lowercase. This is because there are duplicate entries in the dataset which in both upper and lower.
This increases redundancy
End of explanation
"""
testdata['SOC_NAME'].value_counts().count()
df = pd.DataFrame({'SOC_NAME': tes... |
arkottke/pysra | examples/example-01.ipynb | mit | import matplotlib.pyplot as plt
import numpy as np
import pysra
%matplotlib inline
# Increased figure sizes
plt.rcParams["figure.dpi"] = 120
"""
Explanation: Example 1 : Time series SRA
Time series analysis to compute surface response spectrum and site
amplification functions.
End of explanation
"""
fname = "dat... |
guyk1971/deep-learning | reinforcement/Q-learning-cart_w.ipynb | mit | import gym
import tensorflow as tf
import numpy as np
"""
Explanation: Deep Q-learning
In this notebook, we'll build a neural network that can learn to play games through reinforcement learning. More specifically, we'll use Q-learning to train an agent to play a game called Cart-Pole. In this game, a freely swinging p... |
dipsuw/data-512-a1 | src/hcds-a1-data-curation.ipynb | mit | # import the required libraries
import requests
import csv
import pandas as pd
import json
from datetime import datetime, timedelta
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: English Wikipedia page views, 2008 - 2017
Implementated by Deepa Agrawal
deepa15@uw.edu
Oct 2017
Data Curation Assignme... |
tensorflow/federated | docs/tutorials/simulations_with_accelerators.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... |
oscaribv/pyaneti | pyaneti_extras/.ipynb_checkpoints/synthetic_k2100-checkpoint.ipynb | gpl-3.0 | #Imort modules
from __future__ import print_function, division, absolute_import
import numpy as np
#Import citlalatonac from pyaneti_extras, note that pyaneti has to be compiled in your machine
#and pyaneti has to be in your PYTHONPATH, e.g., you have to add in your bashrc file
#export PYTHONPATH=${PYTHONPATH}:/pathtop... |
GEMScienceTools/rmtk | notebooks/vulnerability/derivation_fragility/R_mu_T_no_dispersion/dolsek_fajfar/dolsek_fajfar.ipynb | agpl-3.0 | from rmtk.vulnerability.derivation_fragility.R_mu_T_no_dispersion.dolsek_fajfar import DF2004
from rmtk.vulnerability.common import utils
%matplotlib inline
"""
Explanation: Dolsek and Fajfar (2004)
This methodology makes use of work by Dolsek and Fajfar (2004) to estimate the inelastic displacement of a SDOF system ... |
quole/gensim | docs/notebooks/annoytutorial.ipynb | lgpl-2.1 | # pip install watermark
%reload_ext watermark
%watermark -v -m -p gensim,numpy,scipy,psutil,matplotlib
"""
Explanation: Similarity Queries using Annoy Tutorial
This tutorial is about using the (Annoy Approximate Nearest Neighbors Oh Yeah) library for similarity queries with a Word2Vec model built with gensim.
Why use ... |
ES-DOC/esdoc-jupyterhub | notebooks/cams/cmip6/models/sandbox-1/seaice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'cams', 'sandbox-1', 'seaice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Seaice
MIP Era: CMIP6
Institute: CAMS
Source ID: SANDBOX-1
Topic: Seaice
Sub-Topics: Dynamics, Thermodynamics, Radi... |
crocha700/pyqg | docs/examples/layered.ipynb | mit | import numpy as np
from numpy import pi
from matplotlib import pyplot as plt
%matplotlib inline
import pyqg
"""
Explanation: Fully developed baroclinic instability of a 3-layer flow
End of explanation
"""
L = 1000.e3 # length scale of box [m]
Ld = 15.e3 # deformation scale [m]
kd = 1./Ld # ... |
wisner23/serenata-de-amor | develop/2016-08-13-irio-descriptive-analysis.ipynb | mit | print(data.shape)
data.head()
data.iloc[0]
def change_type_to_category(column):
data[column] = data[column].astype('category')
category_columns = ['congressperson_id',
'state', 'party', 'term_id',
'subquota_number', 'subquota_group_id',
'document_type', 'applicant_id', 'congressperson_name'... |
dbouquin/AstroHackWeek2015 | day3-machine-learning/09.1 - Linear models.ipynb | gpl-2.0 | from sklearn.datasets import make_regression
from sklearn.cross_validation import train_test_split
X, y, true_coefficient = make_regression(n_samples=80, n_features=30, n_informative=10, noise=100, coef=True, random_state=5)
X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=5)
print(X_train.shape)... |
rueedlinger/machine-learning-snippets | notebooks/unsupervised/clustering/clustering_basics_model_evaluation.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import seaborn as sns
import pandas as pd
from sklearn import cluster, datasets, manifold, metrics
"""
Explanation: Clustering Basics and Model Evaluation
Cluster analysis or clustering is the task of grouping unlabeled data, so that simila... |
turbomanage/training-data-analyst | courses/machine_learning/deepdive2/image_classification/solutions/2_mnist_models.ipynb | apache-2.0 | from datetime import datetime
import os
PROJECT = "your-project-id-here" # REPLACE WITH YOUR PROJECT ID
BUCKET = "your-bucket-id-here" # REPLACE WITH YOUR BUCKET NAME
REGION = "us-central1" # REPLACE WITH YOUR BUCKET REGION e.g. us-central1
# Do not change these
os.environ["PROJECT"] = PROJECT
os.environ["BUCKET"]... |
google-aai/sc17 | cats/step_1_to_3.ipynb | apache-2.0 | # Required libraries:
import numpy as np
import pandas as pd
import seaborn as sns
"""
Explanation: Performance Metric and Requirements
Author(s): kozyr@google.com
Before we get started on data, we have to choose our project performance metric and decide the statistical testing criteria. We'll make use of the metric ... |
diegocavalca/Studies | books/deep-learning-with-python/5.3-using-a-pretrained-convnet.ipynb | cc0-1.0 | from keras.applications import VGG16
conv_base = VGG16(weights='imagenet',
include_top=False,
input_shape=(150, 150, 3))
"""
Explanation: Using a pre-trained convnet
This notebook contains the code sample found in Chapter 5, Section 3 of Deep Learning with Python. Note that the ori... |
jinntrance/MOOC | coursera/deep-neural-network/quiz and assignments/week 13 CNN - Face recognition & Neural style transfer /Face+Recognition+for+the+Happy+House+-+v3.ipynb | cc0-1.0 | from keras.models import Sequential
from keras.layers import Conv2D, ZeroPadding2D, Activation, Input, concatenate
from keras.models import Model
from keras.layers.normalization import BatchNormalization
from keras.layers.pooling import MaxPooling2D, AveragePooling2D
from keras.layers.merge import Concatenate
from kera... |
jgomezc1/medios | NOTEBOOKS/PROBLEMA_3_7.ipynb | mit | import numpy as np
from numpy import array, cross, dot , sqrt
from sympy import *
from IPython.display import Image,Latex
Image(filename='FIGURES/Ejer3_7.png',width=250)
"""
Explanation: Problema 3.7
El tensor de tensiones en el punto P esta definido como:
$$\left[ {\begin{array}{*{20}{c}}
8&{ - 4}&1\
{ - 4}&3&{1/2}\... |
jtleider/censusdata | docs/notebooks/example2.ipynb | mit | import pandas as pd
import censusdata
pd.set_option('display.expand_frame_repr', False)
pd.set_option('display.precision', 2)
county65plus = censusdata.download('acs5', 2015, censusdata.censusgeo([('county', '*')]),
['B01001_001E', 'B01001_020E', 'B01001_021E', 'B01001_022E', 'B01001... |
arviz-devs/arviz | doc/source/user_guide/pystan2_refitting_xr_lik.ipynb | apache-2.0 | import arviz as az
import pystan
import numpy as np
import matplotlib.pyplot as plt
import scipy.stats as stats
import xarray as xr
"""
Explanation: (pystan2_refitting_xr)=
Refitting PyStan (2.x) models with ArviZ (and xarray)
ArviZ is backend agnostic and therefore does not sample directly. In order to take advantage... |
google-research/google-research | action_gap_rl/notebooks/mode_regression.ipynb | apache-2.0 | #@title Default title text
# 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, softwar... |
miykael/nipype_tutorial | notebooks/example_1stlevel.ipynb | bsd-3-clause | from nilearn import plotting
%matplotlib inline
from os.path import join as opj
import json
from nipype.interfaces.spm import Level1Design, EstimateModel, EstimateContrast
from nipype.algorithms.modelgen import SpecifySPMModel
from nipype.interfaces.utility import Function, IdentityInterface
from nipype.interfaces.io i... |
mmatera/qmnotebooks | Integracion numérica.ipynb | gpl-3.0 | def fun(x):
return np.exp(-x**2)
integr.quad(fun,0.,1.)
integr.quad(lambda x:np.exp(-x**2),0.,1.)
"""
Explanation: Integración de funciones
Integración en un intervalo finito
Para integrar numéricamente una función en un intervalo finito, usamos la rutina quad. Esta toma tres argumentos:
* Una función de un arg... |
jmschrei/pomegranate | tutorials/C_Feature_Tutorial_4_Missing_Values.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... |
awhite40/pymks | notebooks/elasticity_3D.ipynb | mit | %matplotlib inline
%load_ext autoreload
%autoreload 2
import numpy as np
import matplotlib.pyplot as plt
import timeit as tm
"""
Explanation: Linear Elasticity in 3D
Introduction
This example provides a demonstration of using PyMKS to compute the linear strain field for a two-phase composite material in 3D, and pres... |
CDIPS-AI-2017/pensieve | Notebooks/MkvChains.ipynb | apache-2.0 | import pensieve as pens
import textacy
from collections import defaultdict
from random import random
"""
Explanation: Attempting human-like speach: Markov chains
In orderto make the activitiy sentences in our memory more human-like, we can attempt to build a simple chatbot from the tex as well. A simple, and maybe nai... |
pulinagrawal/nupic | src/nupic/frameworks/viz/examples/Demo.ipynb | agpl-3.0 | from nupic.engine import Network, Dimensions
# Create Network instance
network = Network()
# Add three TestNode regions to network
network.addRegion("region1", "TestNode", "")
network.addRegion("region2", "TestNode", "")
network.addRegion("region3", "TestNode", "")
# Set dimensions on first region
region1 = network.... |
Unidata/unidata-python-workshop | notebooks/Satellite_Data/PlottingSatelliteData.ipynb | mit | from datetime import datetime
# Create variables for URL generation
# YOUR CODE GOES HERE
# Construct the data_url string
# YOUR CODE GOES HERE
# Print out your URL and verify it works!
# YOUR CODE GOES HERE
"""
Explanation: <a name="pagetop"></a>
<div style="width:1000 px">
<div style="float:right; width:98 px; h... |
rishuatgithub/MLPy | torch/PYTORCH_NOTEBOOKS/00-Crash-Course-Topics/01-Crash-Course-Pandas/02-DataFrames.ipynb | apache-2.0 | import pandas as pd
import numpy as np
from numpy.random import randn
np.random.seed(101)
df = pd.DataFrame(randn(5,4),index='A B C D E'.split(),columns='W X Y Z'.split())
df
"""
Explanation: <a href='http://www.pieriandata.com'><img src='../Pierian_Data_Logo.png'/></a>
<center><em>Copyright Pierian Data</em></cen... |
ES-DOC/esdoc-jupyterhub | notebooks/snu/cmip6/models/sandbox-1/atmoschem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'snu', 'sandbox-1', 'atmoschem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmoschem
MIP Era: CMIP6
Institute: SNU
Source ID: SANDBOX-1
Topic: Atmoschem
Sub-Topics: Transport, Emissions Co... |
RyanSkraba/beam | examples/notebooks/documentation/transforms/python/elementwise/tostring-py.ipynb | apache-2.0 | #@title Licensed under the Apache License, Version 2.0 (the "License")
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you u... |
metpy/MetPy | v0.11/_downloads/e5685967297554788de3cf5858571b23/Natural_Neighbor_Verification.ipynb | bsd-3-clause | import matplotlib.pyplot as plt
import numpy as np
from scipy.spatial import ConvexHull, Delaunay, delaunay_plot_2d, Voronoi, voronoi_plot_2d
from scipy.spatial.distance import euclidean
from metpy.interpolate import geometry
from metpy.interpolate.points import natural_neighbor_point
"""
Explanation: Natural Neighbo... |
junhwanjang/DataSchool | Lecture/12. Scikit-Learn & statsmodels 패키지 소개/3) Scikit-Learn 패키지의 샘플 데이터 - 회귀 분석용.ipynb | mit | from sklearn.datasets import load_boston
boston = load_boston()
print(boston.DESCR)
dfX = pd.DataFrame(boston.data, columns=boston.feature_names)
dfy = pd.DataFrame(boston.target, columns=["MEDV"])
df = pd.concat([dfX, dfy], axis=1)
df.tail()
df.describe()
cols = ["LSTAT", "NOX", "RM", "MEDV"]
sns.pairplot(df[cols])... |
Neuroglycerin/neukrill-net-work | notebooks/model_modifications/Fewer convolutional channels with dropout experiment (large).ipynb | mit | print('## Model structure summary\n')
print(model)
params = model.get_params()
n_params = {p.name : p.get_value().size for p in params}
total_params = sum(n_params.values())
print('\n## Number of parameters\n')
print(' ' + '\n '.join(['{0} : {1} ({2:.1f}%)'.format(k, v, 100.*v/total_params)
... |
computational-class/cc2017 | data/06.data_cleaning_Tweets.ipynb | mit | bigfile = open('/Users/chengjun/百度云同步盘/Writing/OWS/ows-raw.txt', 'rb')
chunkSize = 1000000
chunk = bigfile.readlines(chunkSize)
print len(chunk)
with open("/Users/chengjun/GitHub/cjc/data/ows_tweets_sample.txt", 'w') as f:
for i in chunk:
f.write(i)
"""
Explanation: 数据清洗之推特数据
王成军
wangchengjun@nju.edu.c... |
sdpython/pyquickhelper | _unittests/ut_helpgen/notebooks_svg/td1a_unit_test_ci.ipynb | mit | from jyquickhelper import add_notebook_menu
add_notebook_menu()
from pyensae.graphhelper import draw_diagram
"""
Explanation: 1A.soft - Tests unitaires, setup et ingéniérie logicielle
On vérifie toujours qu'un code fonctionne quand on l'écrit mais cela ne veut pas dire qu'il continuera à fonctionner à l'avenir. La ro... |
alexvmarch/pandas_intro | 02_distances.ipynb | mit | xyz = pd.read_hdf('xyz.hdf5', 'xyz')
xyz.head()
"""
Explanation: Load our previous work
HDF5's are easy to load
End of explanation
"""
from scipy.spatial.distance import pdist
def skeleton_free_boundary_distances(frame): # Note that this is frame, not DataFrame
'''
Compute all of the atom to atom distan... |
as595/AllOfYourBases | FriendsOfFiends/FriendsOfFiends.ipynb | gpl-3.0 | import numpy as np # for array manipulation
import matplotlib.pyplot as pl # for plotting stuff
from mayavi import mlab # optional
from scipy import stats # optional
"""
Explanation: First we’ll need some libraries…
End of explanation
"""
def read_sdss(filename):
datafile = open(fi... |
compsocialscience/summer-institute | 2018/materials/boulder/day2-digital-trace-data/BoulderSICSS-NoAuth.ipynb | mit | # Import the libraries we need
import json
import time
import networkx
import matplotlib.pyplot as plt
from collections import Counter
# Check working directory
os.getcwd()
# Set working directory
os.chdir('FOLDER FOR SAVING FILES')
# Check working directory
os.getcwd()
"""
Explanation: <h1>Constructing Ego Network... |
GoogleCloudPlatform/tf-estimator-tutorials | 00_Miscellaneous/tfx/tfx-pipelines/01-census-data-analysis.ipynb | apache-2.0 | import os
ROOT_DIR = '..'
DATA_DIR = ROOT_DIR + '/data'
TRAIN_DATA_DIR = DATA_DIR + '/train'
RAW_SCHEMA_DIR = ROOT_DIR + '/raw_schema'
!mkdir $DATA_DIR
!mkdir $TRAIN_DATA_DIR
!gsutil cp gs://cloud-samples-data/ml-engine/census/data/adult.data.csv $DATA_DIR
!gsutil cp gs://cloud-samples-data/ml-engine/census/data/adul... |
eshlykov/mipt-day-after-day | labs/term-4/lab-1-6.ipynb | unlicense | import numpy as np
import scipy as ps
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Работа 1.6. Измерение модуля Юнга методом акустического резонанса
Цель работы: исследование явления акустического резонанса. Измерение скорости
распространения продольных колебаний в тонких стр... |
GoogleCloudPlatform/asl-ml-immersion | notebooks/bigquery/labs/a_sample_explore_clean.ipynb | apache-2.0 | from google.cloud import bigquery
PROJECT = !gcloud config get-value project
PROJECT = PROJECT[0]
%env PROJECT=$PROJECT
"""
Explanation: Sample, Explore, and Clean Taxifare Dataset
Learning Objectives
- Practice querying BigQuery
- Sample from large dataset in a reproducible way
- Practice exploring data using Panda... |
stevenydc/2015lab1 | Lab1-git.ipynb | mit | !git status
"""
Explanation: Lab 1: Version Control with Git
End of explanation
"""
%%bash
cd /tmp
rm -rf Testing #remove if it exists
git clone git@github.com:rahuldave/Testing.git
%%bash
ls /tmp/Testing
"""
Explanation: This tutorial is largely based on the repository:
git@github.com:rdadolf/git-and-github.git
w... |
yevheniyc/C | 1c_Python_Cookbook_3/Chapter_1.ipynb | mit | p = (4, 5, 6, 7)
x, y, z, w = p # x -> 4
data = ['ACME', 50, 91.1, (2012, 12, 21)]
name, _, price, date = data # name -> 'ACME', data -> (2012, 12, 21)
s = 'Hello'
a, b, c, d, e = s # a -> H
p = (4, 5)
x, y, z = p # "ValueError"
"""
Explanation: Chapter 1 - Data Structures and Algorithms
1.1 Unpacking a Sequence ... |
NumCosmo/NumCosmo | notebooks/DataNCount/run_ascaso_mcmc_unbinned.ipynb | gpl-3.0 | #CCL cosmology
cosmo_ccl = ccl.Cosmology(Omega_c = 0.30711 - 0.048254, Omega_b = 0.048254, h = 0.677, sigma8 = 0.8822714165197718, n_s=0.96, Omega_k = 0, transfer_function='eisenstein_hu')
#ccl_cosmo_set_high_prec (cosmo_ccl)
cosmo_numcosmo, dist, ps_lin, ps_nln, hmfunc = create_nc_obj (cosmo_ccl)
psf = hmfunc.peek_p... |
dtamayo/reboundx | ipython_examples/CentralForce.ipynb | gpl-3.0 | import rebound
import reboundx
sim = rebound.Simulation()
sim.add(m=1.)
sim.add(m=1.e-3, a=1., e=0.2)
ps = sim.particles
"""
Explanation: A General Central Force
This implementation adds a central acceleration of the form $\vec{a}=Ar^\gamma\hat{r}$, where $\vec{r}$ is the vector from the central particle to the body... |
5agado/data-science-learning | machine learning/Evaluation Metrics.ipynb | apache-2.0 | import numpy as np
import pandas as pd
from sklearn import metrics
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_context("paper")
%matplotlib notebook
"""
Explanation: Table of Contents
Intro
Classification
Accuracy, precision, recall
Binary
Multi-class
Probabilities
Log Loss
Regression
Hinge... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.