Python Programming

Combine CSV files in Python in 3 Easy Steps

Combine CSV files in Python in 3 Easy Steps

Combine CSV files in Python in 3 Easy Steps Unfortunately, with the latest update to RStudio, RWordPress has not yet been updated. In the meantime, manually posting RStudio code on how to easily combine two files in R in a few easy steps: Step 1:  Import the packages Select the folder Step 2:  Read each
+ Read More

Top Words in COVID & Corona Domain Names – Text Basics

Top Words in COVID & Corona Domain Names A few basics on determining the most popular terms in a dataframe of text. In this case, the dataframe is domain names that have been exported into a csv. For my example, I have a list of ~205,000 domain names with that has been compiled with ‘covid’
+ Read More

Python Word Analytics

Text Analytics on News Article

Text Analytics For a little fun, this is a text analytics based on a CBC News article which is available at http://www.cbc.ca/news/technology/trump-climate-change-executive-order-1.4043650[raw]. Below you will see the Python code along with the various word analytics on the text (which was downloaded and put into a text file named “cbcnewstrump.txt”. Enjoy! [/raw]

Word Counter in Jupyter Notebooks

Word Counter in Jupyter Notebooks

Simple utilities can make things so much easier at times.  This Jupyter Notebook take a document or in this case, ‘Alice in Wonderland’ by Lewis Carroll and provides the top 10 words.  Naturally, words can be eliminated but for ease of reference, only the word ‘the’ has been removed. For websites, a deeper cleaner is needed
+ Read More

Python Pandas

Power of Python Pandas

Power of Python Pandas The ease of extracting and summarizing large amounts of data using Python Pandas is powerful.  Below is an example of using airline data to find out how many passengers went to an airport, accident rate based on reference codes, deaths and the causes of accidents.  With a few lines of code,
+ Read More

Extract User Reviews using Python Pandas

Extract User Reviews using Python Pandas

Extract User Reviews using Python Pandas TripAdvisor user reviews data about a particular hotel. To help the hotel understand the feedback the reviews provide, and what it might suggest they should focus on to improve customer experience.  In part I, data will be extracted for each reviewer’s ratings of a hotel along with a summary.  The
+ Read More

Python Relational Database

Python Relational Database

Python Relational Database In this example, two data “assets” will be created to be used by a company for a direct marketing campaigns. The raw data will be used to create a python relational database to create a “flat” file with selected customers and variables. Examples of the summary output will be provided along with
+ Read More

Python Data Types

Python Data Types

Python Data Types:  Putting Airline Data In Order The data used in the python data types example is from OpenFlights.org and contains three data files, one for airports, one for routes and one for airlines. The data are for up to January 2012. The data in the file airports.dat looks like this: 1,”Goroka”,”Goroka”,”Papua New Guinea”,”GKA”,”AYGA”,-6.081689,145.391881,5282,10,”U”,”Pacific/Port_Moresby” 2,”Madang”,”Madang”,”Papua New Guinea”,”MAG”,”AYMD”,-5.207083,145.7887,20,10,”U”,”Pacific/Port_Moresby” 3,”Mount
+ Read More