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 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)]] |
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
// ==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== |