repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
hagne/atm-py
examples/instruments_miniSASP.ipynb
mit
from atmPy.instruments.miniSASP import miniSASP from atmPy.tools import plt_tools from atmPy.instruments.piccolo import piccolo %matplotlib inline plt_tools.setRcParams(plt) """ Explanation: Introduction The miniSASP module is probably one of the more confuse modules and needs to be reorganized. Its goal is to read an...
pschragger/big-data-python-class
Lectures/Week 5 - MapReduce - MRJob/MR_SORT.ipynb
mit
%load data/numbers.txt """ Explanation: examine the data First examine the data by loading it in with the %Load command It will fill in the block with the content of the file in the block and comment out the %Load command End of explanation """ # %load code/MRSortByString.py from mrjob.job import MRJob class MRSor...
jaidevd/inmantec_fdp
notebooks/day2/05_statistical_data_viz.ipynb
mit
df.plot? """ Explanation: Plotting options of pandas series and dataframes End of explanation """ ax = pd.tools.plotting.scatter_matrix(df[['Weight', 'Height', 'MRI_Count']]) ax = pd.tools.plotting.scatter_matrix(df[['FSIQ', 'PIQ', 'VIQ']]) """ Explanation: Exercise: Try different plotting options from the kind pa...
matsaleh13/courses
deeplearning1/nbs/lesson6.ipynb
apache-2.0
path = get_file('nietzsche.txt', origin="https://s3.amazonaws.com/text-datasets/nietzsche.txt") text = open(path).read() print('corpus length:', len(text)) chars = sorted(list(set(text))) vocab_size = len(chars)+1 print('total chars:', vocab_size) """ Explanation: Setup We're going to download the collected works of ...
IIPBC/Material
machine_learning_Nina/Exercise1-1.ipynb
mit
import numpy as np %matplotlib inline import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D """ Explanation: Exercício 1.1 Regressão linear, usando o método do gradiente descendente para minimização<br> Em regressão, o que queremos é predizer $y$ para um dado $\mathbf{x}$.<br> Aqui vamos considerar ...
fablln/Deep-Learning
word_prediction_lstm/TP3-notebook.ipynb
mit
import numpy as np import collections # used to build the dictionary import random import time from time import time import pickle # may be used to save your model import matplotlib.pyplot as plt #Import Tensorflow and rnn import tensorflow as tf from tensorflow.contrib import rnn # Target log path logs_path = 'lst...
intel-analytics/analytics-zoo
docs/docs/colab-notebook/orca/quickstart/autoxgboost_regressor_sklearn_boston.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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed un...
infilect/ml-course1
keras-notebooks/advanced/8.1-text-generation-with-lstm.ipynb
mit
import keras import numpy as np path = keras.utils.get_file( 'nietzsche.txt', origin='https://s3.amazonaws.com/text-datasets/nietzsche.txt') text = open(path).read().lower() print('Corpus length:', len(text)) """ Explanation: Text generation with LSTM This notebook contains the code samples found in Chapter 8...
chanitacr/sc-python
01-analysing-data.ipynb
mit
import numpy numpy.loadtxt(fname='data/weather-01.csv', delimiter = ',') """ Explanation: Analysing tabublar data we are going to use a LIBRARY called numpy End of explanation """ weight_kg = 55 print (weight_kg) print ('Weight in pounds:', weight_kg * 2.2) weight_kg = 57.5 print ('Weight in pounds:', weight_kg...
BillyLjm/CS100.1x.__CS190.1x
ML_lab1_review_student.ipynb
mit
labVersion = 'cs190_week1_v_1_2' """ Explanation: Math and Python review and CTR data download This notebook reviews vector and matrix math, the NumPy Python package, and Python lambda expressions. It also covers downloading the data required for Lab 4, where you will analyze website click-through rates. Part 1 cove...
jorisvandenbossche/DS-python-data-analysis
_solved/pandas_02_basic_operations.ipynb
bsd-3-clause
import pandas as pd import numpy as np import matplotlib.pyplot as plt # redefining the example DataFrame countries = pd.DataFrame({'country': ['Belgium', 'France', 'Germany', 'Netherlands', 'United Kingdom'], 'population': [11.3, 64.3, 81.3, 16.9, 64.9], 'area': [30510, 671308, 357050, 41526, 244820...
450586509/DLNLP
src/notebooks/CNN/.ipynb_checkpoints/CNN_random_word-checkpoint.ipynb
apache-2.0
file_names = ['stsa.fine.test','stsa.fine.train','stsa.fine.dev'] file_path = '/home/bruce/data/sentiment/citai_process' def read_file(fname=''): with open(join(file_path,fname)) as fr: lines = fr.readlines() lines = [line.strip().lower() for line in lines] lables = [int(line[0:1]) for line in lines...
bosscha/alma-calibrator
notebooks/2mass/13_environment-with_analysis.ipynb
gpl-2.0
from astroquery.gaia import Gaia tables = Gaia.load_tables(only_names=True) for table in (tables): print (table.get_qualified_name()) #obj = ["3C 454.3", 343.49062, 16.14821, 1.0] obj = ["PKS J0006-0623", 1.55789, -6.39315, 1] #obj = ["M87", 187.705930, 12.391123, 1.0] #### name, ra, dec, radius of cone (in deg) ...
adrifmonte/ml-intro
notebooks/machine-learning-continues.ipynb
mit
import pandas as pd train_df = pd.read_csv('data/train.csv') test_df = pd.read_csv('data/test.csv') test_check_df = pd.read_csv('data/test-check.csv') print('Train columns: ', train_df.columns.values, '\n') print('Test columns: ', test_df.columns.values, '\n') print('Test check columns: ', test_check_df.columns.value...
nick-youngblut/SIPSim
ipynb/bac_genome/n1210/.ipynb_checkpoints/atomIncorp_taxaIncorp_abund-checkpoint.ipynb
mit
workDir = '/home/nick/notebook/SIPSim/dev/bac_genome1210/' sourceDir = os.path.join(workDir, 'atomIncorp_taxaIncorp') buildDir = os.path.join(workDir, 'atomIncorp_taxaIncorp_abund') R_dir = '/home/nick/notebook/SIPSim/lib/R/' """ Explanation: Accuracy as a function taxon abundance Variable parameters: Partition commu...
masedki/masedki.github.io
enseignements/python/nn_conv.ipynb
mit
## pour tracer des figures import matplotlib.pyplot as plt ## pour déclarer le CNN import keras from keras import datasets from keras.models import Sequential from keras.layers import Dense, Dropout, Flatten, Activation, Conv2D, MaxPooling2D from keras import backend as K import tensorflow as tf """ Explanation: Class...
hypergravity/astrostatistics
python/slides1.ipynb
mit
# Basic python print("Hello world!") print(type("Hello world!")) print(type("Hello world!")==str) # dir() # Built-in data types # int print(type(1)) # float print(type(1.0)) # str print(type("Hello World")) # bool print(type(False)) # Built-in data types: list alist = [1, 2.0, "3"] print(alist) print(type(ali...
gVallverdu/cookbook
kernel_density_estimation.ipynb
gpl-2.0
import numpy as np import scipy as sp from scipy.stats import gaussian_kde from scipy.stats import norm import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import matplotlib.patches as mpatches plt.rcParams["figure.figsize"] = (9, 6) plt.rcParams["font.size"] = 18 # just for fun # plt.xkcd(scale...
ocefpaf/UTide
notebooks/utide_real_data_example.ipynb
mit
with open('can1998.dtf') as f: lines = f.readlines() print(''.join(lines[:30])) """ Explanation: Look at the data file to see what structure it has. End of explanation """ def date_parser(year, month, day, hour): year, month, day, hour = map(int, (year, month, day, hour)) return datetime.datetime(year, ...
afarouky/become-datascience-master
linear-regression-tutorial/(Multiple)-Linear-Regression-tutrial.ipynb
mit
# Imports import numpy as np import pandas as pd from sklearn.datasets import load_boston #Ploting import seaborn as sns import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D %matplotlib inline # %matplotlib notebook """ Explanation: (Multiple) Linear Regression: This Tutorial will illstrate how to...
honjy/foundations-homework
13/311 time series homework.ipynb
mit
df = pd.read_csv("311-2015.csv", nrows=200000, low_memory=False) #Why can't we use parse_dates=True? --> If the date is in a format that pandas recognizes as a date like YYYYMMDD #Keep the data set small and make sure everything works before running everything through it df.head() df.info() def parse_date(str_date)...
danmelamed/vowpal_wabbit
python/examples/poisson_regression.ipynb
bsd-3-clause
# Train log-transform model training_samples = [] logz = np.log(0.001 + z) vw = pyvw.vw("-b 2 --loss_function squared -l 0.1 --holdout_off -f vw.log.model --readable_model vw.readable.log.model") for i in range(len(logz)): training_samples.append("{label} | x:{x} y:{y}".format(label=logz[i], x=x[i], y=y[i])) # Do h...
jtwhite79/pyemu
examples/pyemu_ensemble_basics.ipynb
bsd-3-clause
import flopy # load the model model_ws = os.path.join("Freyberg","extra_crispy") ml = flopy.modflow.Modflow.load("freyberg.nam",model_ws=model_ws) # Because this model is old -- it predates flopy's modelgrid implementation. # And because modelgrid has been implemented without backward compatability # the modelgrid ...
peishunli/peishunli.github.io
blog/python_beginning/.ipynb_checkpoints/4function-checkpoint.ipynb
gpl-3.0
import math x=1 y=math.sqrt callable(x) callable(y) """ Explanation: title: 函数 create: 2016.12.7 modified: 2016.12.7 tags: python 函数 参数 4 [TOC] 接下来会介绍如果将语句组织成函数。还会详细介绍参数(parameter)和作用域(scope),以及递归的概念。 1 创建函数 内建的callable函数可以用来判断函数是否可调用: End of explanation """ def hello(name): return 'Hello, ...
martinjrobins/hobo
examples/plotting/residuals-autocorrelation.ipynb
bsd-3-clause
import pints import pints.toy as toy import pints.plot import numpy as np import matplotlib.pyplot as plt # Use the toy logistic model model = toy.LogisticModel() real_parameters = [0.015, 500] times = np.linspace(0, 1000, 100) org_values = model.simulate(real_parameters, times) # Add independent Gaussian noise nois...
ES-DOC/esdoc-jupyterhub
notebooks/cccr-iitm/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', 'cccr-iitm', 'sandbox-3', 'atmoschem') """ Explanation: ES-DOC CMIP6 Model Properties - Atmoschem MIP Era: CMIP6 Institute: CCCR-IITM Source ID: SANDBOX-3 Topic: Atmoschem Sub-Topics: Transport, ...
CentreForCorpusResearch/clic
docs/notebooks/Concordance/.ipynb_checkpoints/A serious concordance-checkpoint.ipynb
mit
# coding: utf-8 import os from cheshire3.baseObjects import Session from cheshire3.document import StringDocument from cheshire3.internal import cheshire3Root from cheshire3.server import SimpleServer session = Session() session.database = 'db_dickens' serv = SimpleServer(session, os.path.join(cheshire3Root, 'con...
fastai/courses
deeplearning1/nbs/wordvectors.ipynb
apache-2.0
def get_glove(name): with open(path+ 'glove.' + name + '.txt', 'r') as f: lines = [line.split() for line in f] words = [d[0] for d in lines] vecs = np.stack(np.array(d[1:], dtype=np.float32) for d in lines) wordidx = {o:i for i,o in enumerate(words)} save_array(res_path+name+'.dat', vecs) pickle...
salvor7/salvor7.github.io
content/A Million Pseudo-Random Digits/How uniformly Random are RAND's 'Million Psueod-Random Digits'.ipynb
mit
import pandas as pd the_digits = pd.read_csv('data.csv') the_digits.head() """ Explanation: I found this data set on Kaggle. It is 1 million single digit numbers from 1 to 9, and I was curious if their distribution is uniform. Or said another way, how reasonable is it suggest the numbers in the list were generated un...
turbomanage/training-data-analyst
courses/machine_learning/deepdive/10_recommend/labs/wals.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 # Do not change these os.environ["PROJECT"] = PROJECT os.environ["BUCKET"] = BUCKET os.environ["REGION"]...
mjones01/NEON-Data-Skills
code/Python/remote-sensing/hyperspectral-data/Intro_NEON_AOP_HDF5_Reflectance_Tiles_py.ipynb
agpl-3.0
#Check that you are using the correct version of Python (should be 3.5 for these tutorials) import sys sys.version """ Explanation: syncID: 61ad1fc43ddd45b49cad1bca48656bbe title: "NEON AOP Hyperspectral Data in HDF5 format with Python - Tiles" description: "Learn how to read NEON AOP hyperspectral flightline data us...
tritemio/multispot_paper
out_notebooks/Multi-spot vs usALEX FRET histogram comparison-out-17d.ipynb
mit
data_id = '17d' ph_sel_name = "None" data_id = "17d" """ Explanation: Executed: Mon Mar 27 22:24:30 2017 Duration: 12 seconds. End of explanation """ from fretbursts import * sns = init_notebook() import os import pandas as pd from IPython.display import display, Math import lmfit print('lmfit version:', lmfit._...
fotis007/python_intermediate
Python_2_4.ipynb
gpl-3.0
import networkx as nx g = nx.Graph() g.add_node(1) g.add_node(2) g.add_node(3) g.add_node(4) #oder schneller g.add_nodes_from([1,2,3,4]) #Hinzufügen von Kanten g.add_edge(1,2) g.add_edge(1,3) g.add_edge(1,4) #oder schneller g.add_edges_from([(1,2),(1,3),(1,4)]) """ Explanation: Grundbegriffe des Arbeitens mit Graph...
gfabieno/SeisCL
Tutorial/unused/Model_Building.ipynb
gpl-3.0
import numpy as np import matplotlib.pyplot as plt from SeisCL import SeisCL """ Explanation: Models generation In this notebook, we will explore various ways of creating a model for our simulation. Three-layer model First, let's start by creating a single layer model with the following characteristics : \begin{array}...
kitu2007/dl_class
autoencoder/Convolutional_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) img = mnist.train.images[2] plt.imshow(img.reshape((28, 28)), cmap='Greys_r') """ Explanation: C...
charlesll/RamPy
examples/Machine Learning Regression.ipynb
gpl-2.0
%matplotlib inline import numpy as np np.random.seed(42) # fixing the seed import matplotlib import matplotlib.pyplot as plt import rampy as rp from scipy.stats import norm x = np.arange(0,600,1.0) nb_samples = 300 # number of samples in our dataset S_1 = norm.pdf(x,loc=200.,scale=130.) S_2 = norm.pdf(x,loc=400,scale...
jrieke/mhbf
5/5.ipynb
mit
from __future__ import division, print_function import numpy as np import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Solution from Johannes Rieke and Alex Moore¶ End of explanation """ mu = 0.2 sigma = 0.5 dt = 0.01 time = np.arange(0, 10, dt) for i in range(5): x = np.zeros_like(time) fo...
tatsuya-ogawa/udacity-deep-learning
tv-script-generation/dlnd_tv_script_generation.ipynb
mit
""" DON'T MODIFY ANYTHING IN THIS CELL """ import helper data_dir = './data/simpsons/moes_tavern_lines.txt' text = helper.load_data(data_dir) # Ignore notice, since we don't use it for analysing the data text = text[81:] """ Explanation: TV Script Generation In this project, you'll generate your own Simpsons TV scrip...
terrydolan/lfcelite
lfcelite.ipynb
mit
%%html <! left align the change log table in next cell > <style> table {float:left} </style> """ Explanation: LFC Data Analysis: The Elite Strikers See Terry's blog LFC: The Elite Strikers for a discussion of of the data analysis. This notebook analyses Liverpool FC's elite strikers data from 1962-1963 to 2014-2015. A...
cdt15/lingam
examples/CausalEffect(LogisticRegression).ipynb
mit
import numpy as np import pandas as pd import graphviz import lingam from lingam.utils import make_prior_knowledge print([np.__version__, pd.__version__, graphviz.__version__, lingam.__version__]) np.set_printoptions(precision=3, suppress=True) np.random.seed(0) """ Explanation: Causal Effect for Logistic Regression...
statsmodels/statsmodels.github.io
v0.12.1/examples/notebooks/generated/wls.ipynb
bsd-3-clause
%matplotlib inline import numpy as np from scipy import stats import statsmodels.api as sm import matplotlib.pyplot as plt from statsmodels.sandbox.regression.predstd import wls_prediction_std from statsmodels.iolib.table import (SimpleTable, default_txt_fmt) np.random.seed(1024) """ Explanation: Weighted Least Squar...
jrg365/gpytorch
examples/02_Scalable_Exact_GPs/Grid_GP_Regression.ipynb
mit
import gpytorch import torch import math """ Explanation: GP Regression with Grid Structured Training Data In this notebook, we demonstrate how to perform GP regression when your training data lies on a regularly spaced grid. For this example, we'll be modeling a 2D function where the training data is on an evenly spa...
adrienhenry/characteristicTimesNetwork
compute_disorder.ipynb
mit
%matplotlib notebook from LinearChain import * import matplotlib.pyplot as plt from matplotlib import rc from scipy.integrate import ode from scipy.integrate import quad from scipy import stats import numpy as np import multiprocessing as mp exec(open("fig_settings.py").read()) """ Explanation: Compute disorder Impor...
google/data-pills
pills/GA/[DATA_PILL]_[GA]_Customer_Market_Intelligence_(CMI).ipynb
apache-2.0
import IPython import plotly import plotly.offline as py import plotly.graph_objs as go import math import json import numpy as np import pandas as pd from scipy import spatial from scipy.spatial import distance from sklearn.cluster import KMeans from google.colab import drive from google.colab import auth from sklearn...
gwulfs/research_public
lectures/Arbitrage Pricing Theory.ipynb
apache-2.0
import numpy as np import pandas as pd from statsmodels import regression import matplotlib.pyplot as plt """ Explanation: Arbitrage Pricing Theory By Evgenia "Jenny" Nitishinskaya and Delaney Granizo-Mackenzie. Part of the Quantopian Lecture Series: www.quantopian.com/lectures github.com/quantopian/research_public ...
IBM/differential-privacy-library
notebooks/30seconds.ipynb
mit
from sklearn import datasets from sklearn.model_selection import train_test_split dataset = datasets.load_iris() X_train, X_test, y_train, y_test = train_test_split(dataset.data, dataset.target, test_size=0.2) """ Explanation: Getting started: Machine learning with differential privacy in 30 seconds We're using the I...
nitin-cherian/LifeLongLearning
Python/Python Morsels/multimax/my_try/multimax.ipynb
mit
multimax([]) """ Explanation: Bonus1: Make sure the function returns an empty list if the iterable is empty End of explanation """ numbers = [1, 3, 8, 5, 4, 10, 6] odds = (n for n in numbers if n % 2 == 1) multimax(odds) """ Explanation: Bonus2: Make sure the function works well with iterator such as files, generat...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/production_ml/babyweight/train_deploy.ipynb
apache-2.0
!sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst !pip install --user google-cloud-bigquery==2.26.0 """ Explanation: Structured data prediction using Vertex AI Platform Learning Objectives Create a BigQuery Dataset and Google Cloud Storage Bucket Export from BigQuery to CSVs in GCS Training on Clou...
landmanbester/fundamentals_of_interferometry
8_Calibration/8_1_Calibration_Least_Squares_Problem.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 8. Calibration Previous: 8. Calibration Next: 8.2 1GC calibration Import standard modules: End of explanation """ from scipy im...
trsherborne/learn-python
lesson2.ipynb
mit
a = 4 b = 8 c = 9 if a%2 == 0: print('Multiple of 2') else: print('Not a multiple of 2') if b%2 == 0: print('Multiple of 2') else: print('Not a multiple of 2') if c%2 == 0: print('Multiple of 2') else: print('Not a multiple of 2') """ Explanation: LSESU Applicable Maths Python Lesson 2 2...
AntonelliLab/seqcap_processor
docs/notebook/subdocs/locus_selection.ipynb
mit
%%bash source activate secapr_env secapr locus_selection -h """ Explanation: Locus selection When inspecting the results of the reference-based assembly you may find that many loci are not covered by many or any reads. In that case you may want to make a selection of loci with good coverage and continue to only work w...
freelanceastro/galactic-machine-learning
Galaxy-Zoo-Machine-Learning.ipynb
mit
## An attempt at Python 2 backward compatibility from __future__ import absolute_import, division, print_function, unicode_literals %matplotlib inline from skimage import data, io, filters filename = "images_training_rev1/100008.jpg" galaxy = io.imread(filename) io.imshow(galaxy) io.show() """ Explanation: Making a f...
GoogleCloudPlatform/ml-design-patterns
01_need_for_design_patterns/ml_challenges.ipynb
apache-2.0
import pandas as pd import tensorflow as tf from sklearn.utils import shuffle from google.cloud import bigquery """ Explanation: ML Challenges This notebook includes various code snippets mentioned in the first chapter of our Machine Learning Design Patterns book. End of explanation """ # Setting a random seed in T...
sains1/UTRonsProject
Notebooks/4_siteCanonicality.ipynb
mit
import pandas as pd import math import sqlite3 import numpy """ Explanation: Looking at the site canonicality for novel UTRons Used cgat script gtf2gtf.py with options to output splice information Analysed splice info of a GTF file that contained the 3' UTRs of all the novel UTRons by taking the last 2 exons of every ...
eds-admin/eds-blog
Statistics/Hypothesis Testing.ipynb
mit
import random random.seed(42) def flip(n): results ={'heads': 0, 'tails': 0} for _ in range(n): coin = random.choice(['heads', 'tails']) results[coin] += 1 return results def print_proportions(flips): total = flips['heads'] + flips['tails'] print("Heads p={}\nTails p={}".format( ...
HrantDavtyan/Data_Scraping
Week 7/Google_maps_API.ipynb
apache-2.0
import googlemaps from datetime import datetime """ Explanation: Google Maps API - authorized access This notebook provides introduction to requesting data from Google Maps API using Python. There is a standout Python package developed explicitly for that purpose. To install that package go to the comman prompt and en...
skorokithakis/pythess-files
015 - Breaking Benjamin/meta_alltheway/meta_alltheway.ipynb
mit
from abc import ABCMeta, abstractmethod class Vehicle(metaclass=ABCMeta): @abstractmethod def change_gear(self): pass @abstractmethod def start_engine(self): pass class Car(Vehicle): # subclass the ABC, abstract methods MUST be overridden def __init__(self, make, model, color): ...
stephenliu1989/msmbuilder
examples/advanced/gmrq-model-selection.ipynb
lgpl-2.1
from __future__ import print_function import numpy as np from msmbuilder.example_datasets import load_doublewell from msmbuilder.cluster import NDGrid from msmbuilder.msm import MarkovStateModel from sklearn.pipeline import Pipeline from sklearn.cross_validation import KFold """ Explanation: This example demonstrates ...
liganega/Gongsu-DataSci
previous/y2017/GongSu03_Python_DataTypes_Part_1.ipynb
gpl-3.0
print("Hello World") """ Explanation: 파이썬 기본 자료형 1부 수정 사항 다양한 기초연산 연습문제 추가 필요 파이썬 언어에서 사용되는 값들의 기본 자료형을 살펴본다. 변수에 할당될 수 있는 가장 단순한 자료형에는 네 종류가 있다: 정수 자료형(int): ..., -3, -2, -1, 0, 1, 2, 3, 등등 1 + 2, -2 * 3, 등등 부동소수점 자료형(float): 1.2, 0.333333, -1.2, -3.7680, 등등 2.0/3.5, 3.555 + 3.4 * 7.9, 등등 불리언 자료형(bool...
donK23/pyData-Projects
EventDec/event_dec/notebook/1_Exploration.ipynb
apache-2.0
import numpy as np import pandas as pd import math import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Exploration Exploration of prepocessed DF End of explanation """ file_path = "../data/events_df.pkl" df = pd.read_pickle(file_path) print(df.shape) print(df.dtypes) df.head() """ Explanation: Inp...
pambot/cbio-proteomics
tutorial/cbio_import_tutorial.ipynb
mit
# import classes import sys sys.path.append('../') from ms2cbioportal import (CDAPiTraqTable, CDAPPrecursorAreaTable, MaxQuantProteomeTable, MaxQuantPTMTable, MSMeta) """ Explanation: Using the cBioPortal M...
gdementen/larray
doc/source/tutorial/getting_started.ipynb
gpl-3.0
%xmode Minimal from larray import * """ Explanation: Getting Started The purpose of the present Getting Started section is to give a quick overview of the main objects and features of the LArray library. To get a more detailed presentation of all capabilities of LArray, read the next sections of the tutorial. The API...
yingchi/fastai-notes
deeplearning1/nbs/try-resnet.ipynb
apache-2.0
import sys, os current_dir = os.getcwd() HOME_DIR = current_dir DATA_HOME_DIR = current_dir + '/data/redux/' print(current_dir, DATA_HOME_DIR) from utils import * %matplotlib inline batch_size = 64 no_of_epochs = 3 path = DATA_HOME_DIR model_path = path+'model' """ Explanation: Try Resnet Paras Setting End of explan...
james-prior/euler
euler-048-self-power-20170113.ipynb
mit
def foo(n, m): return str(sum(i ** i for i in range(1, n + 1)))[-m:] foo(10, 10) n = 1000 m = 10 %timeit foo(n, m) foo(n, m) """ Explanation: Project Euler Distinct primes factors Problem 48 The series, 1<sup>1</sup> + 2<sup>2</sup> + 3<sup>3</sup> + ... + 10<sup>10</sup> = 10405071317. Find the last ten digit...
dsavransky/MAE4060
Notebooks/Viscous Nutation Damper.ipynb
mit
from miscpy.utils.sympyhelpers import * init_printing() w1,w2,w3,w1d,w2d,w3d,D,O,Od,I1,Iw,Is,It,M1,M2 = \ symbols('omega_1,omega_2,omega_3,omegadot_1,omegadot_2,\ omegadot_3,D,Omega,Omegadot,I_1,I_W,I_S,I_T,M1,M2') diffmap = {w1:w1d,w2:w2d,w3:w3d,O:Od} """ Explanation: Viscous Nutation Damper End of explanation """ ...
iwansmith/FutureLHCb
notebooks/03_ExampleFitter.ipynb
gpl-3.0
Fitter = FutureFitter("../output/Data_Histograms_1.0_LHCb.root", "MCORR_Data_DsMuNu", "../output/Source_Histograms_DsMu_1.0_LHCb_Merged.root", False) Fitter.Fit() c1 = ROOT.TCanvas("c1", "c1", 900,900) Fitter.Plot(c1) c1.Draw() c1.Print("ExampleFit_DsMuNu.pdf") """ Explanation: Perform and plot a $B_s \rightarrow...
harrisonpim/bookworm
06 - Stable Roommates, Marriages, and Gender.ipynb
mit
def gale_shapley(proposors, acceptors): ''' Returns stable marriage pairings for a given set of input candidates and their lists of spousal preferences Parameters ---------- proposors : dict (required) the set of men and their list of spousal preferences acceptors : dict (required)...
InsightSoftwareConsortium/SimpleITK-Notebooks
Python/65_Registration_FFD.ipynb
apache-2.0
import SimpleITK as sitk import registration_utilities as ru import registration_callbacks as rc %matplotlib inline import matplotlib.pyplot as plt from ipywidgets import interact, fixed # utility method that either downloads data from the Girder repository or # if already downloaded returns the file name for readin...
mamrehn/machine-learning-tutorials
ipynb/[scikit-learn, ipython notebook] installation.ipynb
cc0-1.0
conda update --all """ Explanation: Miniconda Installation Install Miniconda from their Website. All required python packages will be downloaded using the conda package and environment management system. When Miniconda is installed on your system, open up your shell with the command <kbd>WINDOWS</kbd> + <kbd>R</kbd> -...
hzzyyy/pymcef
examples/1. When mean variance models fail.ipynb
bsd-3-clause
from cvxopt import solvers, matrix, spdiag from numpy import linspace, random solvers.options['show_progress'] = False solvers.options['abstol'] = 1e-10 solvers.options['reltol'] = 1e-9 solvers.options['feastol'] = 1e-10 P = spdiag([1.0, 4.0, 9.0]) q = matrix([0.0, 0.0, 0.0]) G = -1.0 * spdiag([1.0, 1.0, 1.0]) h = matr...
JAmarel/Phys202
Interpolation/.ipynb_checkpoints/InterpolationEx01-checkpoint.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import seaborn as sns import numpy as np from scipy.interpolate import interp1d """ Explanation: Interpolation Exercise 1 End of explanation """ dictionary = np.load('trajectory.npz') y = dictionary.items()[0][1] t = dictionary.items()[1][1] x = dictionary.items()...
theideasmith/theideasmith.github.io
_notebooks/Regression.ipynb
mit
import numpy as np from pylab import * %matplotlib inline """ Explanation: A Simple Linear Regression Implementation in Python This is a sequel to my previous blog post where I discussed the fundamental theory of linear regression with gradient descent. Here we'll continue our study of gradient descent by implementin...
EconForge/dolo
examples/notebooks/rbc_model.ipynb
bsd-2-clause
from dolo import * """ Explanation: Solving the rbc model This worksheet demonstrates how to solve the RBC model with the dolo library and how to generates impulse responses and stochastic simulations from the solution. This notebook is distributed with dolo in : examples\notebooks\. The notebook was opened and run ...
ajaykumar-bollepalli/pythontraining
DictionariesPractice.ipynb
apache-2.0
myDict = {'color':'blue', 'taste':'sweet'} myDict """ Explanation: Dictionaries Dictionaries in python are Mappings (or associations). Means they store values in key and value associations (pair). Example: 'color' : 'Blue' Here color is the key and Blue is the value. notice that key and value are seperated by :. The...
tensorflow/probability
tensorflow_probability/examples/jupyter_notebooks/TFP_Release_Notebook_0_13_0.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License"); { display-mode: "form" } # 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, sof...
streety/biof509
Wk05-regression-classification-merged.ipynb
mit
!pip install --upgrade sklearn !pip install --upgrade seaborn import matplotlib.pyplot as plt import numpy as np import seaborn as sns %matplotlib inline """ Explanation: Week 5 - Regression and Classification End of explanation """ from sklearn import datasets diabetes = datasets.load_diabetes() # Description ...
pvalienteverde/ElCuadernillo
ElCuadernillo/20160725_SistemasDeRecomendacionContentBased/Content-Based.ipynb
mit
import pandas as pd import sys sys.path.append('./Scripts') import ContendBased as CB # Autorecarga los modulos %load_ext autoreload %autoreload 2 """ Explanation: Recomendacion de articulos basados en su contenido End of explanation """ datos = pd.read_csv("BD/people_wiki.csv") datos.head(3) """ Explanation: Impo...
squishbug/DataScienceProgramming
10-Information-Based-Learning/HW10/README_corrected.ipynb
cc0-1.0
import pandas as pd import numpy as np from __future__ import division %%sh ## RUN BUT DO NOT EDIT THIS CELL ## run this cell to download the cereal dataset into your current directory cp /home/data/cereal/cereal.csv . ## RUN BUT DO NOT EDIT THIS CELL # load the data, define ratingID cer = pd.read_csv('cereal.csv',...
tensorflow/docs
site/en/tutorials/customization/custom_training_walkthrough.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...
SJSlavin/phys202-2015-work
assignments/assignment04/MatplotlibEx02.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np """ Explanation: Matplotlib Exercise 2 Imports End of explanation """ !head -n 30 open_exoplanet_catalogue.txt """ Explanation: Exoplanet properties Over the past few decades, astronomers have discovered thousands of extrasolar planets. The follo...
nigroup/nideep
examples/parallel_train/plot_parallel.ipynb
bsd-2-clause
import numpy as np import os import matplotlib.pyplot as plt %matplotlib inline from cycler import cycler from pylab import rcParams rcParams['figure.figsize'] = 8, 6 rcParams.update({'font.size': 15}) # color and linestyle cycle #colors = [x['color'] for x in list(rcParams['axes.prop_cycle'])] colors_base = ['b', '...
DhashS/Olin-Complexity-Final-Project
reports/03_approximation_algorithms.ipynb
gpl-3.0
def Christofides(G): T = nx.algorithms.minimum_spanning_tree(G) O = {n for n, d in T.degree(T.nodes_iter()).items() if d%2 == 1} induced_subgraph = nx.Graph(G.subgraph(O)) M = minimum_perfect_matching(induced_subgraph) T.add_weighted_edges_from([(u,v,M[u][v]['weight']) for u, v in M.edg...
AllenDowney/ThinkBayes2
notebooks/chap02.ipynb
mit
import pandas as pd table = pd.DataFrame(index=['Bowl 1', 'Bowl 2']) """ Explanation: Bayes's Theorem Think Bayes, Second Edition Copyright 2020 Allen B. Downey License: Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) In the previous chapter, we derived Bayes's Theorem: $$P(A|B) = \frac{P(A) ...
DigitalSlideArchive/HistomicsTK
docs/examples/simple_tissue_detection.ipynb
apache-2.0
import girder_client import numpy as np from matplotlib import pylab as plt from matplotlib.colors import ListedColormap from histomicstk.saliency.tissue_detection import ( get_slide_thumbnail, get_tissue_mask) %matplotlib inline """ Explanation: Tissue Detection Overview: This includes tools to detect tissue fr...
kmunve/APS
aps/notebooks/wind_slab_problem.ipynb
mit
warnings, url = gf.get_warnings_as_json([3022, 3023, 3024], "2017-12-01", "2018-05-31", lang_key=1, simple=False, recursive_count=5) print(url) warnings_flattened = (flatten(w) for w in warnings) df = pd.DataFrame(warnings_flattened) df.head(5) df.columns df_a = df # define individual columns for avalanche problem ...
sainathadapa/fastai-courses
deeplearning2/babi-memnn.ipynb
apache-2.0
%matplotlib inline import importlib, utils2; importlib.reload(utils2) from utils2 import * np.set_printoptions(4) cfg = K.tf.ConfigProto(gpu_options={'allow_growth': True}) K.set_session(K.tf.Session(config=cfg)) """ Explanation: Babi End to End MemNN End of explanation """ def tokenize(sent): return [x.strip()...
mne-tools/mne-tools.github.io
0.21/_downloads/59aa8e259e776a361531f7d21fa2f1ec/plot_compute_raw_data_spectrum.ipynb
bsd-3-clause
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Martin Luessi <mluessi@nmr.mgh.harvard.edu> # Eric Larson <larson.eric.d@gmail.com> # License: BSD (3-clause) import numpy as np import matplotlib.pyplot as plt import mne from mne import io, read_proj, read_selection from mne.datasets im...
ledrui/Regression
week2/week-2-multiple-regression-assignment-2-blank.ipynb
mit
import graphlab """ Explanation: Regression Week 2: Multiple Regression (gradient descent) In the first notebook we explored multiple regression using graphlab create. Now we will use graphlab along with numpy to solve for the regression weights with gradient descent. In this notebook we will cover estimating multiple...
dksahuji/simpleabc
SimpleABC_demo.ipynb
mit
from simple_abc import Model, basic_abc, pmc_abc import pylab as plt import numpy as np from scipy import stats %matplotlib inline plt.style.use('ggplot') """ Explanation: SimpleABC Demo Let's see how SimpleABC works by using it for a very easy problem. We will approximate the posterior distribution of mean and standa...
whitead/numerical_stats
unit_4/hw_2020/homework_4_key.ipynb
gpl-3.0
#1.1 x = list(range(2,100,2)) print(x) #1.2 print(sum(x)) #1.3 s = 0 for xi in x: s += xi print(s) #1.4 print(x[::-1]) #1.5 print(x[len(x)//2:]) #1.6 y = [] for xi in x: y.append(xi**2) print(y) """ Explanation: Homework 4 CHE 116: Numerical Methods and Statistics (2/6/2020) 1. Lists Problems [2 points...
jasag/Phytoliths-recognition-system
code/notebooks/Prototypes/Classifiers_and_HoG/2_Classifiers.ipynb
bsd-3-clause
import pickle path = '../../rsc/obj/' X_train_path = path + 'X_train.sav' y_train_path = path + 'y_train.sav' X_train = pickle.load(open(X_train_path, 'rb')) y_train = pickle.load(open(y_train_path, 'rb')) print(X_train.shape) """ Explanation: Clasificadores En este notebook se entrenaran los distintos clasificado...
aliakbars/uai-ai
scripts/tugas2.ipynb
mit
from __future__ import print_function, division # Gunakan print(...) dan bukan print ... import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from sklearn.datasets import load_digits from sklearn.cluster import KMeans from sklearn.metrics import accuracy_score, confusion_matrix,...
eaton-lab/toytree
docs/8-styling.ipynb
bsd-3-clause
import toytree import toyplot import numpy as np # a tree to use for examples url = "https://eaton-lab.org/data/Cyathophora.tre" rtre = toytree.tree(url).root(wildcard='prz') """ Explanation: Styling toytree drawings The number of styling available in toytree is enormous and will continue to grow as development on th...
csiu/100daysofcode
misc/2017-03-02-day06.ipynb
mit
speaker = 'Thomas Levi' topics_mentioned_at_meetup = [ "latent dirichlet allocation", "collapsed gibbs sampling", "bayesian inference", "topic modelling", "porter stemmer", "flesch reading ease", "word2vec" ] """ Explanation: layout: post author: csiu date: 2017-03-02 title: "Day06: Jupyter...
prefrontalvortex/bci_erp
python/eventlab_header.ipynb
mit
example_header = r""" # Non-editable header begin -------------------------------------------------------------------------------- # # data format...............: continuous # setname...................: S1_EEG_elist # filename..................: S1_EEG.set # filepath..................: C:\Users\mike\Downloads\Te...
tensorflow/examples
courses/udacity_deep_learning/1_notmnist.ipynb
apache-2.0
# These are all the modules we'll be using later. Make sure you can import them # before proceeding further. from __future__ import print_function import imageio import matplotlib.pyplot as plt import numpy as np import os import sys import tarfile from IPython.display import display, Image from sklearn.linear_model im...
rgarcia-herrera/sistemas-dinamicos
linearizar sistemas no lineales en torno a puntos de equilibrio.ipynb
gpl-3.0
b = symbols('b') b = Matrix([[1, -4], [2, -3]]) b """ Explanation: Este sistema lineal End of explanation """ b.eigenvects() """ Explanation: Eigenvalores y Eigenvectores End of explanation """ y1, y2 = symbols("y1 y2") solve(((-1 + 2j) * y1) - (y1 - 4 * y2), y1) solve(((-1 + 2j) * y2) - (2 * ...
cathalmccabe/PYNQ
boards/ZCU104/notebooks/common/zcu104_pmbus.ipynb
bsd-3-clause
import pynq rails = pynq.get_rails() rails """ Explanation: PMBus on the ZCU104 The ZCU104 has some support for monitoring power rails on the board using PMBus. PYNQ exposes these rails through the get_rails function that returns a dictionary of all of the rails available to be monitored. End of explanation """ rec...
Neuro17/finance4py
notebooks/indicator_examples_with_plots.ipynb
mit
# reading data from google finance stock = DataReader('NFLX', 'google') # extract bollinger bands boll_bands = fp.bbands(stock.Close) boll_bands.tail() # extract average true range atr = fp.average_true_range(stock.High, stock.Low, stock.Close) atr.tail() # extract RSI rsi = fp.rsi(stock.Close).to_frame() rsi.head(...
yashdeeph709/Algorithms
PythonBootCamp/Complete-Python-Bootcamp-master/Milestone Project 1- Complete Walkthrough Solution.ipynb
apache-2.0
# For using the same code in either Python 2 or 3 from __future__ import print_function ## Note: Python 2 users, use raw_input() to get player input. Python 3 users, use input() """ Explanation: Milestone Project 1: Full Walk-through Code Solution Below is the filled in code that goes along with the complete walk-th...