code
stringlengths
2.5k
150k
kind
stringclasses
1 value
<a href="https://colab.research.google.com/github/ndoshi83/DS-Unit-1-Sprint-1-Dealing-With-Data/blob/master/NDoshi_DS4_114_Making_Data_backed_Assertions.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Lambda School Data Science - Making Data-backe...
github_jupyter
# Visual Designer (Data Prep) In this exercise we will be building a pipeline in Azure Machine Learning using the [Visual Designer](https://docs.microsoft.com/azure/machine-learning/concept-designer). Traditionally the Visual Designer is used for training and deploying models. Here we will build a data prep pipeline t...
github_jupyter
# Overview ### `clean_us_data.ipynb`: Fix data inconsistencies in the raw time series data from [`etl_us_data.ipynb`](./etl_us_data.ipynb). Inputs: * `outputs/us_counties.csv`: Raw county-level time series data for the United States, produced by running [etl_us_data.ipynb](./etl_us_data.ipynb) * `outputs/us_counties_...
github_jupyter
___ <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a> ___ # Scikit-learn Primer **Scikit-learn** (http://scikit-learn.org/) is an open-source machine learning library for Python that offers a variety of regression, classification and clustering algorithms. In this section we'll perfor...
github_jupyter
<table class="ee-notebook-buttons" align="left"> <td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Gena/map_center_object.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td> <td><a target="_blank" href=...
github_jupyter
# Examples for the AbsComponent Class (v1.1) ``` %matplotlib inline # suppress warnings for these examples import warnings warnings.filterwarnings('ignore') # import try: import seaborn as sns; sns.set_style("white") except: pass import numpy as np from astropy.table import QTable import astropy.units as u fr...
github_jupyter
``` """ Update Parameters Here """ CONTRACT_ADDRESS = "0x9A534628B4062E123cE7Ee2222ec20B86e16Ca8F" COLLECTION = "MekaVerse" METHOD = "raritytools" TOKEN_COL = "TOKEN_ID" # Use TOKEN_NAME if you prefer to infer token id from token name NUMBERS_TO_CHECK = 50 # Number of tokens to search for opportunities OPENSEA_API_KE...
github_jupyter
<p> Notice: This notebook is not optimized for memory nor performance yet. Please use it with caution when handling large datasets. ### Notice: Please ignore Feature engineering part if you are using a ready dataset # Feature engineering This notebook is for BDSE12_03G_HomeCredit_V2.csv processing for bear LGBM fina...
github_jupyter
# Batch Prediction ## 1. Download demo data ``` cd PhaseNet wget https://github.com/wayneweiqiang/PhaseNet/releases/download/test_data/test_data.zip unzip test_data.zip ``` ## 2. Run batch prediction PhaseNet currently supports three data formats: numpy, hdf5, and mseed - For numpy format: ~~~bash python phasenet...
github_jupyter
# Multithreading and Multiprocessing Recall the phrase "many hands make light work". This is as true in programming as anywhere else. What if you could engineer your Python program to do four things at once? What would normally take an hour could (almost) take one fourth the time.<font color=green>\*</font> This is ...
github_jupyter
``` from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister, QiskitError #from qiskit import execute, BasicAer import qiskit.ignis.verification.randomized_benchmarking as rb #import qiskit.test.benchmarks.randomized_benchmarking as br import pyzx from pyzx.circuit.qasmparser import QASMParser from pyzx.ci...
github_jupyter
``` import pandas as pd from textblob import Word headers = pd.read_csv("header.csv") headers['Header'] citation = [Word("citation").synsets[2], Word("reference").synsets[1], Word("cite").synsets[3]] run = [Word("run").synsets[9],Word("run").synsets[34],Word("execute").synsets[4]] install = [Word("installation").synset...
github_jupyter
``` %matplotlib inline import numpy as np import matplotlib.pyplot as plt ``` ### Define a function to integrate ``` def func(x): a = 1.01 b= -3.04 c = 2.07 return a*x**2 + b*x + c ``` ### Define it's integral so we know the right answer ``` def func_integral(x): a = 1.01 b= -3.04 c = 2....
github_jupyter
# Tuning an estimator [José C. García Alanis (he/him)](https://github.com/JoseAlanis) Research Fellow - Child and Adolescent Psychology at [Uni Marburg](https://www.uni-marburg.de/de) Member - [RTG 2271 | Breaking Expectations](https://www.uni-marburg.de/en/fb04/rtg-2271), [Brainhack](https://brainhack.org/) <im...
github_jupyter
# Homework 2: classification Data source: http://archive.ics.uci.edu/ml/datasets/Polish+companies+bankruptcy+data **Description:** The goal of this HW is to be familiar with the basic classifiers PML Ch 3. For this HW, we continue to use Polish companies bankruptcy data Data Set from UCI Machine Learning Repository. Do...
github_jupyter
``` """ Title: Python Crash Course Author: Rafia Bushra Description: A python tutorial for DSA/ISE 5113 students Last Updated: 3/26/21 """ ``` ### Topics This notebook covers the following topics - 1. Basic Concepts 1. [Basic Syntax](#basic-syntax) 2. [Lists](#lists) 3. [String Manipulation](...
github_jupyter
# webgrabber für Listen von Wikipedia ``` # Gebäckliste import requests from bs4 import BeautifulSoup # man muss der liste einen letzten eintrag geben, weil sonst weitere listen unter der eigentlichen ausgelesen werden. def grab_list(url, last_item): # wenn wikipedia eine Tabelle anzeigt grabbed_list = [] r =...
github_jupyter
# Introduction Now that I have removed the RNA/DNA node and we have fixed many pathways, I will re-visit the things that were raised in issue #37: 'Reaction reversibility'. There were reactions that we couldn't reverse or remove or they would kill the biomass. I will try to see if these problems have been resolved now....
github_jupyter
# Градиентный бустинг своими руками **Внимание:** в тексте задания произошли изменения - поменялось число деревьев (теперь 50), правило изменения величины шага в задании 3 и добавился параметр `random_state` у решающего дерева. Правильные ответы не поменялись, но теперь их проще получить. Также исправлена опечатка в ф...
github_jupyter
# Modeling and Simulation in Python Project 1 example Copyright 2018 Allen Downey License: [Creative Commons Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0) ``` # Configure Jupyter so figures appear in the notebook %matplotlib inline # Configure Jupyter to display the assigned value aft...
github_jupyter
# Trial 2: classification with learned graph filters We want to classify data by first extracting meaningful features from learned filters. ``` import time import numpy as np import scipy.sparse, scipy.sparse.linalg, scipy.spatial.distance from sklearn import datasets, linear_model import matplotlib.pyplot as plt %ma...
github_jupyter
``` """ This example demonstrates many of the 2D plotting capabilities in pyqtgraph. All of the plots may be panned/scaled by dragging with the left/right mouse buttons. Right click on any plot to show a context menu. """ from pyqtgraph.jupyter import GraphicsLayoutWidget from IPython.display import display import nu...
github_jupyter
## Import libraries ``` # generic tools import numpy as np import datetime # tools from sklearn from sklearn.preprocessing import LabelBinarizer from sklearn.metrics import classification_report from sklearn.datasets import fetch_openml from sklearn.model_selection import train_test_split # tools from tensorflow im...
github_jupyter
``` # G Oldford Feb 19 2022 # visualize monte carlo results from ecosim Monte Carlo # uses ggplot2 # # https://erdavenport.github.io/R-ecology-lesson/05-visualization-ggplot2.html library(tidyverse) library(matrixStats) # No biomass found in the auto written MC run out files, so saving from the plot direct from MC plu...
github_jupyter
## Dependencies ``` import os import sys import cv2 import shutil import random import warnings import numpy as np import pandas as pd import seaborn as sns import multiprocessing as mp import matplotlib.pyplot as plt from tensorflow import set_random_seed from sklearn.utils import class_weight from sklearn.model_sele...
github_jupyter
# Translate `dzn` to `smt2` for z3 ### Check Versions of Tools ``` import os import subprocess my_env = os.environ.copy() output = subprocess.check_output(f'''/home/{my_env['USER']}/optimathsat/bin/optimathsat -version''', shell=True, universal_newlines=True) output output = subprocess.check_output(f'''/home/{my_env...
github_jupyter
<p><img alt="Colaboratory logo" height="45px" src="/img/colab_favicon.ico" align="left" hspace="10px" vspace="0px"></p> <h1>Welcome to Colaboratory!</h1> Colaboratory is a free Jupyter notebook environment that requires no setup and runs entirely in the cloud. With Colaboratory you can write and execute code, save ...
github_jupyter
<h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Leveraging-Pre-trained-Word-Embedding-for-Text-Classification" data-toc-modified-id="Leveraging-Pre-trained-Word-Embedding-for-Text-Classification-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Leveragin...
github_jupyter
<p><font size="6"><b>04 - Pandas: Working with time series data</b></font></p> > *© 2021, Joris Van den Bossche and Stijn Van Hoey (<mailto:jorisvandenbossche@gmail.com>, <mailto:stijnvanhoey@gmail.com>). Licensed under [CC BY 4.0 Creative Commons](http://creativecommons.org/licenses/by/4.0/)* --- ``` import pandas...
github_jupyter
Demonstrating how to get DonkeyCar Tub files into a PyTorch/fastai DataBlock ``` from fastai.data.all import * from fastai.vision.all import * from fastai.data.transforms import ColReader, Normalize, RandomSplitter import torch from torch import nn from torch.nn import functional as F from donkeycar.parts.tub_v2 impor...
github_jupyter
# Redis列表实现一次pop 弹出多条数据 ![](https://kingname-1257411235.cos.ap-chengdu.myqcloud.com/2019-03-03-16-52-34.png) ``` # 连接 Redis import redis client = redis.Redis(host='122.51.39.219', port=6379, password='leftright123') # 注意: # 这个 Redis 环境仅作为练习之用,每小时会清空一次,请勿存放重要数据。 # 准备数据 client.lpush('test_batch_pop', *list(range(100...
github_jupyter
``` # importamos las librerías necesarias %matplotlib inline import random import tsfresh import os import math from scipy import stats from scipy.spatial.distance import pdist from math import sqrt, log, floor from fastdtw import fastdtw import ipywidgets as widgets import matplotlib.pyplot as plt import matplotlib.cm...
github_jupyter
<a href="https://colab.research.google.com/github/user9990/Synthetic-data-gen/blob/master/Welcome_To_Colaboratory.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> <p><img alt="Colaboratory logo" height="45px" src="/img/colab_favicon.ico" align="left"...
github_jupyter
# Practice with conditionals Before we practice conditionals, let's review: To execute a command when a condition is true, use `if`: ``` if [condition]: [command] ``` To execute a command when a condition is true, and execute something else otherwise, use `if/else`: ``` if [condition]: [command 1] else: [comm...
github_jupyter
# Using "method chains" to create more readable code ### Game of Thrones example - slicing, group stats, and plotting I didn't find an off the shelf dataset to run our seminal analysis from last week, but I found [an analysis](https://www.kaggle.com/dhanushkishore/impact-of-game-of-thrones-on-us-baby-names) that expl...
github_jupyter
Text classification with attention and synthetic gradients. Imports and set-up: ``` %tensorflow_version 2.x import numpy as np import tensorflow as tf import pandas as pd import subprocess from sklearn.model_selection import train_test_split import gensim import re import sys import time # TODO: actually implement...
github_jupyter
# Imports ``` import numpy as np import xarray as xr import seaborn as sns import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib.colors import LinearSegmentedColormap from matplotlib.patches import Polygon from matplotlib import colors as mat_colors import mpl_toolkits.axisartist as axisartist from ...
github_jupyter
``` # import sys # #sys.path.insert(0,'../input/dlibpkg/dlib-19.19.0/') # sys.path.insert(0,'../input/imutils/imutils-0.5.3/') # !pip install dlib # import dlib # from scipy.spatial import distance as dist # from imutils.video import FileVideoStream # from imutils.video import VideoStream # from imutils import face_uti...
github_jupyter
# Face Recognition In this assignment, you will build a face recognition system. Many of the ideas presented here are from [FaceNet](https://arxiv.org/pdf/1503.03832.pdf). In lecture, we also talked about [DeepFace](https://research.fb.com/wp-content/uploads/2016/11/deepface-closing-the-gap-to-human-level-performance-...
github_jupyter
<a href="https://colab.research.google.com/github/DeepInsider/playground-data/blob/master/docs/articles/deeplearningdat.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ##### Copyright 2019 Digital Advantage - Deep Insider. ``` #@title Licensed unde...
github_jupyter
##### Copyright 2019 The TensorFlow Authors. ``` #@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 ...
github_jupyter
# Word Embeddings in MySQL This example uses the official MySQL Connector within Python3 to store and retrieve various amounts of Word Embeddings. We will use a local MySQL database running as a Docker Container for testing purposes. To start the database run: ``` docker run -ti --rm --name ohmysql -e MYSQL_ROOT_PAS...
github_jupyter
``` from future.builtins import next import os import csv import re import logging import optparse import dedupe from unidecode import unidecode import pandas as pd pd.options.display.float_format = '{:20,.2f}'.format pd.set_option('display.max_rows', 5000) pd.set_option('display.max_columns', 5000) pd.set_option('di...
github_jupyter
``` %matplotlib inline import io import os import matplotlib.pyplot as plt import matplotlib.patches as patch import pandas as pd import numpy as np import seaborn as sns sns.set_style('darkgrid') sns.set_context('notebook') datafile_AMT = '../data/MTurk_anonymous.xlsx' #datafile_DTU1 = '../data/DTU1_anonymous.xlsx' #d...
github_jupyter
# COVID-MultiVent The COVID MultiVent System was developed through a collaboration between Dr. Arun Agarwal, pulmonary critical care fellow at the University of Missouri, and a group of medical students at the University of Pennsylvania with backgrounds in various types of engineering. The system allows for monitoring...
github_jupyter
``` import glob import itertools from ipywidgets import widgets, Layout import numpy as np import os import pandas as pd import plotly.io as pio import plotly.graph_objects as go from apex_performance_plotter.apex_performance_plotter.load_logfiles import load_logfiles pio.templates.default = "plotly_white" from IPyth...
github_jupyter
# Homework 10: `SQL` ## Due Date: Thursday, November 16th at 11:59 PM You will create a database of the NASA polynomial coefficients for each specie. **Please turn in your database with your `Jupyter` notebook!** # Question 1: Convert XML to a SQL database Create two tables named `LOW` and `HIGH`, each correspond...
github_jupyter
# Results for BERT when applying syn tranformation to both premise and hypothesis to the MNLI dataset ``` import pandas as pd import os import numpy as np import matplotlib.pyplot as plt import seaborn as sns from tqdm import tqdm from IPython.display import display, HTML from lr.analysis.util import get_ts_from_resu...
github_jupyter
[View in Colaboratory](https://colab.research.google.com/github/tompollard/buenosaires2018/blob/master/1_intro_to_python.ipynb) # Programming in Python In this part of the workshop, we will introduce some basic programming concepts in Python. We will then explore how these concepts allow us to carry out an anlysis th...
github_jupyter
<a href="https://colab.research.google.com/github/achmfirmansyah/sweet_project/blob/master/ICST2020/03_BUildup_transformation.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` import pandas as pd !pip install rasterio import rasterio !pip install ...
github_jupyter
Copyright 2021 Google LLC 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 distri...
github_jupyter
---- <img src="../../../files/refinitiv.png" width="20%" style="vertical-align: top;"> # Data Library for Python ---- ## Content layer - News This notebook demonstrates how to retrieve News. #### Learn more To learn more about the Refinitiv Data Library for Python please join the Refinitiv Developer Community. By ...
github_jupyter
# Migrating scripts from Framework Mode to Script Mode This notebook focus on how to migrate scripts using Framework Mode to Script Mode. The original notebook using Framework Mode can be find here https://github.com/awslabs/amazon-sagemaker-examples/blob/4c2a93114104e0b9555d7c10aaab018cac3d7c04/sagemaker-python-sdk/t...
github_jupyter
``` # -*- coding: utf-8 -*- import sys import os import numpy as np import pandas as pd import cobra print('Python version:', sys.version) print('numpy version:', np.__version__) print('pandas version:', pd.__version__) print('cobrapy version:', cobra.__version__) def AddRxn(model, newRxnFile): """Function of addi...
github_jupyter
``` import numpy as np import torch import os import pickle import matplotlib.pyplot as plt # %matplotlib inline # plt.rcParams['figure.figsize'] = (20, 20) # plt.rcParams['image.interpolation'] = 'bilinear' import sys sys.path.append('../train/') from torch.autograd import Variable from torch.utils.data import DataL...
github_jupyter
<a href="https://colab.research.google.com/github/yushan111/analytics-zoo/blob/add-autoestimator-quick-start/docs/docs/colab-notebook/orca/quickstart/autoestimator_pytorch_lenet_mnist.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ![image.png](data...
github_jupyter
<a href="https://colab.research.google.com/github/NeuromatchAcademy/course-content-dl/blob/main/tutorials/W1D2_LinearDeepLearning/student/W1D2_Tutorial1.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # DL Neuromatch Academy: Week 1, Day 2, Tutoria...
github_jupyter
## Classifying Hourly Timestamps into Day or Night ``` import pandas as pd import numpy as np import warnings from df2gspread import df2gspread as d2g warnings.simplefilter('ignore') ## Import Raw TTN Data from Google SpreadSheet url = 'https://docs.google.com/spreadsheets/d/e/2PACX-1vRlXVQ6c3fKWvtQlFRSRUs5TI3soU7Eghl...
github_jupyter
## Coding Matrices Here are a few exercises to get you started with coding matrices. The exercises start off with vectors and then get more challenging ### Vectors ``` ### TODO: Assign the vector <5, 10, 2, 6, 1> to the variable v v = [] ``` The v variable contains a Python list. This list could also be thought of ...
github_jupyter
``` %load_ext sql %sql sqlite:///flights.db ``` 숙제 1 ======= ### 일러두기 : **_꼼꼼하게 읽어보기 바랍니다_** * `prettytable` 모듈을 설치해야 스크립트를 실행할 수 있음. (설치 방법: `pip install --user prettytable`) * `flights.db` 파일이 숙제용 Jupyter notebook과 같은 디렉터리에 있어야 함 (없다면 [여기서](http://open.gnu.ac.kr/lecslides/2018-2-DB/Assignments1/flights.db.zi...
github_jupyter
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-59152712-8"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-59152712-8'); </script> # Generating C code for the right-hand-side of the scalar w...
github_jupyter
``` import os import urllib from zipfile import ZipFile import fileinput import numpy as np import gc import urllib.request if not os.path.exists('glove.840B.300d.txt'): if not os.path.exists('glove.840B.300d.zip'): print('downloading GloVe') urllib.request.urlretrieve("http://nlp.stanford.edu/data/...
github_jupyter
``` from HARK.ConsumptionSaving.ConsLaborModel import ( LaborIntMargConsumerType, init_labor_lifecycle, ) import numpy as np import matplotlib.pyplot as plt from time import process_time mystr = lambda number: "{:.4f}".format(number) # Format numbers as strings do_simulation = True # Make and solve a labor int...
github_jupyter
### Find the top rooms ignited and the top materials in those rooms that were first ignited ``` import psycopg2 import pandas as pd from IPython.display import display conn = psycopg2.connect(service='nfirs') pd.options.display.max_rows = 1000 df = pd.read_sql_query("select * from codelookup where fieldid = 'PROP_US...
github_jupyter
``` import pandas as pd import spacy dir(spacy) ``` # Linguistic Features ## Part-of-speech tagging After tokenization, spaCy can parse and tag a given Doc. This is where the statistical model comes in, which enables spaCy to make a prediction of which tag or label most likely applies in this context. A model consis...
github_jupyter
``` # coding=utf-8 import pandas as pd import numpy as np from sklearn import preprocessing df=pd.read_csv(r'./data/happiness_train_complete.csv',encoding='GB2312',index_col='id') df = df[df["happiness"]>0] #原表中幸福度非正的都是错误数据,可以剔除12条错误数据 df.dtypes[df.dtypes==object] #查得有四列不是数据类型,需要对其进行转化 for i in range(df.dtypes[df...
github_jupyter
# Algorithmic Fairness, Accountability, and Ethics, Spring 2022 # Exercise 5 ## Task 0 (Setup) We use the same dataset as in week 3 and 4. If you missed to install the module, please carry out the installation tasks at <https://github.com/zykls/folktables#basic-installation-instructions>. After successful installati...
github_jupyter
1 Short Answer (25pts) 1. (5pts) True or False. (And explain your reason.)Mean-variance optimization goes long the highest Sharpe-Ratio assets and shorts the lowestSharpe-ratio assets. A. False: Not necessarily. MV optimization optimizes for the total portfolio return vs the portfolio variance. The opti...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt import csv dataVals = np.genfromtxt(r'1zncA.txt', delimiter='', dtype=float) avgCoords = [] x = 0 def ray_dir(E,F): d = E-F def intersect_line_triangle(q1, q2, p1, p2, p3): def signed_tetra_volume(a, b, c, d): return np.sign(np.dot(np.cross(b - a, c...
github_jupyter
# HistGradientBoostingClassifier with MaxAbsScaler This code template is for classification analysis using a HistGradientBoostingClassifier and the feature rescaling technique called MaxAbsScaler ### Required Packages ``` import warnings import numpy as np import pandas as pd import matplotlib.pyplot as plt ...
github_jupyter
# Prática Guiada: Demonstração de `GridSearchCV` Vamos usar o conjunto de dados iris... que já conhecemos bem. Veremos como usar `GridSearchCV` para otimizar o hiperparâmetro `k` do algoritmo de vizinhos mais próximos. [aqui](http://rcs.chemometrics.ru/Tutorials/classification/Fisher.pdf) há um link para o paper de ...
github_jupyter
``` import numpy as np import pandas as pd import matplotlib.pyplot as plt from sqlalchemy import create_engine import statsmodels.api as sm import warnings warnings.filterwarnings('ignore') postgres_user = 'dsbc_student' postgres_pw = '7*.8G9QH21' postgres_host = '142.93.121.174' postgres_port = '5432' postgres_db =...
github_jupyter
# **Deep-STORM (2D)** --- <font size = 4>Deep-STORM is a neural network capable of image reconstruction from high-density single-molecule localization microscopy (SMLM), first published in 2018 by [Nehme *et al.* in Optica](https://www.osapublishing.org/optica/abstract.cfm?uri=optica-5-4-458). The architecture used h...
github_jupyter
# Microstructure classification using Neural Networks In this example, we will generate microstructures of 4 different types with different grain sizes. Then we will split the dataset into training and testing set. Finally we will trian the neural network using CrysX-NN to make predictions. ## Run the following cel...
github_jupyter
# <center> Pandas*</center> *pandas is short for Python Data Analysis Library <img src="https://welovepandas.club/wp-content/uploads/2019/02/panda-bamboo1550035127.jpg" height=350 width=400> ``` import pandas as pd ``` In pandas you need to work with DataFrames and Series. According to [the documentation of pandas]...
github_jupyter
# Tips ### Introduction: This exercise was created based on the tutorial and documentation from [Seaborn](https://stanford.edu/~mwaskom/software/seaborn/index.html) The dataset being used is tips from Seaborn. ### Step 1. Import the necessary libraries: ``` import pandas as pd import matplotlib.pyplot as plt imp...
github_jupyter
# Matplotlib Matplotlib is a powerful tool for generating scientific charts of various sorts. This presentation only touches on some features of matplotlib. Please see <a href="https://jakevdp.github.io/PythonDataScienceHandbook/index.html"> https://jakevdp.github.io/PythonDataScienceHandbook/index.html</a> or many o...
github_jupyter
``` import numpy as np import sklearn from sklearn.svm import SVC from sklearn.model_selection import train_test_split from sklearn.model_selection import GridSearchCV from sklearn.metrics import classification_report,confusion_matrix import warnings import seaborn as sns import pandas as pd import matplotlib.pyplot ...
github_jupyter
# Leaf Rice Disease Detection using ResNet50V2 Architecture ![a.jpg](data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAF7BwgDASI...
github_jupyter
### Stock Prediction using fb Prophet Prophet is a procedure for forecasting time series data based on an additive model where non-linear trends are fit with yearly, weekly, and daily seasonality, plus holiday effects. It works best with time series that have strong seasonal effects and several seasons of historical d...
github_jupyter
``` library(repr) ; options(repr.plot.res = 100, repr.plot.width=5, repr.plot.height= 5) # Change plot sizes (in cm) - this bit of code is only relevant if you are using a jupyter notebook - ignore otherwise ``` <!--NAVIGATION--> < [Multiple Explanatory Variables](16-MulExpl.ipynb) | [Main Contents](Index.ipynb) | [Mo...
github_jupyter
# Optimization Methods Until now, you've always used Gradient Descent to update the parameters and minimize the cost. In this notebook, you will learn more advanced optimization methods that can speed up learning and perhaps even get you to a better final value for the cost function. Having a good optimization algorit...
github_jupyter
## YOLOv3 - Functions changing the pipeline to functions to make the implementation easier ``` import os.path import cv2 import numpy as np import requests yolo_config = 'yolov3.cfg' if not os.path.isfile(yolo_config): url = 'https://raw.githubusercontent.com/pjreddie/darknet/master/cfg/yolov3.cfg' r = requ...
github_jupyter
# <span style='color:darkred'> 2 Protein Visualization </span> *** For the purposes of this tutorial, we will use the HIV-1 protease structure (PDB ID: 1HSG). It is a homodimer with two chains of 99 residues each. Before starting to perform any simulations and data analysis, we need to observe and familiarize with the...
github_jupyter
# Image features exercise *Complete and hand in this completed worksheet (including its outputs and any supporting code outside of the worksheet) with your assignment submission. For more details see the [assignments page](http://vision.stanford.edu/teaching/cs231n/assignments.html) on the course website.* We have see...
github_jupyter
# Nuclear Fuel Cycle Overview The nuclear fuel cycle is the technical and economic system traversed by nuclear fuel during the generation of nuclear power. ## Learning Objectives By the end of this lesson, you should be able to: - Categorize types of fission reactors by their fuels and coolants. - Summarize the his...
github_jupyter
# Namespace * 為了將你寫的程式碼轉換成可以執行的程式,Python語言使用翻譯器(interpreter)來辨別你的程式碼,它會把你命名的變數分在不同的範圍內,這些範圍就叫作Namespace。 * 每次創建一個變數時,翻譯器會在Namespace裡面記錄變數名稱和變數存的東西的記憶體位置。當有新的變數名稱時,翻譯器會先看新變數要存的值有沒有在紀錄裡,有的話就直接將新變數指定到該位置,例如: ```python a = 2 a = a + 1 b = 2 ``` <img src="https://cdn.programiz.com/sites/tutorial2program/files/aEquals2.jp...
github_jupyter
``` import os, gc import pygrib import numpy as np import pandas as pd import xarray as xr import multiprocessing as mp from glob import glob from functools import partial from datetime import datetime, timedelta os.environ['OMP_NUM_THREADS'] = '1' nbm_dir = '/scratch/general/lustre/u1070830/nbm/' urma_dir = '/scrat...
github_jupyter
## Plotting very large datasets meaningfully, using `datashader` There are a variety of approaches for plotting large datasets, but most of them are very unsatisfactory. Here we first show some of the issues, then demonstrate how the `datashader` library helps make large datasets truly practical. We'll use part of ...
github_jupyter
``` # nuclio: ignore import nuclio %nuclio config kind = "job" %nuclio config spec.image = "mlrun/ml-models" import warnings warnings.simplefilter(action='ignore', category=FutureWarning) import os import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from mlrun.execution import ...
github_jupyter
Taller Presencial --- Programación en Python === El algoritmo MapReduce de Hadoop se presenta en la siguiente figura. <img src="https://raw.githubusercontent.com/jdvelasq/datalabs/master/images/map-reduce.jpg"/> Se desea escribir un programa que realice el conteo de palabras usando el algoritmo MapReduce. ``` # # A...
github_jupyter
<a href="https://colab.research.google.com/github/mkirby1995/DS-Unit-2-Sprint-3-Classification-Validation/blob/master/DS_Unit_2_Sprint_Challenge_3_Classification_Validation.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> _Lambda School Data Science...
github_jupyter
``` # check pytorch installation: import torch, torchvision print(torch.__version__, torch.cuda.is_available()) assert torch.__version__.startswith("1.9") # please manually install torch 1.9 if Colab changes its default version import detectron2 from detectron2.utils.logger import setup_logger setup_logger() # imp...
github_jupyter
**author**: lukethompson@gmail.com<br> **date**: 7 Oct 2017<br> **language**: Python 3.5<br> **license**: BSD3<br> ## alpha_diversity_90bp_100bp_150bp.ipynb ``` import pandas as pd import math import numpy as np import matplotlib.pyplot as plt import seaborn as sns from empcolors import get_empo_cat_color %matplotlib...
github_jupyter
# Value Investing Indicators from SEC Filings ### Data Source: https://www.sec.gov/dera/data/financial-statement-data-sets.html ``` import pandas as pd import os import shutil import glob import sys import warnings import functools from functools import reduce import os pd.set_option('display.max_columns', 999) wa...
github_jupyter
# Modeling @Author: Bruno Vieira Goals: Create a classification model able to identify a BOT account on twitter, using only profile-based features. ``` # Libs import os import numpy as np import pandas as pd from sklearn.pipeline import Pipeline from sklearn.compose import ColumnTransformer from sklearn.impute import...
github_jupyter
``` from IPython import display from utils import Logger import torch from torch import nn from torch.optim import Adam from torch.autograd import Variable from torchvision import transforms, datasets DATA_FOLDER = './torch_data/VGAN/MNIST' ``` ## Load Data ``` def mnist_data(): compose = transforms.Compose( ...
github_jupyter
``` # Import Dependencies import pandas as pd import random # A gigantic DataFrame of individuals' names, their trainers, their weight, and their days as gym members training_data = pd.DataFrame({ "Name":["Gino Walker","Hiedi Wasser","Kerrie Wetzel","Elizabeth Sackett","Jack Mitten","Madalene Wayman","Jamee Horvath...
github_jupyter
# Self-Driving Car Engineer Nanodegree ## Project: **Finding Lane Lines on the Road** *** In this project, you will use the tools you learned about in the lesson to identify lane lines on the road. You can develop your pipeline on a series of individual images, and later apply the result to a video stream (really j...
github_jupyter
``` from simforest import SimilarityForestClassifier, SimilarityForestRegressor from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor from sklearn.datasets import load_svmlight_file from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler from sklearn.me...
github_jupyter