Making VS Code and Python Play Nice on Windows

One of the editors I use regularly is VS Code. I work a lot with Python, but when installing Anaconda using default settings on a Windows machine already having VSC installed there’s a good chance you’ll run into an issue. When attempting to run Python code straight from VSC you may get an error. This should be fixed on some newer versions of Anaconda, but I’ve needed to do something about it often enough I feel it’s useful to save the solution janh posted on StackExchange. ...

Jul 21, 2021 · 1 min · 126 words · D. Michael Senter

Making INPUT and LABEL Statements with AWK

I am currently working with a database provided by the North Carolina Department of Public Safety that consists of several fixed-width files. Each of these has an associated codebook that gives the internal variable name, a label of the variable, its data type, as well as the start column and the length of the fields for each column. To import the data sets into SAS, I could copy and paste part of that data into my INPUT and LABEL statements, but that gets tedious pretty fast when dealing with dozens of lines. And since I have multiple data sets like that, I didn’t really want to do it that way. In this post I show how a simple command-line script can be written to deal with this problem. ...

Jul 6, 2021 · 4 min · 836 words · D. Michael Senter

SASPy Video Tutorial

I have been using both SAS and Python extensively for a while now. With each having great features, it was very useful to combine my skills in both languages by seamlessly moving between SAS and Python in a single notebook. In the video below, fellow SAS intern Ariel Chien and I show how easy it is to connect the SAS and Python kernels using the open-source SASPy package together with SAS OnDemand for Academics. I hope you will also find that this adds to your workflow! ...

Jun 29, 2021 · 1 min · 130 words · D. Michael Senter

Census 2020 Population Estimates Updated

The Census Bureau has updated its population estimates for 2020 with county level data. This means any projects that have had to rely on the 2019 estimates can now switch to the 2020 estimates. ...

Jun 9, 2021 · 2 min · 277 words · D. Michael Senter

Using Git with SAS Studio

Git is a widely used version control system that allows users to track their software development in both public and private repositories. It is also increasingly used to store data in text formats, see for example the New York Times COVID-19 data set. This post will briefly demonstrate how to clone and pull updates from a GitHub repository using the git functions that are built into SAS Studio. ...

Jan 11, 2021 · 3 min · 499 words · D. Michael Senter

North Carolina Housing Data

A popular beginners machine learning problem is the prediction of housing prices. A frequently used data set for this purpose uses housing prices in California along some additional gathered through the 1990 Census. One such data set is available here at Kaggle. Unfortunately, that data set is rather old. And I live in North Carolina, not California! So I figured I might as well create a new housing data set, but this time with more up-to-date information and using North Carolina as the state to be analyzed. One thing that may be interesting about North Carlina as compared to California is the position of major populations centers. In California, major population centers are near the beach, while major population centers in North Carolina are in the interior of the state. Both large citites and proximity to the beach tend to correlate with higher housing prices. In California, unlike in North Carolina, both of these go together. ...

Nov 6, 2020 · 8 min · 1644 words · D. Michael Senter

Teacher Salaries

What do you do when your data table is in PDF format? Let’s use tabula-py to extract teacher salary information from PDFs directly into Pandas dataframes. We’ll also use some regex to clean up the results.

Oct 29, 2020 · 9 min · 1788 words · D. Michael Senter

Accessing Census Data via API

The Census Bureau makes an incredible amount of data available online. In this post, I will summarize how to get access to this data via Python by using the Census Bureau’s API. The Census Bureau makes a pretty useful guide available here - I recommend checking it out. ...

Aug 22, 2020 · 5 min · 999 words · D. Michael Senter

Porting Forward

My website is back up and running! Some incompatabilities between my old site and updates to both Hugo and the Academic Theme have led to some downtime on this page as I didn’t have time to look through how to rebuild my site without loosing previous content. I’m currently in the process of updating everything and will try to bring back some material as well. Stay tuned! ...

Jul 27, 2020 · 1 min · 85 words · D. Michael Senter