repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
vzg100/Post-Translational-Modification-Prediction | .ipynb_checkpoints/Lysine Acetylation -MLP-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"]
for i in par:
print("y", i)
y = Predictor()
y.load_data(file="Data/Trainin... |
gaufung/Data_Analytics_Learning_Note | python-statatics-tutorial/advance-theme/Python-Advance.ipynb | mit | num=[1,2,3]
iter(num)
num.__iter__()
num.__reversed__()
it = iter(num)
print it.next()
print it.next()
print it.next()
print it.next()
"""
Explanation: Python 进阶
1 迭代器、生成表达式和生成器
1.1 迭代器(iterators)
迭代器对象拥有个next方法用来表达下一个对象,并且如果导到了最后一个,将会抛出一个StopIteration的异常
End of explanation
"""
(i for i in num)
[i for i in num]
... |
kingsgeocomp/applied_gsa | Practical-06-2. Exploration.ipynb | mit | from sklearn.decomposition import PCA
"""
Explanation: Dimensionality Reduction
End of explanation
"""
o_dir = os.path.join('outputs','pca')
if os.path.isdir(o_dir) is not True:
print("Creating '{0}' directory.".format(o_dir))
os.mkdir(o_dir)
pca = PCA() # Use all Principal Com... |
ES-DOC/esdoc-jupyterhub | notebooks/inm/cmip6/models/sandbox-3/landice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'inm', 'sandbox-3', 'landice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Landice
MIP Era: CMIP6
Institute: INM
Source ID: SANDBOX-3
Topic: Landice
Sub-Topics: Glaciers, Ice.
Properties: 3... |
phanrahan/magmathon | notebooks/tutorial/coreir/coreir-tutorial/full_adder.ipynb | mit | import magma as m
import mantle
"""
Explanation: FullAdder - Combinational Circuits
This notebook walks through the implementation of a basic combinational circuit, a full adder. This example introduces many of the features of Magma including circuits, wiring, operators, and the type system.
Start by importing Magma a... |
jpn--/larch | book/example/legacy/300L_itinerary.ipynb | gpl-3.0 | import larch, pandas, os, gzip
larch.__version__
"""
Explanation: 300L: Itinerary Choice Data
End of explanation
"""
from larch.data_warehouse import example_file
with gzip.open(example_file("arc"), 'rt') as previewfile:
print(*(next(previewfile) for x in range(70)))
"""
Explanation: The example itinerary choi... |
tkarna/cofs | demos/02-2d-tsunami.ipynb | mit | %matplotlib inline
import matplotlib
import matplotlib.pyplot as plt
import scipy.interpolate # used for interpolation
import pyproj # used for coordinate transformations
import math
from thetis import *
"""
Explanation: Simulating the 1945 Makran Tsunami using Thetis
The 1945 Makran Tsunami was a large tsunami whic... |
econ-ark/HARK | examples/Gentle-Intro/Gentle-Intro-To-HARK.ipynb | apache-2.0 | # This cell has a bit of initial setup. You can click the triangle to the left to expand it.
# Click the "Run" button immediately above the notebook in order to execute the contents of any cell
# WARNING: Each cell in the notebook relies upon results generated by previous cells
# The most common problem beginners hav... |
henchc/EDUC290B | 01-Intro-to-Computational-Tools-Python.ipynb | mit | age = 42
first_name = 'Ahmed'
"""
Explanation: Introduction to Computational Tools and Python
This notebook introduces students to popular computational tools used in the Digital Humanities and Social Sciences and the research possibilities they create. It then provides an abbreviated introduction to Python focussing... |
Vvkmnn/books | AutomateTheBoringStuffWithPython/lesson41.ipynb | gpl-3.0 | from selenium import webdriver
"""
Explanation: Lesson 41:
Controlling the Browser with the Selenium Module
We download and parse webpages using beautifulsoup module, but some pages require logins and other dependencies to function properly.
We can simulate these effects using selenium to launch a programmatic browse... |
sz-workshop-2017/virtual-machine | notebooks/4.1 - Working with NLTK.ipynb | apache-2.0 | # First we import the NLTK library and download
# the data used in the examples in the book
# the data will be stored in a directory on the
# virtual machine but accessible through your notebooks
import nltk
nltk.download()
from nltk.book import *
"""
Explanation: 4.1 - Working with NLTK
In this notebook we will wo... |
OriHoch/knesset-data-pipelines | jupyter-notebooks/committee meeting attendees.ipynb | mit | import yaml
from dataflows import Flow, filter_rows, cache, dump_to_path
from datapackage_pipelines_knesset.common_flow import load_knesset_data, load_member_names
import tabulator
"""
Explanation: Example flow for processing and aggregating stats about committee meeting attendees and protocol parts
See the DataFlows... |
quantopian/research_public | notebooks/lectures/Position_Concentration_Risk/answers/notebook.ipynb | apache-2.0 | import numpy as np
import pandas as pd
import scipy.stats as stats
import matplotlib.pyplot as plt
import math
import cvxpy
"""
Explanation: Exercise Answer Key: Position Concentration Risk
Lecture Link
This exercise notebook refers to this lecture. Please use the lecture for explanations and sample code.
https://www.... |
cgivre/oreilly-sec-ds-fundamentals | Notebooks/Unsupervised/K-Means Clustering Example.ipynb | apache-2.0 | data = pd.DataFrame([[1, 2],
[5, 8],
[1.5, 1.8],
[8, 8],
[1, 0.6],
[9, 11]], columns=['x','y'])
print( data )
"""
Explanation: K-Means Clustering Example
In this example notebook, you will see how to implement K-Means Clustering in Python using Scik... |
materialsvirtuallab/nano106 | lectures/lecture_4_point_group_symmetry/Symmetry Computations on mmm (D_2h) Point Group.ipynb | bsd-3-clause | import numpy as np
import itertools
from sympy import symbols
"""
Explanation: NANO106 - Symmetry Computations on $mmm (D_{2h})$ Point Group
by Shyue Ping Ong
This notebook demonstrates the computation of orbits in the mmm point group. It is part of course material for UCSD's NANO106 - Crystallography of Materials. Un... |
jbwhit/jupyter-best-practices | notebooks/07-Some_basics.ipynb | mit | # Create a [list]
days = ['Monday', # multiple lines
'Tuesday', # acceptable
'Wednesday',
'Thursday',
'Friday',
'Saturday',
'Sunday', # trailing comma is fine!
]
days
# Simple for-loop
for day in days:
print(day)
# Double for-loop
for day in days:
fo... |
takanory/python-machine-learning | 10 Minutes to pandas.ipynb | mit | # それぞれ必要なものを import するけど、こういう風に短く書くのがこっち界隈だと一般的らしい
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
"""
Explanation: 10 Minutes to pandas写経
https://pandas.pydata.org/pandas-docs/stable/10min.html をやってみる
End of explanation
"""
# Creating a Series by passing a list of values, letting pandas crea... |
ES-DOC/esdoc-jupyterhub | notebooks/bcc/cmip6/models/sandbox-2/atmoschem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'bcc', 'sandbox-2', 'atmoschem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmoschem
MIP Era: CMIP6
Institute: BCC
Source ID: SANDBOX-2
Topic: Atmoschem
Sub-Topics: Transport, Emissions Co... |
cloudmesh/book | notebooks/scipy/scipy-examples.ipynb | apache-2.0 | import numpy as np # import numpy
import scipy as sp # import scipy
from scipy import stats # refer directly to stats rather than sp.stats
import matplotlib as mpl # for visualization
from matplotlib import pyplot as plt # refer directly to pyplot
# rather than mpl.pyplot
# for ex... |
AntArch/Presentations_Github | 20151008_OpenGeo_Reuse_under_licence/20151008_OpenGeo_Reuse_under_licence.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... |
tpin3694/tpin3694.github.io | mathematics/argmin_and_argmax.ipynb | mit | import numpy as np
import pandas as pd
np.random.seed(1)
"""
Explanation: Title: argmin and argmax
Slug: argmin_and_argmax
Summary: An explanation of argmin and argmax in Python.
Date: 2016-01-23 12:00
Category: Mathematics
Tags: Basics
Authors: Chris Albon
argmin and argmax are the inputs, x's, to a function, f... |
quantopian/research_public | videos/miscellaneous/dfs/dfs_quant_finance.ipynb | apache-2.0 | import pandas as pd
df = local_csv('nba_data.csv')
df['game_datetime'] = pd.to_datetime(df['game_date'])
df = df.set_index(['game_datetime', 'player_id'])
"""
Explanation: Before running this notebook, run the 2 cells containing supporting functions at the bottom.
Daily Fantasy Sports and Quantitative Finance
A ca... |
graphistry/pygraphistry | demos/demos_databases_apis/gpu_rapids/part_ii_gpu_cudf.ipynb | bsd-3-clause | #!pip install graphistry -q
import pandas as pd
import numpy as np
import cudf
import graphistry
graphistry.__version__
# To specify Graphistry account & server, use:
# graphistry.register(api=3, username='...', password='...', protocol='https', server='hub.graphistry.com')
# For more options, see https://github.com... |
shreyas111/Multimedia_CS523_Project1 | Style_Transfer_Without_Style_Loss.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import tensorflow as tf
import numpy as np
import PIL.Image
"""
Explanation: Style Transfer
Our Changes:
We have modified the code in such a way that the style loss and the gram matrices are not calculated. The algorithm only runs on
content loss and the denoise loss.... |
rvuduc/cse6040-ipynbs | 02--textproc.ipynb | bsd-3-clause | quote = """I wish you'd stop talking.
I wish you'd stop prying and trying to find things out.
I wish you were dead. No. That was silly and unkind.
But I wish you'd stop talking."""
print (quote)
def countWords1 (s):
"""Counts the number of words in a given input string."""
Lines = s.split ('\n')
count = 0
... |
rasbt/pattern_classification | data_collecting/twitter_wordcloud.ipynb | gpl-3.0 | %load_ext watermark
%watermark -d -v -m -p twitter,pyprind,wordcloud,pandas,scipy,matplotlib
"""
Explanation: <br>
<br>
Turn Your Twitter Timeline into a Word Cloud Using Python
<br>
<br>
Sections
Requirements
A. Downloading Your Twitter Timeline Tweets
B. Creating the Word Cloud
<br>
<br>
Requirements
[back to top]... |
GoogleCloudPlatform/ai-notebooks-extended | dataproc-hub-example/build/infrastructure-builder/mig/files/gcs_working_folder/examples/Python/storage/Cloud Storage client library.ipynb | apache-2.0 | from google.cloud import storage
"""
Explanation: Cloud Storage client library
This tutorial shows how to get started with the Cloud Storage Python client library.
Create a storage bucket
Buckets are the basic containers that hold your data. Everything that you store in Cloud Storage must be contained in a bucket. You... |
ozak/CompEcon | notebooks/ipympl.ipynb | gpl-3.0 | # Enabling the `widget` backend.
# This requires jupyter-matplotlib a.k.a. ipympl.
# ipympl can be install via pip or conda.
%matplotlib widget
import matplotlib.pyplot as plt
import numpy as np
# Testing matplotlib interactions with a simple plot
fig = plt.figure()
plt.plot(np.sin(np.linspace(0, 20, 100)));
# Alway... |
root-mirror/training | INSIGHTS2018/Exercises/WorkingWithFiles/WritingOnFilesExercise.ipynb | gpl-2.0 | import ROOT
"""
Explanation: Writing on files
This is a Python notebook in which you will practice the concepts learned during the lectures.
Startup ROOT
Import the ROOT module: this will activate the integration layer with the notebook automatically
End of explanation
"""
rndm = ROOT.TRandom3(1)
filename = "histos... |
dr-nate/msmbuilder | examples/tICA-vs-PCA.ipynb | lgpl-2.1 | %matplotlib inline
import numpy as np
from matplotlib import pyplot as plt
xx, yy = np.meshgrid(np.linspace(-2,2), np.linspace(-3,3))
zz = 0 # We can only visualize so many dimensions
ww = 5 * (xx-1)**2 * (xx+1)**2 + yy**2 + zz**2
c = plt.contourf(xx, yy, ww, np.linspace(-1, 15, 20), cmap='viridis_r')
plt.contour(xx, ... |
JohnCrickett/PythonExamples | Enums.ipynb | mit | from enum import Enum
class MyEnum(Enum):
first = 1
second = 2
third = 3
"""
Explanation: Enums
This notebook is an introduction to Python Enums as introduced in Python 3.4 and subsequently backported to other version of Python.
More details can be found in the library documentation: https://docs.python.o... |
tarashor/vibrations | py/notebooks/MatricesForOrthogonalCoordinates.ipynb | mit | from sympy import *
from geom_util import *
from sympy.vector import CoordSys3D
N = CoordSys3D('N')
alpha1, alpha2, alpha3 = symbols("alpha_1 alpha_2 alpha_3", real = True, positive=True)
init_printing()
%matplotlib inline
%reload_ext autoreload
%autoreload 2
%aimport geom_util
"""
Explanation: Matrix generation
Ini... |
tensorflow/tpu | tools/colab/regression_sine_data_with_keras.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... |
ethen8181/machine-learning | keras/nn_keras_basics.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(plot_style=False)
os.chdir(path)
# 1. magic to print version
# 2. magic so that the notebo... |
kevinjliang/Duke-Tsinghua-MLSS-2017 | 01C_MLP_CNN_Assignment.ipynb | apache-2.0 | import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
# Import data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
# Helper functions for creating weight variables
def weight_variable(shape):
"""weight_variable generates a weight variable of a given shape."""
initi... |
krondor/nlp-dsx-pot | Lab 1 - IntroSpark - Student.ipynb | gpl-3.0 | #Step 1.1 - Check spark version
"""
Explanation: Lab 1 - Hello Spark
This Lab will show you how to work with Apache Spark using Python
Step 1 - Working with Spark Context
Step 1 - Invoke the spark context and extract what version of the spark driver application.
Type<br>
sc.version
End of explanation
"""
#Step 2.1 ... |
kubeflow/pipelines | samples/core/multiple_outputs/multiple_outputs.ipynb | apache-2.0 | !python3 -m pip install 'kfp>=0.1.31' --quiet
"""
Explanation: Multiple outputs example
This notebook is a simple example of how to make a component with multiple outputs using the Pipelines SDK.
Before running notebook:
Setup notebook server
This pipeline requires you to setup a notebook server in the Kubeflow UI. A... |
kdungs/teaching-SMD2-2016 | solutions/2.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import scipy.optimize
plt.style.use('ggplot')
from functools import partial
"""
Explanation: Übungsblatt 2: Kleinste Quadrate
End of explanation
"""
def generate_sample(a, n=10, size=10000):
ks = np.arange(1, n + 1)
yss = np.random.poisso... |
sraejones/phys202-2015-work | assignments/assignment06/ProjectEuler17.ipynb | mit | def number_to_words(n):
"""Given a number n between 1-1000 inclusive return a list of words for the number."""
# YOUR CODE HERE
# English name of each digit/ place in dictionary
one = {
0: '',
1: 'one',
2: 'two',
3: 'three',
4: 'four',
... |
keras-team/keras-io | examples/audio/ipynb/uk_ireland_accent_recognition.ipynb | apache-2.0 | !pip install -U -q tensorflow_io
"""
Explanation: English speaker accent recognition using Transfer Learning
Author: Fadi Badine<br>
Date created: 2022/04/16<br>
Last modified: 2022/04/16<br>
Description: Training a model to classify UK & Ireland accents using feature extraction from Yamnet.
Introduction
The following... |
dataventures/workshops | 4/0-Time-Series-Analysis.ipynb | mit | import pandas as pd
import numpy as np
import matplotlib.pylab as plt
%matplotlib inline
from matplotlib.pylab import rcParams
rcParams['figure.figsize'] = 15, 6
"""
Explanation: Time Series Analysis and Forecasting
Sometimes the data we're working with has a special dependence on time as its primary predictive featur... |
sdpython/pyquickhelper | _unittests/ut_helpgen/notebooks_svg/seance4_projection_population_correction.ipynb | mit | from jyquickhelper import add_notebook_menu
add_notebook_menu()
"""
Explanation: Evolutation d'une population (correction)
End of explanation
"""
from actuariat_python.data import population_france_2015
population = population_france_2015()
df = population
df.head(n=3)
hommes = df["hommes"]
femmes = df["femmes"]
so... |
ernestyalumni/MLgrabbag | nVidia_entrevue/Halloween_candy_max.ipynb | mit | sample_input_arr = np.array([5,10,2,4,3,2,1],dtype=np.int32)
f = np.savetxt("sample_input.txt", sample_input_arr, fmt='%i',delimiter="\n")
N_H = 10 # <= 10000
C_max = 5 # <= 1000
c_low = 0
c_high = 10
filename = "sample_input_1.txt"
homes = np.random.randint(low=c_low,high=c_high, size=N_H)
input_arr = np.insert(ho... |
myfunprograms/deep_learning | project4/files/dlnd_language_translation_original.ipynb | gpl-3.0 | """
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... |
jpe3002/algorithms-1 | elementary-sorting.ipynb | gpl-3.0 | import pandas
from bokeh.io import push_notebook, show, output_notebook
from bokeh.charts import Bar
from bokeh.plotting import figure, reset_output
import random
import time
def exch(data, idx_a, idx_b):
# todo: fix checking...
tmp = data[idx_a]
data[idx_a] = data[idx_b]
data[idx_b] = tmp
def c... |
desihub/desimodel | doc/nb/DESI-0347-Updates.ipynb | bsd-3-clause | %pylab inline
import os
import astropy.table
from desimodel.inputs import docdb
from desimodel.inputs.throughput import load_spec_throughputs
"""
Explanation: DESI-347 Throughput Updates to DESIMODEL
Study changes to DESIMODEL after updating throughputs from DESI-347.
End of explanation
"""
def compare(old='v13',... |
vitojph/2016progpln | notebooks/8-textblob.ipynb | mit | from textblob import TextBlob
"""
Explanation: textblob: otro módulo para tareas de PLN (NLTK + pattern)
textblob es una librería de procesamiento del texto para Python que permite realizar tareas de Procesamiento del Lenguaje Natural como análisis morfológico, extracción de entidades, análisis de opinión, traducción ... |
james-prior/cohpy | 20170706-dojo-clear-to-end-of-table.ipynb | mit | %%script bash
# Ignore this boring cell.
# It allows one to do C in Jupyter notebook.
cat >20170706_head.c <<EOF
#include <stdlib.h>
#include <stdio.h>
#define LINES (3)
#define COLUMNS (4)
void print_buf(char buf[LINES][COLUMNS])
{
for (int row = 0; row < LINES; row++) {
for (int column = 0; column < C... |
tensorflow/docs-l10n | site/ja/tutorials/distribute/multi_worker_with_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... |
sdpython/teachpyx | _doc/notebooks/python/hypercube.ipynb | mit | from jyquickhelper import add_notebook_menu
add_notebook_menu()
"""
Explanation: Hypercube et autres exercices
Exercices autour de tableaux en plusieurs dimensions et autres exercices.
End of explanation
"""
def u(n):
if n <= 2:
return 1
else:
return u(n-1) + u(n-2) + u(n-3)
u(5)
"""
Expla... |
turbomanage/training-data-analyst | courses/machine_learning/deepdive2/launching_into_ml/solutions/repeatable_splitting.ipynb | apache-2.0 | from google.cloud import bigquery
"""
Explanation: <h1> Repeatable splitting </h1>
In this notebook, we will explore the impact of different ways of creating machine learning datasets.
<p>
Repeatability is important in machine learning. If you do the same thing now and 5 minutes from now and get different answers, t... |
ContextLab/quail | docs/tutorial/naturalistic-analyses.ipynb | mit | import quail
import numpy as np
import seaborn as sns
from scipy.spatial.distance import cdist
%matplotlib inline
egg = quail.load_example_data(dataset='naturalistic')
"""
Explanation: Analyzing naturalistic stimuli
In traditional list-learning free recall experiments, remembering is often cast as a binary operation:... |
bobmyhill/burnman | tutorial/tutorial_04_fitting.ipynb | gpl-2.0 | import burnman
import numpy as np
import matplotlib.pyplot as plt
"""
Explanation: <h1>The BurnMan Tutorial</h1>
Part 4: Fitting
This file is part of BurnMan - a thermoelastic and thermodynamic toolkit
for the Earth and Planetary Sciences
Copyright (C) 2012 - 2021 by the BurnMan team,
released under the GNU GPL v2 or... |
murali-munna/pattern_classification | dimensionality_reduction/projection/linear_discriminant_analysis.ipynb | gpl-3.0 | %load_ext watermark
%watermark -v -d -u -p pandas,scikit-learn,numpy,matplotlib
"""
Explanation: Sebastian Raschka
- Link to the containing GitHub Repository: https://github.com/rasbt/pattern_classification
- Link to this IPython Notebook on GitHub: linear_discriminant_analysis.ipynb
End of explanation
"""
feature... |
giacomov/3ML | docs/notebooks/The_3ML_workflow.ipynb | bsd-3-clause | from threeML import *
import matplotlib.pyplot as plt
%matplotlib notebook
plt.style.use('mike')
import warnings
warnings.filterwarnings('ignore')
"""
Explanation: The 3ML workflow
Generally, an analysis in 3ML is performed in 3 steps:
Load the data: one or more datasets are loaded and then listed in a DataList obje... |
steinam/teacher | jup_notebooks/.ipynb_checkpoints/Versicherung_11FI3_On_Paper-checkpoint.ipynb | mit | %load_ext sql
%sql mysql://steinam:steinam@localhost/versicherung_complete
"""
Explanation: Versicherung on Paper
End of explanation
"""
%%sql
-- meine Lösung
select distinct(Land) from Fahrzeughersteller;
%%sql
-- deine Lösung
select fahrzeughersteller.Land
from fahrzeughersteller
group by fahrzeughersteller.... |
ComputationalModeling/spring-2017-danielak | past-semesters/fall_2016/day-by-day/day17-analyzing-tweets-with-string-processing/In-Class-Strings.ipynb | agpl-3.0 | %matplotlib inline
import matplotlib.pyplot as plt
from string import punctuation
"""
Explanation: Day 17 In-class assignment: Data analysis and Modeling in Social Sciences
Part 3
The first part of this notebook is a copy of a blog post tutorial written by Dr. Neal Caren (University of North Carolina, Chapel Hill). Th... |
PyPSA/PyPSA | examples/notebooks/transformer_example.ipynb | mit | import pypsa
import numpy as np
import pandas as pd
network = pypsa.Network()
network.add("Bus", "MV bus", v_nom=20, v_mag_pu_set=1.02)
network.add("Bus", "LV1 bus", v_nom=0.4)
network.add("Bus", "LV2 bus", v_nom=0.4)
network.add(
"Transformer",
"MV-LV trafo",
type="0.4 MVA 20/0.4 kV",
bus0="MV bus",... |
tpin3694/tpin3694.github.io | sql/sums_counts_max_averages.ipynb | mit | # Ignore
%load_ext sql
%sql sqlite://
%config SqlMagic.feedback = False
"""
Explanation: Title: Calculate Counts, Sums, Max, and Averages
Slug: sums_counts_max_averages
Summary: Calculate Counts, Sums, and Averages in SQL.
Date: 2017-01-16 12:00
Category: SQL
Tags: Basics
Authors: Chris Albon
Note: This tutoria... |
rohithmohan/aesop | docs/barnase_barstar_directedmutagenesis.ipynb | gpl-3.0 | from aesop import DirectedMutagenesis, plotScan_interactive, plotNetwork_interactive
path_apbs = 'path\to\executable\apbs'
path_coulomb = 'path\to\executable\coulomb'
path_pdb2pqr = 'path\to\executable\pdb2pqr'
jobname = 'directedscan'
pdbfile = 'barnase_barstar.pdb'
selstr = ['chain A', 'chain B']
target = ['re... |
ugaliguy/Udacity | data-analyst-nanodegree/dandp0-bikeshareanalysis/Bay_Area_Bike_Share_Analysis.ipynb | mit | # import all necessary packages and functions.
# See this post to fix potential bug that arose the first time I tried to run this block
# http://stackoverflow.com/questions/38085174/import-numpy-throws-error-syntaxerror-unicode-error-unicodeescape-codec
#-ca/38107818#38107818
import csv
from datetime import datetime
... |
agile-geoscience/xlines | notebooks/08_Read_and_write_LAS.ipynb | apache-2.0 | import welly
ls ../data/*.LAS
"""
Explanation: x lines of Python
Reading and writing LAS files
This notebook goes with the Agile blog post of 23 October.
Set up a conda environment with:
conda create -n welly python=3.6 matplotlib=2.0 scipy pandas
You'll need welly in your environment:
conda install tqdm # Should h... |
LeosNoob/PyNotes | PyNotes/7. Funciones.ipynb | gpl-3.0 | printfunc(3)
def func(num):
return(num**num+num)
"""
Explanation: Funciones
Las funciones es una fragmento de código que recibe parámetros, ejecuta instrucciones y regresa resultados. Y nos permiten reutilizar código llamandola cuantas veces sea necesario.
``` python
def función(parámetros):
instrucci... |
dit/dit | examples/MDBSI.ipynb | bsd-3-clause | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
from dit import ditParams, Distribution
from dit.distconst import uniform
ditParams['repr.print'] = ditParams['print.exact'] = True
"""
Explanation: Multivariate Dependencies Beyond Shannon Information
This is a companion Jupyter notebook to the w... |
ES-DOC/esdoc-jupyterhub | notebooks/inm/cmip6/models/sandbox-3/atmoschem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'inm', 'sandbox-3', 'atmoschem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmoschem
MIP Era: CMIP6
Institute: INM
Source ID: SANDBOX-3
Topic: Atmoschem
Sub-Topics: Transport, Emissions Co... |
ProfessorKazarinoff/staticsite | content/code/matplotlib_plots/bar_plot_with_error_bars_jupyter_matplotlib.ipynb | gpl-3.0 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
data_url = 'https://github.com/ProfessorKazarinoff/staticsite/raw/master/content/code/matplotlib_plots/3D-printed_tensile_test_data.xlsx'
df = pd.read_excel(data_url)
df.head()
#https://raw.githubusercontent.com/guipsamora/pandas... |
SolitonScientific/AtomicString | AFAString.ipynb | mit | import numpy as np
import pylab as pl
pl.rcParams["figure.figsize"] = 9,6
###################################################################
##This script calculates the values of Atomic Function up(x) (1971)
###################################################################
################### One Pulse of atomic ... |
bgalbraith/bandits | notebooks/Stochastic Bandits - Preference Estimation.ipynb | apache-2.0 | %matplotlib inline
import os
import sys
module_path = os.path.abspath(os.path.join('..'))
if module_path not in sys.path:
sys.path.append(module_path)
import bandits as bd
"""
Explanation: Stochastic Multi-Armed Bandits - Preference Estimation
These examples come from Chapter 2 of Reinforcement Learning: An Intro... |
ES-DOC/esdoc-jupyterhub | notebooks/test-institute-1/cmip6/models/sandbox-3/atmos.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'test-institute-1', 'sandbox-3', 'atmos')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmos
MIP Era: CMIP6
Institute: TEST-INSTITUTE-1
Source ID: SANDBOX-3
Topic: Atmos
Sub-Topics: Dynamical... |
aleph314/K2 | Data Mining/Recommender Systems/Recommender-Engine_exercise.ipynb | gpl-3.0 | import numpy as np
import pandas as pd
df = pd.read_csv('./data/ml-100k/u.data', sep='\t', header=None)
df.columns = ['userid', 'itemid', 'rating', 'timestamp']
df['timestamp'] = pd.to_datetime(df['timestamp'],unit='s')
df.head()
"""
Explanation: Recommender Engine
Perhaps the most famous example of a recommender e... |
cosmolejo/Fisica-Experimental-3 | Constante_de_Planck/Constante_Plank.ipynb | gpl-3.0 | import numpy as np
#import pyfirmata as pyF
from time import sleep
import os
import matplotlib.pyplot as plt
%matplotlib inline
from scipy import stats
from scipy import constants as cons
######################################
##VECTORES
######################################
led=[1.6325,2.424,2.566,3.7095] #ir,rojo,... |
statsmodels/statsmodels.github.io | v0.13.1/examples/notebooks/generated/statespace_sarimax_internet.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import pandas as pd
from scipy.stats import norm
import statsmodels.api as sm
import matplotlib.pyplot as plt
import requests
from io import BytesIO
from zipfile import ZipFile
# Download the dataset
dk = requests.get('http://www.ssfpack.com/files/DK-data.zip').content
f = Bytes... |
geektoni/shogun | doc/ipython-notebooks/structure/FGM.ipynb | bsd-3-clause | %pylab inline
%matplotlib inline
import os
SHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data')
import numpy as np
import scipy.io
dataset = scipy.io.loadmat(os.path.join(SHOGUN_DATA_DIR, 'ocr/ocr_taskar.mat'))
# patterns for training
p_tr = dataset['patterns_train']
# patterns for testing
p_ts = dataset['pat... |
othersite/document | machinelearning/deep-learning-book/code/appendix_g_tensorflow-basics/appendix_g_tensorflow-basics.ipynb | apache-2.0 | %load_ext watermark
%watermark -a 'Sebastian Raschka' -d -p tensorflow,numpy
"""
Explanation: Accompanying code examples of the book "Introduction to Artificial Neural Networks and Deep Learning: A Practical Guide with Applications in Python" by Sebastian Raschka. All code examples are released under the MIT license. ... |
GoogleCloudPlatform/vertex-ai-samples | notebooks/community/managed_notebooks/predictive_maintainance/predictive_maintenance_usecase.ipynb | apache-2.0 | import os
PROJECT_ID = ""
# Get your Google Cloud project ID from gcloud
if not os.getenv("IS_TESTING"):
shell_output = !gcloud config list --format 'value(core.project)' 2>/dev/null
PROJECT_ID = shell_output[0]
print("Project ID: ", PROJECT_ID)
"""
Explanation: Predictive Maintenance
Table of contents
... |
EstevesDouglas/UNICAMP-FEEC-IA369Z | dev/checkpoint/2017-04-28-estevesdouglas-compartilhando-notebook.ipynb | gpl-3.0 | -- Campainha IoT - LHC - v1.1
-- ESP Inicializa pinos, Configura e Conecta no Wifi, Cria conexão TCP
-- e na resposta de um "Tocou" coloca o ESP em modo DeepSleep para economizar bateria.
-- Se nenhuma resposta for recebida em 15 segundos coloca o ESP em DeepSleep.
led_pin = 3
status_led = gpio.LOW
ip_servidor = "192.1... |
feststelltaste/software-analytics | prototypes/_archive/Production Coverage Demo Notebook.ipynb | gpl-3.0 | import pandas as pd
coverage = pd.read_csv("../input/spring-petclinic/jacoco.csv")
coverage = coverage[['PACKAGE', 'CLASS', 'LINE_COVERED' ,'LINE_MISSED']]
coverage['LINES'] = coverage.LINE_COVERED + coverage.LINE_MISSED
coverage.head(1)
"""
Explanation: Context
John Doe remarked in #AP1432 that there may be too much ... |
yw-fang/readingnotes | machine-learning/Automate-Boring-Staff-Python-2016/ch13.ipynb | apache-2.0 | wget https://nostarch.com/download/Automate_the_Boring_Stuff_onlinematerials_v.2.zip
"""
Explanation: Ch13 处理pdf和wrod文档
2019 July 24 at Kyoto Univ.
pdf 和 word 文档都是二进制文件,由于包含多媒体信息(图标甚至视频),处理起来比普通文本复杂许多。好在一些先驱者已经写好了一些模块可以让我们来使用,致敬这帮人!哈哈。这章节我们主要专注从pdf中解析文本,或者从已有文档生成新的pdf。
13.1.1 从 pdf 提取文本
此处我们使用PyPDF2模块,注意它并不能帮助我们提取图像等多... |
spacedrabbit/PythonBootcamp | Advanced Python Objects - Test.ipynb | mit | print bin(1024)
print hex(1024)
"""
Explanation: Advanced Python Objects Test
Advanced Numbers
Problem 1: Convert 1024 to binary and hexadecimal representation:
End of explanation
"""
print round(5.2322, 2)
"""
Explanation: Problem 2: Round 5.23222 to two decimal places
End of explanation
"""
s = 'hello how are y... |
dpshelio/2015-EuroScipy-pandas-tutorial | 05 - Time series data.ipynb | bsd-2-clause | %matplotlib inline
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
try:
import seaborn
except:
pass
pd.options.display.max_rows = 8
"""
Explanation: Working with time series data
Some imports:
End of explanation
"""
from IPython.display import HTML
HTML('<iframe src=http://www.eea.eur... |
GoogleCloudPlatform/tf-estimator-tutorials | 08_Text_Analysis/04 - Text Classification - SMS Ham vs. Spam - Word Embeddings + LSTM.ipynb | apache-2.0 | import tensorflow as tf
from tensorflow import data
from datetime import datetime
import multiprocessing
import shutil
print(tf.__version__)
MODEL_NAME = 'sms-class-model-01'
TRAIN_DATA_FILES_PATTERN = 'data/sms-spam/train-*.tsv'
VALID_DATA_FILES_PATTERN = 'data/sms-spam/valid-*.tsv'
VOCAB_LIST_FILE = 'data/sms-spa... |
zambzamb/zpic | python/Electron Plasma Waves.ipynb | agpl-3.0 | import em1ds as zpic
#v_the = 0.001
v_the = 0.02
#v_the = 0.20
electrons = zpic.Species( "electrons", -1.0, ppc = 64, uth=[v_the,v_the,v_the])
sim = zpic.Simulation( nx = 500, box = 50.0, dt = 0.0999/2, species = electrons )
sim.filter_set("sharp", ck = 0.99)
#sim.filter_set("gaussian", ck = 50.0)
"""
Explanation: ... |
sandeshkalantre/bdg-nanowire | Arahanov-Bohm Oscillations/Cylindrical Shell and Arahanov-Bohm Oscillations.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import itertools
import scipy.special
# define a dummy class to pass parameters to functions
class Parameters:
def __init__(self):
return
# define the Hamiltonian
def calc_H(params):
t_z = params.t_z
t_phi = params.t_phi
N_z... |
plumbwj01/Barcoding-Fraxinus | scanfasta.ipynb | apache-2.0 | desired_contigs = ['Contig' + str(x) for x in [1131, 3182, 39106, 110, 5958]]
desired_contigs
"""
Explanation: Using the two contig names you sent me it's simplest to do this:
End of explanation
"""
grab = [c for c in contigs if c.name in desired_contigs]
len(grab)
"""
Explanation: If you have a genuinely big file ... |
ageron/ml-notebooks | 09_up_and_running_with_tensorflow.ipynb | apache-2.0 | # To support both python 2 and python 3
from __future__ import division, print_function, unicode_literals
# Common imports
import numpy as np
import os
try:
# %tensorflow_version only exists in Colab.
%tensorflow_version 1.x
except Exception:
pass
# to make this notebook's output stable across runs
def r... |
GoogleCloudPlatform/vertex-ai-samples | notebooks/community/ml_ops/stage4/get_started_with_vertex_ml_metadata.ipynb | apache-2.0 | import os
# The Vertex AI Workbench Notebook product has specific requirements
IS_WORKBENCH_NOTEBOOK = os.getenv("DL_ANACONDA_HOME")
IS_USER_MANAGED_WORKBENCH_NOTEBOOK = os.path.exists(
"/opt/deeplearning/metadata/env_version"
)
# Vertex AI Notebook requires dependencies to be installed with '--user'
USER_FLAG = ... |
pastas/pastas | concepts/response_functions.ipynb | mit | import numpy as np
import pandas as pd
import pastas as ps
import matplotlib.pyplot as plt
ps.show_versions()
"""
Explanation: Response functions
This notebook provides an overview of the response functions that are available in Pastas. Response functions describe the response of the dependent variable (e.g., ground... |
ituethoslab/navcom-2017 | exercises/Week 2-Qualitative Approaches to Quantitative Data/Exercises week 2.ipynb | gpl-3.0 | import pandas as pd
"""
Explanation: Exercises week 2: Qualitative Approaches to Quantitative Data
1. We have seen network graphs
We saw network graphs on the lecture. Where else have you seen them? What purpose do you remember they have served?
Talk with neighbour for 10 min what do you think is necessary for making ... |
albahnsen/ML_SecurityInformatics | notebooks/02-IntroPython.ipynb | mit | import sys
print('Python version:', sys.version)
import IPython
print('IPython:', IPython.__version__)
import numpy
print('numpy:', numpy.__version__)
import scipy
print('scipy:', scipy.__version__)
import matplotlib
print('matplotlib:', matplotlib.__version__)
import pandas
print('pandas:', pandas.__version__)
... |
empet/Plotly-plots | Tri-Surf-Plotly.ipynb | gpl-3.0 | import numpy as np
from scipy.spatial import Delaunay
import plotly.plotly as py
py.sign_in('empet','api_key')
u=np.linspace(0,2*np.pi, 24)
v=np.linspace(-1,1, 8)
u,v=np.meshgrid(u,v)
u=u.flatten()
v=v.flatten()
#evaluate the parameterization at the flattened u and v
tp=1+0.5*v*np.cos(u/2.)
x=tp*np.cos(u)
y=tp*np.si... |
DiXiT-eu/collatex-tutorial | unit8/unit8-collatex-and-XML/CollateX and XML, Part 2.ipynb | gpl-3.0 | from collatex import *
from lxml import etree
import json,re
"""
Explanation: CollateX and XML, Part 2
David J. Birnbaum (djbpitt@gmail.com, http://www.obdurodon.org), 2015-06-29
This example collates a single line of XML from four witnes... |
facaiy/book_notes | Reinforcement_Learing_An_Introduction/Temporal_Difference_Learning/note.ipynb | cc0-1.0 | Image('./res/fig6_1.png')
Image('./res/TD_0.png')
"""
Explanation: Chapter 6 Temporal-Difference Learning
DP, TD, and Monte Carlo methods all use some variation of generalized policy iteration: primarily differences in their approaches to the prediction problem.
6.1 TD Prediction
constant-$\alpha$ MC: $V(S_t) \gets V... |
mne-tools/mne-tools.github.io | 0.15/_downloads/plot_mne_inverse_coherence_epochs.ipynb | bsd-3-clause | # Author: Martin Luessi <mluessi@nmr.mgh.harvard.edu>
#
# License: BSD (3-clause)
import numpy as np
import mne
from mne.datasets import sample
from mne.minimum_norm import (apply_inverse, apply_inverse_epochs,
read_inverse_operator)
from mne.connectivity import seed_target_indices, spec... |
matt-graham/auxiliary-pm-mcmc | experiment_notebooks/Auxiliary Pseudo-Marginal MCMC - MI u updates and RD-SS theta updates.ipynb | mit | data_dir = os.path.join(os.environ['DATA_DIR'], 'uci')
exp_dir = os.path.join(os.environ['EXP_DIR'], 'apm_mcmc')
"""
Explanation: Construct data and experiments directorys from environment variables
End of explanation
"""
data_set = 'pima'
method = 'apm(mi+rdss)'
n_chain = 10
chain_offset = 0
seeds = np.random.rando... |
keylime1/courses_12-752 | yingyin2/Variable selection.ipynb | mit | import csv
file = open('public_layout.csv','r')
reader = csv.reader(file, delimiter=',')
fullcsv = list(reader)
"""
Explanation: Firstly import csv and open the csv file.
End of explanation
"""
dic_1=dict()
print(dic_1)
for i in range(801):
data = np.genfromtxt('recs2009_public.csv',delimiter=',',skip_header=1... |
enbanuel/phys202-2015-work | assignments/assignment10/ODEsEx02.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
from scipy.integrate import odeint
from IPython.html.widgets import interact, fixed
"""
Explanation: Ordinary Differential Equations Exercise 1
Imports
End of explanation
"""
def lorentz_derivs(yvec, t, sigma, rho, beta):
"""Compute the the de... |
borja876/Thinkful-DataScience-Borja | Challenge+Boston+marathon.ipynb | mit | #Compare from a silhouette_score perspective kmeans against Spectral Clustering
range_n_clusters = np.arange(10)+2
for n_clusters in range_n_clusters:
# The silhouette_score gives the average value for all the samples.
# This gives a perspective into the density and separation of the formed
# clusters
# Initi... |
tommyod/abelian | docs/notebooks/functions.ipynb | gpl-3.0 | # Imports from abelian
from abelian import LCA, HomLCA, LCAFunc
# Other imports
import math
import matplotlib.pyplot as plt
from IPython.display import display, Math
def show(arg):
return display(Math(arg.to_latex()))
"""
Explanation: Tutorial: Functions on LCAs
This is an interactive tutorial written with real ... |
planet-os/notebooks | api-examples/gfs-api.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import dateutil.parser
import datetime
from urllib.request import urlopen, Request
import simplejson as json
"""
Explanation: <h1>Using the Planet OS API to Produce Weather Forecast Graphs</h1>
Note: this notebook requires python3.
This notebook is... |
PMEAL/OpenPNM | examples/simulations/steady_state/fickian_diffusion_and_tortuosity.ipynb | mit | import numpy as np
import openpnm as op
%config InlineBackend.figure_formats = ['svg']
import matplotlib.pyplot as plt
%matplotlib inline
np.random.seed(10)
ws = op.Workspace()
ws.settings["loglevel"] = 40
np.set_printoptions(precision=5)
"""
Explanation: Fickian Diffusion and Tortuosity
In this example, we will learn... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.