repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
steinam/teacher | jup_notebooks/data-science-ipython-notebooks-master/numpy/02.02-The-Basics-Of-NumPy-Arrays.ipynb | mit | import numpy as np
np.random.seed(0) # seed for reproducibility
x1 = np.random.randint(10, size=6) # One-dimensional array
x2 = np.random.randint(10, size=(3, 4)) # Two-dimensional array
x3 = np.random.randint(10, size=(3, 4, 5)) # Three-dimensional array
"""
Explanation: <!--BOOK_INFORMATION-->
<img align="left"... |
Kaggle/learntools | notebooks/intro_to_programming/raw/tut5.ipynb | apache-2.0 | flowers = "pink primrose,hard-leaved pocket orchid,canterbury bells,sweet pea,english marigold,tiger lily,moon orchid,bird of paradise,monkshood,globe thistle"
print(type(flowers))
print(flowers)
"""
Explanation: Introduction
When doing data science, you need a way to organize your data so you can work with it effici... |
dipanjank/ml | tensorflow/simple_recurrent_nn.ipynb | gpl-3.0 | import numpy as np
import pandas as pd
import tensorflow as tf
%pylab inline
pylab.style.use('ggplot')
"""
Explanation: RNN from scratch using TensorFlow
<img src="http://d3kbpzbmcynnmx.cloudfront.net/wp-content/uploads/2015/09/rnn.jpg">
In this example, we'll build a simple RNN using TensorFlow and we'll train the R... |
oznome/jupyter-examples | prov/Provenance using KN resource.ipynb | mit | import prov, requests, pandas as pd, io, git, datetime, urllib
from prov.model import ProvDocument
"""
Explanation: Creating Provenance an Example Using a Python Notebook
End of explanation
"""
pg = ProvDocument()
kn_id = "data/data-gov-au/number-of-properties-by-suburb-and-planning-zone-csv"
pg.add_namespace('kn',... |
statkclee/ThinkStats2 | code/chap14soln-kor.ipynb | gpl-3.0 | %matplotlib inline
from __future__ import print_function, division
import numpy as np
import random
import first
import normal
import thinkstats2
import thinkplot
"""
Explanation: 통계적 사고 (2판) 연습문제 (thinkstats2.com, think-stat.xwmooc.org)<br>
Allen Downey / 이광춘(xwMOOC)
End of explanation
"""
def GenerateAdultWeight... |
ES-DOC/esdoc-jupyterhub | notebooks/test-institute-2/cmip6/models/sandbox-1/landice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'test-institute-2', 'sandbox-1', 'landice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Landice
MIP Era: CMIP6
Institute: TEST-INSTITUTE-2
Source ID: SANDBOX-1
Topic: Landice
Sub-Topics: Gla... |
vravishankar/Jupyter-Books | Python Dictionaries.ipynb | mit | dict1 = {'id': 1, 'name':'John Doe', 'email':'john.doe@example.org','salary':14000.00}
dict1
dict1['name']
dict1['email']='john.doe@example.com'
dict1
type(dict1)
str(dict1)
list(dict1.keys())
list(dict1.values())
sorted(list(dict1.keys()))
del(list)
dict2 = dict([('id',2),('name','Jack Jill'),('salary',15500... |
materialsproject/mapidoc | example_notebooks/Using the Materials API with Python.ipynb | bsd-3-clause | # We start by importing MPRester, which is available from the root import of pymatgen.
from pymatgen.ext.matproj import MPRester
from pprint import pprint
# Initializing MPRester. Note that you can call MPRester. MPRester looks for the API key in two places:
# - Supplying it directly as an __init__ arg.
# - Setting t... |
gogartom/caffe-textmaps | examples/detection.ipynb | mit | !mkdir -p _temp
!echo `pwd`/images/fish-bike.jpg > _temp/det_input.txt
!../python/detect.py --crop_mode=selective_search --pretrained_model=../models/bvlc_reference_rcnn_ilsvrc13/bvlc_reference_rcnn_ilsvrc13.caffemodel --model_def=../models/bvlc_reference_rcnn_ilsvrc13/deploy.prototxt --gpu --raw_scale=255 _temp/det_in... |
arongdari/sparse-graph-prior | notebooks/PosteriorInferenceGGPgraph.ipynb | mit | import os
import pickle
import time
from collections import defaultdict
import matplotlib.pyplot as plt
import numpy as np
from scipy.io import loadmat
from sgp import GGPgraphmcmc
%matplotlib inline
"""
Explanation: Posterior inference for GGP graph model
In this notebook, we'll infer the posterior distribution of... |
jrg365/gpytorch | examples/08_Advanced_Usage/TorchScript_Variational_Models.ipynb | mit | import torch
import urllib.request
import os
from scipy.io import loadmat
from math import floor
# this is for running the notebook in our testing framework
smoke_test = ('CI' in os.environ)
if not smoke_test and not os.path.isfile('../elevators.mat'):
print('Downloading \'elevators\' UCI dataset...')
urllib... |
qutip/qutip-notebooks | examples/piqs-entropy_purity.ipynb | lgpl-3.0 | import matplotlib.pyplot as plt
import numpy as np
from qutip import *
from qutip.piqs import *
from scipy.sparse import block_diag
from scipy.sparse.linalg import eigsh, eigs
from scipy import log
"""
Explanation: Calculate Von Neumann Entropy and Purity for Dicke-Basis density matrix in presence of homogeneous local... |
phobson/pygridtools | docs/tutorial/01_GridgenBasics.ipynb | bsd-3-clause | %matplotlib inline
import warnings
warnings.simplefilter('ignore')
import numpy as np
import matplotlib.pyplot as plt
import pandas
import geopandas
import pygridgen as pgg
import pygridtools as pgt
"""
Explanation: Grid Generation Basics
This section will cover:
Loading and visualizing boundary data
Generating vis... |
rasbt/algorithms_in_ipython_notebooks | ipython_nbs/data-structures/stacks.ipynb | gpl-3.0 | class Stack(object):
def __init__(self):
self.stack = []
def add(self, item):
self.stack.append(item)
def pop(self):
self.stack.pop()
def peek(self):
return self.stack[-1]
def size(self):
return len(self.stack)
"""
Explanation: Stacks
Stac... |
AlertaDengue/InfoDenguePredict | Notebooks/Data Exploration.ipynb | gpl-3.0 | import pandas as pd
import getpass, os
os.environ['PSQL_USER']='dengueadmin'
os.environ['PSQL_HOST']='localhost'
os.environ['PSQL_DB']='dengue'
os.environ['PSQL_PASSWORD']=getpass.getpass("Enter the database password: ")
os.chdir('..')
from infodenguepredict.data.infodengue import get_temperature_data, get_alerta_tabl... |
YaniLozanov/Software-University | Python/Jupyter notebook/03.Logical checks/Jupyter notebook/Simple Conditional Statements.ipynb | mit | num = float(input())
if num >= 5.50:
print("Excellent!")
"""
Explanation: <h1 align="center">Simple Conditional Statements</h1>
<h2>01.Excellent Result</h2>
The first task of this topic is to write a console program that introduces an estimate (decimal number) and prints "Excellent!" if the score is 5.50 or hig... |
steinam/teacher | jup_notebooks/data-science-ipython-notebooks-master/pandas/03.12-Performance-Eval-and-Query.ipynb | mit | import numpy as np
rng = np.random.RandomState(42)
x = rng.rand(1000000)
y = rng.rand(1000000)
%timeit x + y
"""
Explanation: <!--BOOK_INFORMATION-->
<img align="left" style="padding-right:10px;" src="figures/PDSH-cover-small.png">
This notebook contains an excerpt from the Python Data Science Handbook by Jake VanderP... |
keras-team/keras-io | guides/ipynb/functional_api.ipynb | apache-2.0 | import numpy as np
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
"""
Explanation: The Functional API
Author: fchollet<br>
Date created: 2019/03/01<br>
Last modified: 2020/04/12<br>
Description: Complete guide to the functional API.
Setup
End of explanation
"""
inputs = kera... |
Kappa-Dev/ReGraph | examples/Tutorial_NetworkX_backend/.ipynb_checkpoints/Part1_graphs-checkpoint.ipynb | mit | from regraph import NXGraph, Rule
from regraph import plot_graph, plot_instance, plot_rule
%matplotlib inline
"""
Explanation: ReGraph tutorial (NetworkX backend)
Part 1: Rewriting simple graph with attributes
This notebook consists of simple examples of usage of the ReGraph library
End of explanation
"""
# Create ... |
google-research/text-to-text-transfer-transformer | notebooks/t5-deploy.ipynb | apache-2.0 | # Copyright 2020 The T5 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 applicable law ... |
JackDi/phys202-2015-work | assignments/assignment05/InteractEx02.ipynb | mit | %matplotlib inline
from matplotlib import pyplot as plt
import numpy as np
from matplotlib import markers
from IPython.html.widgets import interact, interactive, fixed
from IPython.display import display
"""
Explanation: Interact Exercise 2
Imports
End of explanation
"""
# YOUR CODE HERE
t=np.linspace(0,4*3.14,1000... |
jazcollins/models | object_detection/object_detection_tutorial.ipynb | apache-2.0 | import numpy as np
import os
import six.moves.urllib as urllib
import sys
import tarfile
import tensorflow as tf
import zipfile
from collections import defaultdict
from io import StringIO
from matplotlib import pyplot as plt
from PIL import Image
"""
Explanation: Object Detection Demo
Welcome to the object detection ... |
IBMDecisionOptimization/docplex-examples | examples/mp/jupyter/sports_scheduling.ipynb | apache-2.0 | import sys
try:
import docplex.mp
except:
raise Exception('Please install docplex. See https://pypi.org/project/docplex/')
"""
Explanation: Use decision optimization to help a sports league schedule its games
This tutorial includes everything you need to set up decision optimization engines, build mathematical... |
mas-dse-greina/neon | luna16/old_code/LUNA16_loader.ipynb | apache-2.0 | import SimpleITK as sitk
import numpy as np
import pandas as pd
import os
import matplotlib.pyplot as plt
import ntpath
%matplotlib inline
"""
Explanation: LUNA16 Pre-processing Script
Summary:
This is the LUng Nodule Analysis (LUNA16) script for reading in the CT scans and extracting image patches around the candida... |
retnuh/deep-learning | 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... |
zipeiyang/liupengyuan.github.io | chapter2/homework/computer/end/201611680575.ipynb | mit | import random
import time
def simple_sort(numbers):
for i in range(len(numbers)):
for j in range(i+1,len(numbers)):
min=i
if numbers[min]>numbers[j]:
min=j
numbers[i],numbers[min]=numbers[min],numbers[i]
def quick_sort(seq):
left_seq=[]
right_seq=[]... |
emsi/ml-toolbox | random/catfish/2_fullyconnected.ipynb | agpl-3.0 | # These are all the modules we'll be using later. Make sure you can import them
# before proceeding further.
from __future__ import print_function
import numpy as np
import tensorflow as tf
from six.moves import cPickle as pickle
from six.moves import range
"""
Explanation: Deep Learning
Assignment 2
Previously in 1_n... |
Unidata/unidata-python-workshop | notebooks/CartoPy/CartoPy.ipynb | mit | # Set things up
%matplotlib inline
# Importing CartoPy
import cartopy.crs as ccrs
import cartopy.feature as cfeature
import matplotlib.pyplot as plt
"""
Explanation: <a name="top"></a>
<div style="width:1000 px">
<div style="float:right; width:98 px; height:98px;">
<img src="https://raw.githubusercontent.com/Unidata... |
tensorflow/docs-l10n | site/ja/hub/tutorials/tf_hub_delf_module.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... |
fja05680/pinkfish | examples/190.momentum-dmsr-portfolio/optimize.ipynb | mit | import datetime
import matplotlib.pyplot as plt
import pandas as pd
import pinkfish as pf
import strategy
# Format price data.
pd.options.display.float_format = '{:0.2f}'.format
%matplotlib inline
# Set size of inline plots
'''note: rcParams can't be in same cell as import matplotlib
or %matplotlib inline
... |
bmeaut/python_nlp_2017_fall | course_material/01_Introduction/01_Python_introduction_lab_solutions.ipynb | mit | for n in range(70, 80):
print(n)
"""
Explanation: Laboratory 01
You are expected to complete all basic exercises.
Advanced exercises are prefixed with *.
You are free to use any material (lecture, Stackoverflow etc.) except full solutions.
1. range() practice
1.1 Print the numbers between 70 and 79 inclusive.
End ... |
jinntrance/MOOC | coursera/deep-neural-network/quiz and assignments/week 6/Optimization+methods.ipynb | cc0-1.0 | import numpy as np
import matplotlib.pyplot as plt
import scipy.io
import math
import sklearn
import sklearn.datasets
from opt_utils import load_params_and_grads, initialize_parameters, forward_propagation, backward_propagation
from opt_utils import compute_cost, predict, predict_dec, plot_decision_boundary, load_data... |
NachoCP/GAN-IC-DSC | mnist/mnist.ipynb | unlicense | def batchnormalization(X, eps=1e-8, W=None, b=None):
if X.get_shape().ndims == 4:
mean = tf.reduce_mean(X, [0,1,2])
standar_desviation = tf.reduce_mean(tf.square(X-mean), [0,1,2])
X = (X - mean) / tf.sqrt(standar_desviation + eps)
if W is not None and b is not None:
... |
madsenmj/ml-introduction-course | Class01/Class01.ipynb | apache-2.0 | import pandas as pd
"""
Explanation: Class 01
Big Data Ingesting: CSVs, Data frames, and Plots
Welcome to PHY178/CSC171. We will be using the Python language to import data, run machine learning, visualize the results, and communicate those results.
Much of the data that we will use this semester is stored in a CSV fi... |
jermainewang/mxnet | example/vae/VAE_example.ipynb | apache-2.0 | mnist = mx.test_utils.get_mnist()
image = np.reshape(mnist['train_data'],(60000,28*28))
label = image
image_test = np.reshape(mnist['test_data'],(10000,28*28))
label_test = image_test
[N,features] = np.shape(image) #number of examples and features
f, (ax1, ax2, ax3, ax4) = plt.subplots(1,4, sharex='col', sha... |
bgroveben/python3_machine_learning_projects | learn_kaggle/deep_learning/dropout_and_strides.ipynb | mit | from IPython.display import YouTubeVideo
YouTubeVideo('fwNLf4t7MR8', width=800, height=450)
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from tensorflow.python import keras
from tensorflow.python.keras.models import Sequential
from tensorflow.python.keras.layers import De... |
McStasMcXtrace/McCode | Docker/mcstas/mcstasscript/McStasScript_demo.ipynb | gpl-3.0 | import sys
# Path to McStasScript pythoon file
sys.path.append('/home/docker/McStasScript')
from mcstasscript.interface import instr, plotter, functions
# Creating the instance of the class, insert path to mcrun and to mcstas root directory
Instr = instr.McStas_instr("jupyter_demo")
Instr.show_components() # Shows a... |
esa-as/2016-ml-contest | SHandPR/GradientBoosting.ipynb | apache-2.0 | %matplotlib inline
import pandas as pd
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.colors as colors
from mpl_toolkits.axes_grid1 import make_axes_locatable
from pandas import set_option
set_option("display.max_rows", 10)
pd.options.mode.chained_assignment = None
filen... |
liganega/Gongsu-DataSci | previous/notes2017/W04/W04_Exc_solutions.ipynb | gpl-3.0 | def n_divide(n):
L = []
for i in range(n+1):
L.append(i * 1.0/n)
return L
n_divide(10)
"""
Explanation: 연습문제
아래 문제들을 해결하는 코드를 W04-Exc.py 파일에 작성하여 제출하라.
연습 1
양의 정수 n을 입력 받아 0과 1 사이의 값을 n등분하는 숫자들의
리스트를 리턴하는 함수 n_divide(n)을 작성하라. (힌트: range 함수 활용)
예제:
In [1]: n_divide(10)
out[1]: [0, 0.1, 0.2, ..... |
vipmunot/Data-Science-Course | Data Visualization/Project/predictive modal - xgboost/kobe_sim_xgboost.ipynb | mit | import numpy as np
import pandas as pd
from sklearn import preprocessing
from sklearn import metrics
from sklearn.metrics import accuracy_score
from sklearn.ensemble import AdaBoostClassifier
from sklearn.neighbors import KNeighborsClassifier
import xgboost as xgb
import numpy as np
"""
Explanation: Loading necessary ... |
Olsthoorn/IHE-python-course-2017 | exercises/Mar07/readingText.ipynb | gpl-2.0 | import os
os.listdir() # make a list of the files in the current directory, so that we may handle them.
"""
Explanation: <figure>
<IMG SRC="../../logo/logo.png" WIDTH=250 ALIGN="right">
</figure>
IHE Python course, 2017
Reading text files
T.N.Olsthoorn, Feb 27, 2017
Reading and writing files is one of the essenti... |
jeicher/cobrapy | documentation_builder/milp.ipynb | lgpl-2.1 | cone_selling_price = 7.
cone_production_cost = 3.
popsicle_selling_price = 2.
popsicle_production_cost = 1.
starting_budget = 100.
"""
Explanation: Mixed-Integer Linear Programming
Ice Cream
This example was originally contributed by Joshua Lerman.
An ice cream stand sells cones and popsicles. It wants to maximize its... |
ga7g08/ga7g08.github.io | _notebooks/2015-07-02-Mining-used-car-sales.ipynb | mit | from BeautifulSoup import BeautifulSoup
import urllib
import pandas as pd
import seaborn
import numpy as np
import matplotlib.pyplot as plt
import scipy.optimize as so
%matplotlib inline
import seaborn as sns
sns.set_style(rc={'font.family': ['sans-serif'],'axis.labelsize': 25})
sns.set_context("notebook")
plt.rcPar... |
sangheestyle/ml2015project | howto/model13_DPGMM.ipynb | mit | import gzip
import pickle
from os import path
from collections import defaultdict
from numpy import sign
"""
Load buzz data as a dictionary.
You can give parameter for data so that you will get what you need only.
"""
def load_buzz(root='../data', data=['train', 'test', 'questions'], format='pklz'):
buzz_data = {... |
mitdbg/modeldb | client/workflows/demos/census-with-managed-versioning.ipynb | mit | # restart your notebook if prompted on Colab
try:
import verta
except ImportError:
!pip install verta
"""
Explanation: Logistic Regression with Grid Search (scikit-learn)
<a href="https://colab.research.google.com/github/VertaAI/modeldb/blob/master/client/workflows/demos/census-with-managed-versioning.ipynb" t... |
pyqg/pyqg | docs/examples/layered.ipynb | mit | import numpy as np
from numpy import pi
from matplotlib import pyplot as plt
import pyqg
from pyqg import diagnostic_tools as tools
"""
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 ... |
infilect/ml-course1 | week2/vgg_transfer_imagenet_to_flower/transfer_learning_solution.ipynb | mit | from urllib.request import urlretrieve
from os.path import isfile, isdir
from tqdm import tqdm
vgg_dir = 'tensorflow_vgg/'
# Make sure vgg exists
if not isdir(vgg_dir):
raise Exception("VGG directory doesn't exist!")
class DLProgress(tqdm):
last_block = 0
def hook(self, block_num=1, block_size=1, total_s... |
emsi/ml-toolbox | random/catfish/TL_02_Fixed feature extraction (CNN Codes vel bottleneck).ipynb | agpl-3.0 | from __future__ import print_function
import matplotlib.pyplot as plt
import numpy as np
import os
import sys
import zipfile
from IPython.display import display, Image
from scipy import ndimage
from sklearn.linear_model import LogisticRegression
from six.moves.urllib.request import urlretrieve
from six.moves import cPi... |
jorgemauricio/INIFAP_Course | ejercicios/Pandas/Ejercicio_Estaciones_Aguascalientes_Solucion.ipynb | mit | # importar librerías
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
plt.style.use("ggplot")
# leer csv
df = pd.read_csv("/Users/jorgemauricio/Documents/Research/INIFAP_Course/data/ags_ejercicio_curso.csv")
# estructura de la base de datos
df.head()
"""... |
flaviocordova/udacity_deep_learn_project | gan_mnist/Intro_to_GANs_Solution.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... |
BenLangmead/comp-genomics-class | notebooks/CG_MarkovChain.ipynb | gpl-2.0 | from __future__ import print_function
import random
import re
import gzip
from itertools import islice
from operator import itemgetter
import numpy as np
from future.standard_library import install_aliases
install_aliases()
from urllib.request import urlopen, urlcleanup, urlretrieve
"""
Explanation: Markov chains for... |
ES-DOC/esdoc-jupyterhub | notebooks/messy-consortium/cmip6/models/sandbox-1/ocean.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'messy-consortium', 'sandbox-1', 'ocean')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocean
MIP Era: CMIP6
Institute: MESSY-CONSORTIUM
Source ID: SANDBOX-1
Topic: Ocean
Sub-Topics: Timestepp... |
GoogleCloudPlatform/training-data-analyst | courses/ai-for-finance/practice/freestyle.ipynb | apache-2.0 | %%bigquery df
SELECT
*
FROM
`cloud-training-prod-bucket.ml4f.percent_change_sp500`
LIMIT
10
df.head()
"""
Explanation: Machine Learning for Finance Freestyle
In this lab you'll be given the opportunity to apply everything you have learned to build a trading strategy for SP500 stocks. First, let's introdu... |
GoogleCloudPlatform/vertex-ai-samples | notebooks/community/ml_ops/stage6/get_started_with_cpr.ipynb | apache-2.0 | ! mkdir src
%%writefile src/requirements.txt
fastapi
uvicorn
joblib~=1.0
numpy~=1.20
scikit-learn~=0.24
google-cloud-storage>=1.26.0,<2.0.0dev
google-cloud-aiplatform[prediction] @ git+https://github.com/googleapis/python-aiplatform.git@custom-prediction-routine
"""
Explanation: E2E ML on GCP: MLOps stage 6 : Get sta... |
MartyWeissman/Python-for-number-theory | PwNT Notebook 7.ipynb | gpl-3.0 | def GCD(a,b):
while b: # Recall that != means "not equal to".
a, b = b, a % b
return abs(a)
def totient(m):
tot = 0 # The running total.
j = 0
while j < m: # We go up to m, because the totient of 1 is 1 by convention.
j = j + 1 # Last step of while loop: j = m-1, and then j = j... |
dsacademybr/PythonFundamentos | Cap02/Notebooks/DSA-Python-Cap02-05-Dicionarios.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 2</font>
Download: http://github.com/dsacademybr
End of explanation
"""
# Isso ... |
letsgoexploring/teaching | winter2017/econ129/python/Econ129_Class_18_Complete.ipynb | mit | # 1. Input model parameters and print
parameters = pd.Series()
parameters['rho'] = .75
parameters['sigma'] = 0.006
parameters['alpha'] = 0.35
parameters['delta'] = 0.025
parameters['beta'] = 0.99
print(parameters)
# 2. Compute the steady state of the model directly
A = 1
K = (parameters.alpha*A/(parameters.beta**-1+pa... |
molpopgen/fwdpy | docs/examples/advanced/BGSmp.ipynb | gpl-3.0 | #Use Python 3's print a a function.
#This future-proofs the code in the notebook
from __future__ import print_function
#Import fwdpy. Give it a shorter name
import fwdpy as fp
##Other libs we need
import numpy as np
import pandas as pd
import math
import os
import sqlite3
import multiprocessing as mp
import libsequenc... |
feststelltaste/software-analytics | courses/20191014_ML-Summit/Einfuehrung in Software Analytics (Presentation).ipynb | gpl-3.0 | %matplotlib inline
import pandas as pd
"""
Explanation: Abstract
Titel: Einführung in Software Analytics
Beschreibung
In Unternehmen werden Datenanalysen intensiv genutzt, um aus Geschäftsdaten wertvolle Einsichten
zu gewinnen. Warum nutzen wir als Softwareentwickler Datenanalysen dann nicht auch für unsere eigenen Da... |
scikit-optimize/scikit-optimize.github.io | dev/notebooks/auto_examples/plots/visualizing-results.ipynb | bsd-3-clause | print(__doc__)
import numpy as np
np.random.seed(123)
import matplotlib.pyplot as plt
"""
Explanation: Visualizing optimization results
Tim Head, August 2016.
Reformatted by Holger Nahrstaedt 2020
.. currentmodule:: skopt
Bayesian optimization or sequential model-based optimization uses a surrogate
model to model the... |
tritemio/multispot_paper | index.ipynb | mit | from notebook_runner import run_notebook, run_notebook_template
"""
Explanation: Multi-spots paper data analysis
<p class="lead">This notebook performs data analysis for the paper: <br><br>
<i>Multi-spot single-molecule FRET: high-throughput analysis of freely diffusing molecules</i> <br>
Ingargiola et al. PLOS ONE (2... |
adamsteer/nci-notebooks | pgpointcloud/PGpnt_16tiles.ipynb | apache-2.0 | import os
import psycopg2 as ppg
import numpy as np
import ast
from osgeo import ogr
import shapely as sp
from shapely.geometry import Point,Polygon,asShape
from shapely.wkt import loads as wkt_loads
from shapely import speedups
import cartopy as cp
import cartopy.crs as ccrs
import pandas as pd
import pandas.io.s... |
YuguangTong/AY250-hw | hw_9/bayes_inference.ipynb | mit | loc_data = pd.read_csv('location_data_hw9.csv')
loc_data.head()
"""
Explanation: load data
End of explanation
"""
fig, axes = plt.subplots(2,2, figsize=[6, 4])
ylabels = [['red_pos_X', 'red_pos_Y'], ['blue_pos_X', 'blue_pos_Y']]
for i in range(2):
for j in range(2):
axes[i,j].plot(loc_data['t'], loc_data... |
locuslab/dreaml | examples/MNIST.ipynb | apache-2.0 | # Import libraries
import cPickle, gzip
import numpy as np
from time import sleep
import dreaml as dm
from dreaml.server import start
from dreaml.loss import Softmax
import dreaml.transformations as trans
# Load data from files
f = gzip.open('mnist.pkl.gz', 'rb')
train_set, valid_set, test_set = cPickle.load(f)
f.clos... |
joshspeagle/dynesty | demos/Examples -- Exponential Wave.ipynb | mit | # system functions that are always useful to have
import time, sys, os
# basic numeric setup
import numpy as np
# inline plotting
%matplotlib inline
# plotting
import matplotlib
from matplotlib import pyplot as plt
# seed the random number generator
rstate = np.random.default_rng(916301)
# re-defining plotting def... |
newhavenrc/nhrc2 | backend/determine_region.ipynb | mit | import fiona
from shapely.geometry import shape
import nhrc2
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
from collections import defaultdict
import numpy as np
from matplotlib.patches import Polygon
from shapely.geometry import Point
%matplotlib inline
#the project root directory:
nhrc2di... |
diging/tethne-notebooks | 4. Time-variant networks.ipynb | gpl-3.0 | from tethne.readers.wos import read
datadirpath = '/Users/erickpeirson/Projects/tethne-notebooks/data/wos'
MyCorpus = read(datadirpath)
"""
Explanation: Introduction to Tethne: Time-Variant Networks
Now that we can index our Corpus temporally using the slice method, we can start to build time-variant networks. In this... |
anthonyng2/FX-Trading-with-Python-and-Oanda | Oanda v20 REST-oandapyV20/05.00 Trade Management.ipynb | mit | import pandas as pd
import oandapyV20
import oandapyV20.endpoints.trades as trades
import configparser
config = configparser.ConfigParser()
config.read('../config/config_v20.ini')
accountID = config['oanda']['account_id']
access_token = config['oanda']['api_key']
"""
Explanation: <!--NAVIGATION-->
< Order Management... |
rjdkmr/do_x3dna | docs/notebooks/base_steps_tutorial.ipynb | gpl-3.0 | import numpy as np
import matplotlib.pyplot as plt
import dnaMD
%matplotlib inline
"""
Explanation: Analysis of local base-steps parameters
This tutorial discuss the analyses that can be performed using the dnaMD Python module included in the do_x3dna package. The tutorial is prepared using Jupyter Notebook and thi... |
t--wagner/python_in_the_lab | 03_problems.ipynb | gpl-3.0 | l0 = [0, 1, 2, 3, 4, 5]
l1 = ['a', 'b', 'c', 'd', 'e', 'f']
"""
Explanation: 1. Combine the two lists
End of explanation
"""
list(zip(l0, l1))
"""
Explanation: Solution:
Use zip() with list()
End of explanation
"""
l0 = [0, 1, 2]
l1 = ['a', 'b', 'c']
"""
Explanation: 2. Create all products of the two lists
End o... |
jorisvandenbossche/DS-python-data-analysis | _solved/visualization_02_plotnine.ipynb | bsd-3-clause | import pandas as pd
"""
Explanation: <p><font size="6"><b>Plotnine: Introduction </b></font></p>
© 2021, Joris Van den Bossche and Stijn Van Hoey (jorisvandenbossche@gmail.com, s... |
arthur-e/swc-workshop | python-climate/Python-SWC-Intro-Climate.ipynb | mit | print('Hello, world!')
"""
Explanation: Overview
This lesson introduces Python as an environment for reproducible scientific data analysis and programming. The materials are based on the Software Carpentry Programming with Python lesson.
At the end of this lesson, you will be able to:
Read and write basic Python code... |
mrcslws/nupic.research | projects/archive/dynamic_sparse/notebooks/ExperimentAnalysis-SigOptTest-4vars.ipynb | agpl-3.0 | %load_ext autoreload
%autoreload 2
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 *
from nupic.research.frameworks.dynamic... |
anshbansal/anshbansal.github.io | udacity_machine_learning_notes/deep_learning/lesson_01/lesson_01.ipynb | mit | scores = [3.0, 1.0, 0.2]
import numpy as np
def softmax(x):
return np.exp(x) / np.sum(np.exp(x), axis=0)
import matplotlib.pyplot as plt
x = np.arange(-2.0, 6.0, 0.1)
scores = np.vstack([x, np.ones_like(x), 0.2 * np.ones_like(x)])
scores.shape
plt.plot(x, softmax(scores).T, linewidth = 2)
plt.legend(['x', '1',... |
aw236/aw236.github.io | dataViz/seaborn_viz_examples_upwork.ipynb | mit | import os
os.getcwd()
"""
Explanation: Initialization
End of explanation
"""
import numpy as np
def sinplot(flip=1):
x = np.linspace(0, 14, 100)
for i in range(1, 7):
plt.plot(x, np.sin(x + i * .5) * (7 - i) * flip)
sbn.set()
sinplot()
sbn.set_style("whitegrid")
data = np.random.normal(size... |
Kaggle/learntools | notebooks/pandas/raw/tut_5.ipynb | apache-2.0 | #$HIDE_INPUT$
import pandas as pd
pd.set_option('max_rows', 5)
reviews = pd.read_csv("../input/wine-reviews/winemag-data-130k-v2.csv", index_col=0)
reviews.rename(columns={'points': 'score'})
"""
Explanation: Introduction
Oftentimes data will come to us with column names, index names, or other naming conventions that... |
quantopian/research_public | notebooks/lectures/Residuals_Analysis/notebook.ipynb | apache-2.0 | # Import libraries
import numpy as np
import pandas as pd
from statsmodels import regression
import statsmodels.api as sm
import statsmodels.stats.diagnostic as smd
import scipy.stats as stats
import matplotlib.pyplot as plt
import math
"""
Explanation: Residuals Analysis
By Chris Fenaroli and Max Margenot
Part of th... |
samuelshaner/openmc | docs/source/pythonapi/examples/mdgxs-part-i.ipynb | mit | from IPython.display import Image
Image(filename='images/mdgxs.png', width=350)
"""
Explanation: This IPython Notebook introduces the use of the openmc.mgxs module to calculate multi-energy-group and multi-delayed-group cross sections for an infinite homogeneous medium. In particular, this Notebook introduces the the ... |
dsacademybr/PythonFundamentos | Cap09/Mini-Projeto2/Mini-Projeto2 - Analise4.ipynb | gpl-3.0 | # Imports
import os
import subprocess
import stat
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from datetime import datetime
sns.set(style = "white")
%matplotlib inline
# Dataset
clean_data_path = "dataset/autos.csv"
df = pd.read_csv(clean_data_path,encoding = "latin-1")... |
ContextLab/quail | docs/tutorial/advanced_plotting.ipynb | mit | import quail
%matplotlib inline
egg = quail.load_example_data()
"""
Explanation: Advanced plotting
This tutorial will go over more advanced plotting functionality. Before reading this, you should take a look at the basic analysis and plotting tutorial. First, we'll load in some example data. This dataset is an egg co... |
CentroGeo/PyHagerstrand | Hagerstrand II.ipynb | gpl-2.0 | %pylab inline
from haggerstrand.diffusion import SimpleDiffusion
s = SimpleDiffusion(50,50,9,20,[(20,20)],0.3,10)
s.random_diffusion()
plt.imshow(s.result[:,:,9])
"""
Explanation: Análisis de datos
En esta parte del taller vamos a analizar, usando herramientas de ESDA (Exploratory Spatial Data Analysis), los datos gen... |
lemonyhermit/CodingYoga | python-for-developers/Chapter4/Chapter4_Loops.ipynb | gpl-2.0 | # Sum 0 to 99
s = 0
for x in range(1, 100):
s = s + x
print s
"""
Explanation: Python for Developers
First Edition
Chapter 4: Loops
Loops are repetition structures, generally used to process data collections, such as lines of a file or records of a database that must be processed by the same code block.
For
It is... |
oasis-open/cti-python-stix2 | docs/guide/equivalence.ipynb | bsd-3-clause | import stix2
from stix2 import AttackPattern, Environment, MemoryStore
env = Environment(store=MemoryStore())
ap1 = AttackPattern(
name="Phishing",
external_references=[
{
"url": "https://example2",
"source_name": "some-source2",
},
],
)
ap2 = AttackPattern(
nam... |
mne-tools/mne-tools.github.io | 0.19/_downloads/1458a29737cd3695e2bfc763012d8259/plot_report.ipynb | bsd-3-clause | import os
import mne
"""
Explanation: Getting started with mne.Report
This tutorial covers making interactive HTML summaries with
:class:mne.Report.
:depth: 2
As usual we'll start by importing the modules we need and loading some
example data <sample-dataset>:
End of explanation
"""
path = mne.datasets.samp... |
serge-sans-paille/talks | PyConFr2017.ipynb | mit | id # id(obj: Any) -> int
int # int(obj: SupportsInt) -> int
list.append # list.append(self: List[T], obj: T) -> None
"""
Explanation: L'interpréteur Python, quel sale type
PyConFR 2017, Toulouse
par Serge « sans paille » Guelton
avec la bénédiction de QuarksLab
Round 0
Quel type pour...
End of explanation
"""
f... |
ivergara/science_notebooks | Transitions in a d4 system.ipynb | gpl-3.0 | import numpy as np
import itertools
import functools
import operator
def generate_states(electrons, states):
seed = [1 if position < electrons else 0 for position in range(states)]
generated_states = list(set(itertools.permutations(seed)))
generated_states.sort(reverse=True)
return generated_states
st... |
nnadeau/pybotics | examples/machine_learning.ipynb | mit | from pybotics.predefined_models import ur10
from pybotics.robot import Robot
nominal_robot = Robot.from_parameters(ur10())
defective_robot = Robot.from_parameters(ur10())
defective_robot.tool.position = [0.1, 0, 0]
"""
Explanation: Robot Machine Learning
Many robot predictive maintenance applications require being ... |
coolharsh55/advent-of-code | 2016/python3/Day03.ipynb | mit | with open('../inputs/day03.txt', 'r') as f:
data = f.readlines()
"""
Explanation: Day 3: Squares With Three Sides
author: Harshvardhan Pandit
license: MIT
link to problem statement
Now that you can think clearly, you move deeper into the labyrinth of hallways and office furniture that makes up this part of Easter ... |
benneely/qdact-basic-analysis | notebooks/variablesummary.ipynb | gpl-3.0 | import pandas as pd
import pickle
import numpy as np
import matplotlib.pyplot as plt
from textwrap import wrap
#from matplotlib import rcParams
#rcParams.update({'figure.autolayout': True})
%matplotlib inline
dd = pickle.load(open("./python_scripts/02_data_dictionary_dict.p", "rb" ))
voi = ['ESASPain','ESASShortnessO... |
cliburn/sta-663-2017 | notebook/10D_Foreign_Language_Interface.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
plt.style.use('ggplot')
import numpy as np
"""
Explanation: Foreign Function Interface
End of explanation
"""
%%file c_math.h
#pragma once
double plus(double a, double b);
double mult(double a, double b);
double square(double a);
double acc(double *xs, int size);
... |
kwinkunks/rainbow | notebooks/Guessing_colourmaps-NOCROSS.ipynb | apache-2.0 | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Avoiding the cross
End of explanation
"""
cd ~/Dropbox/dev/rainbow/notebooks
from PIL import Image
# img = Image.open('data/cbar/boxer.png')
# img = Image.open('data/cbar/fluid.png')
# img = Image.open('data/cbar/lisa.png')
# im... |
hannorein/reboundx | ipython_examples/Custom_Effects.ipynb | gpl-3.0 | import rebound
sim = rebound.Simulation()
sim.add(m=1.)
sim.add(m=1e-6,a=1.)
sim.move_to_com()
"""
Explanation: Custom Effects
This notebook walks you through how to simply add your own custom forces and operators through REBOUNDx.
The first thing you need to decide is whether you want to write a force or an operator.... |
anhaidgroup/py_entitymatching | notebooks/guides/step_wise_em_guides/Performing Blocking Using Blackbox Blocker.ipynb | bsd-3-clause | # Import py_entitymatching package
import py_entitymatching as em
import os
import pandas as pd
"""
Explanation: Introduction
This IPython notebook illustrates how to perform blocking using rule-based blocker.
First, we need to import py_entitymatching package and other libraries as follows:
End of explanation
"""
#... |
IS-ENES-Data/submission_forms | dkrz_forms/Templates/Forms/Doc/Workflow_Form_Update.ipynb | apache-2.0 | # import necessary packages
from dkrz_forms import form_handler, utils, wflow_handler, checks
from datetime import datetime
from pprint import pprint
"""
Explanation: DKRZ data ingest workflow information update
(Disclaimer: This demo notebook is for data managers only !)
Updating information with respect to the data ... |
ES-DOC/esdoc-jupyterhub | notebooks/ipsl/cmip6/models/sandbox-2/atmoschem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'ipsl', 'sandbox-2', 'atmoschem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmoschem
MIP Era: CMIP6
Institute: IPSL
Source ID: SANDBOX-2
Topic: Atmoschem
Sub-Topics: Transport, Emissions ... |
EcoFinPy/ecofinpy.github.io | Analysis of Grades.ipynb | mit | %matplotlib inline
"""
Explanation: Example of notebook to perform analysis of data
This notebook describes step by step the analysis of the grades
Set some options for the notebook. We can ignore these options for now.
End of explanation
"""
import pandas
"""
Explanation: Import the tools needed
Import tool called... |
dietmarw/EK5312_ElectricalMachines | Chapman/Ch9-Problem_9-06.ipynb | unlicense | %pylab notebook
%precision %.4g
"""
Explanation: Excercises Electric Machinery Fundamentals
Chapter 9
Problem 9-6
End of explanation
"""
p = 6
R1 = 1.3 # [Ohm]
R2 = 1.73 # [Ohm]
X1 = 2.01 # [Ohm]
X2 = 2.01 # [Ohm]
Xm = 105.0 # [Ohm]
s = 0.05
Prot = 291 # [W]
n_sync = 1000 # [r/min]
"""
... |
ankurankan/pgmpy_notebook | notebooks/8. Reading and Writing from pgmpy file formats.ipynb | mit | from pgmpy.readwrite import ProbModelXMLReader
reader_string = ProbModelXMLReader('../files/example.pgmx')
"""
Explanation: readwrite module pgmpy
pgmpy is a python library for creation, manipulation and implementation of Probabilistic graph models. There are various standard file formats for representing PGM data. P... |
danielhers/dynet | examples/jupyter-tutorials/RNNs.ipynb | apache-2.0 | # we assume that we have the dynet module in your path.
import dynet as dy
"""
Explanation: RNNs tutorial
End of explanation
"""
pc = dy.ParameterCollection()
NUM_LAYERS=2
INPUT_DIM=50
HIDDEN_DIM=10
builder = dy.LSTMBuilder(NUM_LAYERS, INPUT_DIM, HIDDEN_DIM, pc)
# or:
# builder = dy.SimpleRNNBuilder(NUM_LAYERS, INPU... |
mjbommar/cscs-530-w2015 | code/004-basic-zombie/001-basic-zombie.ipynb | bsd-2-clause | class Grid2D(object):
"""
2-D grid class.
"""
pass
class InformationNetwork(object):
"""
Information diffusion network.
"""
pass
"""
Explanation: Space Classes
Physical Grid
Information Diffusion Network
End of explanation
"""
class Model(object):
"""
Model class.
"""
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.