repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
catherinezucker/dustcurve | model.ipynb | gpl-3.0 | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
distance=np.array([4,7.75,7.75,14,14,19])
fake_reddening=np.array([0,0,2,2,5,5])
plt.plot(distance, fake_reddening,lw=5)
plt.xlabel(r'Distance Modulus')
plt.ylabel('Reddening')
plt.xlim(4,19)
plt.ylim(0,7)
plt.title("Our Contrived Reddening Profile... |
zhaojijet/UdacityDeepLearningProject | DLND-your-first-network/dlnd-your-first-neural-network.ipynb | apache-2.0 | %matplotlib inline
%config InlineBackend.figure_format = 'retina'
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
"""
Explanation: Your first neural network
In this project, you'll build your first neural network and use it to predict daily bike rental ridership. We've provided some of the code... |
NeuroDataDesign/pan-synapse | pipeline_1/background/PLOS_Algorithms.md.ipynb | apache-2.0 | ######################################
###THIS IS PSEUDOCODE; WILL NOT RUN###
######################################
###STEP 1: COMPUTATION OF FOREGROUND PROBABILITY###
cdfMapVolume = []
for image in volume:
#Get a distribution of intensities of the slice
dist = generateDistribution(image)
#Get t... |
pombredanne/https-gitlab.lrde.epita.fr-vcsn-vcsn | doc/notebooks/automaton.weight_series.ipynb | gpl-3.0 | import vcsn
"""
Explanation: automaton.weight_series
Compute the sum of all the weights of the behavior. Find weighted distance between initial and final states.
Implementations:
- In $\mathbb{N}_\text{min}$: Shortest path algorithm.
- Otherwise: Proper applied to the spontaneous version of the automaton, i.e., as if ... |
goodmami/penman | docs/api-demo.ipynb | mit | import penman
penman.__version__
"""
Explanation: Penman API Demo
This notebook demonstrates the basic usage of the Penman API. For an overview of what Penman does, see the project page. For API documentation, see here.
To start, import the penman module.
End of explanation
"""
g = penman.decode('''
# ::snt The do... |
tensorflow/docs-l10n | site/ko/tutorials/load_data/numpy.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/float_and_double_rouding.ipynb | mit | from jyquickhelper import add_notebook_menu
add_notebook_menu()
%matplotlib inline
"""
Explanation: Float conversion
I came up with the following question $(float64)x < (float64)y \Longrightarrow (float32) x < (float32)y$? What is the probability this holds?
End of explanation
"""
import numpy
rnd = numpy.random.ra... |
jgomezc1/medios | NOTEBOOKS/Ej2_Estatica.ipynb | mit | from IPython.display import Image,Latex
"""
Explanation: Ejemplo 2. Estática
End of explanation
"""
Image(filename='FIGURES/Rampa.png',width=250)
"""
Explanation: Por medio de un par de cables se quiere sostener un bloque de peso $W = 200\; kgf$. Determine la tensión en cada cuerda si las coordenadas de posición de... |
jc091/deep-learning | first-neural-network/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... |
ES-DOC/esdoc-jupyterhub | notebooks/test-institute-2/cmip6/models/sandbox-1/atmos.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'test-institute-2', 'sandbox-1', 'atmos')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmos
MIP Era: CMIP6
Institute: TEST-INSTITUTE-2
Source ID: SANDBOX-1
Topic: Atmos
Sub-Topics: Dynamical... |
tpin3694/tpin3694.github.io | python/filter_items_in_list_with_filter.ipynb | mit | # Create an list of items denoting the number of soldiers in each regiment, view the list
regimentSize = (5345, 6436, 3453, 2352, 5212, 6232, 2124, 3425, 1200, 1000, 1211); regimentSize
"""
Explanation: Title: Selecting Items In A List With Filters
Slug: filter_items_in_list_with_filter
Summary: Selecting Items In A L... |
theonaun/surgeo | scripts/fetch_surnames.ipynb | mit | #CENSUS_URL_2000 = 'https://www2.census.gov/topics/genealogy/2000surnames/names.zip'
CENSUS_URL_2010 = 'https://www2.census.gov/topics/genealogy/2010surnames/names.zip'
CENSUS_SURNAME_COLUMNS = [
'name',
'rank',
'count',
'proportion',
'cum_proportion',
'white',
'black',
'api',
'nat... |
christophebertrand/ada-epfl | HW03-Interactive_Viz/HW03-collect.ipynb | mit | # imports
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from matplotlib.pyplot import show
%matplotlib inline
sns.set_context('notebook')
pd.options.mode.chained_assignment = None # default='warn'
"""
Explanation: HW3 Collect and Map
Data exploration and cleaning
In th... |
ellisonbg/leafletwidget | examples/MapCursorStyle.ipynb | mit | from ipyleaflet import Map
m = Map()
m.zoom = 3
m
"""
Explanation: Change cursor type over the map
End of explanation
"""
# Crosshair
m.default_style = {'cursor': 'crosshair'}
# Pointer
m.default_style = {'cursor': 'default'}
# Waiting
m.default_style = {'cursor': 'wait'}
# Not allowed value
m.default_style = {'c... |
marcelomiky/PythonCodes | scikit-learn/Estudos 1 - scikit-learn - hello!.ipynb | mit | # http://scikit-learn.org/stable/tutorial/basic/tutorial.html
from sklearn import datasets
iris = datasets.load_iris()
digits = datasets.load_digits()
"""
Explanation: Scikit-learn comes with a few standard datasets, for instance the iris and digits datasets for classification and the boston house prices dataset for ... |
sspickle/sci-comp-notebooks | P00-Intro.ipynb | mit | #
# When the cursor is in this cell hit "shift enter" to execute the python code here
#
x=3 # x is assigned an integer value of 3
y=2.4 # y is assigned a floating point value of 2.4
print("x and y are:", x, 'and',y)
"""
Explanation: Scientific Computing with Python
This is a course about applying computer prog... |
mitchshack/data_analysis_with_python_and_pandas | 2- IPython Notebooks and Raw Python Data Analysis/2-3 Raw Python - List Comprehensions.ipynb | apache-2.0 | x = range(10)
x
"""
Explanation: Raw Python - List Comprehensions
End of explanation
"""
[item**3 for item in x]
[item for item in x if item % 2 == 0]
[item**2 for item in x if item % 2 == 0]
test_list = [
"hello",
"x,y,z. i like this.",
"this is two xx",
"this, x, here x is, here it is againx"
]
"""
Explanatio... |
chrlttv/Teaching | Session3/1.TextProcessing.ipynb | mit | # Run me: press Shift+Enter
print("Hello, world!!")
"""
Explanation: Text Mining
Text mining is the process of automatically extracting high-quality information from text. High-quality information is typically derived through the devising of patterns and trends through means such as statistical pattern learning.
Typic... |
rohanisaac/spectra | notebooks/find_background.ipynb | gpl-3.0 | %matplotlib inline
from __future__ import division
import matplotlib.pyplot as plt
import numpy as np
import os
import sys
from scipy import signal
"""
Explanation: Intelligent background subtraction algorithm using wavelets.
Also contains implementations of other wavelets and peak-finding code
Runs 2017/1/9
Find and ... |
qutip/qutip-notebooks | examples/rcsolver-for-tls-bosonic-system.ipynb | lgpl-3.0 | %pylab inline
from qutip import *
from qutip import rcsolve
"""
Explanation: Reaction coordinate solver for 2-level bosonic system
Author: Neill Lambert (nwlambert@gmail.com)
Anubhav Vardhan (anubhavvardhan@gmail.com)
For more information about QuTiP see http://qutip.org
Introduction
Reference: link.aps.org/d... |
trungdong/datasets-provanalytics-dmkd | Application 1 - ProvStore Documents.ipynb | mit | import pandas as pd
df = pd.read_csv("provstore/data.csv")
df.head()
df.describe()
# The number of each label in the dataset
df.label.value_counts()
"""
Explanation: Application 1: ProvStore Documents
Identifying owners of provenance documents from their provenance network metrics
Goal: To determine if the provena... |
jseabold/statsmodels | examples/notebooks/statespace_news.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import pandas as pd
import statsmodels.api as sm
import matplotlib.pyplot as plt
macrodata = sm.datasets.macrodata.load_pandas().data
macrodata.index = pd.period_range('1959Q1', '2009Q3', freq='Q')
"""
Explanation: Forecasting, updating datasets, and the "news"
In this notebook,... |
jbocharov-mids/W207-Machine-Learning | reference/Decision_Tree_explained.ipynb | apache-2.0 | # This tells matplotlib not to try opening a new window for each plot.
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
from sklearn.datasets import load_iris
from sklearn import tree
from sklearn.tree import DecisionTreeClassifier
# For producing decision tree diagrams.
from IPython.core.display... |
googledatalab/notebooks | samples/Anomaly Detection in HTTP Logs.ipynb | apache-2.0 | from __future__ import division
import google.datalab.bigquery as bq
import matplotlib.pyplot as plot
import numpy as np
"""
Explanation: Anomaly Detection in HTTP Logs
This sample notebook demonstrates working with HTTP request logs data stored in BigQuery.
Google Cloud Logging in the Google Cloud Platform makes it s... |
superbock/parallel2015 | parallel.ipynb | mit | def function(argument):
"""
This function just prints the given argument.
:param argument: what to print
:returns: also returns the argument
"""
print("Calling function with argument %s" % argument)
return argument
function(42)
"""
Explanation: Parallel/efficient coding in... |
kyleabeauchamp/mdtraj | examples/two-pass-clustering.ipynb | lgpl-2.1 | from __future__ import print_function
import random
from collections import defaultdict
import mdtraj as md
import numpy as np
import scipy.cluster.hierarchy
stride = 5
subsampled = md.load('ala2.h5', stride=stride)
print(subsampled)
"""
Explanation: This example demonstrates one possible way to cluster data sets tha... |
cyang019/blight_fight | src/Feature_Engineering.ipynb | mit | buildings = pd.read_csv("../data/buildings.csv")
events = pd.read_csv("../data/events.csv")
buildings.head(2)
events.head(2)
events['type'].value_counts() # types: 1: 311-calls, 2: crimes, 3: blight violations
"""
Explanation: Loading data
End of explanation
"""
def str_to_list(events_str):
events_list = e... |
bjodah/pyodesys | examples/_native_override_chemical_kinetics.ipynb | bsd-2-clause | from operator import mul
from functools import reduce
import subprocess
import numpy as np
import sympy as sp
import matplotlib.pyplot as plt
from pyodesys.results import Result
from pyodesys.symbolic import SymbolicSys
from pyodesys.native import native_sys
from pyodesys.native.util import parse_standalone_output
from... |
amirziai/learning | deep-learning/Residual-networks.ipynb | mit | import numpy as np
from keras import layers
from keras.layers import Input, Add, Dense, Activation, ZeroPadding2D, BatchNormalization, Flatten, Conv2D, AveragePooling2D, MaxPooling2D, GlobalMaxPooling2D
from keras.models import Model, load_model
from keras.preprocessing import image
from keras.utils import layer_utils
... |
massimo-nocentini/simulation-methods | notes/matrices-functions/H-generation-matrix.ipynb | mit | from sympy import *
from sympy.abc import n, i, N, x, lamda, phi, z, j, r, k, a, alpha, beta
from commons import *
from matrix_functions import *
from sequences import *
import functions_catalog
init_printing()
d,h = IndexedBase('d'), IndexedBase('h')
alpha, beta, gamma = symbols(r'\alpha \beta \gamma')
"""
Explana... |
WNoxchi/Kaukasos | FAI02_old/layer-test.ipynb | mit | import keras
from keras.models import Model
from keras.layers import Dense, Input, Convolution2D
from keras.applications.imagenet_utils import _obtain_input_shape
from keras import backend as K
input_shape = (224, 224, 3)
img_input = Input(shape=input_shape, name='blah-input')
# x = Convolution2D(64, 3, 3, activation=... |
WeirdCircumstances/hu_bp_python_course | 03_advanced/.ipynb_checkpoints/advanced_python_tricks-checkpoint.ipynb | mit | import time
t = time.localtime()
t.tm_mday
"""
Explanation: Retrospective
Interpreter
Basic Calculations
Data Structures
Control flow
Functions
Documentation
Packages
Packages are folders containing Modules. If you are lucky, these modules also work together in a way. The folder needs to contain an __init__.py file... |
KushajveerSingh/Data-Science-Libraries | Tensorflow/Tensorflow.ipynb | mit | from __future__ import print_function
import tensorflow as tf
import numpy as np
"""
Explanation: <p>There are different tensorflow API's. The lowest level API is Tensorflow Core. Some higher level API's are tf.estmator</p>
Tensors
<p>The rank of a tensor is its number of dimensions.</p>
End of explanation
"""
node... |
metpy/MetPy | v0.7/_downloads/upperair_soundings.ipynb | bsd-3-clause | import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
import numpy as np
import pandas as pd
import metpy.calc as mpcalc
from metpy.cbook import get_test_data
from metpy.plots import Hodograph, SkewT
from metpy.units import units
"""
Explanation: Upper Air Sounding Tutorial
Uppe... |
ryan-leung/PHYS4650_Python_Tutorial | notebooks/Jan2018/python-syntax.ipynb | bsd-3-clause | print "Hello", "World!"
print "Tips 3: Use \ to escape an characters like \""
print "Tips 4: Use \\n \n to make a newline character"
print '''Tips 5: Use three \' to
make
multiple
line
'''
"""
Explanation: Python Syntax
Introduction
In this tutorial notebook, you will learn how to do programming in python and Jup... |
tpospisi/FlexCoDE | tutorial/Flexcode-tutorial-teddy.ipynb | gpl-2.0 | import numpy as np
import flexcode
from cdetools.cde_loss import cde_loss
from matplotlib import pyplot as plt
from flexcode.regression_models import RandomForest
"""
Explanation: The flexcode package can be installed directly by cloning the Github repository:
<code style="background:black;color:white">git clone https... |
planetlabs/notebooks | jupyter-notebooks/in-class-exercises/mosaicing-and-masking/mosaicing-and-masking.ipynb | apache-2.0 | # Load our 3 images using rasterio
import rasterio
img1 = None
img2 = None
img3 = None
# < update above with your own code >
"""
Explanation: Creating a composite image from multiple PlanetScope scenes
In this exercise, you'll learn how to create a composite image (or mosaic) from multiple PlanetScope satellite imag... |
jorisvandenbossche/DS-python-data-analysis | notebooks/python_recap/python_rehearsal.ipynb | bsd-3-clause | pressure_hPa = 1010 # hPa
"""
Explanation: <p><font size="6"><b> Python rehearsal</b></font></p>
DS Data manipulation, analysis and visualization in Python
May/June, 2021
© 2021, Joris Van den Bossche and Stijn Van Hoey (jorisvandenbossc&#... |
appleby/fastai-courses | deeplearning1/nbs/lesson4-ma.ipynb | apache-2.0 | ratings = pd.read_csv(path+'ratings.csv')
ratings.head()
len(ratings)
"""
Explanation: Set up data
We're working with the movielens data, which contains one rating per row, like this:
End of explanation
"""
movie_names = pd.read_csv(path+'movies.csv').set_index('movieId')['title'].to_dict()
users = ratings.userId.... |
ES-DOC/esdoc-jupyterhub | notebooks/dwd/cmip6/models/sandbox-1/land.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'dwd', 'sandbox-1', 'land')
"""
Explanation: ES-DOC CMIP6 Model Properties - Land
MIP Era: CMIP6
Institute: DWD
Source ID: SANDBOX-1
Topic: Land
Sub-Topics: Soil, Snow, Vegetation, Energy Balance... |
erinspace/share_tutorials | SHARE_Curation_Associates_Overview.ipynb | apache-2.0 | import json
import requests
iss_url = 'http://api.open-notify.org/iss-now.json'
data = requests.get(iss_url).json()
print(json.dumps(data, indent=4))
# Lattitude and Longitude of C'Ville
LAT = 38.0293
LON = 78.4767
iss_url = 'http://api.open-notify.org/iss-pass.json?lat={}&lon={}'.format(LAT, LON)
print(iss_url)
... |
ML4DS/ML4all | TM1.IntrodNLP/NLP_py2_wikitools/databricks/TM1_NLP_db_student.ipynb | mit | # %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
# import pylab
# Required imports
from wikitools import wiki
from wikitools import category
import nltk
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords
from nltk.stem import WordNetLemmatizer
from time import time
from... |
turbomanage/training-data-analyst | courses/machine_learning/deepdive/08_image/labs/mnist_models.ipynb | apache-2.0 | import os
PROJECT = "cloud-training-demos" # REPLACE WITH YOUR PROJECT ID
BUCKET = "cloud-training-demos-ml" # REPLACE WITH YOUR BUCKET NAME
REGION = "us-central1" # REPLACE WITH YOUR BUCKET REGION e.g. us-central1
MODEL_TYPE = "dnn" # "linear", "dnn", "dnn_dropout", or "cnn"
# Do not change these
os.environ["PROJECT... |
irockafe/revo_healthcare | notebooks/ST000450/ROC.ipynb | mit | metadata_df = my_mwtab.factors_to_df(mwtfile)
df = my_mwtab.get_feature_table(mwtfile)
assert(metadata_df.index == df.index).all()
print 'df shape', df.shape
print 'metadata shape', metadata_df.shape
metadata_df.head()
# convert classes to numbers
le = preprocessing.LabelEncoder()
le.fit(metadata_df['Disease'])
y = le... |
hektor-monteiro/python-notebooks | Atividade Data Vis - alunos.ipynb | gpl-2.0 | # importing pandas package
import pandas as pd
# making data frame from csv file
data = pd.read_csv("iris.csv")
data.head()
data.dtypes
data.columns
# descrevendo os dados
data.describe()
data['sepal.length']
data.mean()
data.plot()
data.hist()
from pandas.plotting import scatter_matrix
scatter_matrix(dat... |
karlstroetmann/Artificial-Intelligence | Python/7 Neural Networks/Digit-Recognition-NN.ipynb | gpl-2.0 | import gzip
import pickle
"""
Explanation: Handwritten Digit Recognition
In this notebook we show how a fully connected feed-forward neural networks can be used to recognize handwritten digits.
The data that we are using is stored in a <a href="https://docs.python.org/3/library/gzip.html">gzipped</a>,
<a href="https:... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/image_classification/labs/4_tpu_training.ipynb | apache-2.0 | import os
os.environ["BUCKET"] = "your-bucket-here"
"""
Explanation: Transfer Learning on TPUs
In the <a href="3_tf_hub_transfer_learning.ipynb">previous notebook</a>, we learned how to do transfer learning with TensorFlow Hub. In this notebook, we're going to kick up our training speed with TPUs.
Learning Objectives
... |
mne-tools/mne-tools.github.io | 0.20/_downloads/f094864c4eeae2b4353a90789dd18b2b/plot_mixed_source_space_inverse.ipynb | bsd-3-clause | # Author: Annalisa Pascarella <a.pascarella@iac.cnr.it>
#
# License: BSD (3-clause)
import os.path as op
import matplotlib.pyplot as plt
from nilearn import plotting
import mne
from mne.minimum_norm import make_inverse_operator, apply_inverse
# Set dir
data_path = mne.datasets.sample.data_path()
subject = 'sample'
... |
albahnsen/ML_SecurityInformatics | notebooks/12_Intro_DeepLearning.ipynb | mit | import numpy as np
from load import mnist
X_train, X_test, y_train2, y_test2 = mnist(onehot=True)
y_train = np.argmax(y_train2, axis=1)
y_test = np.argmax(y_test2, axis=1)
X_train[1].reshape((28, 28)).round(2)[:, 4:9].tolist()
from pylab import imshow, show, cm
import matplotlib.pylab as plt
%matplotlib inline
def... |
Diyago/Machine-Learning-scripts | statistics/Одновыборочные непараметрические критерии stat.non_parametric_tests_1sample.ipynb | apache-2.0 | import numpy as np
import pandas as pd
import itertools
from scipy import stats
from statsmodels.stats.descriptivestats import sign_test
from statsmodels.stats.weightstats import zconfint
%pylab inline
"""
Explanation: Непараметрические криетрии
Критерий | Одновыборочный | Двухвыборочный | Двухвыборочный (связанные ... |
ozorich/phys202-2015-work | days/day08/Display.ipynb | mit | class Ball(object):
pass
b = Ball()
b.__repr__()
print(b)
"""
Explanation: Display of Rich Output
In Python, objects can declare their textual representation using the __repr__ method.
End of explanation
"""
class Ball(object):
def __repr__(self):
return 'TEST'
b = Ball()
print(b)
"""
Explanatio... |
JrtPec/opengrid | notebooks/Analysis/Energy_signature.ipynb | apache-2.0 | import pandas as pd
"""
Explanation: This script is a port of EnergyID's code that calculates a linear regression on heating data
Imports and setup
General imports
End of explanation
"""
from opengrid.library import houseprint
from opengrid import config
from opengrid.library import linearregression
c = config.Conf... |
suryaavala/stockprediction | eurusd/PrepareData - Technical Indicators.ipynb | mit | def MACD(df,period1,period2,periodSignal):
EMA1 = pd.DataFrame.ewm(df,span=period1).mean()
EMA2 = pd.DataFrame.ewm(df,span=period2).mean()
MACD = EMA1-EMA2
Signal = pd.DataFrame.ewm(MACD,periodSignal).mean()
Histogram = MACD-Signal
return Histogram
def stochastics_oscillator(df,p... |
google/rba | Data Pre-Processing & Feature Selection.ipynb | apache-2.0 | ###########################################################################
#
# Copyright 2021 Google Inc.
#
# 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/... |
empet/Plotly-plots | DICOM-Image-viz.ipynb.ipynb | gpl-3.0 | import numpy as np
import pydicom
print (pydicom.__version__)
"""
Explanation: Plotly visualization of DICOM images
This notebook is an update of one based on an older version (0.99) of pydicom for Python 2.7.
Here we use Python 3.6 and pydicom 1.0.2.
DICOM (Digital Imaging and Communications in Medicine) is a stand... |
nljubesi/python-for-linguists | 5-Funkcije.ipynb | gpl-3.0 | def uvecaj(broj):
return broj+1
"""
Explanation: 5. Funkcije
Do sada smo koristili funkcije, no samo one unaprijed definirane u Pythonu poput funkcije float(), len() i slično. U ovom ćemo poglavlju naučiti pisati vlastite funkcije i to iz dva važna razloga:
1. organizacija koda koji rješava neki problem funkcijama... |
austinjalexander/sandbox | python/py/nanodegree/intro_ml/EnronPOI-Copy2.ipynb | mit | ### Task 1: Select what features you'll use.
### features_list is a list of strings, each of which is a feature name.
### The first feature must be "poi".
names = np.array(my_dataset.keys())
print names.shape, names[:5], "\n"
features_list = my_dataset.itervalues().next().keys()
features_list.sort()
features_list.remo... |
wittawatj/kernel-gof | ipynb/demo_kgof.ipynb | mit | %load_ext autoreload
%autoreload 2
%matplotlib inline
import kgof
import kgof.data as data
import kgof.density as density
import kgof.goftest as gof
import kgof.kernel as kernel
import kgof.util as util
import matplotlib
import matplotlib.pyplot as plt
import autograd.numpy as np
import scipy.stats as stats
"""
Expla... |
SGMAP-AGD/anonymisation | examples/Transparence Santé/Transparence.ipynb | gpl-3.0 | %matplotlib inline
import csv
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
from anonymizer.config_anonymizer import config
import os
import io
path_data = config['PATH']['TRANSPARENCE']
nbre_lignes = 50000
avantages = pd.read_csv(path_data, sep = ";", nrows = nbre_lignes,... |
kmorel/kmorel.github.io | images/better-plots/MultiSeries.ipynb | mit | import pandas
import numpy
import toyplot
import toyplot.pdf
import toyplot.png
import toyplot.svg
print('Pandas version: ', pandas.__version__)
print('Numpy version: ', numpy.__version__)
print('Toyplot version: ', toyplot.__version__)
"""
Explanation: When analyzing data, I usually use the following three module... |
mxbu/logbook | blog-notebooks/Forecasting-Swiss-GDP-Growth-with-Statsmodels.ipynb | mit | import numpy as np
import pandas as pd
import statsmodels.api as sm
from pandas.io.data import DataReader
import matplotlib.pyplot as plt
import warnings
warnings.simplefilter('ignore')
table = pd.read_excel('forecasting_data.xlsx')
idx = table.observation_date
data = table[['SwissGDP','Inflation','Unemployment','Expo... |
Featuretools/featuretools | docs/source/getting_started/primitives.ipynb | bsd-3-clause | import featuretools as ft
es = ft.demo.load_mock_customer(return_entityset=True)
feature_defs = ft.dfs(
entityset=es,
target_dataframe_name="customers",
agg_primitives=["mean"],
trans_primitives=["time_since_previous"],
features_only=True,
)
feature_defs
"""
Explanation: Feature primitives
Featu... |
Upward-Spiral-Science/claritycontrol | code/a05_classification_simulation.ipynb | apache-2.0 | import os
PATH="/Users/david/Desktop/CourseWork/TheArtOfDataScience/claritycontrol/code/scripts/" # use your own path
os.chdir(PATH)
import clarity as cl # I wrote this module for easier operations on data
import clarity.resources as rs
import csv,gc # garbage memory collection :)
import numpy as np
import matplotl... |
tombstone/models | research/object_detection/colab_tutorials/object_detection_tutorial.ipynb | apache-2.0 | !pip install -U --pre tensorflow=="2.*"
!pip install tf_slim
"""
Explanation: Object Detection API Demo
<table align="left"><td>
<a target="_blank" href="https://colab.sandbox.google.com/github/tensorflow/models/blob/master/research/object_detection/colab_tutorials/colab_tutorials/object_detection_tutorial.ipynb">
... |
hanhanwu/Hanhan_Data_Science_Practice | Better4Industry/Feature_Selection_Collection/try_shap_xgboost.ipynb | mit | import xgboost as xgb
import shap
from sklearn.model_selection import train_test_split
import pandas as pd
X,y = shap.datasets.boston()
X.head()
print(y.shape) # predict house price
y[4:10]
y = pd.DataFrame(y)
y.head()
# for regression method, I can not use stratify split with this method
X_train, X_test, y_train,... |
Ccaccia73/NLAAS-Labs | lab02.ipynb | mit | import FEM_utilities as FEM
"""
Explanation: Module for computations
End of explanation
"""
a = 1000. # lenght [mm]
b = 200. # width [mm]
t = 1.5 # thickness [mm]
"""
Explanation: Parameters:
End of explanation
"""
nx = 40
ny = 8
nodes, elements, fixed, loaded = FEM.Nodes(nx, ny, a, b)
#nodes
#elements
#... |
paolorivas/homeworkfoundations | homeworkdata/Data and Databases_class-9 and 10.ipynb | mit | x = ["duck", "aardvark", "crocodile", "emu", "bee",]
sorted(x)
# Sorts the original list
x.sort()
x
# Similar to order by DESC in SQL
sorted(x, reverse=True)
"""
Explanation: HW Review
Sorting lists -- what we already know
End of explanation
"""
# Sorted by second letter of each string: aardvard, bee, emu, croco... |
gkc1000/pyscf | pyscf/nao/notebook/AWS/example-ase-siesta-pyscf-h2o.ipynb | apache-2.0 | cat /proc/cpuinfo
"""
Explanation: Easy Ab initio calculation with ASE-Siesta-Pyscf
No installation necessary, just download a ready to go container for any system, or run it into the cloud
Are we really on the Amazon cloud??
End of explanation
"""
# import libraries and set up the molecule geometry
from ase.units i... |
astroumd/GradMap | notebooks/Lectures2021/Lecture4/GradMap_L4_Instructor.ipynb | gpl-3.0 | # set exercise1 equal to your matrix
#SOLUTION:
exercise1 = [[0,1,0],[1,0,1],[0,1,0]]
"""
Explanation: Introduction to Image Processing
Image processing is a very useful tool for scientists in the lab, and for everyday uses as well. For, example, an astronomer may use image processing to help find and recognize stars,... |
mu4farooqi/deep-learning-projects | bike-sharing-predictor/bike-sharing-neural-network.ipynb | gpl-3.0 | %matplotlib inline
%config InlineBackend.figure_format = 'retina'
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
"""
Explanation: Your first neural network
In this project, you'll build your first neural network and use it to predict daily bike rental ridership. We've provided some of the code... |
brettavedisian/Liquid-Crystals-Summer-2015 | .ipynb_checkpoints/VPEqualZero-checkpoint.ipynb | mit | f2 = ((1/2)*r_c*c**2+(1/4)*u_c*c**4+(1/6)*v_c*c**6+(1/2)*r_p*p**2+(1/4)*u_p*p**4-E*p-gamma*c*p-e*c**2*p**2/2)
nsimplify(f2)
"""
Explanation: $f_{2}(c,p) = \dfrac{1}{2}r_{c}c^{2}+\dfrac{1}{4}u_{c}c^{4}+\dfrac{1}{6}v_{c}c^{6}+\dfrac{1}{2}r_{p}p^{2}+\dfrac{1}{4}u_{p}p^{4}-\gamma cp-\dfrac{1}{2}ec^{2}p^{2}-Ep$
End of expl... |
chagaz/sfan | StructuredSparsityDataGeneration.ipynb | mit | # adjacency matrix
W = np.zeros((num_feats, num_feats))
for i in range(num_feats/mod_size):
W[i*mod_size:(i+1)*mod_size, i*mod_size:(i+1)*mod_size] = np.ones((mod_size, mod_size))
if not i == (num_feats/mod_size - 1):
W[(i+1)*mod_size-1, (i+1)*mod_size] = 1
W[(i+1)*mod_size, (i+1)*mod_size-1] = ... |
google/applied-machine-learning-intensive | content/06_other_models/02_embeddings/colab.ipynb | apache-2.0 | # 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 the L... |
mathause/regionmask | docs/notebooks/mask_3D.ipynb | mit | import regionmask
regionmask.__version__
"""
Explanation: Create 3D boolean masks
In this tutorial we will show how to create 3D boolean masks for arbitrary latitude and longitude grids. It uses the same algorithm to determine if a gridpoint is in a region as for the 2D mask. However, it returns a xarray.Dataset with... |
McIntyre-Lab/ipython-demo | interactive_plotting.ipynb | gpl-2.0 | # Import Module
import numpy as np
import scipy as sp
import scipy.stats as stats
import matplotlib.pyplot as plt
%matplotlib inline
import pandas as pd
"""
Explanation: Example of Interactive Plotting
The IPython notebook excels at interactive science. By its very nature you can easily create a bit of code, run it, l... |
jasontlam/snorkel | tutorials/workshop/Workshop_1_Snorkel_API.ipynb | apache-2.0 | %load_ext autoreload
%autoreload 2
%matplotlib inline
from lib.init import *
from lib.util import check_exercise_1, check_exercise_2
"""
Explanation: <img align="left" src="imgs/logo.jpg" width="50px" style="margin-right:10px">
Snorkel Workshop
Part 1: Snorkel API
Complete Snorkel API documentation is available via Re... |
qxcv/joint-regressor | keras/upgrading-convnets.ipynb | apache-2.0 | %matplotlib inline
from keras.models import model_from_json
from keras.optimizers import SGD
from os import path
from train import infer_sizes
import models
"""
Explanation: This notebook is a handy tool for converting CNNs produced by train.py to fully convolutional CNNs for evaluation.
End of explanation
"""
ca... |
llulai/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... |
DianaMosquera/Diana-M | ML1.ipynb | mit | !pip install -q moviepy > /dev/null 2>&1
!pip install -q imageio > /dev/null 2>&1
!pip install -q tensorflow==2.0.0-beta0 > /dev/null 2>&1
import tensorflow as tf
import numpy as np # Numpy is an efficient linear algebra library.
import matplotlib.pyplot as plt # Matplotlib is used to generate plots... |
seifip/udacity-deep-learning-nanodegree | !P1 - First Neural Network/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... |
ncullen93/pyBN | examples/FactorOperations.ipynb | mit | from pyBN import *
bn = read_bn('data/cmu.bn')
print bn.V
print bn.E
"""
Explanation: Factor Operations with pyBN
It is probably rare that a user wants to directly manipulate factors unless they are developing a new algorithm, but it's still important to see how factor operations are done in pyBN. Moreover, the ease-... |
cuttlefishh/emp | code/01-metadata/metadata_refine_step3_qiita.ipynb | bsd-3-clause | # from qiita_db.study import Study
# from shutil import copy
# from os import mkdir
# ffp = '/home/qiita/emp-sample-info-files'
# study_ids = [ 550, 632, 638, 659, 662, 678, 713, 714, 722, 723,
# 755, 776, 804, 805, 807, 808, 809, 810, 829, 846,
# 861,... |
ThyrixYang/LearningNotes | MOOC/stanford_cnn_cs231n/assignment2/TensorFlow.ipynb | gpl-3.0 | import tensorflow as tf
import numpy as np
import math
import timeit
import matplotlib.pyplot as plt
%matplotlib inline
from cs231n.data_utils import load_CIFAR10
def get_CIFAR10_data(num_training=49000, num_validation=1000, num_test=10000):
"""
Load the CIFAR-10 dataset from disk and perform preprocessing to ... |
DouglasOrr/DeepLearnTute | examples/Intro.ipynb | mit | a = 100
print("a is", a)
a + 200
"""
Explanation: Intro to deep learning in Chainer
Welcome - this interactive tutorial will introduce you to deep learning in Chainer, to prepare for the DIY practical tutorial.
0. iPython
First off, you need to know how to run code & see the results. When you see Exercise, it is an e... |
aspuru-guzik-group/selfies | docs/source/tutorial.ipynb | apache-2.0 | import selfies as sf
"""
Explanation: Tutorial
The Basics
We begin by importing selfies.
End of explanation
"""
original_smiles = "O=Cc1ccccc1" # benzaldehyde
try:
encoded_selfies = sf.encoder(original_smiles) # SMILES -> SELFIES
decoded_smiles = sf.decoder(encoded_selfies) # SELFIES -> SMILES
... |
prihandoko/prihandoko.github.io | _pages/learn/python/Data Structure.ipynb | mit | # Mendefinisikan isi list bisa dilakukan dengan banyak cara.
# Salah satunya adalah mendeklarasikan isinya dengan meletakkannya
# di antara dua tanda kurung siku atau brackets.
kotakota = ["Bandung", "Jakarta", "Surabaya"]
arahangin = ["Utara", "Barat", "Timur", "Selatan"]
print(kotakota[1],arahangin[-1])
for ko... |
tensorflow/docs-l10n | site/ja/tfx/tutorials/serving/rest_simple.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... |
liufuyang/deep_learning_tutorial | course-deeplearning.ai/course5-rnn/Week 1/Dinosaur Island -- Character-level language model/Dinosaurus Island -- Character level language model final - v3.ipynb | mit | import numpy as np
from utils import *
import random
"""
Explanation: Character level language model - Dinosaurus land
Welcome to Dinosaurus Island! 65 million years ago, dinosaurs existed, and in this assignment they are back. You are in charge of a special task. Leading biology researchers are creating new breeds of... |
saashimi/code_guild | interactive-coding-challenges/recursion_dynamic/n_pairs_parentheses/n_pairs_parentheses_challenge.ipynb | mit | def parentheses_util(no_left, no_right, pair_string, result):
# TODO: implement parentheses pairing here
pass
def pair_parentheses(n):
result_set = set()
if n == 0:
return result_set
parentheses_util(n, n, '', result_set)
return result_set
"""
Explanation: <small><i>This notebook was ... |
mne-tools/mne-tools.github.io | stable/_downloads/9363cd44fa61e7532287bca17b028ef6/time_frequency_global_field_power.ipynb | bsd-3-clause | # Authors: Denis A. Engemann <denis.engemann@gmail.com>
# Stefan Appelhoff <stefan.appelhoff@mailbox.org>
#
# License: BSD-3-Clause
import os.path as op
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne.datasets import somato
from mne.baseline import rescale
from mne.stats import bootst... |
DillmannFrench/Intro-PYTHON | Cours06_ROUSSET-DILLMANN-ISEP2016.ipynb | gpl-3.0 | ## n est forcément un entier supérieur ou égal à 1
def f1(n):
a = True
k = 2
while (k < n) and a:
if n % k == 0:
a = False
k = k + 1
if a:
print(n)
return
while n != 1:
k = 2
while k <= n:
if n % k == 0:
n =... |
fantasycheng/udacity-deep-learning-project | tutorials/tensorboard/Anna_KaRNNa_Name_Scoped.ipynb | mit | import time
from collections import namedtuple
import numpy as np
import tensorflow as tf
"""
Explanation: Anna KaRNNa
In this notebook, I'll build a character-wise RNN trained on Anna Karenina, one of my all-time favorite books. It'll be able to generate new text based on the text from the book.
This network is base... |
Boussau/Notebooks | Notebooks/Simulating_phylogenetic_inertia.ipynb | gpl-2.0 | import pandas as pd
import numpy.random as rd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from ete3 import Tree, TreeStyle, NodeStyle
%matplotlib inline
def simulate(num):
times = range(num)
values=list()
values.append(0)
for i in times[1:(len(times))]:
values.appe... |
KushajveerSingh/Data-Science-Libraries | Python/Python Language Basics.ipynb | mit | def \
quicksort():
pass
"""
Explanation: The python Language Reference
CPython -> Python implmentation in C<br>
Python program is read by a parser, input to the parser is a stream of tokens, generated by lexical analyzer.<br>
<ol>
<li>Logical Lines -> The end of a logical line is represented by NEWLINE</li>
<li>Ph... |
ES-DOC/esdoc-jupyterhub | notebooks/inpe/cmip6/models/sandbox-2/landice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'inpe', 'sandbox-2', 'landice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Landice
MIP Era: CMIP6
Institute: INPE
Source ID: SANDBOX-2
Topic: Landice
Sub-Topics: Glaciers, Ice.
Properties:... |
cesarcontre/Simulacion2017 | Modulo2/Clase16_ProbabilidadPrecio-Umbral.ipynb | mit | # Importamos librerías
import numpy as np
import pandas as pd
import pandas_datareader as data
import matplotlib.pyplot as plt
%matplotlib inline
# Creamos la función
def load_adj_close(ticker, data_source, start_date, end_date):
panel_data = data.DataReader(ticker, data_source, start_date, end_date)
closes = ... |
dmolina/es_intro_python | 06-Built-in-Data-Structures.ipynb | gpl-3.0 | L = [2, 3, 5, 7]
"""
Explanation: <!--BOOK_INFORMATION-->
<img align="left" style="padding-right:10px;" src="fig/cover-small.jpg">
This notebook contains an excerpt from the Whirlwind Tour of Python by Jake VanderPlas; the content is available on GitHub.
The text and code are released under the CC0 license; see also t... |
sdpython/pyquickhelper | _unittests/ut_helpgen/notebooks_pdf/TD2A_eco_API_SNCF_corrige.ipynb | mit | from jyquickhelper import add_notebook_menu
add_notebook_menu()
"""
Explanation: 2A.eco - Exercice API SNCF corrigé
Manipulation d'une API REST, celle de la SNCF est prise comme exemple. Correction d'exercices.
End of explanation
"""
# !!!!! Attention à bien mettre votre token ici !!!!!
token_auth = 'XXXXXXXXXXXXX... |
denstorti/Machine-learning-foundations-python | House price prediction with Pandas.ipynb | mit | len(test_data)
len(train_data)
sales.describe()
sales['bedrooms'].unique()
sales.count()
sales['renovated'] = sales['yr_renovated'] > 0
sales.head()
sales.plot.scatter(x='sqft_living', y='price')
sales.index
sales.columns
sales.values
sales.index
bed_count = sales.bedrooms.value_counts()
type(bed_count)... |
radhikapc/foundation-homework | homework_sql/Homework_5-Radhika.ipynb | mit | from bs4 import BeautifulSoup
from urllib.request import urlopen
html = urlopen("http://static.decontextualize.com/cats.html").read()
document = BeautifulSoup(html, "html.parser")
"""
Explanation: Homework #5
This homework presents a sophisticated scenario in which you must design a SQL schema, insert data into it, an... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.