python

Python Environments with Conda

Anaconda (and these days miniconda) has been my go-to for getting Python and the scientific/data science software stack installed on my computer (even on my Arch linux machine!). When it first came out it was the first time I was able to install and use pandas and the rest of the scipy stack. I’ve stuck with it ever since. It was also the first time I used (and understood) virtual environments.

R or Python, which One to Learn (First)?

I’ve been asked a few times lately about whether one should learn R or Python. Channeling David Robinson’s post, I’m writing a blog post about it. When you’ve written the same code 3 times, write a function When you’ve given the same in-person advice 3 times, write a blog post — David Robinson (@drob) November 9, 2017 The only definitive answer I have is if you’re planning to do web deveopment, and you’re somehow only picking between R and Python, pick Python (any of the Python web frameworks, Flask, Django, Pyramid, and then ask yourself why not JavaScript?

Getting Started with Data Science and Analysis

I’ve been an instructor for Software-Carpentry (SWC) over a year now. It’s been a facinating experience and I’m proud to be a part of an open source movement promoting best practices. Typically when looking to start learing data science/analysis the first things people look up is something along the lines of: “learn python”, “free online r course”, “data science python”, “r jobs”, etc. Or scan through the coursera offerings. I’m a bit biased, but I think the SWC material is one of the best ways to just get familiar with the basics.

Open Source A Python Project I

I started my first open source project towards the end of summer 2014 I began working at the Social Decision Analytics Laboratory at the Virginia Informatics Institutee. The project involves creating a simulation environment where we can observe how an idea or belief spreads within a social network. The initial thought was to look for and extend an agent-based model package in Python. I did manage to find the pyabm package by Alex Zvoleff, but for simplicity’s sake I wrote my own package instead of extending his existing code base.

Absolute and Relative Directories in Python

One of the most common tasks (for me at least) is saving or getting data from another directory from where the current python script is running. However, for many of the file I/O functions, it assumes the current directory or you need to give it an absolute directory. Using something like ../other_directory will not work. Here is one way you can get the current script directory, and then append to the string the relative paths.