Skip to content

Instantly share code, notes, and snippets.

@yjw868
yjw868 / Code.gs
Created May 31, 2018 20:41 — forked from hachichaud/Code.gs
Google AppScript to collect Talkus+Slack data
function doPost(e) {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Data");
var toLog = handleTalkusEvent(e.postData.contents);
if (!toLog) {
return;
}
// Improve this by getting first row column names
sheet.appendRow([toLog.endTime, toLog.channelName, toLog.userAsking, toLog.userAskingJoinTime, toLog.firstResponder, toLog.firstResponseTime, toLog.messages]);
}
@yjw868
yjw868 / useful_pandas_snippets.py
Created April 13, 2018 22:48 — forked from bsweger/useful_pandas_snippets.md
Useful Pandas Snippets
# List unique values in a DataFrame column
# h/t @makmanalp for the updated syntax!
df['Column Name'].unique()
# Convert Series datatype to numeric (will error if column has non-numeric values)
# h/t @makmanalp
pd.to_numeric(df['Column Name'])
# Convert Series datatype to numeric, changing non-numeric values to NaN
# h/t @makmanalp for the updated syntax!