Steps to deploy Flask's minitwit on Google App Enginee Flask is a light-weight web framework for Python, which is well documented and clearly written. Its Github depository provides a few examples, which includes minitwit. The minittwit website enjoys a few basic features of social network such as following, login/logout. The demo site on GAE is http://minitwit-123.appspot.com. The Github repo is https://github.com/dapangmao/minitwit.Google App Engine or GAE is a major public clouder service besides Amazon EC2. Among the four languages(Java/Python/Go/PHP) it supports, GAE is friendly to Python users, possibly because Guido van Rossum worked there and personally created Python datastore interface. As for me, it is a good choice for a ...
Translate SAS's sas7bdat format to SQLite and Pandas Thanks Jared Hobbs’ sas7bdat package, Python can read SAS’s data sets quickly and precisely. And it will be great to have a few extension functions to enhance this package with SQLite and Pandas. The good things to transfer SAS libraries to SQLite: Size reduction:SAS’s sas7bdat format is verbose. So far successfully loaded 40GB SAS data to SQLite with 85% reduction of disk usage.Save the cost to buy SAS/ACCESSSAS/ACCESS costs around $8,000 a year for a server, while SQLite is accessible for most common softwares.The good things to transfer SAS data set to Pandas: Pandas’ powerful Excel interface:Write very large Excel ...
One example of test-driven development in Python Function or method is the most basic unit in Python programming. Test-driven development is a key for a developer to assure the code quality of those units. In his book, Harry Percival illustrated a few great examples about how to use TDD with Python and Django. It seems that for web development, TDD including unit testing and integration testing is the cornerstone for every success. For data analysis, coding mostly relies on built-in packages instead large framework like Django, which makes TDD easier. In my opnion, TDD in data analysis could have three steps. Step 1: requirement analysis Before writing ...
Sorting in Python #-------------------------------------------------------------------------------# Name: Methods of sorting# Purpose: implements the sortings mentioned by Robert Sedgewick and# Kevin Wayne, Algorithms 4ed##-------------------------------------------------------------------------------def selection_sort(a): for i in range(len(a)): min = i for j in range(i+1, len(a)): if a[j] < a[min]: min = j a[i], a[min] = a[min], a[i]def insertion_sort(a): for i in range(len(a)): j = i while j > 0: if a[j] < a[j-1]: a[j], a[j-1] = a[j-1], a[j] j -= 1def shell_sort(a): h = 1 while h <= len(a)/3: h = 3*h+ 1 # in the test use 4 as increment sequence while h >= 1: for i in range(len(a)): j = i while ...
When Google Analytics meets SAS Thanks to Tricia’s introduction, I recently realized that Google Analytics is such a powerful tool for web analytics or business intelligence. It will fit the special needs if we use SAS to analyze the well-structure users’ data accumulated in Google Analytics. The challenge is that Google Analytics API and SAS hardly meet each other: Google Analytics often serves web/Linux, and SAS dwells in the ecosystems of Windows/UNIX/Mainframe. On a Windows-equipped computer, I tried three methods to pull out this blog’s data from Google Analytics to SAS: they have their own pros and cons. Method 1: CliendLogin + HTTP protocol The ...