A Byte of my 2.2-lb Brain

Just sharing stuff…

Building Financial Networks

I have been receiving requests to release the Python code I wrote to produce the financial network discussed in my previous post titled PSE Correlation-Based Network. Well, here it is! 🙂

August 24, 2016 · 1 Comment

Twitter Datetime

Twitter’s “CREATED_AT” format looks something like this Wed Mar 04 02:14:57 +0000 2015. To convert this to Python’s datetime format, simply use datetime.strptime(). If the tweets are stored in a … Continue reading

May 28, 2015 · Leave a comment

Add Multiple Columns to Pandas Dataframe from Function

If you have a pandas data frame mydf that has, for example, two columns mydate and mytime (both are of type datetime), to add three more columns: hour, weekday, and … Continue reading

May 5, 2015 · Leave a comment

pandas groupby Function

Grouping To group data frame elements by column, say group data frame df by Column 1, use To group by multiple columns, the argument for the `pandas.groupby()` function would now … Continue reading

April 20, 2015 · Leave a comment