Categories
data science

Create a range of dates using Pandas – Python

Here is how to create a range of dates using the Pandas module. The range will start from April 2 2014 and will end October 1 2014. Well…here it is That’s pretty much it!

Categories
data science

Timing Execution – Python

This is a simple function that can help you time the code. All it does is use time() from the time module to saves the current time when the code begins, then saves the current time when it ends, and then calculates the difference. Then it uses the gmtime and strtime to format the calculated […]

Categories
Uncategorized

Checking out a Sub-Reddit’s Front Page – Python

This code uses Reddit’s own API, praw, to download all the post titles, karma counts, position, and reddit id of each post within a sub reddit. This example collects all the info from the top 100 posts in r/technology at on hour intervals and then saves it to a file.

Categories
Uncategorized

Reformatting dates – Python

This little script will reformat a series of dates in a file, from 22 April 1980 to a more compact 19800422 ([yyyymmdd]) ISO standard, using the re and time libraries. Start with a file containing a series of dates Then this is the python code Now the output file will read