Python: How to open and read .csv documents

Unlike text documents, which Python has a native open() function for: Python: How to open and read text documents Opening and reading .csv files requires importing the csv module and using a csv.reader(). For example, this code will open and read the first 10 lines in a .csv file: import csv csv_path = r’C:\Users\Chris\Desktop\Python Scripts\Python … Continue reading Python: How to open and read .csv documents

Python: How to install WinPython and Jupyter Notebook

To use Python with a Jupyter Notebook for Data Science and other projects, you will first need to make sure you have Python 3 and Jupyter Notebook installed. There are Jupyter Notebook installation instructions here: https://jupyter.readthedocs.io/en/latest/install.html This site recommends installing Anaconda, which bundles installation of Python 3 with Jupyter Notebook, which is just fine. However, … Continue reading Python: How to install WinPython and Jupyter Notebook

JavaScript: How to create a custom range slider using bootstrap-slider

This article describes how to create a custom HTML range slider using Bootstrap 3, jQuery, HTML, CSS, and a JavaScript package called “bootstrap-slider”.  There are download and installation instructions for this package on github. This slider can be custom styled with CSS and comes with a built-in tooltip. See the graphic below for a description … Continue reading JavaScript: How to create a custom range slider using bootstrap-slider

jQuery: How to toggle switches programmatically

Let’s say you have some HTML/CSS switches in place of a traditional checkbox. jQuery makes it easy to toggle switches on or off. For example: function toggle(){ $(‘.slider’).click(); } Which can be called in a button like so: <button type=”button” class=”btn btn-primary” onClick=”toggle();”>Toggle</button> For example:   Note: This same jQuery can be triggered without clicking … Continue reading jQuery: How to toggle switches programmatically