A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
#!/bin/bash | |
##################################################### | |
# Name: Bash CheatSheet for Mac OSX | |
# | |
# A little overlook of the Bash basics | |
# | |
# Usage: | |
# | |
# Author: J. Le Coupanec | |
# Date: 2014/11/04 |
A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
1. Install Linux updates, set time zones, followed by GCC and Make | |
sudo yum -y update | |
sudo ln -sf /usr/share/zoneinfo/America/Indianapolis \ | |
/etc/localtime | |
sudo yum -y install gcc make | |
2. Download, Untar and Make Redis 2.8 (check here http://redis.io/download) |
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
#!/usr/bin/python | |
import os | |
def walk(dir): | |
for (root, dirs, files) in os.walk(dir): | |
for file in files: | |
path = os.path.join(root, file) | |
print(repr(path)) | |
if __name__ == "__main__": |
#! /usr/bin/env python | |
# | |
# mysql2cassandra.py | |
# Dump a MySQL result set to file and then import into a Cassandra column family | |
# | |
# Configuration | |
# mysql_params [host, port, user, password, db] MySQL conenction parameters | |
# mysql_columns [colname, colname2, ...] Columns for building MySQL query | |
# The column that will hold values of the row key in the Cassandra column family must be first |
to create a new environment | |
conda create -n mynewenviron package1 package2 etc | |
conda create -n newenv --clone ~anaconda | |
to remove an environment | |
conda remove -n myenvirontoremove --all | |
always start with |
Other people's projects:
My projects (tutorials are on my blog at http://maxoffsky.com):
For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.
Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon
with HyperThreading enabled, but it can work without problem on slower machines.
You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.
(def ptrn | |
{ | |
:a {:pattern #"a(?!b)" | |
:purpose "Only allow a if it is not preceded by a 'b' (negative lookahead)" | |
:samples ["acdefg" ; ok | |
"abcdef" ; nil | |
]} | |
:b {:pattern #"(?i)(<title.*?>)(.+?)(</title>)" |