Skip to content

Instantly share code, notes, and snippets.

@suissemaxx
suissemaxx / useful_pandas_snippets.py
Created December 31, 2017 20:22 — 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!
var express = require('express');
var app = express();
app.listen(80, function() {
console.log('Chatfuel Bot-Server listening on port 80...');
});
app.get('/*', function(req, res) {
var jsonResponse = [];
jsonResponse.push({ "text": "Hi. " + (Math.random() * 5 + 1).toFixed(0) + " is a lucky number..." });