Skip to content

Instantly share code, notes, and snippets.

View gabrielvie's full-sized avatar
👨‍💻

Gabriel Vieira gabrielvie

👨‍💻
View GitHub Profile

Card Zoom

Added an effect on mouse hover card.

Example here

Images without copyright.

# Scikit Learn Encoders
from sklearn.preprocessing import LabelEncoder
import pandas as pd
data_frame = pd.read_csv('data_file')
target_feature = 'Feature Label'
# use encoder to tranform

Configurando o Ambiente

Primeiro precisamos criar um virtualenv e ativa-la, para isolarmos as dependencias de python somente para esse projeto.

$ python3 -m venv $HOME/.venvs/metro_notify
$ source $HOME/.venvs/metro_notify/bin/activate

Depois é necessário instalarmos as bibliotecas necessárias para fazermos o webscrappin e o BOT no IFTTT: e Requests

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gabrielvie
gabrielvie / ie_base64_workaround.js
Last active September 25, 2022 12:53
How to implement a download file with base64 on IE/EDGE
if (window.navigator && window.navigator.msSaveOrOpenBlob) {
const data = "<base64 string/>"
const fileName = 'file.pdf'
const byteCharacters = atob(data)
let byteNumbers = new Array(byteCharacters.length)
for (var i = 0; i < byteCharacters.length; i++) {
byteNumbers[i] = byteCharacters.charCodeAt(i)
}
@gabrielvie
gabrielvie / filter_dataframe.ipynb
Last active April 3, 2018 03:55
How do I filter pandas dataframes and series.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
class Aircraft:
def __init__(self, registration, model, num_rows, num_seats_per_row):
self._registration = registration
self._model = model
self._num_rows = num_rows
self._num_seats_per_row = num_seats_per_row
def registration(self):
@gabrielvie
gabrielvie / rename_columns.ipynb
Last active March 30, 2018 03:36
How do I rename columns in a Pandas DataFrame.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gabrielvie
gabrielvie / remove_columns.ipynb
Last active March 30, 2018 03:29
How do I remove columns in DataFrame with Pandas?
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# LIST
numbers = [x * x for x in range(1, 6)]
# [1, 4, 9, 16, 25, 36]
# SET
numbers = {x * x for x in range(1, 6)}
# {1, 4, 36, 9, 16, 25}