repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
tensorflow/agents | docs/tutorials/6_reinforce_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... |
root-mirror/training | SoftwareCarpentry/08-rdataframe-features.ipynb | gpl-2.0 | import ROOT
df = ROOT.RDataFrame("dataset","data/example_file.root")
df1 = df.Define("c","a+b")
out_treename = "outtree"
out_filename = "outtree.root"
out_columns = ["a","b","c"]
snapdf = df1.Snapshot(out_treename, out_filename, out_columns)
"""
Explanation: Save dataset to ROOT file after processing
With RDataFrame... |
HazyResearch/snorkel | tutorials/workshop/Workshop_7_Advanced_BRAT_Annotator.ipynb | apache-2.0 | %load_ext autoreload
%autoreload 2
%matplotlib inline
import os
import numpy as np
# Connect to the database backend and initalize a Snorkel session
from lib.init import *
"""
Explanation: Creating Gold Annotation Labels with BRAT
This is a short tutorial on how to use BRAT (Brat Rapid Annotation Tool), an
online env... |
changhoonhahn/centralMS | centralms/notebooks/notes_catalog.ipynb | mit | import numpy as np
import catalog as Cat
import matplotlib.pyplot as plt
from ChangTools.plotting import prettycolors
"""
Explanation: notebook accompanying catalog.py
Illustrates how to generate new subhalo accretion history catalogs
End of explanation
"""
sig = 0.0
smf = 'li-march'
nsnap0 = 20
subhist = Cat.Su... |
NEONScience/NEON-Data-Skills | tutorials-in-development/Python/neon_api/neon_api_05_taxonomy_py.ipynb | agpl-3.0 | import requests
import json
#Choose values for each option
SERVER = 'http://data.neonscience.org/api/v0/'
FAMILY = 'Pinaceae'
OFFSET = 11
LIMIT = 20
VERBOSE = 'false'
#Create 'options' portion of API call
OPTIONS = '?family={family}&offset={offset}&limit={limit}&verbose={verbose}'.format(
family = FAMILY,
off... |
D-K-E/cltk | notebooks/CLTK Demonstration.ipynb | mit | ## Requires Python 3.7, 3.8, 3.9 on a POSIX-compliant OS
## The latest published beta:
# !pip install cltk
## Or directly from this repo:
# cd .. && make install
# %load_ext autoreload
# %autoreload 2
"""
Explanation: Table of contents
Introduction
Install pre-release of CLTK
Get data
Run NLP pipeline with NLP()
I... |
enbanuel/phys202-2015-work | days/day10/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... |
qinjian623/dlnotes | cs231n/assignments/assignment1/knn.ipynb | gpl-3.0 | # 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.... |
sbu-python-summer/python-tutorial | day-4/matplotlib-exercises.ipynb | bsd-3-clause | import matplotlib.pyplot as plt
import numpy as np
%matplotlib inline
"""
Explanation: matplotlib exercises
End of explanation
"""
a = np.array([0.39, 0.72, 1.00, 1.52, 5.20, 9.54, 19.22, 30.06, 39.48])
"""
Explanation: Q1: planetary positions
The distances of the planets from the Sun (technically, their semi-major... |
daviddesancho/MasterMSM | examples/brownian_dynamics_2D/2D_smFS_MSM.ipynb | gpl-2.0 | %matplotlib inline
%load_ext autoreload
%autoreload 2
import time
import itertools
import h5py
import numpy as np
from scipy.stats import norm
from scipy.stats import expon
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import seaborn as sns
sns.set(style="ticks", color_codes=True, font_scale=1.5)
sns.set_... |
ML4DS/ML4all | R6.Gaussian_Processes/.ipynb_checkpoints/Bayesian_regression-checkpoint.ipynb | mit | # Import some libraries that will be necessary for working with data and displaying plots
# To visualize plots in the notebook
%matplotlib inline
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import scipy.io # To read matlab files
import pylab
"""
Explanation: Bayesian regression
Notebo... |
diging/methods | 1.2 Change and difference/1.2.1 Linear model with OLS.ipynb | gpl-3.0 | text_root = '../data/EmbryoProjectTexts/files'
zotero_export_path = '../data/EmbryoProjectTexts'
documents = nltk.corpus.PlaintextCorpusReader(text_root, 'https.+')
metadata = zotero.read(zotero_export_path, index_by='link', follow_links=False)
"""
Explanation: 1.2. Change over time
In computational humanities, we ar... |
cavestruz/MLPipeline | notebooks/clustering/ExampleGMM.ipynb | mit | gmms = [GMM(i).fit(X) for i in range(1,10)]
"""
Explanation: Fit X in the gmm model for 1, 2, ... 10 components. Hint: You should create 10 instances of a GMM model, e.g. GMM(?).fit(X) would be one instance of a GMM model with ? components.
End of explanation
"""
aics = [g.aic(X) for g in gmms]
bics = [g.bic(X) for... |
BeatHubmann/17F-U-DLND | sentiment-analysis/Sentiment Analysis with TFLearn.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... |
deimagjas/qubits.cloud.AI | dlnd-your-first-neural-network.ipynb | mit | %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... |
mne-tools/mne-tools.github.io | 0.23/_downloads/91078106f2c04f1e09c01a2fa07e9d27/10_raw_overview.ipynb | bsd-3-clause | import os
import numpy as np
import matplotlib.pyplot as plt
import mne
"""
Explanation: The Raw data structure: continuous data
This tutorial covers the basics of working with raw EEG/MEG data in Python. It
introduces the :class:~mne.io.Raw data structure in detail, including how to
load, query, subselect, export, an... |
enakai00/jupyter_ml4se_commentary | 06-pandas DataFrame-02.ipynb | apache-2.0 | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from pandas import Series, DataFrame
"""
Explanation: データフレームからのデータの抽出
End of explanation
"""
from numpy.random import randint
dices = randint(1,7,(5,2))
diceroll = DataFrame(dices, columns=['dice1','dice2'])
diceroll
"""
Explanation: DataFrame ... |
acmiyaguchi/data-pipeline | reports/android-clients/android-clients.ipynb | mpl-2.0 | def dedupe_pings(rdd):
return rdd.filter(lambda p: p["meta/clientId"] is not None)\
.map(lambda p: (p["meta/documentId"], p))\
.reduceByKey(lambda x, y: x)\
.map(lambda x: x[1])
"""
Explanation: Take the set of pings, make sure we have actual clientIds and remove duplicat... |
yongtang/tensorflow | tensorflow/lite/g3doc/tutorials/model_maker_speech_recognition.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... |
karthikrangarajan/intro-to-sklearn | 06.Model Evaluation.ipynb | bsd-3-clause | import pandas as pd
# import model algorithm and data
from sklearn import svm, datasets
# import splitter
from sklearn.cross_validation import train_test_split
# import metrics
from sklearn.metrics import confusion_matrix
# feature data (X) and labels (y)
iris = datasets.load_iris()
X, y = iris.data, iris.target
#... |
smrjan/seldon-server | python/examples/doc_similarity_reuters.ipynb | apache-2.0 | import json
import codecs
import os
docs = []
for filename in os.listdir("reuters-21578-json/data/full"):
f = open("reuters-21578-json/data/full/"+filename)
js = json.load(f)
for j in js:
if 'topics' in j and 'body' in j:
d = {}
d["id"] = j['id']
d["text"] = j['... |
pauliacomi/pyGAPS | docs/examples/inspection.ipynb | mit | # import isotherms
%run import.ipynb
"""
Explanation: General isotherm info
Before we start the characterisation, let's have a cursory look at the isotherms. First, make sure the data is imported by running the previous notebook.
End of explanation
"""
isotherms_n2_77k
"""
Explanation: We know that some of the isot... |
Centre-Alt-Rendiment-Esportiu/att | notebooks/Train_Points_Importer.ipynb | gpl-3.0 | !head -10 train_points_import_data/arduino_raw_data.txt
"""
Explanation: <h1>Train Points Importer</h1>
<hr style="border: 1px solid #000;">
<span>
<h2>
Import Tool for transforming collected hits from Arduino serial port, to ATT readable hit format.
</h2>
<span>
<br>
</span>
<i>Import points from arduino format</i><b... |
mdpiper/topoflow-notebooks | initial_snow_depth.ipynb | mit | from cmt.components import SnowEnergyBalance, SnowDegreeDay
seb, sdd = SnowEnergyBalance(), SnowDegreeDay()
"""
Explanation: Initial snow depth in SnowDegreeDay and SnowEnergyBalance
Problem: Show that setting initial snow depth h0_snow has no effect in SnowDegreeDay and SnowEnergyBalance.
Import the Babel-wrapped Sno... |
ecell/ecell4-notebooks | en/tutorials/tutorial07.ipynb | gpl-2.0 | %matplotlib inline
from ecell4.prelude import *
"""
Explanation: 7. Introduction of Rule-based Modeling
E-Cell4 provides the rule-based modeling environment.
End of explanation
"""
sp1 = Species("A(b^1).B(b^1)")
sp2 = Species("A(b^1).A(b^1)")
pttrn1 = Species("A")
print(count_species_matches(pttrn1, sp1)) # => 1
pr... |
linsalrob/PyFBA | iPythonNotebooks/From_functional_roles_to_gap-filling.ipynb | mit | import sys
import copy
import PyFBA
modeldata = PyFBA.parse.model_seed.parse_model_seed_data('gramnegative', verbose=True)
"""
Explanation: How to gap-fill a genome scale metabolic model
Getting started
Installing libraries
Before you start, you will need to install a couple of libraries:
The PyFBA library has detail... |
NirantK/deep-learning-practice | 03-InitRNN/dlnd_tv_script_generation.ipynb | apache-2.0 | """
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... |
gregmedlock/Medusa | docs/io.ipynb | mit | import medusa
from pickle import load
with open("../medusa/test/data/Staphylococcus_aureus_ensemble.pickle", 'rb') as infile:
ensemble = load(infile)
"""
Explanation: Input and output
Currently, the only supported approach for loading and saving ensembles in medusa is via pickle. pickle is the Python module that ... |
gfeiden/Notebook | Projects/ngc2516_spots/possible_binaries.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
from scipy.interpolate import interp1d
import numpy as np
ngc2516 = np.genfromtxt('data/ngc2516_Christophe_v3.dat') # data for this study from J&J (2012)
irwin01 = np.genfromtxt('data/irwin2007.phot') # data from Irwin+ (2007)
"""
Explanation: Possible Bin... |
sassoftware/sas-viya-programming | communities/Loading Data from Python into CAS.ipynb | apache-2.0 | import swat
conn = swat.CAS(host, port, username, password)
"""
Explanation: Loading Data from Python into CAS
There are many ways of loading data into CAS. Some methods simply invoke actions in CAS that load data from files on the server. Other methods of loading data involve connections to data sources such as da... |
dietmarw/EK5312_ElectricalMachines | Chapman/Ch1-Example_1-10.ipynb | unlicense | %pylab notebook
"""
Explanation: Electric Machinery Fundamentals 5th edition
Chapter 1 (Code examples)
Example 1-10
Calculate and plot the velocity of a linear motor as a function of load.
Import the PyLab namespace (provides set of useful commands and constants like $\pi$)
End of explanation
"""
VB = 120.0 # Ba... |
QuantEcon/QuantEcon.notebooks | solving_initial_value_problems.ipynb | bsd-3-clause | import matplotlib.pyplot as plt
import numpy as np
import sympy as sp
# comment out if you don't want plots rendered in notebook
%matplotlib inline
"""
Explanation: <center>
Solving initial value problems (IVPs) in quantecon
David R. Pugh
End of explanation
"""
from quantecon import ivp
"""
Explanation: 1. Introdu... |
tensorflow/docs-l10n | site/zh-cn/tutorials/estimator/premade.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... |
scotthuang1989/Python-3-Module-of-the-Week | text/difflib.ipynb | apache-2.0 | d = difflib.Differ()
diff = d.compare(text1_lines,text2_lines)
print('\n'.join(diff))
"""
Explanation: Comparing Bodies of Text
The Differ class works on sequences of text lines and produces human-readable deltas, or change instructions, including differences within individual lines. The default output produced by D... |
deepmind/deepmind-research | rl_unplugged/bsuite.ipynb | apache-2.0 | # @title Installation
!pip install dm-acme
!pip install dm-acme[reverb]
!pip install dm-acme[tf]
!pip install dm-sonnet
!pip install dopamine-rl==3.1.2
!pip install atari-py
!pip install dm_env
!git clone https://github.com/deepmind/deepmind-research.git
%cd deepmind-research
!git clone https://github.com/deepmind/bsu... |
daniestevez/jupyter_notebooks | CE5/CE-5 frame analysis ATA 2021-01-23.ipynb | gpl-3.0 | def load_frames(path):
frame_size = 220
frames = np.fromfile(path, dtype = 'uint8')
frames = frames[:frames.size//frame_size*frame_size].reshape((-1, frame_size))
return frames
frames = load_frames('ATA_2021-01-23/ce5_frames_1.u8')
"""
Explanation: Here we look at some Chang'e 5 low data rate telemetr... |
tkurfurst/deep-learning | embeddings/Skip-Grams-Solution.ipynb | mit | import time
import numpy as np
import tensorflow as tf
import utils
"""
Explanation: Skip-gram word2vec
In this notebook, I'll lead you through using TensorFlow to implement the word2vec algorithm using the skip-gram architecture. By implementing this, you'll learn about embedding words for use in natural language p... |
harishkrao/DSE200x | Mini Project/Analysis on the Movie Lens dataset.ipynb | mit | # The first step is to import the dataset into a pandas dataframe.
import pandas as pd
#path = 'C:/Users/hrao/Documents/Personal/HK/Python/ml-20m/ml-20m/'
path = '/Users/Harish/Documents/HK_Work/Python/ml-20m/'
movies = pd.read_csv(path+'movies.csv')
movies.shape
tags = pd.read_csv(path+'tags.csv')
tags.shape
rat... |
macks22/gensim | docs/notebooks/keras_wrapper.ipynb | lgpl-2.1 | from gensim.models import word2vec
"""
Explanation: Using wrappers for Gensim models for working with Keras
This tutorial is about using gensim models as a part of your Keras models.
The wrappers available (as of now) are :
* Word2Vec (uses the function get_embedding_layer defined in gensim.models.keyedvectors)
Word2... |
mne-tools/mne-tools.github.io | 0.16/_downloads/plot_movement_compensation.ipynb | bsd-3-clause | # Authors: Eric Larson <larson.eric.d@gmail.com>
#
# License: BSD (3-clause)
from os import path as op
import mne
from mne.preprocessing import maxwell_filter
print(__doc__)
data_path = op.join(mne.datasets.misc.data_path(verbose=True), 'movement')
head_pos = mne.chpi.read_head_pos(op.join(data_path, 'simulated_qu... |
hainm/scikit-xray-examples | demos/1_time_correlation/XPCS_fitting_with_lmfit.ipynb | bsd-3-clause | # analysis tools from scikit-xray (https://github.com/scikit-xray/scikit-xray/tree/master/skxray/core)
import skxray.core.roi as roi
import skxray.core.correlation as corr
import skxray.core.utils as utils
from lmfit import minimize, Parameters, Model
# plotting tools from xray_vision (https://github.com/Nikea/xray-v... |
ealogar/curso-python | advanced/5_decorators.ipynb | apache-2.0 | real_fibonacci = fibonacci
def fibonacci(n):
res = simcache.get_key(n)
if not res:
res = real_fibonacci(n)
simcache.set_key(n, res)
return res
t1_start = time.time()
print fibonacci(30)
t1_elapsed = time.time() - t1_start
print "fibonacci time {}".format(t1_elapsed)
t1_start = time.time()
p... |
DaveBackus/Data_Bootcamp | Code/IPython/bootcamp_test.ipynb | mit | import datetime
print('Welcome to Data Bootcamp!')
print('Today is: ', datetime.date.today())
"""
Explanation: Data Bootcamp test program (IPython notebook)
First, welcome.
Now that we're friends, click on "Cell" above and choose "Run all." You should see [*] (an asterisk in square brackets), which means the prog... |
hetaodie/hetaodie.github.io | assets/media/uda-ml/qinghua/dongtaiguihua/迷你项目:动态规划(第 2 部分)/Dynamic_Programming_Solution.ipynb | mit | from frozenlake import FrozenLakeEnv
env = FrozenLakeEnv()
"""
Explanation: Mini Project: Dynamic Programming
In this notebook, you will write your own implementations of many classical dynamic programming algorithms.
While we have provided some starter code, you are welcome to erase these hints and write your code... |
EBIvariation/eva-cttv-pipeline | data-exploration/complex-events/notebooks/complex-events-stats.ipynb | apache-2.0 | total_count, variant_type_hist, other_counts, exclusive_counts = counts(no_consequences_path, PROJECT_ROOT)
print(total_count)
plt.figure(figsize=(15,7))
plt.xticks(rotation='vertical')
plt.title('Variant Types (no functional consequences and incomplete coordinates)')
plt.bar(variant_type_hist.keys(), variant_type_hi... |
Neurosim-lab/netpyne | netpyne/tutorials/rxd_movie_tut/rxd_movie_tut.ipynb | mit | plotArgs = {
'speciesLabel': 'ca',
'regionLabel' : 'ecs',
'saveFig' : 'movie',
'showFig' : False,
'clim' : [1.9997, 2.000],
}
"""
Explanation: Making a movie of reaction-diffusion concentrations
We recommend creating and using a virtual environment for NetPyNE tutorials. To do so, ... |
serge-sans-paille/pythran | docs/examples/Third Party Libraries.ipynb | bsd-3-clause | import pythran
%load_ext pythran.magic
%%pythran
#pythran export pythran_cbrt(float64(float64), float64)
def pythran_cbrt(libm_cbrt, val):
return libm_cbrt(val)
"""
Explanation: Using third-party Native Libraries
Sometimes, the functionality you need is only available in third-party native libraries. These libr... |
nudomarinero/mltier1 | explore/Match_LOFAR_combined_final.ipynb | gpl-3.0 | import numpy as np
from astropy.table import Table, join
from astropy import units as u
from astropy.coordinates import SkyCoord, search_around_sky
from IPython.display import clear_output
import pickle
import os
import sys
sys.path.append("..")
from mltier1 import (get_center, Field, MultiMLEstimator, MultiMLEstima... |
ramseylab/networkscompbio | class13_similarity_python3.ipynb | apache-2.0 | import pandas
import igraph
import numpy
import matplotlib.pyplot as plt
import scipy.cluster.hierarchy
import scipy.spatial.distance
"""
Explanation: CS446/546 - Class Session 13 - similarity and hierarchical clustering
In this class session we are going to hierachically cluster (based on Sorensen-Dice similarity) ve... |
gfeiden/Notebook | Daily/20150902_phoenix_cifist_bcs.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import scipy.interpolate as scint
"""
Explanation: Phoenix BT-Settl Bolometric Corrections
Figuring out the best method of handling Phoenix bolometric correction files.
End of explanation
"""
cd /Users/grefe950/Projects/starspot/starspot/color/tab... |
PytLab/gaft | examples/1D_optimization_example.ipynb | gpl-3.0 | from gaft.components import BinaryIndividual
indv = BinaryIndividual(ranges=[(0, 10)], eps=0.001)
"""
Explanation: Find the global minima of function $f(x) = x + 10sin(5x) + 7cos(4x)$
Create individual (use binary encoding)
End of explanation
"""
from gaft.components import Population
population = Population(indv_te... |
GoogleCloudPlatform/ai-platform-samples | notebooks/samples/tensorflow/sentiment_analysis/ai_platform_sentiment_analysis.ipynb | apache-2.0 | import sys
# If you are running this notebook in Colab, run this cell and follow the
# instructions to authenticate your GCP account. This provides access to your
# Cloud Storage bucket and lets you submit training jobs and prediction
# requests.
if 'google.colab' in sys.modules:
from google.colab import auth as go... |
European-XFEL/h5tools-py | docs/Demo.ipynb | bsd-3-clause | !python3 -m karabo_data.tests.make_examples
"""
Explanation: Reading data with karabo_data
This command creates the sample data files used in the rest of this example. These files contain no real data, but they have the same structure as European XFEL's HDF5 data files.
End of explanation
"""
!h5ls fxe_control_examp... |
5hubh4m/CS231n | Assignment1/knn.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.... |
gidden/gidden.github.io | presentations/pyam-iamc2017/pyam-iamc2017.ipynb | cc0-1.0 | import pyam_analysis as iam
data = '/home/gidden/work/iiasa/message/pyam-analysis/tutorial/tutorial_AR5_data.csv'
df = iam.IamDataFrame(data=data)
"""
Explanation: Follow along at:
mattgidden.com/presentations/pyam-iamc2017
Find us on github:
github.com/IAMConsortium/pyam-analysis
Diagnostics, analysis and visualizat... |
BrownDwarf/ApJdataFrames | notebooks/Scholz2009.ipynb | mit | %pylab inline
import seaborn as sns
sns.set_context("notebook", font_scale=1.5)
#import warnings
#warnings.filterwarnings("ignore")
import pandas as pd
"""
Explanation: ApJdataFrames Scholz2009
Title: SUBSTELLAR OBJECTS IN NEARBY YOUNG CLUSTERS (SONYC): THE BOTTOM OF THE INITIAL MASS FUNCTION IN NGC 1333
Authors: A... |
JamesSample/icpw | check_core_icpw.ipynb | mit | # Connect to db
eng = nivapy.da.connect()
"""
Explanation: Explore "core" ICPW data
Prior to updating the "core" ICPW datasets in RESA, I need to get an overview of what's already in the database and what isn't.
End of explanation
"""
# Query projects
prj_grid = nivapy.da.select_resa_projects(eng)
prj_grid
prj_df =... |
apryor6/apryor6.github.io | visualizations/seaborn/notebooks/barplot.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... |
JonasHarnau/apc | apc/vignettes/vignette_ln_vs_odp.ipynb | gpl-3.0 | import apc
# Turn off FutureWarnings
import warnings
warnings.simplefilter('ignore', FutureWarning)
"""
Explanation: Log-Normal or Over-Dispersed Poisson?
We replicate the empirical applications in Harnau (2018a) in Section 2 and Section 6.
The work on this vignette was supported by the European Research Council, gra... |
vinhqdang/my_mooc | coursera/machine_learning_specialization/1_foundation/Document retrieval.ipynb | mit | import graphlab
"""
Explanation: Document retrieval from wikipedia data
Fire up GraphLab Create
End of explanation
"""
people = graphlab.SFrame('people_wiki.gl/')
"""
Explanation: Load some text data - from wikipedia, pages on people
End of explanation
"""
people.head()
len(people)
"""
Explanation: Data contain... |
JackDi/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... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive/10_recommend/content_based_using_neural_networks.ipynb | apache-2.0 | %%bash
pip freeze | grep tensor
"""
Explanation: Content-Based Filtering Using Neural Networks
This notebook relies on files created in the content_based_preproc.ipynb notebook. Be sure to run the code in there before completing this notebook.
Also, we'll be using the python3 kernel from here on out so don't forget to... |
fifabsas/talleresfifabsas | python/Extras/Big_Data/analisis.ipynb | mit | #Obtengo los datos directamente de la página web. No es necesario bajarlos!
educa = pd.read_csv(r"https://recursos-data.buenosaires.gob.ar/ckan2/estadistica-educativa/estadistica-educativa.csv",
delimiter=";")
print(educa.shape) #Imprime la cantidad de filas primero, y después la cantidad de column... |
tensorflow/docs-l10n | site/en-snapshot/hub/tutorials/tf2_text_classification.ipynb | apache-2.0 | # Copyright 2019 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... |
yashdeeph709/Algorithms | PythonBootCamp/Complete-Python-Bootcamp-master/Object Oriented Programming.ipynb | apache-2.0 | l = [1,2,3]
"""
Explanation: Object Oriented Programming
Object Oriented Programming (OOP) tends to be one of the major obstacles for beginners when they are first starting to learn Python.
There are many,many tutorials and lessons covering OOP so feel free to Google search other lessons, and I have also put some link... |
cgivre/oreilly-sec-ds-fundamentals | Notebooks/Intro/One Dimensional Data Worksheet-Python Answers.ipynb | apache-2.0 | import pandas as pd
import numpy as np
"""
Explanation: One Dimensional Data Worksheet
This worksheet reviews the concepts discussed about 1 dimensional data. The goal for these exercises is getting you to think in terms of vectorized computing. This worksheet should take 20-30 minutes to complete.
End of explanatio... |
tvaught/compintro | 02_intro_to_python.ipynb | bsd-3-clause | 2+2
"""
Explanation: Introduction to Python
Simple Expressions / Variable Assignment
The Python interpreter, which is being used to parse and execute each of these lines, can do math like a calculator:
End of explanation
"""
print 2*3
print (4+6)*(2+9) # should calculate to 110
print 12.0/11.0
"""
Explanation: Ano... |
Neuroglycerin/neukrill-net-work | notebooks/model_run_and_result_analyses/Interactive Pylearn2.ipynb | mit | !cat yaml_templates/replicate_8aug_online.yaml
"""
Explanation: Building the train object
The job of the YAML parser is to instantiate the train object and everything inside of it. Looking at an example YAML file:
End of explanation
"""
import pylearn2.space
final_shape = (48,48)
input_space = pylearn2.space.Compo... |
GoogleCloudPlatform/tensorflow-without-a-phd | tensorflow-rnn-tutorial/00_Keras_RNN_predictions_playground.ipynb | apache-2.0 | # using Tensorflow 2
%tensorflow_version 2.x
import numpy as np
from matplotlib import pyplot as plt
import tensorflow as tf
print("Tensorflow version: " + tf.__version__)
#@title Display utilities [RUN ME]
from enum import IntEnum
import numpy as np
class Waveforms(IntEnum):
SINE1 = 0
SINE2 = 1
SINE3 = ... |
TwistedHardware/mltutorial | notebooks/tf/.ipynb_checkpoints/2. Tensors-checkpoint.ipynb | gpl-2.0 | import tensorflow as tf
import sys
print("Python Version:",sys.version.split(" ")[0])
print("TensorFlow Version:",tf.VERSION)
"""
Explanation: <table>
<tr>
<td style="text-align:left;"><div style="font-family: monospace; font-size: 2em; display: inline-block; width:60%">2. Tensors</div><img src="images/ro... |
wanderer2/pymc3 | docs/source/notebooks/getting_started.ipynb | apache-2.0 | import numpy as np
import matplotlib.pyplot as plt
# Initialize random number generator
np.random.seed(123)
# True parameter values
alpha, sigma = 1, 1
beta = [1, 2.5]
# Size of dataset
size = 100
# Predictor variable
X1 = np.random.randn(size)
X2 = np.random.randn(size) * 0.2
# Simulate outcome variable
Y = alpha... |
vdelia/vdelia.github.io | assets/kanren/ukanren.ipynb | cc0-1.0 | import collections
logic_variable = collections.namedtuple("logic_variable", ["index"])
def is_logic_var(x):
return isinstance(x, logic_variable)
"""
Explanation: A python implementation of $\mu$Kanren
[$\mu$Kanren][micro] (microKanren)
is a minimalistic relational programming language, introduced as a stripped... |
google-research/google-research | kws_streaming/colab/02_inference.ipynb | apache-2.0 | !git clone https://github.com/google-research/google-research.git
import sys
import os
import tarfile
import urllib
import zipfile
sys.path.append('./google-research')
"""
Explanation: Copyright 2019 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in complia... |
astro4dev/OAD-Data-Science-Toolkit | Teaching Materials/Programming/Python/PythonISYA2018/01.BasicPythonI/03_dictionaries.ipynb | gpl-3.0 | d = {'Angela': 23746, 'Sofia': 2514, 'Luis': 3747, 'Diego': 61562}
"""
Explanation: Dictionaries
Dictionaries are a very useful data structure. They are similar to lists, but instead
of being indexed by integeres they are indexed by keys which can be of any type as long
as they are immutable. In a dictionary the ke... |
shareactorIO/pipeline | source.ml/jupyterhub.ml/notebooks/zz_old/Python/Basics/Sets.ipynb | apache-2.0 | from urllib.request import urlopen
url_response = urlopen('http://www.py4inf.com/code/romeo.txt')
contents = str(url_response.read())
print(contents)
"""
Explanation: Read Contents from URL
End of explanation
"""
lines = contents.split('\\n')
print(lines)
"""
Explanation: Split Contents Into Lines Using New-lin... |
ebonnassieux/fundamentals_of_interferometry | 2_Mathematical_Groundwork/2_8_the_discrete_fourier_transform.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
2. Mathematical Groundwork
Previous: 2.7 Fourier Theorems
Next: 2.9 Sampling Theory
Import standard modules:
End of explanation
""... |
metpy/MetPy | v0.5/_downloads/Inverse_Distance_Verification.ipynb | bsd-3-clause | import matplotlib.pyplot as plt
import numpy as np
from scipy.spatial import cKDTree
from scipy.spatial.distance import cdist
from metpy.gridding.gridding_functions import calc_kappa
from metpy.gridding.interpolation import barnes_point, cressman_point
from metpy.gridding.triangles import dist_2
plt.rcParams['figure.... |
rhiever/scipy_2015_sklearn_tutorial | notebooks/03.2 Methods - Unsupervised Preprocessing.ipynb | cc0-1.0 | %matplotlib inline
import matplotlib.pyplot as plt
"""
Explanation: Example from Image Processing
End of explanation
"""
from sklearn import datasets
lfw_people = datasets.fetch_lfw_people(min_faces_per_person=70, resize=0.4,
data_home='datasets')
lfw_people.data.shape
"""
Exp... |
sdss/marvin | docs/sphinx/tutorials/exercises/resolved_mass_metallicity_relation_SOLUTION.ipynb | bsd-3-clause | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import os
from os.path import join
path_notebooks = os.path.abspath('.')
path_data = join(path_notebooks, 'data')
"""
Explanation: Spatially-Resolved Mass-Metallicity Relation
We're going to construct the spatially-resolved mass-metallicity relatio... |
prasants/pyds | 10.Visualise_This.ipynb | mit | """
We begin by using an inbuilt iPython Magic function to display plots
within the window.
"""
%matplotlib inline
import matplotlib.pyplot as plt
import matplotlib
print(matplotlib.__version__)
"""
Explanation: Table of Contents
<p><div class="lev1 toc-item"><a href="#Introduction-to-Matplotlib" data-toc-modified-i... |
oliverlee/pydy | examples/npendulum/n-pendulum-control.ipynb | bsd-3-clause | from IPython.display import SVG
SVG(filename='n-pendulum-with-cart.svg')
"""
Explanation: Introduction
Several pieces of the puzzle have come together lately to really demonstrate the power of the scientific python software packages to handle complex dynamic and controls problems (i.e. IPython notebooks, matplotlib an... |
intel-analytics/BigDL | docs/readthedocs/source/doc/Serving/Example/tf1-to-cluster-serving-example.ipynb | apache-2.0 | import tensorflow as tf
tf.__version__
"""
Explanation: In this example, we will use tensorflow v1 (version 1.15) to create a simple MLP model, and transfer the application to Cluster Serving step by step.
This tutorial is recommended for Tensorflow v1 user only. If you are not Tensorflow v1 user, the keras tutorial h... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/production_ml/labs/census.ipynb | apache-2.0 | !pip install tensorflow-transform
"""
Explanation: Preprocessing Data with Advanced Example using TensorFlow Transform
Learning objectives
Create a tf.Transform preprocessing_fn.
Transform the data.
Create an input function for training.
Build the model.
Train and Evaluate the model.
Export the model.
Introduction
T... |
scottlittle/solar-sensors | IPnotebooks/important-IPNBs/all-datasets-together.ipynb | apache-2.0 | from mpl_toolkits.basemap import Basemap #map stuff
from datetime import datetime,timedelta, time
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from data_helper_functions import *
from IPython.display import display
pd.options.display.max_columns = 999
%matplotlib inline
desired_channel = 'BA... |
blue-yonder/tsfresh | notebooks/advanced/friedrich_coefficients.ipynb | mit | from matplotlib import pylab as plt
import numpy as np
import seaborn as sbn
import pandas as pd
from tsfresh.examples.driftbif_simulation import velocity
%matplotlib inline
from tsfresh.feature_extraction import ComprehensiveFCParameters
from tsfresh.feature_extraction.feature_calculators import max_langevin_fixed_p... |
bspalding/research_public | lectures/Instability of parameter estimates.ipynb | apache-2.0 | # We'll be doing some examples, so let's import the libraries we'll need
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
"""
Explanation: Instability of Parameter Estimates
By Evgenia "Jenny" Nitishinskaya and Delaney Granizo-Mackenzie. Algorithms by David Edwards.
Part of the Quantopian Lecture... |
sripaladugu/sripaladugu.github.io | ipynb/Pandas.ipynb | mit | import pandas as pd
"""
Explanation: Series
End of explanation
"""
animals = ["Lion", "Tiger", "Monkey", None]
s = pd.Series(animals)
print(s)
print("The name of this Series: ", s.name)
numbers = [1, 2, 3, None]
pd.Series(numbers)
import numpy as np
np.NaN == None
np.NaN == np.NaN
np.isnan(np.NaN)
sports = {'Cr... |
diegocavalca/Studies | programming/Python/tensorflow/exercises/Graph_Solutions.ipynb | cc0-1.0 | # Q1. Create a graph
g = tf.Graph()
with g.as_default():
# Define inputs
with tf.name_scope("inputs"):
a = tf.constant(2, tf.int32, name="a")
b = tf.constant(3, tf.int32, name="b")
# Ops
with tf.name_scope("ops"):
c = tf.multiply(a, b, name="c")
d = tf.add(a, b, name="d... |
arturops/deep-learning | autoencoder/Simple_Autoencoder.ipynb | mit | %matplotlib inline
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', validation_size=0)
"""
Explanation: A Simple Autoencoder
We'll start off by building a simple autoencoder to compres... |
Faris137/MachineLearningArabic | Pima Project/.ipynb_checkpoints/Pima Project 2.0-checkpoint.ipynb | mit | import numpy as np
import pandas as pd
import seaborn as sb
from sklearn.metrics import classification_report
from sklearn.metrics import confusion_matrix
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklear... |
ES-DOC/esdoc-jupyterhub | notebooks/uhh/cmip6/models/sandbox-3/ocean.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'uhh', 'sandbox-3', 'ocean')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocean
MIP Era: CMIP6
Institute: UHH
Source ID: SANDBOX-3
Topic: Ocean
Sub-Topics: Timestepping Framework, Advection, ... |
SteveDiamond/cvxpy | examples/notebooks/WWW/censored_data.ipynb | gpl-3.0 | import numpy as np
n = 30 # number of variables
M = 50 # number of censored observations
K = 200 # total number of observations
np.random.seed(n*M*K)
X = np.random.randn(K*n).reshape(K, n)
c_true = np.random.rand(n)
# generating the y variable
y = X.dot(c_true) + .3*np.sqrt(n)*np.random.randn(K)
# ordering them base... |
adelle207/pyladies.cz | original/v1/s011-dicts/requests.ipynb | mit | import requests
"""
Explanation: Requests
Nejdřiv si nainstaluj Requests, knihovnu pro webové klienty:
$ pip install requests
A pak v Pythonu:
End of explanation
"""
odpoved = requests.get('http://python.cz')
"""
Explanation: Knihovna Requests ti umožní stahovat webové stránky serverů na Internetu, podobně jako to... |
ComputationalModeling/spring-2017-danielak | past-semesters/spring_2016/day-by-day/day19-exploratory-data-analysis-with-climate-data/Data_Exploration_Plotting.ipynb | agpl-3.0 | # put your code here, and add additional cells as necessary.
"""
Explanation: Exploring data
Names of group members
// Put your names here!
Goals of this assignment
The purpose of this assignment is to explore data using visualization and statistics.
Section 1
The file datafile_1.csv contains a three-dimensional d... |
agrc/Presentations | UGIC/2022/SpatiallyEnabledDataFrames/EditingWithDataFrames.ipynb | mit | import pandas as pd
medians_df = pd.read_csv('assets/median_age.csv')
medians_df.head()
"""
Explanation: Ditch the Cursor
Editing Feature Classes with Spatialy-Enabled DataFrames
ArcPy Is Great, And...
Problem one: row[0]
```python
def update_year_built(layer, year_fields):
with arcpy.da.UpdateCursor(layer, yea... |
cristhro/Machine-Learning | ejercicio 4/notebook.ipynb | gpl-3.0 | data = pd.read_csv('train.csv', header=None ,delimiter=";")
feature_names = ['usuario', 'palabra', 'palabraLeida', 'tiempoCaracter',
'hayErrPalabra', 'tiempoErrPalabra', 'numPalabra','tiempoPalabra', 'tamPalabra', 'caracter',
'falloCaracter', 'palabraCorrecta']
data.columns = feature_names
"""
Explanatio... |
jorisvandenbossche/2015-EuroScipy-pandas-tutorial | solved - 07 - Case study - air quality data.ipynb | bsd-2-clause | from IPython.display import HTML
HTML('<iframe src=http://www.eea.europa.eu/data-and-maps/data/airbase-the-european-air-quality-database-8#tab-data-by-country width=900 height=350></iframe>')
"""
Explanation: <p><font size="6"><b> Case study: air quality data of European monitoring stations (AirBase)</b></font></p>
<b... |
ltiao/notebooks | working-with-pandas-multiindex-dataframes-reading-and-writing-to-csv-and-hdf5.ipynb | mit | # create some noise
a = np.random.randn(50, 600, 100)
a.shape
# create some noise with higher variance and add bias.
b = 2. * np.random.randn(*a.shape) + 1.
b.shape
# manufacture some loss function
# there are n_epochs * n_batchs * batch_size
# recorded values of the loss
loss = 10 / np.linspace(1, 100, a.size)
loss... |
NuGrid/NuPyCEE | regression_tests/temp/SYGMA_SSP_all_yields.ipynb | bsd-3-clause | #from imp import *
#s=load_source('sygma','/home/nugrid/nugrid/SYGMA/SYGMA_online/SYGMA_dev/sygma.py')
%pylab nbagg
import sygma as s
reload(s)
print s.__file__
#import matplotlib
#matplotlib.use('nbagg')
#import matplotlib.pyplot as plt
#matplotlib.use('nbagg')
#import numpy as np
from scipy.integrate import quad
from... |
tensorflow/docs-l10n | site/en-snapshot/quantum/tutorials/mnist.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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.