Skip to content

Instantly share code, notes, and snippets.

@amanahuja
amanahuja / gist:2232996
Created March 29, 2012 03:32
"A small class for Principal Component Analysis"
#!/usr/bin/env python
"""
A small class for Principal Component Analysis
@From: http://stackoverflow.com/questions/1730600/principal-component-analysis-in-python
@author Denis http://stackoverflow.com/users/86643/denis
@dated: April 2010
Usage:
p = PCA( A, fraction=0.90 )
@amanahuja
amanahuja / columnbot.py
Created June 5, 2011 22:57
Algorithm for always playing in Column Four
##
# This function calculates my bot's move in connect four algorithm
# returned mymove indicates what column to play on
# passed variable opponentmove should be the column the opponent just play on
#
# www.code-wars.com
def calculate_my_move (opponentmove):
if opponentmove = anything_at_all: