This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Specify a directory for plugins | |
call plug#begin('~/.local/share/nvim/plugged') | |
" Colorizer A plugin to color colornames and codes | |
Plug 'chrisbra/Colorizer' | |
" vim-markdown-composer An asynchronous markdown preview plugin for Vim and Neovim | |
function! BuildComposer(info) | |
if a:info.status != 'unchanged' || a:info.force | |
if has('nvim') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def nan_if(data, missing_value): | |
return np.where(data == missing_value, np.nan, data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[run] | |
branch = True | |
[report] | |
exclude_lines= | |
if response.status_code == 404: | |
elif response.status_code == 503: | |
pragma: no cover | |
class ServiceUnavailable(Exception): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import facebook | |
class SimpleFacebook(object): | |
def __init__(self, oauth_token): | |
self.graph = facebook.GraphAPI(oauth_token) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from controller import simple_facebook | |
from unittest import mock, TestCase | |
class SimpleFacebookTestCase(TestCase): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Aplicando formatos diferentes para cada coluna no DataFrame | |
df = DataFrame({'a':[7.7885], 'b': [1.989878968657576e-10]}) | |
# out | |
# a b | |
# 0 7.7885 1.989879e-10 | |
df.loc[:, 'b'] = df.loc[:, 'b'].map(lambda x: float('%.11f' % x)) | |
df.loc[:, 'a'] = df.loc[:, 'a'].map(lambda x: float('%.2f' % x)) | |
# out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
data = np.random.rand(7, 3, 2) | |
op_dict = {'sum': np.sum, 'mean': np.mean, 'max': np.max, 'min': np.min} | |
def apply_function(func, data, step, axis=0, slice_=slice(None)): | |
sections = np.arange(step, data.shape[axis], step) | |
return np.array([func(d[slice_], axis=axis) for d in np.split(data, sections, axis=axis)]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Para somar no eixo 1 de três em três | |
txprec[::3].sum(axis=1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/opt/anaconda2/envs/py360/bin/python | |
from datetime import datetime | |
from json import dump | |
from os import walk | |
from os.path import join | |
import logging | |
import re | |
def search_dir(root, target='.git', pattern=re.compile(r'^\.git|[\w\d\s!@#$%^&*()_+\-=\[\]{};\':"\\|,<>\/?]+$'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def find_nearest_point(latitude, longitude, l_latitude, l_longitude): | |
""" | |
This function find the index of the nearest value to the latitude and longitude values int the l_latitude and | |
l_longitude lists. | |
Parameters | |
---------- | |
latitude: float | |
longitude: float | |
l_latitude: list |