Table

0.1 Introduction

Instance of: arrangement of information or data

AKA: Dataframe

Distinct from:

English: A collection of rows and columns, where rows represent specific instances (AKA records, k-tuple, n-tuple, or a vector), and columns represent features (AKA variables, parameters, properties, attributes, or stanchions). The intersection of a row and column is called a sell.

Formalization:

\[ \]

Cites: Wikipedia Table (information) ; Wikipedia Table Table (database) ; Wikidata ; Wolfram

ML Frameworks Interoperability Cheat Sheet

Code

Documentation: data.frame: Data Frames

Examples:

df=data.frame(a=c(1,2,3,4), b=c('a','b','c','d'))
df
  a b
1 1 a
2 2 b
3 3 c
4 4 d

Documentation: pandas.DataFrame

Examples:

import pandas as pd
df = pd.DataFrame({'a': [1, 2,3,4], 'b': ['a','b','c','d']})
df
   a  b
0  1  a
1  2  b
2  3  c
3  4  d

Documentation: PostgreSQL AVG Function

library(DBI)
# Create an ephemeral in-memory RSQLite database
#con <- dbConnect(RSQLite::SQLite(), dbname = ":memory:")
#dbListTables(con)
#dbWriteTable(con, "mtcars", mtcars)
#dbListTables(con)

#Configuration failed because libpq was not found. Try installing:
#* deb: libpq-dev libssl-dev (Debian, Ubuntu, etc)
#install.packages('RPostgres')
#remotes::install_github("r-dbi/RPostgres")
#Took forever because my file permissions were broken
#pg_lsclusters
require(RPostgres)
Loading required package: RPostgres
# Connect to the default postgres database
#I had to follow these instructions and create both a username and database that matched my ubuntu name
#https://www.digitalocean.com/community/tutorials/how-to-install-postgresql-on-ubuntu-20-04-quickstart
con <- dbConnect(RPostgres::Postgres())
DROP TABLE IF EXISTS df;
CREATE TABLE IF NOT EXISTS df (
    a INTEGER,
    b CHAR
);
INSERT INTO df (a, b)
VALUES
    (1,'a'),
    (2,'b'),
    (3,'c'),
    (4,'d');
SELECT  * FROM  df;
4 records
a b
1 a
2 b
3 c
4 d
import torch