repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
dariox2/CADL
session-5/session-5-part-1[1-3].ipynb
apache-2.0
# First check the Python version import sys if sys.version_info < (3,4): print('You are running an older version of Python!\n\n', 'You should consider updating to Python 3.4.0 or', 'higher as the libraries built for this course', 'have only been tested in Python 3.4 and higher.\n') ...
cwharland/data-science-from-scratch
Clustering.ipynb
mit
class KMeans: """k-means algo""" def __init__(self, k): self.k = k # number of clusters self.means = None # means of clusters def classify(self, input): """return the index of the cluster to closest to input""" return min(range(self.k), key = l...
turbomanage/training-data-analyst
courses/machine_learning/deepdive2/text_classification/solutions/rnn_encoder_decoder.ipynb
apache-2.0
import os import pickle import sys import nltk import numpy as np import pandas as pd from sklearn.model_selection import train_test_split import tensorflow as tf from tensorflow.keras.layers import ( Dense, Embedding, GRU, Input, ) from tensorflow.keras.models import ( load_model, Model, ) im...
Jackporter415/phys202-2015-work
assignments/assignment05/InteractEx03.ipynb
mit
%matplotlib inline from matplotlib import pyplot as plt import numpy as np from IPython.html.widgets import interact, interactive, fixed from IPython.display import display """ Explanation: Interact Exercise 3 Imports End of explanation """ def soliton(x, t, c, a): """Return phi(x, t) for a soliton wave with co...
CUBoulder-ASTR2600/lectures
lecture_11_arrays_plotting.ipynb
isc
%matplotlib inline """ Explanation: Plotting Arrays Using matplotlib End of explanation """ import numpy as np import matplotlib.pyplot as pl # import this for plotting routines """ Explanation: The argument after the ipython magic is called the backend for plotting. There are several available, also for creating t...
hpparvi/PyTransit
notebooks/roadrunner/roadrunner_model_example_3.ipynb
gpl-2.0
%pylab inline rc('figure', figsize=(13,6)) def plot_lc(time, flux, c=None, ylim=(0.9865, 1.0025), ax=None, alpha=1): if ax is None: fig, ax = subplots() else: fig, ax = None, ax ax.plot(time, flux, c=c, alpha=alpha) ax.autoscale(axis='x', tight=True) setp(ax, xlabel='Time [d]', ylab...
dereneaton/ipyrad
tests/API_user-guide.ipynb
gpl-3.0
import ipyrad as ip """ Explanation: User guide to the ipyrad API Welcome! This tutorial will introduce you to the basic and advanced features of working with the ipyrad API to assemble RADseq data in Python. The API offers many advantages over the command-line interface, but requires a little more work up front to le...
sz2472/foundations-homework
data and database/Homework_4_database_shengyingzhao.ipynb
mit
numbers_str = '496,258,332,550,506,699,7,985,171,581,436,804,736,528,65,855,68,279,721,120' """ Explanation: Homework #4 These problem sets focus on list comprehensions, string operations and regular expressions. Problem set #1: List slices and list comprehensions Let's start with some data. The following cell contain...
johnnyliu27/openmc
examples/jupyter/pandas-dataframes.ipynb
mit
import glob from IPython.display import Image import matplotlib.pyplot as plt import scipy.stats import numpy as np import pandas as pd import openmc %matplotlib inline """ Explanation: This notebook demonstrates how systematic analysis of tally scores is possible using Pandas dataframes. A dataframe can be automati...
ES-DOC/esdoc-jupyterhub
notebooks/pcmdi/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', 'pcmdi', 'sandbox-2', 'atmos') """ Explanation: ES-DOC CMIP6 Model Properties - Atmos MIP Era: CMIP6 Institute: PCMDI Source ID: SANDBOX-2 Topic: Atmos Sub-Topics: Dynamical Core, Radiation, Turb...
jjdblast/RoadTrafficSimulator
experiments/report.ipynb
mit
data = pd.read_table("./1.data", sep=" ") plt.plot(data['multiplier'], data['avg_speed'], '-o') """ Explanation: Запустим симулятор с фиксированными значениями времени переключения светофоров. End of explanation """ data = pd.read_table("./2.data", sep=" ") plt.plot(data['it'], data['avg_speed'], '-o') """ Explanat...
buruzaemon/natto-py
notebooks/02_わかち書き.ipynb
bsd-2-clause
from natto import MeCab text = "卓球に人生かけるなんて、気味悪いです。" wakati = MeCab("-Owakati") """ Explanation: わかち書き Parsing -O オプション natto-py を利用して文章にある語の区切りに空白を挟んで、わかち書き出力ができます。 End of explanation """ wakati.parse(text) """ Explanation: 文字列として出力 mecab の -O オプションを利用して wakati 出力を指定して返り値を文字列にする方法です。MeCab インスタンスを取得する際に下記の通り出力フォー...
tensorflow/docs-l10n
site/ko/agents/tutorials/9_c51_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...
Neuroglycerin/neukrill-net-work
notebooks/model_run_and_result_analyses/Revisiting alexnet based experiment (small).ipynb
mit
tr = np.array(model.monitor.channels['valid_y_y_1_nll'].time_record) / 3600. fig = plt.figure(figsize=(12,8)) ax1 = fig.add_subplot(111) ax1.plot(model.monitor.channels['valid_y_y_1_nll'].val_record) ax1.plot(model.monitor.channels['train_y_y_1_nll'].val_record) ax1.set_xlabel('Epochs') ax1.legend(['Valid', 'Train']) a...
yashdeeph709/Algorithms
PythonBootCamp/Complete-Python-Bootcamp-master/.ipynb_checkpoints/Object Oriented Programming-checkpoint.ipynb
apache-2.0
l = [1,2,3] """ Explanation: Object Oriented Programming Object Oriented Programming (OOP) tends to be one of the major obstacles for beginners when they are first starting to learn Python. There are many,many tutorials and lessons covering OOP so feel free to Google search other lessons, and I have also put some link...
weleen/mxnet
example/notebooks/moved-from-mxnet/cifar10-recipe.ipynb
apache-2.0
import mxnet as mx import logging import numpy as np # setup logging logger = logging.getLogger() logger.setLevel(logging.DEBUG) """ Explanation: CIFAR-10 Recipe In this notebook, we will show how to train a state-of-art CIFAR-10 network with MXNet and extract feature from the network. This example wiil cover Networ...
AaronCWong/phys202-2015-work
assignments/assignment04/MatplotlibExercises.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np """ Explanation: Visualization 1: Matplotlib Basics Exercises End of explanation """ x = np.random.randn(100) y = np.random.randn(100) plt.scatter(x,y, s = 20, c = 'b') plt.xlabel('Random Number 2') plt.ylabel('Random Number') plt.title('Random 2d...
locie/locie_notebook
base_python/multiprocessing.ipynb
lgpl-3.0
import multiprocessing as mp from time import sleep def a_long_running_function(time): sleep(time) return time # These lines are not blocking process = mp.Process(target=a_long_running_function, args=(10, )) process.start() print(f"before join, process.is_alive: {process.is_alive()}") # These one will block ...
ocean-color-ac-challenge/evaluate-pearson
evaluation-participant-c.ipynb
apache-2.0
w_412 = 0.56 w_443 = 0.73 w_490 = 0.71 w_510 = 0.36 w_560 = 0.01 """ Explanation: E-CEO Challenge #3 Evaluation Weights Define the weight of each wavelength End of explanation """ run_id = '0000000-150630000034908-oozie-oozi-W' run_meta = 'http://sb-10-16-10-55.dev.terradue.int:50075/streamFile/ciop/run/participant-...
DJCordhose/ai
notebooks/workshops/d2d/nn-intro.ipynb
mit
import warnings warnings.filterwarnings('ignore') %matplotlib inline %pylab inline import matplotlib.pylab as plt import numpy as np from distutils.version import StrictVersion import sklearn print(sklearn.__version__) assert StrictVersion(sklearn.__version__ ) >= StrictVersion('0.18.1') import tensorflow as tf t...
kaysg/NLPatelier
libexp_spaCy/libexp_spaCy.ipynb
gpl-3.0
import spacy nlp = spacy.load('en') text = u"We are living in Singapore.\nIt's blazing outside today!\n" doc = nlp(text) for token in doc: print((token.text, token.lemma, token.tag, token.pos)) for token in doc: print((token.text, token.lemma_, token.tag_, token.pos_)) # lemma means *root form* """ Explan...
jjonte/udacity-deeplearning-nd
py3/project-4/dlnd_language_translation.ipynb
unlicense
""" 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...
AlbanoCastroSousa/RESSPyLab
examples/UVC_Calibration_Example_1.ipynb
mit
import RESSPyLab as rpl import numpy as np """ Explanation: Updated Voce-Chaboche Model Fitting Example 1 An example of fitting the updated Voce-Chaboche (UVC) model to a set of test data is provided. Documentation for all the functions used in this example can be found by either looking at docstrings for any of the f...
napjon/krisk
notebooks/declarative-visualization.ipynb
bsd-3-clause
# Use this when you want to nbconvert the notebook (used by nbviewer) from krisk import init_notebook; init_notebook() from krisk import Chart chart = Chart() chart """ Explanation: You can use krisk for Declarative Visualization. You don't have to use krisk.plot package, and directly use Chart class to make any cha...
bjsmith/motivation-simulation
test-jupyter-widgets-clone2.ipynb
gpl-3.0
from matplotlib.pyplot import figure, plot, xlabel, ylabel, title, show from IPython.display import display text = widgets.FloatText() floatText = widgets.FloatText(description='MyField',min=-5,max=5) floatSlider = widgets.FloatSlider(description='MyField',min=-5,max=5) #https://ipywidgets.readthedocs.io/en/stable/...
marius311/cosmoslik
cosmoslik_plugins/likelihoods/spt_lowl/spt_lowl.ipynb
gpl-3.0
%pylab inline from cosmoslik import * """ Explanation: South Pole Telescope low-$\ell$ This plugin implements the South Pole Telescope likelihood from Story et al. (2012) and Keisler et al. (2011). The data comes included with this plugin and was downloaded from here and here, respectively. You can choose which likel...
jmhsi/justin_tinker
data_science/courses/Transforms with Pytorch and Torchsample.ipynb
apache-2.0
# some imports we will need import os import matplotlib.pyplot as plt import torch as th from torchvision import datasets %matplotlib inline """ Explanation: Overview I will go over the following topics using the pytorch and torchsample packages: Dataset Creation and Loading How you create pytorch-suitable datasets...
kimkipyo/dss_git_kkp
통계, 머신러닝 복습/160517화_4일차_시각화 Visualization/3.seaborn 시각화 패키지 소개.ipynb
mit
sns.set() #스타일이 정해짐 sns.set_color_codes() x = np.linspace(0, 2 * np.pi, 400) y = np.sin(x ** 2) f, axarr = plt.subplots(2, sharex=True) axarr[0].plot(x, y) axarr[0].set_title('Sharing X axis') axarr[1].scatter(x, y); """ Explanation: seaborn 시각화 패키지 소개 seaborn은 matplotlib을 기반으로 다양한 색상 테마와 통계용 챠트 등의 기능을 추가한 시각화 패키지이...
farfan92/SpringBoard-
statistics project 1/.ipynb_checkpoints/cfarfan_statistics_exercise_1-checkpoint.ipynb
mit
%matplotlib inline import pandas as pd import numpy as np import scipy.stats as st from scipy.stats import norm import matplotlib.pyplot as plt import seaborn as sns sns.set(color_codes=True) from IPython.core.display import HTML css = open('style-table.css').read() + open('style-notebook.css').read() HTML('<style>{}</...
sraejones/phys202-2015-work
days/day19/FittingModels.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np from scipy import optimize as opt from IPython.html.widgets import interact """ Explanation: Fitting Models Learning Objectives: learn to fit models to data using linear and non-linear regression. This material is licensed under the MIT license and...
mne-tools/mne-tools.github.io
0.13/_downloads/plot_python_intro.ipynb
bsd-3-clause
a = 3 print(type(a)) b = [1, 2.5, 'This is a string'] print(type(b)) c = 'Hello world!' print(type(c)) """ Explanation: Introduction to Python Python is a modern, general-purpose, object-oriented, high-level programming language. First make sure you have a working python environment and dependencies (see install_pytho...
jupyter/nbgrader
nbgrader/docs/source/user_guide/submitted/hacker/ps1/problem1.ipynb
bsd-3-clause
NAME = "Alyssa P. Hacker" COLLABORATORS = "Ben Bitdiddle" """ Explanation: Before you turn this problem in, make sure everything runs as expected. First, restart the kernel (in the menubar, select Kernel$\rightarrow$Restart) and then run all cells (in the menubar, select Cell$\rightarrow$Run All). Make sure you fill i...
clubmliimas/cancer
notebooks/sentdex.ipynb
mit
import dicom # for reading dicom files import os # for doing directory operations import pandas as pd # for some simple data analysis (right now, just to load in the labels data and quickly reference it) # Change this to wherever you are storing your data: # IF YOU ARE FOLLOWING ON KAGGLE, YOU CAN ONLY PLAY WITH THE ...
AEW2015/PYNQ_PR_Overlay
Pynq-Z1/notebooks/examples/pmod_grove_tmp.ipynb
bsd-3-clause
from pynq.pl import Overlay Overlay("base.bit").download() """ Explanation: Grove Temperature Sensor 1.2 This example shows how to use the Grove Temperature Sensor v1.2 on the Pynq-Z1 board. You will also see how to plot a graph using matplotlib. The Grove Temperature sensor produces an analog signal, and requires an ...
lilleswing/deepchem
examples/tutorials/27_Using_Reinforcement_Learning_to_Play_Pong.ipynb
mit
!curl -Lo conda_installer.py https://raw.githubusercontent.com/deepchem/deepchem/master/scripts/colab_install.py import conda_installer conda_installer.install() !/root/miniconda/bin/conda info -e !pip install --pre deepchem import deepchem deepchem.__version__ !pip install 'gym[atari]' """ Explanation: Tutorial Par...
alexandrejaguar/strata-sv-2015-tutorial
resources/Vis1.ipynb
bsd-3-clause
%matplotlib inline import matplotlib.pyplot as plt import numpy as np """ Explanation: Visualization 1: Matplotlib Basics Imports The following imports should be used in all of your notebooks where Matplotlib in used: End of explanation """ t = np.linspace(0,4*np.pi,100) plt.plot(t, np.sin(t)) plt.xlabel('Time') plt...
jupyter/nbgrader
nbgrader/docs/source/user_guide/managing_the_database.ipynb
bsd-3-clause
%%bash # remove the existing database, to start fresh rm gradebook.db """ Explanation: Managing the database Most of the important information that nbgrader has access to---information about students, assignments, grades, etc.---is stored in the nbgrader database. Much of this is added to the database automatically b...
LSSTC-DSFP/LSSTC-DSFP-Sessions
Sessions/Session05/Day1/ReIntroductionToImageProcessing.ipynb
mit
import numpy as np import matplotlib.pyplot as plt %matplotlib notebook """ Explanation: (Re)Introduction to Image Processing Version 0.1 During Session 1 of the DSFP, Robert Lupton provided a problem that brilliantly introduced some of the basic challenges associated with measuring the flux of a point source. As suc...
CAChemE/curso-python-datos
notebooks/005_SWC_defensive_programming.ipynb
bsd-3-clause
# This code has an intentional error. You can type it directly or # use it for reference to understand the error message below. def favorite_ice_cream(): ice_creams = [ "chocolate", "vanilla", "strawberry" ] print(ice_creams[3]) favorite_ice_cream() # Syntax error def some_function...
briennakh/BIOF509
Wk07/Wk07_solutions.ipynb
mit
def plot_arm_frequency(simulation, ax, marker='.', linestyle='', color='k', label=''): """Plot the frequency with which the second arm is chosen NOTE: Currently only works for two arms""" ax.plot(simulation.arm_choice.mean(axis=0), marker=marker, linestyle=linestyle, color=color, label=label) ...
jlandmann/oggm
docs/notebooks/getting_started.ipynb
gpl-3.0
import oggm from oggm import cfg from oggm.utils import get_demo_file cfg.initialize() srtm_f = get_demo_file('srtm_oetztal.tif') rgi_f = get_demo_file('rgi_oetztal.shp') print(srtm_f) """ Explanation: <img src="https://raw.githubusercontent.com/OGGM/oggm/master/docs/_static/logo.png" width="40%" align="left"> Gettin...
laurajchang/NPTFit
examples/Example3_Running_Poissonian_Scans.ipynb
mit
# Import relevant modules %matplotlib inline %load_ext autoreload %autoreload 2 import numpy as np import corner import matplotlib.pyplot as plt from NPTFit import nptfit # module for performing scan from NPTFit import create_mask as cm # module for creating the mask from NPTFit import dnds_analysis # module for ana...
MehtapIsik/assaytools
examples/direct-fluorescence-assay/2 MLE fit for two component binding - simulated and real data.ipynb
lgpl-2.1
import numpy as np import matplotlib.pyplot as plt from scipy import optimize import seaborn as sns %pylab inline """ Explanation: MLE fit for two component binding - simulated and real data In part one of this notebook we see how well we can reproduce Kd from simulated experimental data with a maximum likelihood fu...
tensorflow/docs-l10n
site/ko/probability/examples/Eight_Schools.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License"); { display-mode: "form" } # 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, sof...
getsmarter/bda
module_4/M4_NB3_NetworkClustering.ipynb
mit
import networkx as nx import pandas as pd import numpy as np %matplotlib inline import matplotlib.pylab as plt from networkx.drawing.nx_agraph import graphviz_layout from collections import defaultdict, Counter import operator ## For hierarchical clustering. from scipy.cluster import hierarchy from scipy.spatial imp...
GoogleCloudPlatform/vertex-ai-samples
notebooks/community/sdk/sdk_automl_image_object_detection_online.ipynb
apache-2.0
import os # Google Cloud Notebook if os.path.exists("/opt/deeplearning/metadata/env_version"): USER_FLAG = "--user" else: USER_FLAG = "" ! pip3 install --upgrade google-cloud-aiplatform $USER_FLAG """ Explanation: Vertex SDK: AutoML training image object detection model for online prediction <table align="le...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/end_to_end_ml/solutions/deploy_keras_ai_platform_babyweight.ipynb
apache-2.0
!sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst import os """ Explanation: Deploy and predict with Keras model on Cloud AI Platform. Learning Objectives Setup up the environment Deploy trained Keras model to Cloud AI Platform Online predict from model on Cloud AI Platform Batch predict from model ...
dusenberrymw/systemml
samples/jupyter-notebooks/Deep Learning Image Classification.ipynb
apache-2.0
from systemml import MLContext, dml ml = MLContext(sc) print "Spark Version:", sc.version print "SystemML Version:", ml.version() print "SystemML Built-Time:", ml.buildTime() from sklearn import datasets from sklearn.cross_validation import train_test_split from sklearn.metrics import classification_report import pa...
tpin3694/tpin3694.github.io
python/repr_vs_str.ipynb
mit
import datetime """ Explanation: Title: repr vs. str Slug: repr_vs_str Summary: repr vs. str in Python. Date: 2016-01-23 12:00 Category: Python Tags: Basics Authors: Chris Albon Interesting in learning more? Check out Fluent Python Preliminaries End of explanation """ class Regiment(object): def __init__(...
rishuatgithub/MLPy
torch/PYTORCH_NOTEBOOKS/03-CNN-Convolutional-Neural-Networks/01-MNIST-with-CNN.ipynb
apache-2.0
import torch import torch.nn as nn import torch.nn.functional as F from torch.utils.data import DataLoader from torchvision import datasets, transforms from torchvision.utils import make_grid import numpy as np import pandas as pd from sklearn.metrics import confusion_matrix import matplotlib.pyplot as plt %matplotlib...
hasecbinusr/pysal
pysal/contrib/spint/notebooks/ODW_example.ipynb
bsd-3-clause
origins = ps.weights.lat2W(4,4) dests = ps.weights.lat2W(4,4) origins.n dests.n ODw = ODW(origins, dests) print ODw.n, 16*16 ODw.full()[0].shape """ Explanation: With an equal number of origins and destinations (n=16) End of explanation """ origins = ps.weights.lat2W(3,3) dests = ps.weights.lat2W(5,5) origins...
sdpython/ensae_teaching_cs
_doc/notebooks/td2a_ml/ml_scikit_learn_simple_correction.ipynb
mit
from jyquickhelper import add_notebook_menu add_notebook_menu() %matplotlib inline """ Explanation: Rappels sur scikit-learn et le machine learning (correction) Quelques exercices simples sur scikit-learn. Le notebook est long pour ceux qui débutent en machine learning et sans doute sans suspens pour ceux qui en ont ...
nwjs/chromium.src
third_party/tensorflow-text/src/docs/guide/text_tf_lite.ipynb
bsd-3-clause
#@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...
mitdbg/modeldb
client/workflows/demos/registry/sklearn-census-end-to-end.ipynb
mit
from __future__ import print_function import warnings from sklearn.exceptions import ConvergenceWarning warnings.filterwarnings("ignore", category=ConvergenceWarning) warnings.filterwarnings("ignore", category=FutureWarning) import itertools import os import time import six import numpy as np import pandas as pd i...
raman-sharma/stanford-mir
basic_feature_extraction.ipynb
mit
kick_filepaths, snare_filepaths = stanford_mir.download_drum_samples() """ Explanation: &larr; Back to Index Basic Feature Extraction Somehow, we must extract the characteristics of our audio signal that are most relevant to the problem we are trying to solve. For example, if we want to classify instruments by timbre,...
ALEXKIRNAS/DataScience
Coursera/Machine-learning-data-analysis/Course 5/Week_01/salary.ipynb
mit
plt.figure(figsize(15,10)) sm.tsa.seasonal_decompose(salary.WAG_C_M).plot() print("Критерий Дики-Фуллера: p=%f" % sm.tsa.stattools.adfuller(salary.WAG_C_M)[1]) """ Explanation: Проверка стационарности и STL-декомпозиция ряда: End of explanation """ salary['salary_box'], lmbda = stats.boxcox(salary.WAG_C_M) plt.figur...
deculler/DataScienceTableDemos
BirthweightRegression.ipynb
bsd-2-clause
# HIDDEN from datascience import * %matplotlib inline import numpy as np import matplotlib.pyplot as plots plots.style.use('fivethirtyeight') """ Explanation: Illustration of datascience Tables for multivariate analysis David E. Culler This notebook illustrates some of the use of datascience Tables to perform regressi...
pligor/predicting-future-product-prices
02_preprocessing/exploration02-price_history-remove-spikes.ipynb
agpl-3.0
axis_indifferent = np.arange(len(df.columns)) axis_indifferent[:4] plt.figure(figsize=(17,8)) for ind, history in df.loc[price_histories_big_outliers.index].iterrows(): #nums = [float(str) for str in history.values] #print history.values plt.plot(axis_indifferent, history.values) plt.title('Original Price ...
intel-analytics/BigDL
python/chronos/use-case/fsi/stock_prediction_prophet.ipynb
apache-2.0
import numpy as np import pandas as pd import os FILE_NAME = 'all_stocks_5yr.csv' filepath = os.path.join('data', FILE_NAME) print(filepath) # read data data = pd.read_csv(filepath) print(data[:10]) # change input column name data = data[data['Name']=='MMM'].rename(columns={"date":"ds", "close":"y"}) data.head() ...
liufuyang/deep_learning_tutorial
course-deeplearning.ai/course4-cnn/week4-facenet-nstyle/FaceRecognition/Face+Recognition+for+the+Happy+House+-+v3.ipynb
mit
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...
dsacademybr/PythonFundamentos
Cap05/Notebooks/DSA-Python-Cap05-04-Heranca.ipynb
gpl-3.0
# Versão da Linguagem Python from platform import python_version print('Versão da Linguagem Python Usada Neste Jupyter Notebook:', python_version()) """ Explanation: <font color='blue'>Data Science Academy - Python Fundamentos - Capítulo 5</font> Download: http://github.com/dsacademybr End of explanation """ # Crian...
syednasar/talks
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, we’re going ...
ES-DOC/esdoc-jupyterhub
notebooks/csir-csiro/cmip6/models/sandbox-2/toplevel.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'csir-csiro', 'sandbox-2', 'toplevel') """ Explanation: ES-DOC CMIP6 Model Properties - Toplevel MIP Era: CMIP6 Institute: CSIR-CSIRO Source ID: SANDBOX-2 Sub-Topics: Radiative Forcings. Propert...
mbeyeler/opencv-machine-learning
notebooks/09.04-Training-an-MLP-in-OpenCV-to-Classify-Handwritten-Digits.ipynb
mit
from keras.datasets import mnist (X_train, y_train), (X_test, y_test) = mnist.load_data() """ Explanation: <!--BOOK_INFORMATION--> <a href="https://www.packtpub.com/big-data-and-business-intelligence/machine-learning-opencv" target="_blank"><img align="left" src="data/cover.jpg" style="width: 76px; height: 100px; back...
jonathanrocher/pandas_tutorial
climate_timeseries/climate_timeseries-Part2.ipynb
mit
%matplotlib inline import pandas as pd import numpy as np import matplotlib.pyplot as plt pd.set_option("display.max_rows", 16) LARGE_FIGSIZE = (12, 8) # Change this cell to the demo location on YOUR machine %cd ~/Projects/pandas_tutorial/climate_timeseries/ %ls """ Explanation: Last updated: June 29th 2016 Climat...
mspcvsp/cincinnati311Data
ClusterServiceCodes.ipynb
gpl-3.0
import csv import re import numpy as np import matplotlib.pyplot as plt import nltk from sklearn.cluster import KMeans from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.metrics.pairwise import cosine_similarity from collections import defaultdict import seaborn as sns %matplotlib inline """ Expl...
dsacademybr/PythonFundamentos
Cap10/Mini-Projeto2-Solucao/Mini-Projeto2 - Analise2.ipynb
gpl-3.0
# Versão da Linguagem Python from platform import python_version print('Versão da Linguagem Python Usada Neste Jupyter Notebook:', python_version()) # Imports import os import subprocess import stat import numpy as np import pandas as pd import seaborn as sns import matplotlib as mat import matplotlib.pyplot as plt fr...
basnijholt/holoviews
examples/user_guide/Customizing_Plots.ipynb
bsd-3-clause
import numpy as np import holoviews as hv from holoviews import dim, opts hv.extension('bokeh', 'matplotlib') """ Explanation: Customizing Plots End of explanation """ hv.HoloMap({i: hv.Curve([1, 2, 3-i], group='Group', label='Label') for i in range(3)}, 'Value') """ Explanation: The HoloViews options system allow...
tammoippen/nest-simulator
doc/model_details/aeif_models_implementation.ipynb
gpl-2.0
import numpy as np from scipy.integrate import odeint import matplotlib.pyplot as plt %matplotlib inline plt.rcParams['figure.figsize'] = (15, 6) """ Explanation: NEST implementation of the aeif models Hans Ekkehard Plesser and Tanguy Fardet, 2016-09-09 This notebook provides a reference solution for the Adaptive Expo...
AllenDowney/ThinkStats2
code/chap06ex.ipynb
gpl-3.0
from os.path import basename, exists def download(url): filename = basename(url) if not exists(filename): from urllib.request import urlretrieve local, _ = urlretrieve(url, filename) print("Downloaded " + local) download("https://github.com/AllenDowney/ThinkStats2/raw/master/code/th...
kfollette/ASTR200-Spring2017
Labs/Lab6/Lab6.ipynb
mit
from numpy import * """ Explanation: <small><i>This notebook is based on one put together by Jake Vanderplas and has been modified to suit the purposes of this course, including expansion/modification of explanations and additional exercises. Source and license info for the original is on GitHub.</i></small> Names: [...
opesci/devito
examples/seismic/tutorials/04_dask_pickling.ipynb
mit
#NBVAL_IGNORE_OUTPUT # Set up inversion parameters. param = {'t0': 0., 'tn': 1000., # Simulation last 1 second (1000 ms) 'f0': 0.010, # Source peak frequency is 10Hz (0.010 kHz) 'nshots': 5, # Number of shots to create gradient from 'shape': (1...
ML4DS/ML4all
U3.PCA/PCA_professor.ipynb
mit
# Basic imports %matplotlib inline import numpy as np import matplotlib.pyplot as plt import seaborn as sns; sns.set() """ Explanation: Principal Component Analysis The code in this notebook has been taken from a notebook in the Python Data Science Handbook by Jake VanderPlas; the content is available on GitHub. The c...
riddhishb/ipython-notebooks
Kalman Filter/Kalman-first.ipynb
gpl-3.0
%matplotlib inline import numpy as np import matplotlib.pyplot as plt import random """ Explanation: This is an jupyter notebook. Lectures about Python, useful both for beginners and experts, can be found at http://scipy-lectures.github.io. Open the notebook by (1) copying this file into a directory, (2) in that dir...
arne-cl/alt-mulig
python/maz176-statistics.ipynb
gpl-3.0
%matplotlib inline import os from collections import Counter from operator import itemgetter import pandas as pd from networkx import Graph from networkx.algorithms.components.connected import connected_components from discoursegraphs import select_edges_by, get_pointing_chains from discoursegraphs.readwrite import C...
empet/Math
Animating-the-Dragon-curve-construction.ipynb
bsd-3-clause
import numpy as np from numpy import pi import plotly.graph_objects as go def rot_matrix(alpha): #Define the matrix of rotation about origin with an angle of alpha radians: return np.array([[np.cos(alpha), -np.sin(alpha)], [np.sin(alpha), np.cos(alpha)]]) def rotate_dragon(x, y, alpha=pi/2):...
wrgeorge1983/pcap-plotting
pcap.ipynb
mit
# This whole business is totally unnecessary if you're path is setup right. But if it's not, # this is probably easier than actually fixing it. %load_ext autoreload import os wireshark_path = "C:\\Program Files\\Wireshark\\" + os.pathsep # or, if it's under 'program files(x86)'... # wireshark_path = "C:\\Program File...
Vettejeep/Data-Analysis-and-Data-Science-Projects
Support Vector Machines and the UCI Mushroom Data Set.ipynb
gpl-3.0
%matplotlib inline import pandas as pd import numpy as np import itertools from sklearn.svm import SVC from sklearn.model_selection import train_test_split from sklearn import metrics import matplotlib.pyplot as plt """ Explanation: Support Vector Machines and the UCI Mushroom Data Set Kevin Maher <span style="colo...
jorgemauricio/INIFAP_Course
algoritmos/Validacion_App_Movil_climMAPcore_AGS_BW.ipynb
mit
# librerias import pandas as pd import numpy as np import matplotlib.pyplot as plt import statsmodels.formula.api as sm %matplotlib inline plt.style.use('grayscale') # leer archivo data = pd.read_csv('../data/dataFromAguascalientesClimmapcore.csv') # verificar su contenido data.head() # diferencia entre valores de p...
karlstroetmann/Algorithms
Python/Chapter-05/Selection-Sort.ipynb
gpl-2.0
def sort(L): if L == []: return [] x = min(L) return [x] + sort(delete(x, L)) """ Explanation: Selection Sort The algorithm <em style="color:blue;">selection sort</em> is specified via two equations: If $L$ is empty, $\texttt{sort}(L)$ is the empty list: $$ \mathtt{sort}([]) = [] $$ Otherwise...
sz2472/foundations-homework
homework_6_shengying_zhao.ipynb
mit
type(data) data.keys() print(data['currently']) print(data['currently']['temperature']-data['currently']['apparentTemperature']) """ Explanation: 2) What's the current wind speed? How much warmer does it feel than it actually is? End of explanation """ print(data['daily']) type(data['daily']) data['daily'].keys...
AllenDowney/ModSim
python/soln/examples/queue_soln.ipynb
gpl-2.0
# install Pint if necessary try: import pint except ImportError: !pip install pint # download modsim.py if necessary from os.path import exists filename = 'modsim.py' if not exists(filename): from urllib.request import urlretrieve url = 'https://raw.githubusercontent.com/AllenDowney/ModSim/main/' ...
tensorflow/docs-l10n
site/en-snapshot/model_optimization/guide/combine/sparse_clustering_example.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...
mauroalberti/gsf
docs/notebooks/DEM-plane intersections.ipynb
gpl-3.0
from pygsf.io.gdal.raster import try_read_raster_band """ Explanation: Plane-DEM intersections First dated version: 2019-06-11 Current version: 2021-04-24 Last run: 2021-04-24 A few simulated topographic surfaces were used to validate the routine for calculating the plane-DEM intersection. Loading the dataset can be m...
parrt/msan692
notes/excel.ipynb
mit
with open('data/SampleSuperstoreSales.xls', "rb") as f: txt = f.read() print(txt[0:100]) """ Explanation: Reading data from Excel Let's get some data. Download Sample Superstore Sales .xls file or my local copy and open it in Excel to see what it looks like. Data of interest that we want to process in Python o...
ES-DOC/esdoc-jupyterhub
notebooks/cnrm-cerfacs/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', 'cnrm-cerfacs', 'sandbox-1', 'seaice') """ Explanation: ES-DOC CMIP6 Model Properties - Seaice MIP Era: CMIP6 Institute: CNRM-CERFACS Source ID: SANDBOX-1 Topic: Seaice Sub-Topics: Dynamics, Ther...
nadvamir/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...
sauravrt/signal-processing
ipynb/ComplexCircularGaussian.ipynb
gpl-2.0
# magic %matplotlib inline import numpy as np import matplotlib.pyplot as plt # prettyplot stuff import seaborn as sns sns.set(style='ticks', palette='Set2') sns.despine() mu = 0 sigmasq = 1 sd = np.sqrt(sigmasq) # Generate complex gaussian r.v. samples x = np.random.normal(loc = mu, scale = sd/np.sqrt(2), size = 10...
ageron/tensorflow-safari-course
10_training_deep_nets_ex9.ipynb
apache-2.0
from __future__ import absolute_import, division, print_function, unicode_literals import tensorflow as tf tf.__version__ from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("tmp/data/") """ Explanation: Try not to peek at the solutions when you go through the exercises. ;-) ...
googledatalab/notebooks
samples/ML Toolbox/Image Classification/Flower/Local End to End.ipynb
apache-2.0
!mkdir -p /content/flowerdata !gsutil -m cp gs://cloud-datalab/sampledata/flower/* /content/flowerdata """ Explanation: Efficient training for image classification Transfer learning using Inception Package - Local Run Experience Traditionally, image classification required a very large corpus of training data - often...
mne-tools/mne-tools.github.io
0.19/_downloads/03c9d71de135994dbf45db72856a1f9a/plot_mne_inverse_envelope_correlation.ipynb
bsd-3-clause
# Authors: Eric Larson <larson.eric.d@gmail.com> # Sheraz Khan <sheraz@khansheraz.com> # Denis Engemann <denis.engemann@gmail.com> # # License: BSD (3-clause) import os.path as op import numpy as np import matplotlib.pyplot as plt import mne from mne.connectivity import envelope_correlation from mn...
davicsilva/dsintensive
notebooks/miniprojects/data_wrangling_json/sliderule_dsi_json_exercise.ipynb
apache-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.pydata.org/pandas-docs/stable/io.html#io-json-reader data source: http://jsonstudio....
rgbrown/invariants
code/Moving frame calculations.ipynb
mit
from sympy import Function, Symbol, symbols, init_printing, expand, I, re, im from IPython.display import Math, display init_printing() from transvectants import * def disp(expr): display(Math(my_latex(expr))) # p and q are \bar{x} \bar{y} x, y = symbols('x y') p, q = symbols('p q') a, b, c, d = symbols('a b c d...
sjsrey/pysal
notebooks/explore/giddy/Rank_Markov.ipynb
bsd-3-clause
import pysal.lib as ps import numpy as np import matplotlib.pyplot as plt %matplotlib inline import seaborn as sns import pandas as pd import geopandas as gpd """ Explanation: Full Rank Markov and Geographic Rank Markov Author: Wei Kang &#119;&#101;&#105;&#107;&#97;&#110;&#103;&#57;&#48;&#48;&#57;&#64;&#103;&#109;&#97...
ptrendx/mxnet
example/autoencoder/convolutional_autoencoder.ipynb
apache-2.0
import random import matplotlib.pyplot as plt import mxnet as mx from mxnet import autograd, gluon """ Explanation: Convolutional Autoencoder In this example we will demonstrate how you can create a convolutional autoencoder in Gluon End of explanation """ batch_size = 512 ctx = mx.gpu() if len(mx.test_utils.list_...
nick-youngblut/SIPSim
ipynb/theory/.ipynb_checkpoints/diff_bound_layer-checkpoint.ipynb
mit
import os import numpy as np from scipy.integrate import quad %load_ext rpy2.ipython workDir = '/home/nick/notebook/SIPSim/dev/theory/' %%R library(readxl) library(dplyr) library(tidyr) library(ggplot2) library(rootSolve) if not os.path.isdir(workDir): os.makedirs(workDir) %cd $workDir """ Explanation: Goal: M...
davewsmith/notebooks
temperature/AfterMovingSensors.ipynb
mit
%matplotlib inline import matplotlib matplotlib.rcParams['figure.figsize'] = (12, 5) import pandas as pd df = pd.read_csv('after-sensor-move.csv', header=None, names=['time', 'mac', 'f', 'h'], parse_dates=[0]) per_sensor_f = df.pivot(index='time', columns='mac', values='f') downsampled_f = per_sensor_f.resample('2T')...
SteveDiamond/cvxpy
examples/notebooks/dqcp/minimum_length_least_squares.ipynb
gpl-3.0
!pip install --upgrade cvxpy import cvxpy as cp import numpy as np """ Explanation: Minimum-length least squares This notebook shows how to solve a minimum-length least squares problem, which finds a minimum-length vector $x \in \mathbf{R}^n$ achieving small mean-square error (MSE) for a particular least squares prob...
sarahmid/programming-bootcamp-v2
lab6_exercises.ipynb
mit
def fancy_calc(a, b, c): x1 = basic_calc(a,b) x2 = basic_calc(b,c) x3 = basic_calc(c,a) z = x1 * x2 * x3 return z def basic_calc(x, y): result = x + y return result x = 1 y = 2 z = 3 result = fancy_calc(x, y, z) """ Explanation: Programming Bootcamp 2016 Lesson 6 Exercises Earning point...
a-mt/dev-roadmap
docs/!ml/notebooks/Naive Bayes.ipynb
mit
import numpy as np import pandas as pd from IPython.core.display import display, HTML display(HTML(''' <style> .dataframe td, .dataframe th { border: 1px solid black; background: white; } .dataframe td { text-align: left; } </style> ''')) df = pd.DataFrame({ 'Outlook': ['sunny', 'sunny', 'overcast', 'rain',...