Skip to content

Instantly share code, notes, and snippets.

View andreshp's full-sized avatar

Andrés Herrera Poyatos andreshp

View GitHub Profile
@hellpanderrr
hellpanderrr / sort_df.py
Created July 27, 2015 12:26
Pandas sort dataframe using custom function
def sort_df(df, column_idx, key):
'''Takes dataframe, column index and custom function for sorting,
returns dataframe sorted by this column using this function'''
col = df.ix[:,column_idx]
temp = pd.DataFrame([])
temp[0] = col
temp[1] = df.index
temp = temp.values.tolist()
df = df.ix[[i[1] for i in sorted(temp, key=key)]]
@ncordon
ncordon / TeX-for-Telegram.user.js
Last active August 31, 2017 17:47
GreaseMonkey extension to render Latex only in window of sent messages
// ==UserScript==
// @name TeX for Telegram
// @namespace https://ncordon.github.io/
// @description Allows LaTeX messages in Telegram Desktop
// @version 1
// @include https://web.telegram.org/*
// @grant none
// @license WTFPL
// ==/UserScript==