repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
arcyfelix/Courses | 17-09-27-AWS Machine Learning A Complete Guide With Python/07 - Binary Classification/01 - ml_logistic_cost_example.ipynb | apache-2.0 | # Sigmoid or logistic function
# For any x, output is bounded to 0 & 1.
def sigmoid_func(x):
return 1.0/(1 + math.exp(-x))
sigmoid_func(10)
sigmoid_func(-100)
sigmoid_func(0)
# Sigmoid function example
x = pd.Series(np.arange(-8, 8, 0.5))
y = x.map(sigmoid_func)
x.head()
fig = plt.figure(figsize = (12, 8))
pl... |
besser82/shogun | doc/ipython-notebooks/classification/MKL.ipynb | bsd-3-clause | %pylab inline
%matplotlib inline
import os
SHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data')
# import all shogun classes
import shogun as sg
from shogun import *
"""
Explanation: Multiple Kernel Learning
By Saurabh Mahindre - <a href="https://github.com/Saurabh7">github.com/Saurabh7</a>
This notebook is ab... |
zrhans/python | exemplos/googlecode-day-python/google-python-class-day1-p3.ipynb | gpl-2.0 | # Criando um dicionario vazio
d = {}
# Adicionando elementos para chave-valor
d['a'] = 'alpha'
d['o'] = 'omega'
d['g'] = 'gamma'
# algumas propriedades uteis
d
#Exibindo as chaves
d.keys()
# Iterando sobre as chaves
for k in d.keys(): print 'Key:',k,'->',d[k]
#Exibindo os valores
d.values()
#Exibindo os itens
d.i... |
cielling/jupyternbs | analyze_stockdata_testing.ipynb | agpl-3.0 | import sqlite3
conn3 = sqlite3.connect('edgar_idx.db')
cursor=conn3.cursor()
"""
Explanation: Setting up for testing
Use sqlite3 to connect to the edgar_idx database
End of explanation
"""
ticker = "MMM"
"""
Explanation: Set the ticker and pull out the list of 10-Q's and 10-K's for it from the database. Save each t... |
aldian/tensorflow | tensorflow/lite/g3doc/tutorials/model_maker_text_classification.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... |
diegocavalca/Studies | phd-thesis/nilmtk/disaggregation_and_metrics.ipynb | cc0-1.0 | from __future__ import print_function, division
import time
from matplotlib import rcParams
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from six import iteritems
from nilmtk import DataSet, TimeFrame, MeterGroup, HDFDataStore
from nilmtk.disaggregate import CombinatorialOptimisation, FHMM
i... |
ffpenaloza/AstroExp | tarea5/tarea5.ipynb | gpl-3.0 | from astropy.io import fits
import numpy as np
f475 = fits.open('hst_9401_02_acs_wfc_f475w_drz.fits')
f850 = fits.open('hst_9401_02_acs_wfc_f850lp_drz.fits')
f475[1].writeto('sci_f475w_m87.fits',clobber=True)
f475[2].writeto('invvar_f475w_m87.fits',clobber=True)
f850[1].writeto('sci_f850lp_m87.fits',clobber=True)
f8... |
mne-tools/mne-tools.github.io | stable/_downloads/d8a6d02146c5c075611a652218e020ad/30_reading_fnirs_data.ipynb | bsd-3-clause | import os.path as op
import numpy as np
import pandas as pd
import mne
"""
Explanation: Importing data from fNIRS devices
fNIRS devices consist of two kinds of optodes: light sources (AKA "emitters" or
"transmitters") and light detectors (AKA "receivers"). Channels are defined as
source-detector pairs, and channel loc... |
mne-tools/mne-tools.github.io | 0.19/_downloads/bb8e52a46ac1372ec146fb9c9983f326/plot_15_handling_bad_channels.ipynb | bsd-3-clause | import os
from copy import deepcopy
import numpy as np
import mne
sample_data_folder = mne.datasets.sample.data_path()
sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample',
'sample_audvis_raw.fif')
raw = mne.io.read_raw_fif(sample_data_raw_file, verbose=False)
""... |
JAmarel/Phys202 | Interact/.ipynb_checkpoints/InteractEx04-checkpoint.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
from IPython.html.widgets import interact, interactive, fixed
from IPython.display import display
"""
Explanation: Interact Exercise 4
Imports
End of explanation
"""
def random_line(m, b, sigma, size=10):
"""Create a line y = m*x + b + N(0,si... |
pmgbergen/porepy | tutorials/ad_framework.ipynb | gpl-3.0 | import numpy as np
import porepy as pp
import scipy.sparse.linalg as spla
# fractures 1 and 2 cross each other in (3, 3)
frac_1 = np.array([[2, 2], [2, 4]])
frac_2 = np.array([[2, 5], [3, 3]])
# fracture 3 is isolated
frac_3 = np.array([[6, 6], [1, 5]])
gb = pp.meshing.cart_grid([frac_1, frac_2, frac_3], nx=np.array... |
dynaryu/rmtk | rmtk/vulnerability/derivation_fragility/R_mu_T_dispersion/SPO2IDA/spo2ida.ipynb | agpl-3.0 | from rmtk.vulnerability.derivation_fragility.R_mu_T_dispersion.SPO2IDA import SPO2IDA_procedure
from rmtk.vulnerability.common import utils
%matplotlib inline
"""
Explanation: SPO2IDA
This methodology uses the SPO2IDA tool described in Vamvatsikos and Cornell (2006) to convert static pushover curves into $16\%$, $50... |
IS-ENES-Data/submission_forms | test/Templates/.ipynb_checkpoints/CMIP6_submission_form-checkpoint.ipynb | apache-2.0 | from dkrz_forms import form_widgets
form_widgets.show_status('form-submission')
"""
Explanation: DKRZ CMIP6 submission form for ESGF data publication
General Information (to be completed based on official CMIP6 references)
Data to be submitted for ESGF data publication must follow the rules outlined in the CMIP6 Arch... |
brentjm/Impurity-Predictions | notebooks/temp.ipynb | bsd-2-clause | import numpy as np
import pandas as pd
import argparse as ap
def mass_density_sat(T):
"""
Mass of water in one cubic meter of air at one bar at temperature T
parameters:
T: float - Temperature (K)
returns float - mass of water in one cubic meter saturated air (kg/m^3)
"""
return ... |
nwilbert/async-examples | notebook/generators.ipynb | mit | class TestIterator:
def __init__(self, max_value):
self._current_value = 0
self._max_value = max_value
def __next__(self):
self._current_value += 1
if self._current_value > self._max_value:
raise StopIteration()
return self._current_value
"""
Explan... |
zingale/hydro_examples | compressible/euler.ipynb | bsd-3-clause | from sympy.abc import rho
rho, u, c = symbols('rho u c')
A = Matrix([[u, rho, 0], [0, u, rho**-1], [0, c**2 * rho, u]])
A
"""
Explanation: Euler Equations
The Euler equations in primitive variable form, $q = (\rho, u, p)^\intercal$ appear as:
$$q_t + A(q) q_x = 0$$
with the matrix $A(q)$:
$$A(q) = \left ( \begin{arra... |
ddemidov/mba | python/example.ipynb | mit | cmin = [0.0, 0.0]
cmax = [1.0, 1.0]
coo = uniform(0, 1, (7,2))
val = uniform(0, 1, coo.shape[0])
"""
Explanation: Using MBA
cmin and cmax are coordinates of the bottom-left and the top-right corners of the bounding box containing scattered data. coo and val are arrays containing coordinates and values of the data po... |
bmcmenamin/fa_kit | examples/Tutorial_Episode0.ipynb | mit | import os
import sys
sys.path.append(os.path.pardir)
%matplotlib inline
import numpy as np
from fa_kit import FactorAnalysis
from fa_kit import plotting as fa_plotting
"""
Explanation: Tutorial Episode 0: Setting up a Factor Analysis pipeline
In this notebook, I show you how to set up a factor analysis pipeline and ... |
mne-tools/mne-tools.github.io | 0.14/_downloads/plot_epochs_spectra.ipynb | bsd-3-clause | # Authors: Denis Engemann <denis.engemann@gmail.com>
#
# License: BSD (3-clause)
import mne
from mne import io
from mne.datasets import sample
print(__doc__)
"""
Explanation: Compute the power spectral density of epochs
This script shows how to compute the power spectral density (PSD)
of measurements on epochs. It a... |
sys-bio/tellurium | examples/notebooks/widgets/widgets_lorenz.ipynb | apache-2.0 | %matplotlib inline
from ipywidgets import interact, interactive
from IPython.display import clear_output, display, HTML
import numpy as np
from scipy import integrate
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.colors import cnames
from matplotlib import animation
""... |
hektor-monteiro/python-notebooks | MCMC-exemplo.ipynb | gpl-2.0 | import numpy as np
import matplotlib.pyplot as plt
xobs = np.array([1.,2.1,3.4,5.6,8.3,9.1,10.7,13.0])
yobs = np.array([6.24724,4.78879,8.82746,15.6056,16.2351,31.5331,8.88331,31.3041])
yobs_er = np.array([0.74,2.91,1.47,1.90,2.86,5.83,6.01,5.31]) # 30% error
plt.errorbar(xobs,yobs, yobs_er, fmt='o', capsize=5)
# ... |
chrsclrk/Solution_Architecture_with_Ansible_Jupyter | Solution_Architecture_with_Ansible_and_Jupyter.ipynb | mit | import sys, platform, subprocess
ansibleVersion = subprocess.check_output(['ansible', '--version']).decode('utf-8').split()[1]
print( f" Python: {' '.join(sys.version.split()[0:4])}\n" # Not the version of Pythone used by Ansible.
f' macOS: {platform.mac_ver()[0]}\n' # Control machine opera... |
tensorflow/hub | examples/colab/wav2vec2_saved_model_finetuning.ipynb | apache-2.0 | #@title Copyright 2021 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 ... |
swirlingsand/deep-learning-foundations | sentiment-network/Sentiment Classification - Mini Project 2.ipynb | mit | def pretty_print_review_and_label(i):
print(labels[i] + "\t:\t" + reviews[i][:80] + "...")
g = open('reviews.txt','r') # What we know!
reviews = list(map(lambda x:x[:-1],g.readlines()))
g.close()
g = open('labels.txt','r') # What we WANT to know!
labels = list(map(lambda x:x[:-1].upper(),g.readlines()))
g.close()... |
opencobra/cobrapy | documentation_builder/deletions.ipynb | gpl-2.0 | import pandas
from time import time
from cobra.io import load_model
from cobra.flux_analysis import (
single_gene_deletion, single_reaction_deletion, double_gene_deletion,
double_reaction_deletion)
cobra_model = load_model("textbook")
ecoli_model = load_model("iJO1366")
"""
Explanation: Simulating Deletions
... |
kit-cel/wt | SC468/BIAWGN_Capacity.ipynb | gpl-2.0 | import numpy as np
import scipy.integrate as integrate
import matplotlib.pyplot as plt
"""
Explanation: Capacity of the Binary-Input AWGN (BI-AWGN) Channel
This code is provided as supplementary material of the OFC short course SC468
This code illustrates
* Calculating the capacity of the binary input AWGN channel usi... |
dswah/pyGAM | doc/source/notebooks/quick_start.ipynb | apache-2.0 | from pygam.datasets import wage
X, y = wage()
"""
Explanation: Quick Start
This quick start will show how to do the following:
Install everything needed to use pyGAM.
fit a regression model with custom terms
search for the best smoothing parameters
plot partial dependence functions
Install pyGAM
Pip
pip install pyg... |
jlawman/jlawman.github.io | content/deep-learning/.ipynb_checkpoints/Activation Functions-Back-up-checkpoint.ipynb | mit | import matplotlib.pyplot as plt
import numpy as np
%matplotlib inline
z = np.linspace(-5,5,num=1000)
"""
Explanation: Deep Learning activation functions examined below include ReLU, Leaky ReLU Sigmoid, tanh
End of explanation
"""
def draw_activation_plot(a,quadrants=2,y_ticks=[0],y_lim=[0,5]):
#Create figur... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/image_classification/solutions/5_fashion_mnist_class.ipynb | apache-2.0 | # TensorFlow and tf.keras
import tensorflow as tf
from tensorflow import keras
# Helper libraries
import numpy as np
import matplotlib.pyplot as plt
print(tf.__version__)
"""
Explanation: Train a Neural Network Model to Classify Images
Learning Objectives
Undersand how to read and display image data
Pre-process ima... |
okkhoy/pyDataAnalysis | ml-regression/week1/ML-Regression-W1.ipynb | mit | crime_rate_data = graphlab.SFrame.read_csv('Philadelphia_Crime_Rate_noNA.csv')
crime_rate_data
graphlab.canvas.set_target('ipynb')
crime_rate_data.show(view='Scatter Plot', x = "CrimeRate", y = "HousePrice")
"""
Explanation: Work with Philadelphia crime rate data
The dataset has information about the house prices ... |
Cyb3rWard0g/HELK | docker/helk-jupyter/notebooks/tutorials/02-intro-to-numpy-arrays.ipynb | gpl-3.0 | import array
array_one = array.array('i',[1,2,3,4])
type(array_one)
type(array_one[0])
"""
Explanation: Introduction to Python NumPy Arrays
Goals:
Learn the basics of Python Numpy Arrays
References:
* http://www.numpy.org/
* https://docs.scipy.org/doc/numpy/user/quickstart.html
* https://www.datacamp.com/communit... |
MingChen0919/learning-apache-spark | notebooks/04-miscellaneous/add-python-files-to-spark-cluster.ipynb | mit | from pyspark import SparkConf, SparkContext, SparkFiles
from pyspark.sql import SparkSession
sc = SparkContext(conf=SparkConf())
"""
Explanation: The SparkContext.addPyFiles() function can be used to add py files. We can define objects and variables in these files and make them available to the Spark cluster.
Create ... |
mne-tools/mne-tools.github.io | 0.15/_downloads/plot_stats_cluster_methods.ipynb | bsd-3-clause | # Authors: Eric Larson <larson.eric.d@gmail.com>
# License: BSD (3-clause)
import numpy as np
from scipy import stats
from functools import partial
import matplotlib.pyplot as plt
# this changes hidden MPL vars:
from mpl_toolkits.mplot3d import Axes3D # noqa
from mne.stats import (spatio_temporal_cluster_1samp_test,... |
NYUDataBootcamp/Projects | UG_S17/DataBootcamp_Spring2017_finalProject.ipynb | mit | %matplotlib inline
# import necessary packages
import pandas as pd
import matplotlib.pyplot as plt
from pandas_datareader import data
from datetime import datetime
import numpy as np
from textblob import TextBlob
import csv
from wordcloud import WordCloud,ImageColorGene... |
physion/ovation-python | examples/requisition-import-from-csv.ipynb | gpl-3.0 | import dateutil.parser
import csv
from ovation.session import connect_lab
from tqdm import tqdm_notebook as tqdm
"""
Explanation: Requisition import
This example demonstrates importing requisition(s) from a CSV file
Setup
End of explanation
"""
user = input('Email: ')
s = connect_lab(user, api='https://lab-servic... |
chengwliu/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers | Chapter2_MorePyMC/Ch2_MorePyMC_PyMC2.ipynb | mit | import pymc as pm
parameter = pm.Exponential("poisson_param", 1)
data_generator = pm.Poisson("data_generator", parameter)
data_plus_one = data_generator + 1
"""
Explanation: Chapter 2
This chapter introduces more PyMC syntax and design patterns, and ways to think about how to model a system from a Bayesian perspect... |
mne-tools/mne-tools.github.io | stable/_downloads/0a1bad60270bfbdeeea274fcca0015d2/multidict_reweighted_tfmxne.ipynb | bsd-3-clause | # Author: Mathurin Massias <mathurin.massias@gmail.com>
# Yousra Bekhti <yousra.bekhti@gmail.com>
# Daniel Strohmeier <daniel.strohmeier@tu-ilmenau.de>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License: BSD-3-Clause
import os.path as op
import mne
from mne.datasets import somato
f... |
tensorflow/docs-l10n | site/ko/agents/tutorials/5_replay_buffers_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... |
NorfolkDataSci/presentations | python-for-data-science/python-for-data-science.ipynb | mit | greeting = "Hello, "
here = "World!"
print greeting + here
letters = ["a", "b", "c"]
for letter in letters:
print letter + letter
def mySuperCoolFunction(i):
return i*i
for j in range(5):
print mySuperCoolFunction(j)
"""
Explanation: Python for data science
Dominion Data Science
Getting started
Instal... |
ml4a/ml4a-guides | examples/reinforcement_learning/deep_q_networks.ipynb | gpl-2.0 | import numpy as np
from blessings import Terminal
class Game():
def __init__(self, shape=(10,10)):
self.shape = shape
self.height, self.width = shape
self.last_row = self.height - 1
self.paddle_padding = 1
self.n_actions = 3 # left, stay, right
self.term = Terminal()... |
AlJohri/DAT-DC-12 | homework/homework2_solutions.ipynb | mit | len(titles)
"""
Explanation: How many movies are listed in the titles dataframe?
End of explanation
"""
titles.sort_values(by='year').head(2)
"""
Explanation: What are the earliest two films listed in the titles dataframe?
End of explanation
"""
len(titles[titles.title == "Hamlet"])
"""
Explanation: How many mov... |
AntArch/Presentations_Github | 20160202_Nottingham_GIServices_Lecture3_Beck_InteroperabilitySemanticsAndOpenData/.ipynb_checkpoints/20151008_OpenGeo_Reuse_under_licence-checkpoint_conflict-20151001-162455.ipynb | cc0-1.0 | from IPython.display import YouTubeVideo
YouTubeVideo('F4rFuIb1Ie4')
## PDF output using pandoc
import os
### Export this notebook as markdown
commandLineSyntax = 'ipython nbconvert --to markdown 20151008_OpenGeo_Reuse_under_licence.ipynb'
print (commandLineSyntax)
os.system(commandLineSyntax)
### Export this not... |
jvcarr/portfolio | projects/Indeed-Scraping-Clean.ipynb | mit | # libraries to import
# related to webscraping - to acquire data
import requests
import bs4
from bs4 import BeautifulSoup
# for working with and visualizing data
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
# for modeling
from sklearn.cross_validation import cross_val_... |
opencb/opencga | opencga-client/src/main/python/notebooks/general-notebooks/pyopencga_basic_notebook_003-variants.ipynb | apache-2.0 | from pyopencga.opencga_config import ClientConfiguration
from pyopencga.opencga_client import OpencgaClient
from pprint import pprint
import json
"""
Explanation: pyOpenCGA basic variant and interpretation usage
[NOTE] The server methods used by pyopencga client are defined in the following swagger URL:
- http://bioi... |
Caranarq/01_Dmine | Datasets/INERE/INERE.ipynb | gpl-3.0 | descripciones = {
'P0009' : 'Potencial de aprovechamiento energía solar',
'P0010' : 'Potencial de aprovechamiento energía eólica',
'P0011' : 'Potencial de aprovechamiento energía geotérmica',
'P0012' : 'Potencial de aprovechamiento energía de biomasa',
'P0606' : 'Generación mediante fuentes renovables de energía',
'P06... |
darkomen/TFG | medidas/20072015/FILAEXTRUDER/Analisis.ipynb | cc0-1.0 | %pylab inline
#Importamos las librerías utilizadas
import numpy as np
import pandas as pd
import seaborn as sns
#Mostramos las versiones usadas de cada librerías
print ("Numpy v{}".format(np.__version__))
print ("Pandas v{}".format(pd.__version__))
print ("Seaborn v{}".format(sns.__version__))
#Abrimos el fichero csv... |
ldhagen/docker-jupyter | OpenCV_Recognize.ipynb | mit | ! wget http://docs.opencv.org/master/res_mario.jpg
import cv2
import numpy as np
from matplotlib import pyplot as plt
from PIL import Image as PIL_Image
from IPython.display import Image as IpyImage
IpyImage(filename='res_mario.jpg')
"""
Explanation: OpenCV template recognition from http://docs.opencv.org/master/d4... |
BeyondTheClouds/enoslib | docs/tutorials/iotlab/tuto_iotlab_g5k_ipv6.ipynb | gpl-3.0 | from enoslib import *
import logging
import sys
"""
Explanation: Grid'5000 and FIT/IoT-LAB - IPv6
Introduction
This example shows how to interact with both platforms in a single experiment.
An IPv6 network is built in IoT-LAB platform, composed of a border sensor and CoAP servers.
A node in Grid'5000 is the client, wh... |
nitheeshkl/Udacity_CarND_LaneLines_P1 | P1.ipynb | mit | #importing some useful packages
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
import cv2
%matplotlib inline
"""
Explanation: Self-Driving Car Engineer Nanodegree
Project: Finding Lane Lines on the Road
In this project, you will use the tools you learned about in the lesson to ide... |
sorig/shogun | doc/ipython-notebooks/regression/Regression.ipynb | bsd-3-clause | %pylab inline
%matplotlib inline
import os
SHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data')
from cycler import cycler
# import all shogun classes
from shogun import *
slope = 3
X_train = rand(30)*10
y_train = slope*(X_train)+random.randn(30)*2+2
y_true = slope*(X_train)+2
X_test = concatenate((linspace(0,... |
eds-uga/cbio4835-sp17 | lectures/Lecture27.ipynb | mit | import os
os.system("curl www.cnn.com -o cnn.html")
"""
Explanation: Lecture 27: Process control, multiprocessing, and fast code
CBIO (CSCI) 4835/6835: Introduction to Computational Biology
Overview and Objectives
As a final lecture, we'll go over how to extend the reach of your Python code beyond the confines of the ... |
tudarmstadt-lt/taxi | distributional_semantics.ipynb | apache-2.0 | def display_taxonomy(graph):
""" Display the taxonomy in a hierarchical layout """
pos = graphviz_layout(graph, prog='dot', args="-Grankdir=LR")
plt.figure(3,figsize=(48,144))
nx.draw(graph, pos, with_labels=True, arrows=True)
plt.show()
# Construct the networkx graph
def process_input(taxonomy):
... |
tensorflow/hub | examples/colab/spice.ipynb | apache-2.0 | #@title Copyright 2020 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 ... |
sdpython/pyquickhelper | _unittests/ut_ipythonhelper/data/having_a_form_in_a_notebook.ipynb | mit | from IPython.display import HTML, Javascript, display_html, display_javascript
input_form = """
<div style="background-color:gainsboro; width:500px; padding:10px;">
<label>Variable Name: </label>
<input type="text" id="var_name" value="myvar" size="170" />
<label>Variable Value: </label>
<input type="text" id="var_va... |
KrusecN13/Knjige | Projekt_knjige.ipynb | mit | import pandas as pd
pd.options.display.max_rows = 12
pd.options.display.max_columns = 12
nagrade = pd.read_csv('csv-datoteke/knjige-nagrade.csv',index_col='Naslov')
stoletja = pd.read_csv('csv-datoteke/knjige.csv',index_col='Naslov')
"""
Explanation: # Knjige
Projekt z naslovom Knjige za predmet programiranje 1 z n... |
tensorflow/workshops | kdd2019/colab/BERT fine-tuning and inferences with Cloud TPU.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... |
mne-tools/mne-tools.github.io | 0.20/_downloads/306dcf0b43a155a02804528d597e4e81/plot_roi_erpimage_by_rt.ipynb | bsd-3-clause | # Authors: Jona Sassenhagen <jona.sassenhagen@gmail.com>
#
# License: BSD (3-clause)
import mne
from mne.event import define_target_events
from mne.channels import make_1020_channel_selections
print(__doc__)
"""
Explanation: Plot single trial activity, grouped by ROI and sorted by RT
This will produce what is someti... |
simpleoier/2016FallSpeechProj | 1. Analysis.ipynb | apache-2.0 | import numpy as np
import os
from sklearn.manifold import TSNE
from common import Data
lld=Data('lld')
lld.load_training_data()
print 'training feature shape: ', lld.feature.shape
print 'training label shape: ', lld.label.shape
#lld.load_test_data()
#print 'test feature shape: ',lld.feature_test.shape
#print 'test l... |
Mynti207/cs207project | docs/stock_example_prices.ipynb | mit | # load data
with open('data/prices_include.json') as f:
stock_data_include = json.load(f)
with open('data/prices_exclude.json') as f:
stock_data_exclude = json.load(f)
# keep track of which stocks are included/excluded from the database
stocks_include = list(stock_data_include.keys())
stocks_exclude = ... |
shaunharker/DSGRN | software/Server/Accounts/Skeleton/notebooks/Tutorials/DSGRN_Python_GettingStarted.ipynb | mit | import DSGRN
"""
Explanation: DSGRN Python Interface Tutorial
This notebook shows the basics of manipulating DSGRN with the python interface.
End of explanation
"""
network = DSGRN.Network("network.txt")
print(network)
print(network.graphviz())
"""
Explanation: Network
The starting point of the DSGRN analysis is ... |
phungkh/phys202-2015-work | assignments/assignment04/MatplotlibEx01.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
"""
Explanation: Matplotlib Exercise 1
Imports
End of explanation
"""
import os
assert os.path.isfile('yearssn.dat')
"""
Explanation: Line plot of sunspot data
Download the .txt data for the "Yearly mean total sunspot number [1700 - now]" from th... |
konstantinstadler/pymrio | doc/source/notebooks/working_with_oecd_icio.ipynb | gpl-3.0 | import pymrio
from pathlib import Path
oecd_storage = Path('/tmp/mrios/OECD')
meta_2018_download = pymrio.download_oecd(storage_folder=oecd_storage, years=[2011])
"""
Explanation: Working with the OECD - ICIO database
The OECD Inter-Country Input-Output tables (ICIO) are available on the OECD webpage.
The parsing ... |
tensorflow/docs-l10n | site/zh-cn/guide/tpu.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... |
sarathid/Learning | Deep_learning_ND/Week 1/dlnd-your-first-network/DLND-your-first-network/old_files/dlnd-your-first-neural-network_TRY.ipynb | gpl-3.0 | %matplotlib inline
%config InlineBackend.figure_format = 'retina'
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
"""
Explanation: Your first neural network
In this project, you'll build your first neural network and use it to predict daily bike rental ridership. We've provided some of the code... |
jamesorr/CO2SYS-MATLAB | notebooks/CO2SYS-Matlab_derivnum.ipynb | mit | %load_ext oct2py.ipython
"""
Explanation: Calculate sensitivities with the derivnum add-on for CO2SYS-Matlab
James Orr<br>
<img align="left" width="50%" src="http://www.lsce.ipsl.fr/Css/img/banniere_LSCE_75.png"><br><br>
LSCE/IPSL, CEA-CNRS-UVSQ, Gif-sur-Yvette, France
27 February 2018 <br><br>
updated: 29 June 2020
... |
phungkh/phys202-2015-work | days/day11/Interpolation.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
"""
Explanation: Interpolation
Learning Objective: Learn to interpolate 1d and 2d datasets of structured and unstructured points using SciPy.
End of explanation
"""
x = np.linspace(0,4*np.pi,10)
x
"""
Explanation: Overview
W... |
statsmodels/statsmodels.github.io | v0.13.1/examples/notebooks/generated/autoregressive_distributed_lag.ipynb | bsd-3-clause | import numpy as np
import pandas as pd
import seaborn as sns
sns.set_style("darkgrid")
sns.mpl.rc("figure", figsize=(16, 6))
sns.mpl.rc("font", size=14)
"""
Explanation: Autoregressive Distributed Lag (ARDL) models
ARDL Models
Autoregressive Distributed Lag (ARDL) models extend Autoregressive models with lags of expl... |
AllenDowney/ModSimPy | notebooks/chap03.ipynb | mit | # Configure Jupyter so figures appear in the notebook
%matplotlib inline
# Configure Jupyter to display the assigned value after an assignment
%config InteractiveShell.ast_node_interactivity='last_expr_or_assign'
# import functions from the modsim library
from modsim import *
# set the random number generator
np.ran... |
srippa/nn_deep | assignment1/svm.ipynb | mit | # Run some setup code for this notebook.
import random
import numpy as np
from cs231n.data_utils import load_CIFAR10
import matplotlib.pyplot as plt
# This is a bit of magic to make matplotlib figures appear inline in the
# notebook rather than in a new window.
%matplotlib inline
plt.rcParams['figure.figsize'] = (10.... |
SunPower/pvfactors | docs/tutorials/PVArray_introduction.ipynb | bsd-3-clause | # Import external libraries
import matplotlib.pyplot as plt
# Settings
%matplotlib inline
"""
Explanation: PV Array geometry introduction
In this section, we will learn how to:
create a 2D PV array geometry with PV rows at identical heights, tilt angles, and with identical widths
plot that PV array
calculate the int... |
kazzz24/deep-learning | reinforcement/Q-learning-cart-Copy1.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... |
atlury/deep-opencl | DL0110EN/2.6.3.multi-target_linear_regression.ipynb | lgpl-3.0 | from torch import nn
import torch
Set the random seed:
torch.manual_seed(1)
"""
Explanation: <div class="alert alert-block alert-info" style="margin-top: 20px">
<a href="http://cocl.us/pytorch_link_top"><img src = "http://cocl.us/Pytorch_top" width = 950, align = "center"></a>
<img src = "https://ibm.box.com/share... |
napjon/krisk | notebooks/themes-colors.ipynb | bsd-3-clause | import krisk.plot as kk
import pandas as pd
# Use this when you want to nbconvert the notebook (used by nbviewer)
from krisk import init_notebook; init_notebook()
df = pd.read_csv('../krisk/tests/data/gapminderDataFiveYear.txt', sep='\t').sample(50)
"""
Explanation: With krisk, you also can customize color and themes... |
raghakot/keras-vis | applications/self_driving/visualize_attention.ipynb | mit | import numpy as np
from matplotlib import pyplot as plt
%matplotlib inline
from model import build_model, FRAME_W, FRAME_H
from keras.preprocessing.image import img_to_array
from vis.utils import utils
model = build_model()
model.load_weights('weights.hdf5')
img = utils.load_img('images/left.png', target_size=(FRAME... |
probml/pyprobml | notebooks/book1/03/prob.ipynb | mit | import os
import time
import numpy as np
np.set_printoptions(precision=3)
import glob
import matplotlib.pyplot as plt
import PIL
import imageio
import sklearn
import scipy.stats as stats
import scipy.optimize
import seaborn as sns
sns.set(style="ticks", color_codes=True)
import pandas as pd
pd.set_option("precisi... |
environmentalscience/essm | docs/examples/examples_numerics.ipynb | gpl-2.0 | from IPython.display import display
from sympy import init_printing, latex
init_printing()
from sympy.printing import StrPrinter
StrPrinter._print_Quantity = lambda self, expr: str(expr.abbrev) # displays short units (m instead of meter)
%run -i 'test_equation_definitions.py'
"""
Explanation: Use examples for num... |
bokeh/bokeh | examples/howto/server_embed/notebook_embed.ipynb | bsd-3-clause | import yaml
from bokeh.layouts import column
from bokeh.models import ColumnDataSource, Slider
from bokeh.plotting import figure
from bokeh.themes import Theme
from bokeh.io import show, output_notebook
from bokeh.sampledata.sea_surface_temperature import sea_surface_temperature
output_notebook()
"""
Explanation: E... |
GoogleCloudPlatform/asl-ml-immersion | notebooks/building_production_ml_systems/labs/4b_streaming_data_inference.ipynb | apache-2.0 | import os
import shutil
import googleapiclient.discovery
import numpy as np
import tensorflow as tf
from google import api_core
from google.api_core.client_options import ClientOptions
from google.cloud import bigquery
from matplotlib import pyplot as plt
from tensorflow import keras
from tensorflow.keras.callbacks im... |
broundy/udacity | nanodegrees/deep_learning_foundations/unit_1/project_1/dlnd-your-first-neural-network.ipynb | unlicense | %matplotlib inline
%config InlineBackend.figure_format = 'retina'
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
"""
Explanation: Your first neural network
In this project, you'll build your first neural network and use it to predict daily bike rental ridership. We've provided some of the code... |
dmolina/es_intro_python | 03-example_iris.ipynb | gpl-3.0 | from IPython.display import IFrame
IFrame('http://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data', width=300, height=200)
"""
Explanation: Getting started in scikit-learn with the famous iris dataset
From the video series: Introduction to machine learning with scikit-learn
Agenda
What is the famous ... |
Mashimo/datascience | 02-Classification/jhu.ipynb | apache-2.0 | import pandas as pd # Start by importing the data
X = pd.read_csv('../datasets/pml-training.csv', low_memory=False)
X.shape
"""
Explanation: LDA: Linear discriminant Analysis
A prediction model for Weight Lifting based on sensors to predict how well an exercise is performed.
Project goal
In this project we will u... |
johnpfay/environ859 | 07_DataWrangling/notebooks/02-Numpy-with-FeatureClasses.ipynb | gpl-3.0 | #Import arcpy and numpy
import arcpy
import numpy as np
#Point to the HUC12.shp feature class in the Data folder
huc12_fc = '../Data/HUC12.shp'
print arcpy.Exists(huc12_fc)
"""
Explanation: Using NumPy with ArcGIS: FeatureClass to Numpy
Demonstrates manipulation of feature class attribute data using Numpy. By no mean... |
FRidh/pstd | examples/basic_example.ipynb | bsd-3-clause | import sys
sys.path.append("..")
import numpy as np
from pstd import PSTD, PML, Medium, PointSource
from acoustics import Signal
#import seaborn as sns
%matplotlib inline
"""
Explanation: Basic example
In this notebook we show how to perform a basic simulation.
End of explanation
"""
x = 30.0
y = 20.0
z = 0.0
soun... |
toddstrader/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... |
chi-hung/notebooks | Crawling_Basics.ipynb | mit | soup = BeautifulSoup('<b class="boldest">Extremely bold</b>',"html.parser")
tag = soup.b
type(tag)
"""
Explanation: Now, I'm going to learn Beautiful Soup:
Tag:
End of explanation
"""
print tag.name
print tag["class"]
print tag.attrs
"""
Explanation: A tag has a name (say, "someTag"). It contains a set of attribut... |
fredhohman/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... |
dato-code/tutorials | dss-2016/lead_scoring/lead_scoring_tutorial.ipynb | apache-2.0 | from __future__ import print_function
import graphlab as gl
"""
Explanation: 1. Introduction
The scenario: suppose we run an online travel agency. We would like to convince our users to book overseas vacations, rather than domestic ones. Each of the users in this dataset will definitely book something at the end of a ... |
widdowquinn/SI_Holmes_etal_2017 | notebooks/01-data_qa.ipynb | mit | %pylab inline
import os
import random
import warnings
warnings.filterwarnings('ignore')
import numpy as np
import pandas as pd
import scipy
import seaborn as sns
from Bio import SeqIO
import tools
"""
Explanation: <img src="images/JHI_STRAP_Web.png" style="width: 150px; float: right;">
Supplementary Information: H... |
nholtz/structural-analysis | Devel/V05/Testing-Stuff.ipynb | cc0-1.0 | import hashlib
import inspect
import types
types.ClassType
class Bar:
pass
class Foo(Bar):
def __getitem__(s):
pass
type(Foo) is types.ClassType
inspect.getmembers(Foo)
def fdigest(filename):
f = open(filename,mode='rb')
m = hashlib.sha256(f.read())
f.close()
return m.hexdigest()
h ... |
basnijholt/orbitalfield | Paper-figures.ipynb | bsd-2-clause | import numpy as np
import holoviews as hv
import holoviews_rc
import kwant
from fun import *
import os
def ticks(plot, x=True, y=True):
hooks = [tick_marks]
if x:
xticks = [0, 1, 2]
else:
xticks = [(0,''), (1,''), (2,'')]
hooks.append(hide_x)
if y:
yticks = [0, 17, 35]
... |
metpy/MetPy | v0.9/_downloads/d5ee7fed8071553be26c422a7518141c/isentropic_example.ipynb | bsd-3-clause | import cartopy.crs as ccrs
import cartopy.feature as cfeature
import matplotlib.pyplot as plt
import numpy as np
import xarray as xr
import metpy.calc as mpcalc
from metpy.cbook import get_test_data
from metpy.plots import add_metpy_logo, add_timestamp
from metpy.units import units
"""
Explanation: Isentropic Analysi... |
ES-DOC/esdoc-jupyterhub | notebooks/cams/cmip6/models/sandbox-2/landice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'cams', 'sandbox-2', 'landice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Landice
MIP Era: CMIP6
Institute: CAMS
Source ID: SANDBOX-2
Topic: Landice
Sub-Topics: Glaciers, Ice.
Properties:... |
ComputationalModeling/spring-2017-danielak | past-semesters/spring_2016/homework_assignments/Homework_5.ipynb | agpl-3.0 | %matplotlib inline
import matplotlib.pyplot as plt
from string import punctuation
import urllib.request
files=['negative.txt','positive.txt']
path='http://www.unc.edu/~ncaren/haphazard/'
for file_name in files:
urllib.request.urlretrieve(path+file_name,file_name)
pos_sent = open("positive.txt").read()
positive_wo... |
GoogleCloudPlatform/openmrs-fhir-analytics | dwh/test_spark.ipynb | apache-2.0 | print('Hellooo! We use PySpark!')
"""
Explanation: FHIR Analytics with Spark
This notebook serves as a cleaned-up scratchbook for developing queries for processing
FHIR resources extracted from OpenMRS. This is part of the
OpenMRS Analytics Engine.
The notebook is based on Apache Spark and the
output of ETL batch/stre... |
GoogleCloudPlatform/training-data-analyst | courses/data-engineering/demos/composer_gcf_trigger/composertriggered.ipynb | apache-2.0 | import os
PROJECT = 'your-project-id' # REPLACE WITH YOUR PROJECT ID
REGION = 'us-central1' # REPLACE WITH YOUR REGION e.g. us-central1
# do not change these
os.environ['PROJECT'] = PROJECT
os.environ['REGION'] = REGION
"""
Explanation: Triggering a Cloud Composer Pipeline with a Google Cloud Function
In this advance... |
analysiscenter/dataset | examples/tutorials/09_tracking.ipynb | apache-2.0 | %load_ext autoreload
%autoreload 2
import sys
import warnings
warnings.filterwarnings("ignore")
import torch
import numpy as np
from tqdm import tqdm_notebook, tqdm
sys.path.append('../..')
from batchflow import Notifier, Pipeline, Dataset, I, W, V, L, B
from batchflow.monitor import *
# Set GPU
%env CUDA_VISIBLE_D... |
poldrack/fmri-analysis-vm | analysis/Bayesian/VariationalBayes.ipynb | mit | import numpy,scipy
import time
from numpy.linalg import inv
from scipy.special import digamma,gammaln
from numpy import log,pi,trace
from numpy.linalg import det
import matplotlib.pyplot as plt
from pymc3 import Model,glm,find_MAP,NUTS,sample,Metropolis,HalfCauchy,Normal
%matplotlib inline
"""
Explanation: This not... |
rishuatgithub/MLPy | torch/PYTORCH_NOTEBOOKS/01-PyTorch-Basics/03-PyTorch-Basics-Exercises-Solutions.ipynb | apache-2.0 | # CODE HERE
import torch
import numpy as np
"""
Explanation: <img src="../Pierian-Data-Logo.PNG">
<br>
<strong><center>Copyright 2019. Created by Jose Marcial Portilla.</center></strong>
PyTorch Basics Exercises - SOLUTIONS
For these exercises we'll create a tensor and perform several operations on it.
<div class="ale... |
merryjman/astronomy | sample.ipynb | gpl-3.0 | # Import modules that contain functions we need
import pandas as pd
import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
"""
Explanation: Star catalogue analysis
Thanks to UCF Physics undergrad Tyler Townsend for contributing to the development of this notebook.
End of explanation
"""
# Read in data... |
vzg100/Post-Translational-Modification-Prediction | .ipynb_checkpoints/Phosphorylation Sequence Tests -MLP -dbptm+ELM -scalesTrain-VectorAvr.-checkpoint.ipynb | mit | from pred import Predictor
from pred import sequence_vector
from pred import chemical_vector
"""
Explanation: Template for test
End of explanation
"""
par = ["pass", "ADASYN", "SMOTEENN", "random_under_sample", "ncl", "near_miss"]
scale = [-1, "standard", "robust", "minmax", "max"]
for i in par:
for j in scale:... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.