repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
AdrianoValdesGomez/Master-Thesis | 3D_Plots_01.ipynb | cc0-1.0 | ts = np.linspace(0,16*np.pi,1000)
xs = np.sin(ts)
ys = np.cos(ts)
zs = ts
fig = plt.figure()
ax = fig.add_subplot(111, projection ='3d')
ax.plot(xs,ys,zs, zdir = 'z')
"""
Explanation: Line plot
End of explanation
"""
ts = np.linspace(0,8*np.pi,1000)
xs = np.sin(ts)
ys = np.cos(ts)
zs = ts
fig = plt.figure()
ax = f... |
gregcaporaso/short-read-tax-assignment | ipynb/mock-community/taxonomy-assignment-blast+.ipynb | bsd-3-clause | from os.path import join, expandvars
from joblib import Parallel, delayed
from glob import glob
from os import system
from tax_credit.framework_functions import (parameter_sweep,
generate_per_method_biom_tables,
move_results_to_repo... |
BrownDwarf/ApJdataFrames | notebooks/Hartmann2005.ipynb | mit | import warnings
warnings.filterwarnings("ignore")
"""
Explanation: ApJdataFrames 004: Hartmann2005
Title: IRAC Observations of Taurus Pre–Main-Sequence Stars
Authors: Lee Hartmann, S. T. Megeath, Lori Allen, Kevin Luhman, Nuria Calvet, Paola D'Alessio, Ramiro Franco-Hernandez, and Giovanni Fazio
Data is from this pape... |
AldoMaine/Solutions | notebooks/Tramp_Steamer.ipynb | mit | graph = {
"A": {"B": (12, 3), "C":(25, 6), },
"B": {"C": (11, 2), },
"C": {"A": (30, 6), "D": (16, 4), },
"D": {"A": (12, 2), },
}
"""
Explanation: Tramp Steamer Problem
Al Duke 3/11/2022
<p style="text-align: center"> <b>Figure 1. Tramp Steamer</b> </p>
Imagine you own a cargo ship that transpo... |
DSSatPitt/katz-python-workshop | web-scraping/Scraping Livingsocial.ipynb | cc0-1.0 | # import 3rd party libraries for fetching and parsing HTML documents
from bs4 import BeautifulSoup
import requests
"""
Explanation: Scraping Data from Livingsocial
The purpose of this exercise is to demonstrate some basic web scraping practices using the python programming language. To assist with this exercise we ar... |
tpin3694/tpin3694.github.io | machine-learning/fast_c_hyperparameter_tuning.ipynb | mit | # Load libraries
from sklearn import linear_model, datasets
"""
Explanation: Title: Fast C Hyperparameter Tuning
Slug: fast_c_hyperparameter_tuning
Summary: How to fast C hyperparameter tuning for logistic regression in scikit-learn for machine learning in Python.
Date: 2017-09-18 12:00
Category: Machine Learning
Tag... |
Ebotto1/RS-exploration | distribution.ipynb | mit | preg = nsfg.ReadFemPreg()
preg.shape
"""
Explanation: Visualizing distributions
Copyright 2015 Allen Downey
License: Creative Commons Attribution 4.0 International
Let's load up the NSFG pregnancy data.
End of explanation
"""
live = preg[preg.outcome == 1]
live.shape
"""
Explanation: And select the rows correspondi... |
bmeaut/python_nlp_2017_fall | course_material/05_Generator_expressions_list_comprehension/05_OOP_Comprehension_ContextM_lab.ipynb | mit | from math import gcd
class RationalNumber(object):
# TODO
r = RationalNumber(43, 2)
assert r + r == RationalNumber(43) # q = 1 in this case
assert r * 2 == r + r
r1 = RationalNumber(3, 2)
r2 = RationalNumber(4, 3)
assert r1 * r2 == RationalNumber(12, 6)
assert r1 / r2 == RationalNumber(9, 8)
as... |
csc-training/python-introduction | notebooks/exercises/Advanced Object oriented programming.ipynb | mit | class Person:
def __init__(self, name):
pass
def say_hi(self):
pass
"""
Explanation: Object-oriented programming
This notebooks contains assingments that are more complex. They are aimed at students who already know about object- oriented Programming from prior experience and who are famil... |
VectorBlox/PYNQ | Pynq-Z1/notebooks/examples/audio_playback.ipynb | bsd-3-clause | from pynq import Overlay
from pynq.drivers import Audio
Overlay('base.bit').download()
pAudio = Audio()
"""
Explanation: Welcome to Pynq Audio
This notebook shows the basic recording and playback features of the Pynq-Z1.
It uses the audio jack to play back recordings from the built-in microphone, as well as a pre-rec... |
empet/Mathematical-Physics | Eigenfunctions-Laplace-snowflake.ipynb | mit | %matplotlib inline
import numpy as np
import scipy.sparse
from scipy.sparse import linalg
from skimage import (filters, io)
import plotly.graph_objs as go
img=io.imread('images/kochSnowflake.jpg', as_gray=True)
io.imshow(img)
threshold = filters.threshold_otsu(img)
binary = img < threshold
"""
Explanation: <cente... |
DJCordhose/ai | notebooks/booster/5-keras-tensorflow-nn.ipynb | mit | import warnings
warnings.filterwarnings('ignore')
%matplotlib inline
%pylab inline
import pandas as pd
print(pd.__version__)
import tensorflow as tf
tf.logging.set_verbosity(tf.logging.ERROR)
print(tf.__version__)
import keras
print(keras.__version__)
"""
Explanation: Neural Networks with TensorFlow and Keras
End ... |
SheffieldML/notebook | GPy/Poisson regression tutorial.ipynb | bsd-3-clause | %pylab inline
import numpy as np
import scipy as sp
from scipy import stats
import pylab as pb
"""
Explanation: Count Data Tutorial
28th May 2014
by Alan Saul, with edits by Neil Lawrence
In this tutorial we will look at using a Gaussian Process with a Poisson likelihood to model a response variable that is count data... |
tylfin/GeosPy | docs/intro.ipynb | mit | from GeosPy import Geos
geosPy = Geos()
"""
Explanation: GeosPy: Geolocation Inference Made Easy
GeosPy is a python 3 library written to make geolocation inference easy. Geolocation inference is the identification of the real-world geographic location of an object on Earth based off of available data. GeosPy currently... |
jeffwen/self_driving_car_nd | term1/lenet_lab/LeNet-Lab.ipynb | mit | from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", reshape=False)
X_train, y_train = mnist.train.images, mnist.train.labels
X_validation, y_validation = mnist.validation.images, mnist.validation.labels
X_test, y_test = mnist.test.images, mn... |
CentroGeo/geoinformatica | vecindades_python/vecindades_1.ipynb | gpl-3.0 | import geopandas as gpd
denue = gpd.read_file("datos/DENUE_INEGI_09_.shp")
denue.head()
"""
Explanation: Cálculos en vecindades I
En este taller vamos a utilizar Python para calcular un par de variables, asociadas a cada polígono del espacio, en función de las propiedades de los polígonos vecinos.
Si pensamos en térm... |
magenta/ddsp | ddsp/colab/tutorials/0_processor.ipynb | apache-2.0 | # Copyright 2021 Google LLC. 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 or a... |
tensorflow/docs-l10n | site/en-snapshot/tutorials/generative/cyclegan.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... |
npuichigo/ttsflow | third_party/tensorflow/tensorflow/examples/tutorials/deepdream/deepdream.ipynb | apache-2.0 | # boilerplate code
from __future__ import print_function
import os
from io import BytesIO
import numpy as np
from functools import partial
import PIL.Image
from IPython.display import clear_output, Image, display, HTML
import tensorflow as tf
"""
Explanation: DeepDreaming with TensorFlow
Loading and displaying the m... |
linamnt/studyGroup | lessons/misc/sqlite-fts/SQLite3+FTS+Workshop.ipynb | apache-2.0 | import sqlite3
import sys
from glob import glob
"""
Explanation: Import sqlite3 library
End of explanation
"""
conn = sqlite3.connect('/users/mikespears/Desktop/mydb.db') #file-based db
#conn = sqlite3.connect(':memory:') # in-memory db
c = conn.cursor()
"""
Explanation: Connect to a database file or create an in-... |
GoogleCloudPlatform/vertex-ai-samples | notebooks/community/sdk/SDK_BigQuery_Custom_Container_Training.ipynb | apache-2.0 | !pip3 uninstall -y google-cloud-aiplatform
!pip3 install google-cloud-aiplatform
import IPython
app = IPython.Application.instance()
app.kernel.do_shutdown(True)
"""
Explanation: <table align="left">
<td>
<a href="https://colab.research.google.com/github/GoogleCloudPlatform/vertex-ai-samples/blob/master/notebo... |
tallakahath/pymatgen | examples/Calculating XRD patterns.ipynb | mit | # Set up some imports that we will need
from pymatgen import Lattice, Structure
from pymatgen.analysis.diffraction.xrd import XRDCalculator
from IPython.display import Image, display
%matplotlib inline
"""
Explanation: Introduction
This notebook shows how to plot an XRD plot for the two polymorphs of CsCl ($Pm\overli... |
CELMA-project/CELMA | derivations/laplacianInversion/ForwardsBackwards.ipynb | lgpl-3.0 | from IPython.display import display
from sympy import init_printing
from sympy import symbols, expand, together, as_finite_diff, collect
from sympy import Function, Eq, Subs, Derivative
from collections import deque
init_printing()
def fromFunctionToGrid(expr, sym):
"""
Change from @(x,z) to @_xz, where @ rep... |
martin-hunt/hublib | hublib/rappture/test/hist_test.ipynb | mit | io = rappture.RapXML('hist_run.xml')
io
%matplotlib notebook
io['output.histogram(example)'].plot()
"""
Explanation: Histogram Example
This code loads in the output of a run from the Rappture zoo of examples.
https://nanohub.org/infrastructure/rappture/browser/trunk/examples/zoo/histogram
End of explanation
"""
io... |
ryneches/SuchTree | data/plant-pollinators/lopez-fig-wasp/Lopez-Vaamonde.ipynb | bsd-3-clause | %load_ext rpy2.ipython
%pylab inline
%%R -w 800 -h 480 -u px
# First, Liam's code from the blog post...
library(phytools)
Pleistodontes<-read.tree(text="(((1,(2,3)100)50,(((((((4,(5,(6,7)100)69)100,(8,(9,10))81)61,11),(12,13)100),(14,15)100),(16,17)96),18)),19);")
Pleistodontes$tip.label<-c("P._froggatti",
"P._b... |
statsmodels/statsmodels.github.io | v0.12.1/examples/notebooks/generated/discrete_choice_example.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import pandas as pd
from scipy import stats
import matplotlib.pyplot as plt
import statsmodels.api as sm
from statsmodels.formula.api import logit
print(sm.datasets.fair.SOURCE)
print( sm.datasets.fair.NOTE)
dta = sm.datasets.fair.load_pandas().data
dta['affair'] = (dta['affai... |
tensorflow/docs-l10n | site/ja/r1/guide/keras.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... |
GoogleCloudPlatform/bigquery-oreilly-book | 05_devel/pandas.ipynb | apache-2.0 | #!python -m pip install google-cloud-bigquery
%matplotlib inline
#%load_ext google.cloud.bigquery
PROJECT='cloud-training-demos' # CHANGE THIS
"""
Explanation: Example of using BigQuery and Pandas together
This notebook illustrates a typical data science workflow that leverages the relative advantages of both Pandas... |
ComputationalModeling/spring-2017-danielak | past-semesters/fall_2016/day-by-day/day11-random-walks-and-random-numbers/Day_11_Pre_Class_Notebook-SOLUTIONS.ipynb | agpl-3.0 | # Imports the functionality that we need to display YouTube videos in a Jupyter Notebook.
# You need to run this cell before you run ANY of the YouTube videos.
from IPython.display import YouTubeVideo
# WATCH THE VIDEO IN FULL-SCREEN MODE
YouTubeVideo("fF841G53fGo",width=640,height=360) # random numbers
"""
Exp... |
pacificclimate/climate-explorer-netcdf-tests | notebooks/python-netcdf4-vs-HDF5.ipynb | gpl-3.0 | time_major = True
grids = [world_250k, world_125k, canada_5k, bc_400m]
ts = [timescales['seasonal'], timescales['annual'], timescales['monthly']] # Daily takes hours and hours to run #, timescales['daily']]
results = []
for grid in grids:
for timescale in ts:
testfile = write_netcdf_file(timescale, time_m... |
satishkt/ML-Foundations-Coursera | Week3-Classification/Analyzing product sentiment.ipynb | bsd-2-clause | import graphlab
"""
Explanation: Predicting sentiment from product reviews
Fire up GraphLab Create
End of explanation
"""
products = graphlab.SFrame('amazon_baby.gl/')
"""
Explanation: Read some product review data
Loading reviews for a set of baby products.
End of explanation
"""
products.head()
"""
Explanation... |
adityaka/misc_scripts | python-scripts/data_analytics_learn/link_pandas/Ex_Files_Pandas_Data/Exercise Files/02_01/Begin/.ipynb_checkpoints/Object Creation-checkpoint.ipynb | bsd-3-clause | import pandas as pd
import numpy as np
"""
Explanation: Rapid Overview
build intuition about pandas
details later
documentation: http://pandas.pydata.org/pandas-docs/stable/10min.html
End of explanation
"""
my_series = pd.Series([1,3,5,np.nan,6,8])
my_series
"""
Explanation: Basic series; default integer index
do... |
yevheniyc/Projects | 1j_NLP_Python/ex06.ipynb | mit | import pynlp
html_file = "html/article1.html"
json_file = "a1.json"
pynlp.full_parse(html_file, json_file)
"""
Explanation: Exercise 06: store annotated text as JSON files
Much of the preceding NLP code has been worked into a small library, and we'll call functions from that library to help keep these notebooks more... |
mliesenberg/tf-bcgdv | CNN Lab.ipynb | mit | import numpy as np
import tensorflow as tf
from sklearn.utils import shuffle
from tensorflow.examples.tutorials.mnist import input_data
from tensorflow.contrib.layers import flatten
mnist = input_data.read_data_sets("MNIST_data/", reshape=False)
X_train, y_train = mnist.train.images, mnist.train.labels
X_v... |
jsharpna/DavisSML | lectures/lecture1/lecture1.ipynb | mit | ## I will be using Python 3, for install instructions see
## http://anson.ucdavis.edu/~jsharpna/DSBook/unit1/intro.html#installation-and-workflow
## The following packages are numpy (linear algebra), pandas (data munging),
## sklearn (machine learning), matplotlib (graphics), statsmodels (statistical models)
import... |
tpin3694/tpin3694.github.io | machine-learning/logistic_regression.ipynb | mit | # Load libraries
from sklearn.linear_model import LogisticRegression
from sklearn import datasets
from sklearn.preprocessing import StandardScaler
"""
Explanation: Title: Logistic Regression
Slug: logistic_regression
Summary: How to train a logistic regression in scikit-learn.
Date: 2017-09-21 12:00
Category: Machine ... |
anandha2017/udacity | nd101 Deep Learning Nanodegree Foundation/DockerImages/09_preparing_for_sirajs_lesson/notebooks/02_intro-to-tflearn/TFLearn_Sentiment_Analysis_Solution.ipynb | mit | import pandas as pd
import numpy as np
import tensorflow as tf
import tflearn
from tflearn.data_utils import to_categorical
"""
Explanation: Sentiment analysis with TFLearn
In this notebook, we'll continue Andrew Trask's work by building a network for sentiment analysis on the movie review data. Instead of a network w... |
bkimo/discrete-math-with-python | tutorial_1_jupyter_notebook.ipynb | mit | # Import numerical packages
import numpy as np
import scipy.integrate
# Import pyplot for plotting
import matplotlib.pyplot as plt
# Seaborn, useful for graphics
import seaborn as sns
# Magic function to make matplotlib inline; other style specs must come AFTER
%matplotlib inline
# This enables SVG graphics inline.... |
leoferres/prograUDD | clases/08-Error-Messages.ipynb | mit | print(Q)
1 + 'abc'
2 / 0
L = [1, 2, 3]
L[1000]
"""
Explanation: Errores y excepciones
Syntax errors: el código no es válido (fácil de arreglar)
Runtime errors: código es sintácticamente válido, pero no ejecuta ()
Sematic errors: errores de lógica (difícil de identificar y arreglar)
Errores de "runtime"
End of exp... |
adolfoguimaraes/machinelearning | SupervisedLearning/Exercicio04_AllModels.ipynb | mit | # Imports Necessários
import nltk
import re
import pandas as pd
from sklearn.cluster import KMeans
from imdbpie import Imdb
from nltk.stem.snowball import SnowballStemmer
from sklearn.externals import joblib
dataset = joblib.load("../UnsupervisedLearning/moviesclassifieds.pkl")
data = pd.DataFrame(dataset)
data = data... |
navaro1/deep-learning | sentiment-rnn/Sentiment_RNN.ipynb | mit | import numpy as np
import tensorflow as tf
with open('../sentiment-network/reviews.txt', 'r') as f:
reviews = f.read()
with open('../sentiment-network/labels.txt', 'r') as f:
labels = f.read()
reviews[:2000]
"""
Explanation: Sentiment Analysis with an RNN
In this notebook, you'll implement a recurrent neural... |
ES-DOC/esdoc-jupyterhub | notebooks/thu/cmip6/models/sandbox-1/toplevel.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'thu', 'sandbox-1', 'toplevel')
"""
Explanation: ES-DOC CMIP6 Model Properties - Toplevel
MIP Era: CMIP6
Institute: THU
Source ID: SANDBOX-1
Sub-Topics: Radiative Forcings.
Properties: 85 (42 re... |
mne-tools/mne-tools.github.io | 0.24/_downloads/89667e881398db43faecc03a232e53a5/40_whitened.ipynb | bsd-3-clause | import mne
from mne.datasets import sample
"""
Explanation: Plotting whitened data
This tutorial demonstrates how to plot :term:whitened <whitening>
evoked data.
Data are whitened for many processes, including dipole fitting, source
localization and some decoding algorithms. Viewing whitened data thus gives
a di... |
maxentile/msm-learn | notebooks/Gaussian Process tinker.ipynb | mit | n_basis_fxns=15
basis_points=np.linspace(xmin,xmax,n_basis_fxns)
basis_fxns = np.empty(n_basis_fxns,dtype=object)
class RBF():
def __init__(self,center,r=1.0):
self.c=center
self.r=r
def __call__(self,x):
return np.exp(-(np.sum((x-self.c)**2) / (2*self.r**2)))
class StepFxn():
def... |
DTUWindEnergy/TOPFARM | examples/notebook/tutorial.ipynb | agpl-3.0 | # OpenMDAO imports
from openmdao.main.datatypes.array import Array
from openmdao.main.datatypes.float import Float
from openmdao.main.datatypes.list import List
from openmdao.main.component import Component
# FUSED-Wind imports
from fusedwind.plant_flow.asym import AEPMultipleWindRoses, AEPSingleWindRose, BaseAEPMod... |
Ttl/scikit-rf | doc/source/examples/metrology/TwoPortOnePath, EnhancedResponse, and FakeFlip.ipynb | bsd-3-clause | from IPython.display import *
Image('three_receiver_cal/pics/macgyver.jpg', width='50%')
"""
Explanation: TwoPortOnePath, EnhancedResponse, and FakeFlip
Intro
This example demonstrates a macgyver-ish shortcut you can take if you are measuring a device that is reciprocal and symmetric on a switch-less three-receiv... |
maxkleiner/maXbox4 | ARIMA_Predictor.ipynb | gpl-3.0 | #sign:max: MAXBOX8: 03/02/2021 18:34:41
# optimal moving average OMA for market index signals ARIMA study- Max Kleiner
# v2 shell argument forecast days - 4 lines compare - ^GDAXI for DAX
# pip install pandas-datareader
# C:\maXbox\mX46210\DataScience\princeton\AB_NYC_2019.csv AB_NYC_2019.csv
#https://medium.co... |
Olsthoorn/TransientGroundwaterFlow | exercises_notebooks/Techniques.ipynb | gpl-3.0 | import numpy as np
import matplotlib.pyplot as plt
from scipy.special import exp1
"""
Explanation: <figure>
<IMG SRC="../logo/logo.png" WIDTH=250 ALIGN="right">
</figure>
Some python knowledge, and techniques useful for your assignment
IHE Transient groundwater
@Theo Olsthoorn
2019-01-17
2019-12-21
<h1>Table of Co... |
scotthuang1989/Python-3-Module-of-the-Week | algorithm/iterator.ipynb | apache-2.0 | from itertools import *
for i in chain([1, 2, 3], ['a', 'b', 'c']):
print(i, end=' ')
print()
"""
Explanation: Merging and Spliting Iterator
The chain() function takes several iterators as arguments and returns a single iterator that produces the contents of all of the inputs as though they came from a single ite... |
zkbt/mosasaurus | notebooks/reduction-demo.ipynb | mit | %matplotlib auto
# create an instrument with the appropriate settings
from mosasaurus.instruments import LDSS3C
i = LDSS3C(grism='vph-all')
# set up the basic directory structure, where `data/` should be found
path = '/Users/zkbt/Cosmos/Data/mosaurusexample'
i.setupDirectories(path)
# set the extraction defaults
i.e... |
marko911/deep-learning | weight-initialization/weight_initialization.ipynb | mit | %matplotlib inline
import tensorflow as tf
import helper
from tensorflow.examples.tutorials.mnist import input_data
print('Getting MNIST Dataset...')
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
print('Data Extracted.')
"""
Explanation: Weight Initialization
In this lesson, you'll learn how to fin... |
danalexandru/Algo | FII-year3sem2-CN/Exam.ipynb | gpl-2.0 | from IPython.display import display
import pandas as pd
import matplotlib.pyplot
%matplotlib inline
index = ['f(x)']
columns = [-2, 0, 2, 3]
data = [[-3, -5, 9, 22]]
df = pd.DataFrame(data, index=index, columns=columns)
print(df)
# for brevity, we will write it like this
index = [' x', 'f(x)']
columns = [1, 2, 3, 4... |
christophmark/bayesloop | docs/source/tutorials/customobservationmodels.ipynb | mit | import bayesloop as bl
import numpy as np
import sympy.stats
from sympy import Symbol
rate = Symbol('lambda', positive=True)
poisson = sympy.stats.Poisson('poisson', rate)
L = bl.om.SymPy(poisson, 'lambda', bl.oint(0, 6, 1000))
"""
Explanation: Custom observation models
While bayesloop provides a number of observati... |
dmadeka/bqplot | examples/Applications/Wealth of Nations.ipynb | apache-2.0 | import pandas as pd
import numpy as np
import os
from bqplot import (
LogScale, LinearScale, OrdinalColorScale, ColorAxis,
Axis, Scatter, Lines, CATEGORY10, Label, Figure, Tooltip
)
from ipywidgets import HBox, VBox, IntSlider, Play, jslink
initial_year = 1800
"""
Explanation: This is a bqplot recreation of... |
GoogleCloudPlatform/vertex-ai-samples | notebooks/community/gapic/automl/showcase_automl_tabular_binary_classification_online.ipynb | apache-2.0 | import os
import sys
# Google Cloud Notebook
if os.path.exists("/opt/deeplearning/metadata/env_version"):
USER_FLAG = "--user"
else:
USER_FLAG = ""
! pip3 install -U google-cloud-aiplatform $USER_FLAG
"""
Explanation: Vertex client library: AutoML tabular binary classification model for online prediction
<ta... |
PyDataMadrid2016/Conference-Info | workshops_materials/20160408_0900_Basic_Python_Packages_for_Science/Basic Python Packages for Science empty.ipynb | mit | from IPython.display import HTML
HTML('<iframe src="http://conda.pydata.org/docs/_downloads/conda-cheatsheet.pdf" width="700" height="400"></iframe>')
"""
Explanation: Basic Python Packages for Science
The Aeropython’s guide to the Python Galaxy!
Siro Moreno Martín
Alejandro Sáez Mollejo
0. Introduction
Python in the... |
DJCordhose/ai | notebooks/ml/1-classic-code.ipynb | mit | import warnings
warnings.filterwarnings('ignore')
%matplotlib inline
%pylab inline
import pandas as pd
print(pd.__version__)
"""
Explanation: Classic Approach
End of explanation
"""
df = pd.read_csv('./insurance-customers-300.csv', sep=';')
y=df['group']
df.drop('group', axis='columns', inplace=True)
X = df.as_... |
jcmgray/xarray | examples/xarray_seasonal_means.ipynb | apache-2.0 | %matplotlib inline
import numpy as np
import pandas as pd
import xarray as xr
from netCDF4 import num2date
import matplotlib.pyplot as plt
print("numpy version : ", np.__version__)
print("pandas version : ", pd.__version__)
print("xarray version : ", xr.__version__)
"""
Explanation: Calculating Seasonal Averages fr... |
tensorflow/docs-l10n | site/en-snapshot/lite/tutorials/pose_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... |
BeyondTheClouds/enoslib | docs/jupyter/03_using_several_networks.ipynb | gpl-3.0 | import enoslib as en
# Enable rich logging
_ = en.init_logging()
"""
Explanation: Working with several networks
When one single network isn't enough.
Website: https://discovery.gitlabpages.inria.fr/enoslib/index.html
Instant chat: https://framateam.org/enoslib
Source code: https://gitlab.inria.fr/discovery/enoslib
... |
ghvn7777/ghvn7777.github.io | content/fluent_python/1_2_Vector.ipynb | apache-2.0 | from math import hypot
class Vector:
def __init__(self, x = 0, y = 0):
self.x = x
self.y = y
def __repr__(self):
# %r 获取对象各个属性标准字符串表现形式,这是个好习惯,它说明了一个关键点,Vector(1,2) 和 vector('1','2') 是不一样的
# 后者会在定义的时候报错,因为对象的构造只接收数值,不接受字符串
return "Vector(%r, %r)" % (self.x, self.y)
... |
icoxfog417/music_hack_day_onpasha | machines/photo_mood/.ipynb_checkpoints/number_recognizer-checkpoint.ipynb | mit | # グラフが文章中に表示されるようにするおまじない
%matplotlib inline
"""
Explanation: Number Recognizer
今回は、ブラウザ上に書いた手書きの数字を認識させます。具体的には、canvasに書かれた数字が0~9のどれであるかを当てさせます。
その予測を行うためのモデルを、以下のステップに沿って作成していきます。
データロード
モデル構築
学習
評価
保存
End of explanation
"""
from sklearn import datasets
digits = datasets.load_digits()
print(digits.data.shape)
... |
ellisonbg/talk-2015 | 03-JupyterandIPython.ipynb | mit | %load_ext load_style
%load_style images-pad.css
from IPython.display import Image
"""
Explanation: Project Jupyter and IPython
Overview
Jupyter and IPython are a pair of open source projects that together offer an open-source (BSD-licensed), interactive computing environment for Python, Julia, R and other languages.
... |
serpilliere/miasm | doc/ir/lift.ipynb | gpl-2.0 | from miasm.analysis.machine import Machine
from miasm.arch.x86.arch import mn_x86
from miasm.core import parse_asm, asmblock
from miasm.arch.x86.lifter_model_call import LifterModelCall_x86_32
from miasm.core.locationdb import LocationDB
from miasm.loader.strpatchwork import StrPatchwork
from miasm.analysis.binary impo... |
drincruz/PyGotham-2016 | Strava_Running_Data_Example.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
from stravalib import Client, unithelper
"""
Explanation: Quick look into Strava Data
Utilizing stravalib as a client
End of explanation
"""
client = Client()
# Register for an app here https://www.strava.com/settings/api
# You'll get your client_id there and then ... |
psas/composite-propellant-tank | Analysis/Calculations/Shrink Fit and Liner as Gasket Analysis.ipynb | gpl-3.0 | # Import packages here:
import math as m
import numpy as np
from IPython.display import Image
import matplotlib.pyplot as plt
# Properties of Materials (engineeringtoolbox.com, Cengel, Tian, DuPont, http://www.dtic.mil/dtic/tr/fulltext/u2/438718.pdf)
# Coefficient of Thermal Expansion
alphaAluminum = 0.0000131 # in... |
njtwomey/ADS | 01_data_ingress/01_lists.ipynb | mit | from __future__ import print_function
l1 = list()
l2 = []
print(l1)
print(l2)
"""
Explanation: Basics of lists
End of explanation
"""
print(len(l1))
print(len(l2))
"""
Explanation: The length of a list is acquired by the len functino:
End of explanation
"""
l3 = [1, 2, 3]
print(l3)
print(len(l3))
"""
Explanat... |
GoogleCloudPlatform/vertex-ai-samples | notebooks/community/gapic/custom/showcase_custom_tabular_classification_online_exported_ds.ipynb | apache-2.0 | import os
import sys
# Google Cloud Notebook
if os.path.exists("/opt/deeplearning/metadata/env_version"):
USER_FLAG = "--user"
else:
USER_FLAG = ""
! pip3 install -U google-cloud-aiplatform $USER_FLAG
"""
Explanation: Vertex client library: Custom training tabular classification model for online prediction u... |
JShadowMan/package | python/course/ch05-libraries/常用标准库和第三方库.ipynb | mit | # 引入time模块
import time
# 引入datetime模块
#
# 这里使用from ... import ...的形式
# 是因为datetime相关的操作都在`datetime`类中
from datetime import datetime
# 获取当前时间戳
print(time.time())
# 将时间格式化输出
print(time.strftime('%Y-%m-%d %H:%M:%S'))
# 将时间转换为时间戳
print(time.strptime('2019-10-01 12:00:00', '%Y-%m-%d %H:%M:%S'))
# 休眠一段时间
time.sleep(3)
... |
joeandrewkey/deep-learning | tv-script-generation/dlnd_tv_script_generation.ipynb | mit | """
DON'T MODIFY ANYTHING IN THIS CELL
"""
import helper
data_dir = './data/simpsons/moes_tavern_lines.txt'
text = helper.load_data(data_dir)
# Ignore notice, since we don't use it for analysing the data
text = text[81:]
"""
Explanation: TV Script Generation
In this project, you'll generate your own Simpsons TV scrip... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/introduction_to_tensorflow/solutions/3_keras_sequential_api.ipynb | apache-2.0 | import datetime
import os
import shutil
import numpy as np
import pandas as pd
import tensorflow as tf
from google.cloud import aiplatform
from matplotlib import pyplot as plt
from tensorflow import keras
from tensorflow.keras.callbacks import TensorBoard
from tensorflow.keras.layers import Dense, DenseFeatures
from t... |
samstav/scipy_2015_sklearn_tutorial | notebooks/03.4 Methods - Text Feature Extraction.ipynb | cc0-1.0 | X = ["Some say the world will end in fire,",
"Some say in ice."]
len(X)
from sklearn.feature_extraction.text import CountVectorizer
vectorizer = CountVectorizer()
vectorizer.fit(X)
vectorizer.vocabulary_
X_bag_of_words = vectorizer.transform(X)
X_bag_of_words.shape
X_bag_of_words
X_bag_of_words.toarray()
... |
davidhamann/python-fmrest | examples/finding_data.ipynb | mit | import fmrest
"""
Explanation: Finding data with python-fmrest
This is a short example on finding records with python-fmrest.
End of explanation
"""
fms = fmrest.Server('https://10.211.55.15',
user='admin',
password='admin',
database='Contacts',
... |
matsaleh13/courses | deeplearning1/nbs/lesson1.ipynb | apache-2.0 | %matplotlib inline
"""
Explanation: Using Convolutional Neural Networks
Welcome to the first week of the first deep learning certificate! We're going to use convolutional neural networks (CNNs) to allow our computer to see - something that is only possible thanks to deep learning.
Introduction to this week's task: 'Do... |
ganguli-lab/twpca | notebooks/demo.ipynb | mit | %pylab inline
np.random.seed(1234)
from scipy.ndimage.filters import convolve1d, gaussian_filter1d
from twpca import TWPCA
from twpca.regularizers import curvature
import itertools as itr
import seaborn as sns
sns.set_style("ticks")
%load_ext autoreload
%autoreload 2
"""
Explanation: Time-warped PCA demo
This notebook... |
waymo-research/waymo-open-dataset | tutorial/tutorial_local.ipynb | apache-2.0 | # copybara removed file resource import
import os
if os.path.exists('tutorial_local.ipynb'):
# in case it is executed as a Jupyter notebook from the tutorial folder.
os.chdir('../')
fake_predictions_path = '{pyglib_resource}waymo_open_dataset/metrics/tools/fake_predictions.bin'.format(pyglib_resource='')
fak... |
tzoiker/gensim | docs/notebooks/doc2vec-IMDB.ipynb | lgpl-2.1 | import locale
import glob
import os.path
import requests
import tarfile
dirname = 'aclImdb'
filename = 'aclImdb_v1.tar.gz'
locale.setlocale(locale.LC_ALL, 'C')
# Convert text to lower-case and strip punctuation/symbols from words
def normalize_text(text):
norm_text = text.lower()
# Replace breaks with space... |
DAInamite/programming-humanoid-robot-in-python | joint_control/add_training_data.ipynb | gpl-2.0 | %pylab inline
imshow(imread('robot_pose_image/Stand.png'))
"""
Explanation: add data to training set
The provided train data may not sufficient to get good pose recognization results. In case the pose is not recognized correctly, this data can be manually added to the train data.
Defined Poses
Stand: the weight is su... |
landmanbester/fundamentals_of_interferometry | 1_Radio_Science/01_01_a_brief_introduction_to_basic_astrophysics.ipynb | gpl-2.0 | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
from IPython.display import HTML
HTML('../style/course.css') #apply general CSS
"""
Explanation: Outline
Glossary
1. Radio Science using Interferometric Arrays
Previous: 1.0 Introduction
Next: 1.2 Electromagnetic radiation and astronomical quantiti... |
parashardhapola/python-workshop-2015 | notebooks/introduction_to_python.ipynb | mit | organism = "E. Coli"
treatment = "salt stress"
todays_headline = "Python bioformaticians among top paid professionals in the country"
"""
Explanation: Learning essential basic of Python using iPython notebook
1. Strings in Python
Lets start with creating some variables
End of explanation
"""
print todays_headline
"... |
nickdavidhaynes/python-data-science-intro | week_3/exploring_data.ipynb | mit | %matplotlib inline
"""
Explanation: Table of Contents
<p><div class="lev1 toc-item"><a href="#Exploring-and-understanding-data" data-toc-modified-id="Exploring-and-understanding-data-1"><span class="toc-item-num">1 </span>Exploring and understanding data</a></div><div class="lev1 toc-item"><a href="#What-is... |
apryor6/apryor6.github.io | visualizations/seaborn/notebooks/.ipynb_checkpoints/barplot-checkpoint.ipynb | mit | %matplotlib inline
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
plt.rcParams['figure.figsize'] = (20.0, 10.0)
plt.rcParams['font.family'] = "serif"
df = pd.read_csv('../../../datasets/movie_metadata.csv')
df.head()
"""
Explanation: seaborn.barplot
Bar graphs are usefu... |
YuriyGuts/kaggle-quora-question-pairs | notebooks/feature-wm-intersect.ipynb | mit | from pygoose import *
from collections import defaultdict
import seaborn as sns
import nltk
nltk.download('stopwords')
"""
Explanation: Feature: Intersections Weighted by Word Match
Question intersections weighted by word match ratio (based on the kernel by @skihikingkevin).
Imports
This utility package imports nu... |
rubensfernando/mba-analytics-big-data | Python/lista-exercicios/Lista de Exercicios - Base.ipynb | mit | def soma_tres_num(x,y,z=10):
return x+y+z
"""
Explanation: Lista de Exercícios - SEU NOME
Os exercícios valem 30% da nota final.
Data Entrega: 18/09/2016
Formato da Entrega: .ipynb - Clique em File -> Download as -> IPython Notebook (.ipynb)
Enviar por email até a data de entrega, onde o assunto do email dev... |
jluttine/bayespy | doc/source/examples/maximum_likelihood.ipynb | mit | import numpy as np
N = 200
X = np.random.randn(N, 1)
"""
Explanation: Maximum likelihood: Gaussian process hyperparameters
NOTE: Maximum likelihood estimation is very experimental in BayesPy. The whole messaging system is being rewritten in order to support much better MLE along with non-conjugate distributions and a ... |
Mdround/fastai-deeplearning1 | deeplearning1/_MDR/2_distracted_driver/State_Farm_scratch_model.ipynb | apache-2.0 | %matplotlib inline
import numpy as np
import os
import utils
from utils import *
#from imp import reload # fixes a P2-P3 incompatibility
#reload(utils)
"""
Explanation: MDR, June 2017, personal study.
This notebook records a personal learning project, conducted during the Fast.AI course, in which a convnet is taught... |
wcmckee/wcmckee | .ipynb_checkpoints/lcacoffee-checkpoint.ipynb | mit | import json
import os
import pandas
opcvs = open('/home/wcmckee/Downloads/convertcsv.json', 'r')
opzrd = opcvs.read()
jdunp = json.loads(opzrd)
valia = []
pandas.read_json(jdunp)
jdunp.count(int)
len(jdunp)
"""
Explanation: <h1>lcacoffee</h1>
script that displays coffees sold by hour at lca2015.
Currently it o... |
ethen8181/machine-learning | model_selection/partial_dependence/partial_dependence.ipynb | mit | # code for loading the format for the notebook
import os
# path : store the current path to convert back to it later
path = os.getcwd()
os.chdir(os.path.join('..', '..', 'notebook_format'))
from formats import load_style
load_style(css_style = 'custom2.css', plot_style = False)
os.chdir(path)
# 1. magic for inline ... |
antoniomezzacapo/qiskit-tutorial | community/aqua/artificial_intelligence/qsvm_kernel_multiclass.ipynb | apache-2.0 | from datasets import *
from qiskit_aqua.utils import split_dataset_to_data_and_labels
from qiskit_aqua.input import get_input_instance
from qiskit_aqua import run_algorithm
import numpy as np
"""
Explanation: Quantum SVM kernel algorithm: multiclass classifier extension
A multiclass extension works in conjunction wit... |
QuantCrimAtLeeds/PredictCode | examples/Scripts/Reload naive predictions.ipynb | artistic-2.0 | %matplotlib inline
import matplotlib.pyplot as plt
import open_cp.scripted
import open_cp.scripted.analysis as analysis
loaded = open_cp.scripted.Loader("naive_preds.pic.xz")
loaded.timed_points.time_range
fig, axes = plt.subplots(ncols=2, figsize=(16,7))
analysis.plot_data_scatter(loaded, axes[0])
analysis.plot_dat... |
Ccaccia73/NLAAS-Labs | lab07.ipynb | mit | import FEM_utilities as FEM
"""
Explanation: Lab 7 - Buckling behavior under biaxial compression
Module for computations
End of explanation
"""
def write_inp_file(a, b, h, nx, ny, E, ν, γ, num_modes=1):
"""
function to write inp file:
a : lenght of plate
b : height
h : thickn... |
rth/PyKrige | examples/kriging_meuse.ipynb | bsd-3-clause | # This example requires some extra packages compared to the PyKrige package.
# At the time of the creation, I used the conda package manager
# and installed the following (with the versions at the time):
# pandas 0.18.1, geopandas 0.2.1, seaborn 0.7.1, folium 0.2.1, shapely 1.5.16
# If you use pip, "pip install geopan... |
lijingpeng/kaggle | competitions/image_recognize/image_recognize.ipynb | mit | import cv2
import numpy as np
import sys
import pandas as pd
"""
Explanation: 识别谷歌街景图片中的字母
street-view-getting-started-with-julia 让我们从谷歌街景的图片中鉴定字母,这个题目是让我们学习和使用Julia,Julia有python和R的易用性,有C语言的速度,无奈对Julia不是很熟悉,所以还是想用python来试试。
End of explanation
"""
# typeData 为"train"或者"test"
# labelsInfo 包含每一个图片的ID
# 图片存储在trainResize... |
karlbenedict/karlbenedict.github.io | presentations/2014-04-CI-day/examples/notebook_02.ipynb | mit | import urllib
import zipfile
import StringIO
import string
import pandas
import matplotlib.pyplot as plt
import numpy as np
from IPython.display import HTML
import json
"""
Explanation: Network Data Access - USGS NWIS Service-based Data Access
Karl Benedict
Director, Earth Data Analysis Center
Associate Professor, Uni... |
Wei1234c/Elastic_Network_of_Things_with_MQTT_and_MicroPython | notebooks/demo/Remote texting demo.ipynb | gpl-3.0 | import os
import sys
import time
sys.path.append(os.path.abspath(os.path.join(os.path.pardir, '..\\codes', 'client')))
sys.path.append(os.path.abspath(os.path.join(os.path.pardir, '..\\codes', 'node')))
sys.path.append(os.path.abspath(os.path.join(os.path.pardir, '..\\codes', 'shared')))
sys.path.append(os.path.abspa... |
zzsza/Datascience_School | 10. 기초 확률론3 - 확률 분포 모형/01. SciPy를 이용한 확률 분포 분석.ipynb | mit | import scipy as sp
rv = sp.stats.norm()
type(rv)
"""
Explanation: SciPy를 이용한 확률 분포 분석
SciPy는 각종 수치 해석 기능을 제공하는 파이썬 패키지다. SciPy는 여러개의 서브 패키지로 구성되어 있는데 그 중 scipy.stats 서브패키지는 여러가지 확률 분포 분석을 위한 기능을 제공한다.
확률 분포 객체
SciPy에서 확률 분포 기능을 사용하려면 우선 해당 확률 분포에 대한 확률 분포 객체라는 것을 생성한 후에 이 객체의 메서드를 호출한다.
확률 분포 객체를 생성하는 명령에는 다음과 같은 것... |
georgetown-analytics/machine-learning | examples/bbengfort/census/census.ipynb | mit | import os
import requests
CENSUS_DATASET = (
"http://archive.ics.uci.edu/ml/machine-learning-databases/adult/adult.data",
"http://archive.ics.uci.edu/ml/machine-learning-databases/adult/adult.names",
"http://archive.ics.uci.edu/ml/machine-learning-databases/adult/adult.test",
)
def download_data(path... |
dbouquin/DATA_620 | 620_HW8.ipynb | mit | import nltk
nltk.download('all')
# make sure it's all set :)
nltk.word_tokenize("hello world")
%matplotlib inline
import pandas as pd
import seaborn as sns
"""
Explanation: IS620 week 8 - NLTK High Frequency Words
Daina Bouquin
Perform an analysis of high frequency words in a corpus of interest.
Complete the followi... |
bowen0701/data_science | notebook/sentiment_nlp.ipynb | bsd-2-clause | from __future__ import division
from __future__ import print_function
import numpy as np
import scipy as sp
import pandas as pd
import nltk
# When performing experiment, remove comment out for nltk.download().
# nltk.download()
import time
import warnings
warnings.filterwarnings("ignore")
"""
Explanation: Sentimen... |
robertoalotufo/ia898 | src/normalize.ipynb | mit | import numpy as np
def normalize(f, range=[0,255]):
f = np.asarray(f)
range = np.asarray(range)
if f.dtype.char in ['D', 'F']:
raise Exception('error: cannot normalize complex data')
faux = np.ravel(f).astype(float)
minimum = faux.min()
maximum = faux.max()
lower = range[0]
upp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.