Coding

Computer coding and practical software development concepts.

4 reasons why to use visualization grammar with examples

Submitted by Anonymous (not verified) on Tue, 01/24/2023 - 19:35

There are many reasons why a visualization grammar can be useful when creating visualizations. Here are three reasons why you might choose to use a visualization grammar, along with examples that illustrate each reason. For these examples, we use altair and json Pythn libaries, which can be imported as follows:

import altair as alt
import json

Altair gives a consistent interface to the Vega-Lite grammar. You can install it with:

pip install altair vega vega_datasets

Here are 3 reasons why to use graphical grammars:

Tags

TensorFlow or PyTorch?

Submitted by Anonymous (not verified) on Tue, 08/02/2022 - 21:06

Tensorflow 2.0 with Keras (TF2) has been popular for deploying production-level machine learning applications, and PyTorch has been the favorite in classroooms. But PyTorch has been gaining ground on TensorFlow, which to use, and do you have to choose?

Firstly, you can't "mix" in TF2 to PyTorch programs because neither framework is purely python code, and they each have their own compiled C++ backends. Rather, pick one framework or the other for an application, to avoid having problematic conflicts in the CUDA environment.

Tags

Python List Comprehensions

Submitted by Anonymous (not verified) on Fri, 07/22/2022 - 17:26

A Python list comprehension is a very convenient syntax for generating simple lists that can replace loops and .append calls to make your code more succinct and readable.

The resources below provide a lot of help for getting started. Here's an example of how a list comprehension can be used to replace a lot of repetitive code with a reusable function:

Tags