diff --git a/.gitignore b/.gitignore index bf3e1b2..03b6134 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,5 @@ bin/ ### Mac OS ### .DS_Store /.idea/ +/.kotlin/ +/.idea/ diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..2a65317 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,17 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..46c1e48 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index ccc43ba..18940f0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,22 +1,27 @@ import java.util.* + plugins { kotlin("jvm") version "1.8.0" - id("org.jetbrains.kotlinx.dataframe") version "0.13.1" + id("org.jetbrains.kotlinx.dataframe") version "0.15.0-dev" } group = "org.jetbrains.kotlinx.dataframe.examples" version = "1.0-SNAPSHOT" repositories { + mavenLocal() mavenCentral() } dependencies { - implementation ("org.jetbrains.kotlinx:dataframe:0.13.1") - implementation ("org.jetbrains.kotlinx:kandy-lets-plot:0.6.0") - implementation ("org.jetbrains.kotlinx:kandy-api:0.6.0") + implementation ("org.jetbrains.kotlin:kotlin-stdlib:1.8.0") + implementation ("org.jetbrains.kotlinx:dataframe:0.15.0-dev") + implementation ("org.jetbrains.kotlinx:kandy-lets-plot:0.7.1") + implementation ("org.jetbrains.kotlinx:kandy-api:0.7.1") implementation ("org.mariadb.jdbc:mariadb-java-client:3.1.4") + implementation ("org.hsqldb:hsqldb:2.7.3") + testImplementation(kotlin("test")) } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index d2d6fd4..3474a50 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Thu Jan 18 12:11:25 CET 2024 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100644 index 0000000..1b6c787 --- /dev/null +++ b/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..107acd3 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/notebooks/customdb.ipynb b/notebooks/customdb.ipynb new file mode 100644 index 0000000..a53d6c9 --- /dev/null +++ b/notebooks/customdb.ipynb @@ -0,0 +1,1538 @@ +{ + "cells": [ + { + "metadata": { + "ExecuteTime": { + "end_time": "2024-10-10T16:25:44.552813200Z", + "start_time": "2024-10-10T16:25:44.472998200Z" + } + }, + "cell_type": "code", + "source": [ + "import org.jetbrains.kotlinx.dataframe.DataFrame\n", + "import org.jetbrains.kotlinx.dataframe.api.describe\n", + "import org.jetbrains.kotlinx.dataframe.api.print\n", + "import org.jetbrains.kotlinx.dataframe.io.DbConnectionConfig\n", + "import org.jetbrains.kotlinx.dataframe.io.getSchemaForSqlTable\n", + "import org.jetbrains.kotlinx.dataframe.io.readSqlTable\n", + "import org.jetbrains.kotlinx.dataframe.io.getSchemaForAllSqlTables\n", + "import org.jetbrains.kotlinx.dataframe.schema.DataFrameSchema\n", + "import java.sql.DriverManager\n", + "import java.util.*\n" + ], + "outputs": [], + "execution_count": 1 + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2024-10-10T16:26:08.785509400Z", + "start_time": "2024-10-10T16:26:07.914085300Z" + } + }, + "cell_type": "code", + "source": [ + "USE {\n", + " dependencies(\"org.hsqldb:hsqldb:2.7.3\")\n", + "}" + ], + "outputs": [], + "execution_count": 2 + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2024-10-10T16:26:10.797640700Z", + "start_time": "2024-10-10T16:26:10.156473400Z" + } + }, + "cell_type": "code", + "source": [ + "DriverManager.getConnection(org.jetbrains.kotlinx.dataframe.examples.jdbc.customdb.URL, org.jetbrains.kotlinx.dataframe.examples.jdbc.customdb.USER_NAME, org.jetbrains.kotlinx.dataframe.examples.jdbc.customdb.PASSWORD).use { con ->\n", + " org.jetbrains.kotlinx.dataframe.examples.jdbc.customdb.createAndPopulateTable(con)\n", + "}" + ], + "outputs": [], + "execution_count": 3 + }, + { + "cell_type": "markdown", + "source": [ + "**The IMDB Database Exploration: printing schemas for all non-system tables**" + ], + "metadata": { + "collapsed": false + } + }, + { + "cell_type": "code", + "source": [ + "val dbConfig = DbConnectionConfig(org.jetbrains.kotlinx.dataframe.examples.jdbc.customdb.URL, org.jetbrains.kotlinx.dataframe.examples.jdbc.customdb.USER_NAME, org.jetbrains.kotlinx.dataframe.examples.jdbc.customdb.PASSWORD)\n", + "\n", + "val dataschemas = DataFrame.getSchemaForAllSqlTables(dbConfig, dbType = customdb.HSQLDB)\n", + "\n", + "dataschemas.forEach { \n", + " println(\"--- Schema for Table ${it.key} ---\")\n", + " println(it.value)\n", + " println()\n", + "}" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2024-10-10T16:26:13.466682400Z", + "start_time": "2024-10-10T16:26:12.948497700Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "--- Schema for Table ORDERS ---\r\n", + "ID: Int\n", + "ITEM: String\n", + "PRICE: Double\n", + "ORDER_DATE: java.util.Date?\r\n", + "\r\n" + ] + } + ], + "execution_count": 4 + }, + { + "cell_type": "markdown", + "source": [ + "**The IMDB Data Quick Exploration: printing 100 rows from each non-system table**" + ], + "metadata": { + "collapsed": false + } + }, + { + "cell_type": "code", + "source": [ + "val dfs = DataFrame.readAllSqlTables(dbConfig, dbType = customdb.HSQLDB).values\n", + "\n", + "dfs.forEach {\n", + " it.describe().print()\n", + " it.print(5)\n", + "}" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2024-10-10T16:26:16.231380700Z", + "start_time": "2024-10-10T16:26:15.617997500Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " name type count unique nulls top freq mean std min median max\n", + " 0 ID Int 4 4 0 0 1 1,5 1,290994 0 1 3\n", + " 1 ITEM String 4 2 0 Laptop 2 null null Laptop Laptop Smartphone\n", + " 2 PRICE Double 4 2 0 1500 2 1100,0 461,880215 700 1100 1500\n", + " 3 ORDER_DATE java.util.Date 4 1 0 2024-10-10 4 null null 2024-10-10 2024-10-10 2024-10-10\n", + "\r\n", + " ID ITEM PRICE ORDER_DATE\n", + " 0 0 Laptop 1500,0 2024-10-10\n", + " 1 1 Smartphone 700,0 2024-10-10\n", + " 2 2 Laptop 1500,0 2024-10-10\n", + " 3 3 Smartphone 700,0 2024-10-10\n", + "\r\n" + ] + } + ], + "execution_count": 5 + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2024-10-10T16:26:22.186464800Z", + "start_time": "2024-10-10T16:26:22.096726600Z" + } + }, + "cell_type": "code", + "source": "dbConfig", + "outputs": [ + { + "data": { + "text/plain": [ + "DbConnectionConfig(url=jdbc:hsqldb:hsql://localhost/testdb, user=SA, password=)" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 6 + }, + { + "cell_type": "code", + "source": [ + "val ordersDf = DataFrame.readSqlTable(dbConfig, \"orders\", dbType = customdb.HSQLDB)\n", + "ordersDf" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2024-10-10T16:26:25.160902600Z", + "start_time": "2024-10-10T16:26:24.267113100Z" + } + }, + "outputs": [ + { + "data": { + "text/html": [ + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
IDITEMPRICEORDER_DATE
0Laptop1500,0000002024-10-10
1Smartphone700,0000002024-10-10
2Laptop1500,0000002024-10-10
3Smartphone700,0000002024-10-10
\n", + " \n", + " \n", + " " + ], + "application/kotlindataframe+json": "{\"$version\":\"2.1.1\",\"metadata\":{\"columns\":[\"ID\",\"ITEM\",\"PRICE\",\"ORDER_DATE\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Double\"},{\"kind\":\"ValueColumn\",\"type\":\"java.util.Date\"}],\"nrow\":4,\"ncol\":4},\"kotlin_dataframe\":[{\"ID\":0,\"ITEM\":\"Laptop\",\"PRICE\":1500.0,\"ORDER_DATE\":\"2024-10-10\"},{\"ID\":1,\"ITEM\":\"Smartphone\",\"PRICE\":700.0,\"ORDER_DATE\":\"2024-10-10\"},{\"ID\":2,\"ITEM\":\"Laptop\",\"PRICE\":1500.0,\"ORDER_DATE\":\"2024-10-10\"},{\"ID\":3,\"ITEM\":\"Smartphone\",\"PRICE\":700.0,\"ORDER_DATE\":\"2024-10-10\"}]}" + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 7 + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2024-10-10T16:26:53.415292100Z", + "start_time": "2024-10-10T16:26:52.945269200Z" + } + }, + "cell_type": "code", + "source": [ + "val updatedDf = ordersDf.add(\"TAX\") { it[\"PRICE\"] as Double * 0.1 }\n", + "updatedDf" + ], + "outputs": [ + { + "data": { + "text/html": [ + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
IDITEMPRICEORDER_DATETAX
0Laptop1500,0000002024-10-10150,000000
1Smartphone700,0000002024-10-1070,000000
2Laptop1500,0000002024-10-10150,000000
3Smartphone700,0000002024-10-1070,000000
\n", + " \n", + " \n", + " " + ], + "application/kotlindataframe+json": "{\"$version\":\"2.1.1\",\"metadata\":{\"columns\":[\"ID\",\"ITEM\",\"PRICE\",\"ORDER_DATE\",\"TAX\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Double\"},{\"kind\":\"ValueColumn\",\"type\":\"java.util.Date\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Double\"}],\"nrow\":4,\"ncol\":5},\"kotlin_dataframe\":[{\"ID\":0,\"ITEM\":\"Laptop\",\"PRICE\":1500.0,\"ORDER_DATE\":\"2024-10-10\",\"TAX\":150.0},{\"ID\":1,\"ITEM\":\"Smartphone\",\"PRICE\":700.0,\"ORDER_DATE\":\"2024-10-10\",\"TAX\":70.0},{\"ID\":2,\"ITEM\":\"Laptop\",\"PRICE\":1500.0,\"ORDER_DATE\":\"2024-10-10\",\"TAX\":150.0},{\"ID\":3,\"ITEM\":\"Smartphone\",\"PRICE\":700.0,\"ORDER_DATE\":\"2024-10-10\",\"TAX\":70.0}]}" + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 8 + } + ], + "metadata": { + "kernelspec": { + "display_name": "Kotlin", + "language": "kotlin", + "name": "kotlin" + }, + "language_info": { + "name": "kotlin", + "version": "1.8.20", + "mimetype": "text/x-kotlin", + "file_extension": ".kt", + "pygments_lexer": "kotlin", + "codemirror_mode": "text/x-kotlin", + "nbconvert_exporter": "" + }, + "ktnbPluginMetadata": { + "projectDependencies": true + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/notebooks/imdb.ipynb b/notebooks/imdb.ipynb index b516102..58b4c0c 100644 --- a/notebooks/imdb.ipynb +++ b/notebooks/imdb.ipynb @@ -3,8 +3,8 @@ { "metadata": { "ExecuteTime": { - "end_time": "2024-03-25T15:58:40.085023800Z", - "start_time": "2024-03-25T15:58:39.481638700Z" + "end_time": "2024-10-10T15:57:31.648930600Z", + "start_time": "2024-10-10T15:57:30.197064200Z" } }, "cell_type": "code", @@ -14,25 +14,25 @@ "}" ], "outputs": [], - "execution_count": 5 + "execution_count": 1 }, { "metadata": { "ExecuteTime": { - "end_time": "2024-03-25T15:58:48.248747200Z", - "start_time": "2024-03-25T15:58:40.094999200Z" + "end_time": "2024-10-10T15:57:31.748663400Z", + "start_time": "2024-10-10T15:57:31.667881400Z" } }, "cell_type": "code", - "source": "%use dataframe, kandy", + "source": "//%use dataframe, kandy", "outputs": [], - "execution_count": 6 + "execution_count": 2 }, { "metadata": { "ExecuteTime": { - "end_time": "2024-03-25T15:58:48.396541400Z", - "start_time": "2024-03-25T15:58:48.256723300Z" + "end_time": "2024-10-10T15:57:31.866348600Z", + "start_time": "2024-10-10T15:57:31.756642Z" } }, "cell_type": "code", @@ -40,7 +40,7 @@ "import org.jetbrains.kotlinx.dataframe.DataFrame\n", "import org.jetbrains.kotlinx.dataframe.api.describe\n", "import org.jetbrains.kotlinx.dataframe.api.print\n", - "import org.jetbrains.kotlinx.dataframe.io.DatabaseConfiguration\n", + "import org.jetbrains.kotlinx.dataframe.io.DbConnectionConfig\n", "import org.jetbrains.kotlinx.dataframe.io.getSchemaForSqlTable\n", "import org.jetbrains.kotlinx.dataframe.io.readSqlTable\n", "import org.jetbrains.kotlinx.dataframe.io.getSchemaForAllSqlTables\n", @@ -49,7 +49,7 @@ "import java.util.*\n" ], "outputs": [], - "execution_count": 7 + "execution_count": 3 }, { "cell_type": "markdown", @@ -67,21 +67,21 @@ "val USER_NAME = \"root\"\n", "val PASSWORD = \"pass\"\n", "\n", - "val dbConfig = DatabaseConfiguration(URL, USER_NAME, PASSWORD)\n", + "val dbConfig = DbConnectionConfig(URL, USER_NAME, PASSWORD)\n", "\n", "val dataschemas = DataFrame.getSchemaForAllSqlTables(dbConfig)\n", "\n", "dataschemas.forEach { \n", - " println(\"---Yet another table schema---\")\n", - " println(it)\n", + " println(\"--- Schema for Table ${it.key} ---\")\n", + " println(it.value)\n", " println()\n", "}" ], "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2024-03-25T15:58:50.320926400Z", - "start_time": "2024-03-25T15:58:48.406706100Z" + "end_time": "2024-10-10T15:57:33.024637300Z", + "start_time": "2024-10-10T15:57:31.879315800Z" } }, "outputs": [ @@ -89,37 +89,37 @@ "name": "stdout", "output_type": "stream", "text": [ - "---Yet another table schema---\r\n", + "--- Schema for Table actors ---\r\n", "id: Int\n", "first_name: String?\n", "last_name: String?\n", - "gender: Char?\r\n", + "gender: String?\r\n", "\r\n", - "---Yet another table schema---\r\n", + "--- Schema for Table directors ---\r\n", "id: Int\n", "first_name: String?\n", "last_name: String?\r\n", "\r\n", - "---Yet another table schema---\r\n", + "--- Schema for Table directors_genres ---\r\n", "director_id: Int\n", "genre: String\n", "prob: Float?\r\n", "\r\n", - "---Yet another table schema---\r\n", + "--- Schema for Table movies ---\r\n", "id: Int\n", "name: String?\n", "year: Int?\n", "rank: Float?\r\n", "\r\n", - "---Yet another table schema---\r\n", + "--- Schema for Table movies_directors ---\r\n", "director_id: Int\n", "movie_id: Int\r\n", "\r\n", - "---Yet another table schema---\r\n", + "--- Schema for Table movies_genres ---\r\n", "movie_id: Int\n", "genre: String\r\n", "\r\n", - "---Yet another table schema---\r\n", + "--- Schema for Table roles ---\r\n", "actor_id: Int\n", "movie_id: Int\n", "role: String\r\n", @@ -127,7 +127,7 @@ ] } ], - "execution_count": 8 + "execution_count": 4 }, { "cell_type": "markdown", @@ -141,7 +141,7 @@ { "cell_type": "code", "source": [ - "val dfs = DataFrame.readAllSqlTables(dbConfig, limit = 100)\n", + "val dfs = DataFrame.readAllSqlTables(dbConfig, limit = 100).values\n", "\n", "dfs.forEach {\n", " it.describe().print()\n", @@ -151,8 +151,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2024-03-25T15:58:52.840668900Z", - "start_time": "2024-03-25T15:58:50.328181600Z" + "end_time": "2024-10-10T15:57:34.151814700Z", + "start_time": "2024-10-10T15:57:33.039598200Z" } }, "outputs": [ @@ -160,11 +160,11 @@ "name": "stdout", "output_type": "stream", "text": [ - " name type count unique nulls top freq mean std min median max\n", - " 0 id Int 100 100 0 2 1 53,37 30,245679 2 54 106\n", - " 1 first_name String? 100 93 0 Antonio 3 null null Ahmed Krishna Yussuf Abed\n", - " 2 last_name String? 100 81 0 A. 5 null null 'Chincheta' A. a'Hiller\n", - " 3 gender Char? 100 1 0 M 100 null null M M M\n", + " name type count unique nulls top freq mean std min median max\n", + " 0 id Int 100 100 0 2 1 53,37 30,245679 2 54 106\n", + " 1 first_name String 100 93 0 Antonio 3 null null Ahmed Krishna Yussuf Abed\n", + " 2 last_name String 100 81 0 A. 5 null null 'Chincheta' A. a'Hiller\n", + " 3 gender String 100 1 0 M 100 null null M M M\n", "\r\n", " id first_name last_name gender\n", " 0 2 Michael 'babeepower' Viera M\n", @@ -174,10 +174,10 @@ " 4 6 José 'El Francés' M\n", "...\n", "\r\n", - " name type count unique nulls top freq mean std min median max\n", - " 0 id Int 100 100 0 1 1 53,22 30,099022 1 53 104\n", - " 1 first_name String? 100 97 0 Mohamed 3 null null A.C. Lauri Zaki\n", - " 2 last_name String? 100 65 0 Abbott 15 null null 1 Abashidze a'Hiller\n", + " name type count unique nulls top freq mean std min median max\n", + " 0 id Int 100 100 0 1 1 53,22 30,099022 1 53 104\n", + " 1 first_name String 100 97 0 Mohamed 3 null null A.C. Lauri Zaki\n", + " 2 last_name String 100 65 0 Abbott 15 null null 1 Abashidze a'Hiller\n", "\r\n", " id first_name last_name\n", " 0 1 Todd 1\n", @@ -190,7 +190,7 @@ " name type count unique nulls top freq mean std min median max\n", " 0 director_id Int 100 41 0 8 8 35,340000 17,446148 2 37 61\n", " 1 genre String 100 15 0 Drama 21 null null Action Drama War\n", - " 2 prob Float? 100 27 0 1 40 0,623749 0,347447 0 1 1\n", + " 2 prob Float 100 27 0 1 40 0,623749 0,347447 0 1 1\n", "\r\n", " director_id genre prob\n", " 0 2 Short 1,0\n", @@ -200,11 +200,11 @@ " 4 6 Short 1,0\n", "...\n", "\r\n", - " name type count unique nulls top freq mean std min median max\n", - " 0 id Int 100 100 0 0 1 51,320000 30,230054 0 51 103\n", - " 1 name String? 100 98 0 $1,000 Reward 3 null null #28 'A' 'burbs, The\n", - " 2 year Int? 100 48 0 1901 9 1951,500000 41,555488 1897 1955 2004\n", - " 3 rank Float? 100 22 74 7 2 6,150000 1,508178 3 6 10\n", + " name type count unique nulls top freq mean std min median max\n", + " 0 id Int 100 100 0 0 1 51,320000 30,230054 0 51 103\n", + " 1 name String 100 98 0 $1,000 Reward 3 null null #28 'A' 'burbs, The\n", + " 2 year Int 100 48 0 1901 9 1951,500000 41,555488 1897 1955 2004\n", + " 3 rank Float? 100 22 74 7 2 6,150000 1,508178 3 6 10\n", "\r\n", " id name year rank\n", " 0 0 #28 2002 null\n", @@ -254,7 +254,7 @@ ] } ], - "execution_count": 9 + "execution_count": 5 }, { "cell_type": "markdown", @@ -274,8 +274,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2024-03-25T15:58:56.151655600Z", - "start_time": "2024-03-25T15:58:52.869437600Z" + "end_time": "2024-10-10T15:57:35.054917200Z", + "start_time": "2024-10-10T15:57:34.211654300Z" } }, "outputs": [ @@ -460,7 +460,7 @@ " </style>\n", " </head>\n", " <body>\n", - " <table class="dataframe" id="df_956301312"></table>\n", + " <table class="dataframe" id="df_-2097152000"></table>\n", "\n", "<p class="dataframe_description">... showing only top 20 of 10000 rows</p><p class="dataframe_description">DataFrame: rowsCount = 10000, columnsCount = 4</p>\n", "\n", @@ -742,13 +742,13 @@ "\n", "/*<!--*/\n", "call_DataFrame(function() { DataFrame.addTable({ cols: [{ name: "<span title=\"id: Int\">id</span>", children: [], rightAlign: true, values: ["<span class=\"formatted\" title=\"\"><span class=\"numbers\">2</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">3</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">4</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">5</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">6</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">7</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">8</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">9</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">10</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">11</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">12</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">13</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">14</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">15</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">16</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">17</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">18</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">19</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">20</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">21</span></span>"] }, \n", - "{ name: "<span title=\"first_name: String?\">first_name</span>", children: [], rightAlign: false, values: ["Michael","Eloy","Dieguito","Antonio","Jos&#233;","F&#233;lix","Marcial","Jos&#233;","Francisco","V&#237;ctor","Antonio","Luis","Janny","Antonio","Baltazar","Luis Roberto","Murray the","N&#233;stor","Tony","Pollino"] }, \n", - "{ name: "<span title=\"last_name: String?\">last_name</span>", children: [], rightAlign: false, values: ["&#39;babeepower&#39; Viera","&#39;Chincheta&#39;","&#39;El Cigala&#39;","&#39;El de Chipiona&#39;","&#39;El Franc&#233;s&#39;","&#39;El Gato&#39;","&#39;El Jalisco&#39;","&#39;El Morito&#39;","&#39;El Ni&#241;o de la Manola&#39;","&#39;El Payaso&#39;","&#39;El Pesca&#237;to&#39;","&#39;El Plojo&#39;","&#39;el Portugues&#39;","&#39;El Rilete&#39;","&#39;El Toro&#39;","&#39;Formiga&#39;","&#39;K&#39;","&#39;Kick Boxer&#39;","&#39;La Chispa&#39;","&#39;Romero&#39;"] }, \n", - "{ name: "<span title=\"gender: Char?\">gender</span>", children: [], rightAlign: false, values: ["M","M","M","M","M","M","M","M","M","M","M","M","M","M","M","M","M","M","M","M"] }, \n", - "], id: 956301312, rootId: 956301312, totalRows: 10000 } ) });\n", + "{ name: "<span title=\"first_name: String\">first_name</span>", children: [], rightAlign: false, values: ["Michael","Eloy","Dieguito","Antonio","Jos&#233;","F&#233;lix","Marcial","Jos&#233;","Francisco","V&#237;ctor","Antonio","Luis","Janny","Antonio","Baltazar","Luis Roberto","Murray the","N&#233;stor","Tony","Pollino"] }, \n", + "{ name: "<span title=\"last_name: String\">last_name</span>", children: [], rightAlign: false, values: ["&#39;babeepower&#39; Viera","&#39;Chincheta&#39;","&#39;El Cigala&#39;","&#39;El de Chipiona&#39;","&#39;El Franc&#233;s&#39;","&#39;El Gato&#39;","&#39;El Jalisco&#39;","&#39;El Morito&#39;","&#39;El Ni&#241;o de la Manola&#39;","&#39;El Payaso&#39;","&#39;El Pesca&#237;to&#39;","&#39;El Plojo&#39;","&#39;el Portugues&#39;","&#39;El Rilete&#39;","&#39;El Toro&#39;","&#39;Formiga&#39;","&#39;K&#39;","&#39;Kick Boxer&#39;","&#39;La Chispa&#39;","&#39;Romero&#39;"] }, \n", + "{ name: "<span title=\"gender: String\">gender</span>", children: [], rightAlign: false, values: ["M","M","M","M","M","M","M","M","M","M","M","M","M","M","M","M","M","M","M","M"] }, \n", + "], id: -2097152000, rootId: -2097152000, totalRows: 10000 } ) });\n", "/*-->*/\n", "\n", - "call_DataFrame(function() { DataFrame.renderTable(956301312) });\n", + "call_DataFrame(function() { DataFrame.renderTable(-2097152000) });\n", "\n", "\n", " </script>\n", @@ -920,21 +920,21 @@ " \n", " \n", " \n", - "
idfirst_namelast_namegender
2Michael'babeepower' VieraM
3Eloy'Chincheta'M
4Dieguito'El Cigala'M
5Antonio'El de Chipiona'M
6José'El Francés'M
7Félix'El Gato'M
8Marcial'El Jalisco'M
9José'El Morito'M
10Francisco'El Niño de la Manola'M
11Víctor'El Payaso'M
12Antonio'El Pescaíto'M
13Luis'El Plojo'M
14Janny'el Portugues'M
15Antonio'El Rilete'M
16Baltazar'El Toro'M
17Luis Roberto'Formiga'M
18Murray the'K'M
19Néstor'Kick Boxer'M
20Tony'La Chispa'M
21Pollino'Romero'M
\n", + "
idfirst_namelast_namegender
2Michael'babeepower' VieraM
3Eloy'Chincheta'M
4Dieguito'El Cigala'M
5Antonio'El de Chipiona'M
6José'El Francés'M
7Félix'El Gato'M
8Marcial'El Jalisco'M
9José'El Morito'M
10Francisco'El Niño de la Manola'M
11Víctor'El Payaso'M
12Antonio'El Pescaíto'M
13Luis'El Plojo'M
14Janny'el Portugues'M
15Antonio'El Rilete'M
16Baltazar'El Toro'M
17Luis Roberto'Formiga'M
18Murray the'K'M
19Néstor'Kick Boxer'M
20Tony'La Chispa'M
21Pollino'Romero'M
\n", " \n", " \n", " " ], - "application/kotlindataframe+json": "{\"$version\":\"2.0.0\",\"metadata\":{\"columns\":[\"id\",\"first_name\",\"last_name\",\"gender\"],\"nrow\":10000,\"ncol\":4},\"kotlin_dataframe\":[{\"id\":2,\"first_name\":\"Michael\",\"last_name\":\"'babeepower' Viera\",\"gender\":\"M\"},{\"id\":3,\"first_name\":\"Eloy\",\"last_name\":\"'Chincheta'\",\"gender\":\"M\"},{\"id\":4,\"first_name\":\"Dieguito\",\"last_name\":\"'El Cigala'\",\"gender\":\"M\"},{\"id\":5,\"first_name\":\"Antonio\",\"last_name\":\"'El de Chipiona'\",\"gender\":\"M\"},{\"id\":6,\"first_name\":\"José\",\"last_name\":\"'El Francés'\",\"gender\":\"M\"},{\"id\":7,\"first_name\":\"Félix\",\"last_name\":\"'El Gato'\",\"gender\":\"M\"},{\"id\":8,\"first_name\":\"Marcial\",\"last_name\":\"'El Jalisco'\",\"gender\":\"M\"},{\"id\":9,\"first_name\":\"José\",\"last_name\":\"'El Morito'\",\"gender\":\"M\"},{\"id\":10,\"first_name\":\"Francisco\",\"last_name\":\"'El Niño de la Manola'\",\"gender\":\"M\"},{\"id\":11,\"first_name\":\"Víctor\",\"last_name\":\"'El Payaso'\",\"gender\":\"M\"},{\"id\":12,\"first_name\":\"Antonio\",\"last_name\":\"'El Pescaíto'\",\"gender\":\"M\"},{\"id\":13,\"first_name\":\"Luis\",\"last_name\":\"'El Plojo'\",\"gender\":\"M\"},{\"id\":14,\"first_name\":\"Janny\",\"last_name\":\"'el Portugues'\",\"gender\":\"M\"},{\"id\":15,\"first_name\":\"Antonio\",\"last_name\":\"'El Rilete'\",\"gender\":\"M\"},{\"id\":16,\"first_name\":\"Baltazar\",\"last_name\":\"'El Toro'\",\"gender\":\"M\"},{\"id\":17,\"first_name\":\"Luis Roberto\",\"last_name\":\"'Formiga'\",\"gender\":\"M\"},{\"id\":18,\"first_name\":\"Murray the\",\"last_name\":\"'K'\",\"gender\":\"M\"},{\"id\":19,\"first_name\":\"Néstor\",\"last_name\":\"'Kick Boxer'\",\"gender\":\"M\"},{\"id\":20,\"first_name\":\"Tony\",\"last_name\":\"'La Chispa'\",\"gender\":\"M\"},{\"id\":21,\"first_name\":\"Pollino\",\"last_name\":\"'Romero'\",\"gender\":\"M\"}]}" + "application/kotlindataframe+json": "{\"$version\":\"2.1.1\",\"metadata\":{\"columns\":[\"id\",\"first_name\",\"last_name\",\"gender\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"}],\"nrow\":10000,\"ncol\":4},\"kotlin_dataframe\":[{\"id\":2,\"first_name\":\"Michael\",\"last_name\":\"'babeepower' Viera\",\"gender\":\"M\"},{\"id\":3,\"first_name\":\"Eloy\",\"last_name\":\"'Chincheta'\",\"gender\":\"M\"},{\"id\":4,\"first_name\":\"Dieguito\",\"last_name\":\"'El Cigala'\",\"gender\":\"M\"},{\"id\":5,\"first_name\":\"Antonio\",\"last_name\":\"'El de Chipiona'\",\"gender\":\"M\"},{\"id\":6,\"first_name\":\"José\",\"last_name\":\"'El Francés'\",\"gender\":\"M\"},{\"id\":7,\"first_name\":\"Félix\",\"last_name\":\"'El Gato'\",\"gender\":\"M\"},{\"id\":8,\"first_name\":\"Marcial\",\"last_name\":\"'El Jalisco'\",\"gender\":\"M\"},{\"id\":9,\"first_name\":\"José\",\"last_name\":\"'El Morito'\",\"gender\":\"M\"},{\"id\":10,\"first_name\":\"Francisco\",\"last_name\":\"'El Niño de la Manola'\",\"gender\":\"M\"},{\"id\":11,\"first_name\":\"Víctor\",\"last_name\":\"'El Payaso'\",\"gender\":\"M\"},{\"id\":12,\"first_name\":\"Antonio\",\"last_name\":\"'El Pescaíto'\",\"gender\":\"M\"},{\"id\":13,\"first_name\":\"Luis\",\"last_name\":\"'El Plojo'\",\"gender\":\"M\"},{\"id\":14,\"first_name\":\"Janny\",\"last_name\":\"'el Portugues'\",\"gender\":\"M\"},{\"id\":15,\"first_name\":\"Antonio\",\"last_name\":\"'El Rilete'\",\"gender\":\"M\"},{\"id\":16,\"first_name\":\"Baltazar\",\"last_name\":\"'El Toro'\",\"gender\":\"M\"},{\"id\":17,\"first_name\":\"Luis Roberto\",\"last_name\":\"'Formiga'\",\"gender\":\"M\"},{\"id\":18,\"first_name\":\"Murray the\",\"last_name\":\"'K'\",\"gender\":\"M\"},{\"id\":19,\"first_name\":\"Néstor\",\"last_name\":\"'Kick Boxer'\",\"gender\":\"M\"},{\"id\":20,\"first_name\":\"Tony\",\"last_name\":\"'La Chispa'\",\"gender\":\"M\"},{\"id\":21,\"first_name\":\"Pollino\",\"last_name\":\"'Romero'\",\"gender\":\"M\"}]}" }, - "execution_count": 10, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], - "execution_count": 10 + "execution_count": 6 }, { "cell_type": "markdown", @@ -959,8 +959,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2024-03-25T15:59:00.612802300Z", - "start_time": "2024-03-25T15:58:56.159634500Z" + "end_time": "2024-10-10T15:57:36.066215800Z", + "start_time": "2024-10-10T15:57:35.111766500Z" } }, "outputs": [ @@ -1145,7 +1145,7 @@ " </style>\n", " </head>\n", " <body>\n", - " <table class="dataframe" id="df_956301314"></table>\n", + " <table class="dataframe" id="df_-2097151998"></table>\n", "\n", "<p class="dataframe_description">DataFrame: rowsCount = 20, columnsCount = 2</p>\n", "\n", @@ -1428,10 +1428,10 @@ "/*<!--*/\n", "call_DataFrame(function() { DataFrame.addTable({ cols: [{ name: "<span title=\"first_name: String\">first_name</span>", children: [], rightAlign: false, values: ["David","John","Daniel","Peter","Robert","Michael","Antonio","Luis","Paul","Jos&#233;","Richard","A.","Carlos","Frank","Joe","Steve","Jorge","Roberto","Tony","James"] }, \n", "{ name: "<span title=\"count: Int\">count</span>", children: [], rightAlign: true, values: ["<span class=\"formatted\" title=\"\"><span class=\"numbers\">80</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">74</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">49</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">46</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">46</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">45</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">42</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">41</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">40</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">39</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">38</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">36</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">35</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">34</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">34</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">33</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">33</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">33</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">32</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">30</span></span>"] }, \n", - "], id: 956301314, rootId: 956301314, totalRows: 20 } ) });\n", + "], id: -2097151998, rootId: -2097151998, totalRows: 20 } ) });\n", "/*-->*/\n", "\n", - "call_DataFrame(function() { DataFrame.renderTable(956301314) });\n", + "call_DataFrame(function() { DataFrame.renderTable(-2097151998) });\n", "\n", "\n", " </script>\n", @@ -1603,21 +1603,21 @@ " \n", " \n", " \n", - "
first_namecount
David80
John74
Daniel49
Peter46
Robert46
Michael45
Antonio42
Luis41
Paul40
José39
Richard38
A.36
Carlos35
Frank34
Joe34
Steve33
Jorge33
Roberto33
Tony32
James30
\n", + "
first_namecount
David80
John74
Daniel49
Peter46
Robert46
Michael45
Antonio42
Luis41
Paul40
José39
Richard38
A.36
Carlos35
Frank34
Joe34
Steve33
Jorge33
Roberto33
Tony32
James30
\n", " \n", " \n", " " ], - "application/kotlindataframe+json": "{\"$version\":\"2.0.0\",\"metadata\":{\"columns\":[\"first_name\",\"count\"],\"nrow\":20,\"ncol\":2},\"kotlin_dataframe\":[{\"first_name\":\"David\",\"count\":80},{\"first_name\":\"John\",\"count\":74},{\"first_name\":\"Daniel\",\"count\":49},{\"first_name\":\"Peter\",\"count\":46},{\"first_name\":\"Robert\",\"count\":46},{\"first_name\":\"Michael\",\"count\":45},{\"first_name\":\"Antonio\",\"count\":42},{\"first_name\":\"Luis\",\"count\":41},{\"first_name\":\"Paul\",\"count\":40},{\"first_name\":\"José\",\"count\":39},{\"first_name\":\"Richard\",\"count\":38},{\"first_name\":\"A.\",\"count\":36},{\"first_name\":\"Carlos\",\"count\":35},{\"first_name\":\"Frank\",\"count\":34},{\"first_name\":\"Joe\",\"count\":34},{\"first_name\":\"Steve\",\"count\":33},{\"first_name\":\"Jorge\",\"count\":33},{\"first_name\":\"Roberto\",\"count\":33},{\"first_name\":\"Tony\",\"count\":32},{\"first_name\":\"James\",\"count\":30}]}" + "application/kotlindataframe+json": "{\"$version\":\"2.1.1\",\"metadata\":{\"columns\":[\"first_name\",\"count\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"}],\"nrow\":20,\"ncol\":2},\"kotlin_dataframe\":[{\"first_name\":\"David\",\"count\":80},{\"first_name\":\"John\",\"count\":74},{\"first_name\":\"Daniel\",\"count\":49},{\"first_name\":\"Peter\",\"count\":46},{\"first_name\":\"Robert\",\"count\":46},{\"first_name\":\"Michael\",\"count\":45},{\"first_name\":\"Antonio\",\"count\":42},{\"first_name\":\"Luis\",\"count\":41},{\"first_name\":\"Paul\",\"count\":40},{\"first_name\":\"José\",\"count\":39},{\"first_name\":\"Richard\",\"count\":38},{\"first_name\":\"A.\",\"count\":36},{\"first_name\":\"Carlos\",\"count\":35},{\"first_name\":\"Frank\",\"count\":34},{\"first_name\":\"Joe\",\"count\":34},{\"first_name\":\"Steve\",\"count\":33},{\"first_name\":\"Jorge\",\"count\":33},{\"first_name\":\"Roberto\",\"count\":33},{\"first_name\":\"Tony\",\"count\":32},{\"first_name\":\"James\",\"count\":30}]}" }, - "execution_count": 11, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], - "execution_count": 11 + "execution_count": 7 }, { "cell_type": "code", @@ -1636,8 +1636,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2024-03-25T15:59:03.470179100Z", - "start_time": "2024-03-25T15:59:00.626271700Z" + "end_time": "2024-10-10T15:57:37.494722300Z", + "start_time": "2024-10-10T15:57:36.267676400Z" } }, "outputs": [ @@ -1648,10 +1648,10 @@ " <head>\n", " <meta charset="UTF-8">\n", " <style> html, body { margin: 0; overflow: hidden; } </style>\n", - " <script type="text/javascript" data-lets-plot-script="library" src="https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.2.0/js-package/distr/lets-plot.min.js"></script>\n", + " <script type="text/javascript" data-lets-plot-script="library" src="https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.3.3/js-package/distr/lets-plot.min.js"></script>\n", " </head>\n", " <body>\n", - " <div id="4wPVzN"></div>\n", + " <div id="VU2OVP"></div>\n", " <script type="text/javascript" data-lets-plot-script="plot">\n", " var plotSpec={\n", ""mapping":{\n", @@ -1681,11 +1681,11 @@ "}\n", "}]\n", "};\n", - " var plotContainer = document.getElementById("4wPVzN");\n", + " var plotContainer = document.getElementById("VU2OVP");\n", " LetsPlot.buildPlotFromProcessedSpecs(plotSpec, -1, -1, plotContainer);\n", " </script>\n", " </body>\n", - "</html>\"> \n", + "</html>\"> \n", " \n", - " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " David\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " John\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " Daniel\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " Peter\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " David\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " Robert\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " John\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " Michael\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " Daniel\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " Antonio\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " Peter\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " Luis\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " Robert\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " Paul\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " Michael\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " José\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " Antonio\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " Richard\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " Luis\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " A.\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " Paul\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " Carlos\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " José\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " Frank\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " Richard\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " Joe\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " A.\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " Steve\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " Carlos\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " Jorge\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " Frank\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " Roberto\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " Joe\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " Tony\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " Steve\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " James\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " Jorge\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " 0\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " Roberto\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " 10\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " Tony\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " 20\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " James\n", + " \n", + " \n", " \n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " 30\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " 0\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " 40\n", - " \n", + " \n", + " \n", + " \n", + " 10\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " 50\n", - " \n", + " \n", + " \n", + " \n", + " 20\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " 60\n", - " \n", + " \n", + " \n", + " \n", + " 30\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " 70\n", - " \n", + " \n", + " \n", + " \n", + " 40\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " 80\n", - " \n", + " \n", + " \n", + " \n", + " 50\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " 60\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " 70\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " 80\n", + " \n", + " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", " \n", - " \n", + " \n", " \n", " count\n", " \n", " \n", - " \n", + " \n", " \n", " first_name\n", " \n", @@ -2186,10 +2202,10 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", "\n", - " " + " " ], "application/plot+json": { "output_type": "lets_plot_spec", @@ -2272,12 +2288,12 @@ "swing_enabled": true } }, - "execution_count": 12, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], - "execution_count": 12 + "execution_count": 8 }, { "cell_type": "markdown", @@ -2291,8 +2307,8 @@ { "metadata": { "ExecuteTime": { - "end_time": "2024-03-25T15:59:05.408970700Z", - "start_time": "2024-03-25T15:59:03.475647200Z" + "end_time": "2024-10-10T15:57:38.389408500Z", + "start_time": "2024-10-10T15:57:37.586476900Z" } }, "cell_type": "code", @@ -2311,7 +2327,7 @@ { "data": { "text/html": [ - " \n", " \n", - "
nameyearrankgenre
$19716,400000Comedy
$1,000,000 Duck19715,000000Comedy
$1000 a Touchdown19396,700000Comedy
$3019997,500000Comedy
$40,00019969,600000Comedy
'?' Motorist, The19066,800000Comedy
'A' gai waak19837,200000Comedy
'A' gai waak juk jaap19877,200000Comedy
'Babicky dobjejte presne!'19835,600000Horror
'burbs, The19895,900000Comedy
'burbs, The19895,900000Horror
'Crocodile' Dundee II19884,900000Comedy
'E'19817,900000Comedy
'High Sign', The19217,700000Comedy
'Hyp-Nut-Tist', The19356,100000Comedy
'Java Madness' formerly titled 'Coffe...19956,600000Comedy
'J to tedy beru, sfe...!'19775,200000Comedy
'Manos' the Hands of Fate19661,600000Horror
'Ne gnstige Gelegenheit19994,600000Comedy
'Neath Brooklyn Bridge19425,400000Comedy
\n", + "
nameyearrankgenre
$19716,400000Comedy
$1,000,000 Duck19715,000000Comedy
$1000 a Touchdown19396,700000Comedy
$3019997,500000Comedy
$40,00019969,600000Comedy
'?' Motorist, The19066,800000Comedy
'A' gai waak19837,200000Comedy
'A' gai waak juk jaap19877,200000Comedy
'Babicky dobjejte presne!'19835,600000Horror
'burbs, The19895,900000Comedy
'burbs, The19895,900000Horror
'Crocodile' Dundee II19884,900000Comedy
'E'19817,900000Comedy
'High Sign', The19217,700000Comedy
'Hyp-Nut-Tist', The19356,100000Comedy
'Java Madness' formerly titled 'Coffe...19956,600000Comedy
'J to tedy beru, sfe...!'19775,200000Comedy
'Manos' the Hands of Fate19661,600000Horror
'Ne gnstige Gelegenheit19994,600000Comedy
'Neath Brooklyn Bridge19425,400000Comedy
\n", " \n", " \n", " " ], - "application/kotlindataframe+json": "{\"$version\":\"2.0.0\",\"metadata\":{\"columns\":[\"name\",\"year\",\"rank\",\"genre\"],\"nrow\":23000,\"ncol\":4},\"kotlin_dataframe\":[{\"name\":\"$\",\"year\":1971,\"rank\":6.400000095367432,\"genre\":\"Comedy\"},{\"name\":\"$1,000,000 Duck\",\"year\":1971,\"rank\":5.0,\"genre\":\"Comedy\"},{\"name\":\"$1000 a Touchdown\",\"year\":1939,\"rank\":6.699999809265137,\"genre\":\"Comedy\"},{\"name\":\"$30\",\"year\":1999,\"rank\":7.5,\"genre\":\"Comedy\"},{\"name\":\"$40,000\",\"year\":1996,\"rank\":9.600000381469727,\"genre\":\"Comedy\"},{\"name\":\"'?' Motorist, The\",\"year\":1906,\"rank\":6.800000190734863,\"genre\":\"Comedy\"},{\"name\":\"'A' gai waak\",\"year\":1983,\"rank\":7.199999809265137,\"genre\":\"Comedy\"},{\"name\":\"'A' gai waak juk jaap\",\"year\":1987,\"rank\":7.199999809265137,\"genre\":\"Comedy\"},{\"name\":\"'Babicky dobjejte presne!'\",\"year\":1983,\"rank\":5.599999904632568,\"genre\":\"Horror\"},{\"name\":\"'burbs, The\",\"year\":1989,\"rank\":5.900000095367432,\"genre\":\"Comedy\"},{\"name\":\"'burbs, The\",\"year\":1989,\"rank\":5.900000095367432,\"genre\":\"Horror\"},{\"name\":\"'Crocodile' Dundee II\",\"year\":1988,\"rank\":4.900000095367432,\"genre\":\"Comedy\"},{\"name\":\"'E'\",\"year\":1981,\"rank\":7.900000095367432,\"genre\":\"Comedy\"},{\"name\":\"'High Sign', The\",\"year\":1921,\"rank\":7.699999809265137,\"genre\":\"Comedy\"},{\"name\":\"'Hyp-Nut-Tist', The\",\"year\":1935,\"rank\":6.099999904632568,\"genre\":\"Comedy\"},{\"name\":\"'Java Madness' formerly titled 'Coffee Madness'\",\"year\":1995,\"rank\":6.599999904632568,\"genre\":\"Comedy\"},{\"name\":\"'J to tedy beru, sfe...!'\",\"year\":1977,\"rank\":5.199999809265137,\"genre\":\"Comedy\"},{\"name\":\"'Manos' the Hands of Fate\",\"year\":1966,\"rank\":1.600000023841858,\"genre\":\"Horror\"},{\"name\":\"'Ne gnstige Gelegenheit\",\"year\":1999,\"rank\":4.599999904632568,\"genre\":\"Comedy\"},{\"name\":\"'Neath Brooklyn Bridge\",\"year\":1942,\"rank\":5.400000095367432,\"genre\":\"Comedy\"}]}" + "application/kotlindataframe+json": "{\"$version\":\"2.1.1\",\"metadata\":{\"columns\":[\"name\",\"year\",\"rank\",\"genre\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Float\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"}],\"nrow\":23000,\"ncol\":4},\"kotlin_dataframe\":[{\"name\":\"$\",\"year\":1971,\"rank\":6.4,\"genre\":\"Comedy\"},{\"name\":\"$1,000,000 Duck\",\"year\":1971,\"rank\":5.0,\"genre\":\"Comedy\"},{\"name\":\"$1000 a Touchdown\",\"year\":1939,\"rank\":6.7,\"genre\":\"Comedy\"},{\"name\":\"$30\",\"year\":1999,\"rank\":7.5,\"genre\":\"Comedy\"},{\"name\":\"$40,000\",\"year\":1996,\"rank\":9.6,\"genre\":\"Comedy\"},{\"name\":\"'?' Motorist, The\",\"year\":1906,\"rank\":6.8,\"genre\":\"Comedy\"},{\"name\":\"'A' gai waak\",\"year\":1983,\"rank\":7.2,\"genre\":\"Comedy\"},{\"name\":\"'A' gai waak juk jaap\",\"year\":1987,\"rank\":7.2,\"genre\":\"Comedy\"},{\"name\":\"'Babicky dobjejte presne!'\",\"year\":1983,\"rank\":5.6,\"genre\":\"Horror\"},{\"name\":\"'burbs, The\",\"year\":1989,\"rank\":5.9,\"genre\":\"Comedy\"},{\"name\":\"'burbs, The\",\"year\":1989,\"rank\":5.9,\"genre\":\"Horror\"},{\"name\":\"'Crocodile' Dundee II\",\"year\":1988,\"rank\":4.9,\"genre\":\"Comedy\"},{\"name\":\"'E'\",\"year\":1981,\"rank\":7.9,\"genre\":\"Comedy\"},{\"name\":\"'High Sign', The\",\"year\":1921,\"rank\":7.7,\"genre\":\"Comedy\"},{\"name\":\"'Hyp-Nut-Tist', The\",\"year\":1935,\"rank\":6.1,\"genre\":\"Comedy\"},{\"name\":\"'Java Madness' formerly titled 'Coffee Madness'\",\"year\":1995,\"rank\":6.6,\"genre\":\"Comedy\"},{\"name\":\"'J to tedy beru, sfe...!'\",\"year\":1977,\"rank\":5.2,\"genre\":\"Comedy\"},{\"name\":\"'Manos' the Hands of Fate\",\"year\":1966,\"rank\":1.6,\"genre\":\"Horror\"},{\"name\":\"'Ne gnstige Gelegenheit\",\"year\":1999,\"rank\":4.6,\"genre\":\"Comedy\"},{\"name\":\"'Neath Brooklyn Bridge\",\"year\":1942,\"rank\":5.4,\"genre\":\"Comedy\"}]}" }, - "execution_count": 13, + "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], - "execution_count": 13 + "execution_count": 9 }, { "cell_type": "code", @@ -2980,15 +2996,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2024-03-25T15:59:07.556225100Z", - "start_time": "2024-03-25T15:59:05.420938800Z" + "end_time": "2024-10-10T15:57:39.236113800Z", + "start_time": "2024-10-10T15:57:38.510054100Z" } }, "outputs": [ { "data": { "text/html": [ - " \n", " \n", " " ], - "application/kotlindataframe+json": "{\"$version\":\"2.0.0\",\"metadata\":{\"columns\":[\"year\",\"genre\",\"meanRank\"],\"nrow\":204,\"ncol\":3},\"kotlin_dataframe\":[{\"year\":1892,\"genre\":\"Comedy\",\"meanRank\":5.099999904632568},{\"year\":1895,\"genre\":\"Comedy\",\"meanRank\":6.849999904632568},{\"year\":1896,\"genre\":\"Comedy\",\"meanRank\":3.549999952316284},{\"year\":1896,\"genre\":\"Horror\",\"meanRank\":4.25},{\"year\":1897,\"genre\":\"Comedy\",\"meanRank\":4.5},{\"year\":1898,\"genre\":\"Comedy\",\"meanRank\":4.619999980926513},{\"year\":1898,\"genre\":\"Horror\",\"meanRank\":3.200000047683716},{\"year\":1899,\"genre\":\"Comedy\",\"meanRank\":4.2799999713897705},{\"year\":1899,\"genre\":\"Horror\",\"meanRank\":3.299999952316284},{\"year\":1900,\"genre\":\"Comedy\",\"meanRank\":4.612500011920929},{\"year\":1901,\"genre\":\"Comedy\",\"meanRank\":4.7416666348775225},{\"year\":1902,\"genre\":\"Comedy\",\"meanRank\":4.366666714350383},{\"year\":1903,\"genre\":\"Comedy\",\"meanRank\":5.375000059604645},{\"year\":1904,\"genre\":\"Comedy\",\"meanRank\":4.953846142842219},{\"year\":1905,\"genre\":\"Comedy\",\"meanRank\":4.563636411320079},{\"year\":1906,\"genre\":\"Comedy\",\"meanRank\":6.066666762034099},{\"year\":1907,\"genre\":\"Comedy\",\"meanRank\":5.480000019073486},{\"year\":1908,\"genre\":\"Comedy\",\"meanRank\":5.416666666666667},{\"year\":1909,\"genre\":\"Comedy\",\"meanRank\":5.066666642824809},{\"year\":1909,\"genre\":\"Horror\",\"meanRank\":5.099999904632568}]}" + "application/kotlindataframe+json": "{\"$version\":\"2.1.1\",\"metadata\":{\"columns\":[\"year\",\"genre\",\"meanRank\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Double\"}],\"nrow\":204,\"ncol\":3},\"kotlin_dataframe\":[{\"year\":1892,\"genre\":\"Comedy\",\"meanRank\":5.099999904632568},{\"year\":1895,\"genre\":\"Comedy\",\"meanRank\":6.849999904632568},{\"year\":1896,\"genre\":\"Comedy\",\"meanRank\":3.549999952316284},{\"year\":1896,\"genre\":\"Horror\",\"meanRank\":4.25},{\"year\":1897,\"genre\":\"Comedy\",\"meanRank\":4.5},{\"year\":1898,\"genre\":\"Comedy\",\"meanRank\":4.619999980926513},{\"year\":1898,\"genre\":\"Horror\",\"meanRank\":3.200000047683716},{\"year\":1899,\"genre\":\"Comedy\",\"meanRank\":4.2799999713897705},{\"year\":1899,\"genre\":\"Horror\",\"meanRank\":3.299999952316284},{\"year\":1900,\"genre\":\"Comedy\",\"meanRank\":4.612500011920929},{\"year\":1901,\"genre\":\"Comedy\",\"meanRank\":4.7416666348775225},{\"year\":1902,\"genre\":\"Comedy\",\"meanRank\":4.366666714350383},{\"year\":1903,\"genre\":\"Comedy\",\"meanRank\":5.375000059604645},{\"year\":1904,\"genre\":\"Comedy\",\"meanRank\":4.953846142842219},{\"year\":1905,\"genre\":\"Comedy\",\"meanRank\":4.563636411320079},{\"year\":1906,\"genre\":\"Comedy\",\"meanRank\":6.066666762034099},{\"year\":1907,\"genre\":\"Comedy\",\"meanRank\":5.480000019073486},{\"year\":1908,\"genre\":\"Comedy\",\"meanRank\":5.416666666666667},{\"year\":1909,\"genre\":\"Comedy\",\"meanRank\":5.066666642824809},{\"year\":1909,\"genre\":\"Horror\",\"meanRank\":5.099999904632568}]}" }, - "execution_count": 14, + "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], - "execution_count": 14 + "execution_count": 10 }, { "cell_type": "code", @@ -3657,8 +3673,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2024-03-25T15:59:09.601753100Z", - "start_time": "2024-03-25T15:59:07.573181200Z" + "end_time": "2024-10-10T15:57:39.631056700Z", + "start_time": "2024-10-10T15:57:39.254154900Z" } }, "outputs": [ @@ -3669,10 +3685,10 @@ " <head>\n", " <meta charset="UTF-8">\n", " <style> html, body { margin: 0; overflow: hidden; } </style>\n", - " <script type="text/javascript" data-lets-plot-script="library" src="https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.2.0/js-package/distr/lets-plot.min.js"></script>\n", + " <script type="text/javascript" data-lets-plot-script="library" src="https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.3.3/js-package/distr/lets-plot.min.js"></script>\n", " </head>\n", " <body>\n", - " <div id="8ZYAXr"></div>\n", + " <div id="TrWT3G"></div>\n", " <script type="text/javascript" data-lets-plot-script="plot">\n", " var plotSpec={\n", ""mapping":{\n", @@ -3708,11 +3724,11 @@ "}\n", "}]\n", "};\n", - " var plotContainer = document.getElementById("8ZYAXr");\n", + " var plotContainer = document.getElementById("TrWT3G");\n", " LetsPlot.buildPlotFromProcessedSpecs(plotSpec, -1, -1, plotContainer);\n", " </script>\n", " </body>\n", - "</html>\"> \n", + "</html>\"> \n", " \n", - " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " 1,900\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " 1,920\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " 1,940\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " 1,960\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " 1,900\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " 1,980\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " 1,920\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " 2,000\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " 1,940\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " 3\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " 1,960\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " 4\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " 1,980\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " 5\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " 2,000\n", + " \n", + " \n", " \n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " 6\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " 3\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " 7\n", - " \n", + " \n", + " \n", + " \n", + " 4\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " 8\n", - " \n", + " \n", + " \n", + " \n", + " 5\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " 6\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " 7\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " 8\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", " meanRank\n", " \n", " \n", - " \n", + " \n", " \n", " year\n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", " genre\n", " \n", @@ -4049,10 +4083,10 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", "\n", - " " + " " ], "application/plot+json": { "output_type": "lets_plot_spec", @@ -4060,210 +4094,210 @@ "mapping": {}, "data": { "meanRank": [ - 5.1, - 6.85, - 3.55, + 5.099999904632568, + 6.849999904632568, + 3.549999952316284, 4.25, 4.5, - 4.62, - 3.2, - 4.2799997, - 3.3, - 4.6125, - 4.741667, - 4.366667, - 5.375, - 4.953846, - 4.5636363, - 6.0666666, - 5.48, - 5.4166665, - 5.0666666, - 5.1, - 4.9666667, - 5.9, - 6.4249997, - 5.84, - 4.9, - 6.0416665, - 7.3, - 6.0613637, - 6.3, - 5.734286, - 7.4, - 6.079412, - 6.7541666, - 6.5961537, - 7.0444446, - 7.7, - 6.725, - 6.65, - 6.954167, - 7.1363635, - 7.766667, - 6.6076922, + 4.619999980926513, + 3.200000047683716, + 4.2799999713897705, + 3.299999952316284, + 4.612500011920929, + 4.7416666348775225, + 4.366666714350383, + 5.375000059604645, + 4.953846142842219, + 4.563636411320079, + 6.066666762034099, + 5.480000019073486, + 5.416666666666667, + 5.066666642824809, + 5.099999904632568, + 4.9666666984558105, + 5.900000095367432, + 6.424999952316284, + 5.840000057220459, + 4.900000095367432, + 6.041666666666667, + 7.300000190734863, + 6.061363621191545, + 6.300000190734863, + 5.734285681588309, + 7.400000095367432, + 6.079411752083722, + 6.754166642824809, + 6.596153809474065, + 7.044444455040826, + 7.699999809265137, + 6.724999934434891, + 6.650000095367432, + 6.954166650772095, + 7.136363679712469, + 7.766666730244954, + 6.607692351708045, 7.5, - 6.3535714, - 7.4, - 6.830952, - 6.85, - 6.936, - 7.3999996, - 6.997436, + 6.35357141494751, + 7.400000095367432, + 6.830952360516503, + 6.849999904632568, + 6.936000027656555, + 7.3999998569488525, + 6.997435869314732, 7.5, - 7.177778, - 6.9, - 6.7227273, - 7.7999997, - 6.022222, - 6.1, - 6.296732, - 7.2374997, - 6.6308823, - 6.6916666, - 6.5793333, - 6.58, - 6.45027, - 5.485714, - 6.380628, - 6.2916665, - 6.475576, - 5.785714, - 6.3714933, - 7.35, - 6.3181396, - 6.5333333, - 6.419, - 5.96, - 6.3054795, - 5.4933333, - 6.229752, - 5.9307694, - 6.478788, - 5.1, - 6.498171, - 5.7933335, - 6.4657893, - 5.5958333, - 6.3504066, - 5.9117646, - 6.444203, - 5.0642858, - 6.3761907, - 4.2999997, - 6.5068965, - 5.24, - 6.4618278, + 7.177777841356066, + 6.900000095367432, + 6.722727284286961, + 7.799999952316284, + 6.022222233197046, + 6.099999904632568, + 6.296732025208816, + 7.237499952316284, + 6.630882389405194, + 6.691666642824809, + 6.5793333339691165, + 6.580000019073486, + 6.450270290632505, + 5.485714163099017, + 6.380628283735345, + 6.291666746139526, + 6.475576031592585, + 5.785714285714286, + 6.371493214395791, + 7.349999904632568, + 6.318139544198679, + 6.5333333015441895, + 6.419000020027161, + 5.959999990463257, + 6.305479474263649, + 5.49333332379659, + 6.229752054884414, + 5.930769223433274, + 6.478787883363589, + 5.100000030854169, + 6.498170747989562, + 5.793333307902018, + 6.465789482781761, + 5.595833321412404, + 6.350406516858233, + 5.911764705882353, + 6.444202901660532, + 5.064285670007978, + 6.376190472622307, + 4.299999952316284, + 6.506896549257739, + 5.2399999618530275, + 6.461827948529233, 5.875, - 6.472561, - 6.424064, - 6.0125003, - 6.394359, - 5.3428574, - 6.3052354, - 6.0333333, - 6.3544974, - 5.925, - 6.31092, - 5.53, - 6.0485206, - 4.9157896, - 6.075926, - 4.255, - 6.076923, - 4.5, - 6.1616354, - 4.7135134, - 6.1669016, - 5.736111, - 5.968, - 4.9586205, - 6.0439305, - 4.674468, - 6.0614944, - 5.151282, - 6.0686045, - 4.9, - 5.820707, - 4.3418603, - 5.9134407, - 4.591111, - 5.6258707, - 4.475, - 5.7773256, - 4.9365854, - 5.4502892, - 4.3714285, - 5.642458, - 4.398148, - 5.3333335, - 4.5261364, - 5.4391813, - 4.282857, - 5.4327383, - 4.788542, - 5.57551, - 4.477778, - 5.65503, - 4.432, - 5.471006, - 4.6951613, - 5.6384616, - 4.621667, - 5.656497, - 4.714286, - 5.250276, - 4.4313726, - 5.363964, - 4.5630136, - 5.4950495, - 4.4458823, - 5.457416, - 4.35303, - 5.530374, - 4.347826, - 5.544643, - 4.272, - 5.617939, - 4.4133334, - 5.3643155, - 4.5988374, - 5.2887325, - 4.3073173, - 5.3311596, - 4.407092, - 5.457576, - 4.1596637, - 5.2256227, - 4.203125, - 5.59717, - 4.483117, - 5.3725424, + 6.472560968340897, + 6.424064169593036, + 6.012500047683716, + 6.394358982183994, + 5.342857190540859, + 6.305235599348058, + 6.033333407508002, + 6.354497360804724, + 5.925000071525574, + 6.310919530090245, + 5.529999995231629, + 6.048520713162845, + 4.915789491251895, + 6.075925922688143, + 4.254999974370003, + 6.076923084564698, + 4.500000009934108, + 6.16163524441749, + 4.713513528978503, + 6.166901384440946, + 5.736111130979326, + 5.967999986012777, + 4.958620700342902, + 6.043930614614762, + 4.674468101339137, + 6.061494247666721, + 5.15128205372737, + 6.068604659202487, + 4.899999987247378, + 5.820707074921541, + 4.341860485631366, + 5.913440869059614, + 4.591111132833693, + 5.625870638818883, + 4.474999970859951, + 5.777325577514116, + 4.936585356549519, + 5.450289022715794, + 4.371428574834551, + 5.642458088571133, + 4.398148123864774, + 5.33333333535383, + 4.526136344129389, + 5.439181283203482, + 4.282857121740069, + 5.432738091974032, + 4.788541663438082, + 5.575510189646766, + 4.477777787380749, + 5.6550295839648275, + 4.4319999885559085, + 5.471005929292306, + 4.6951612907071265, + 5.638461539025843, + 4.62166668176651, + 5.656497176084141, + 4.714285712156977, + 5.250276238878787, + 4.431372537332423, + 5.363963959990321, + 4.56301367119567, + 5.495049513212525, + 4.445882370892693, + 5.4574162811753855, + 4.3530302716024, + 5.53037382341991, + 4.347826071407484, + 5.544642858207226, + 4.27200001001358, + 5.6179389234717565, + 4.413333322207133, + 5.3643153559617485, + 4.598837209302325, + 5.288732401921716, + 4.307317069875515, + 5.331159419771554, + 4.407092195030645, + 5.457575751073433, + 4.1596638605374245, + 5.225622786321674, + 4.20312499627471, + 5.597169815369372, + 4.483116877543462, + 5.372542367951344, 4.49375, - 5.5690556, - 4.406579, - 5.39581, - 4.738028, - 5.919006, - 4.5858974, - 5.78066, - 4.5896106, - 5.216352, - 4.7712646, - 5.850722, - 4.681443, - 5.703269, - 4.919298, - 5.8995686, - 4.973913, - 6.0140667, - 5.0608697, - 6.1316013, - 5.404348, - 6.112634, - 5.384058, - 5.9727736, - 5.594203 + 5.569055379407802, + 4.4065789266636495, + 5.395810060327945, + 4.7380281753943, + 5.9190058387510955, + 4.585897464018601, + 5.780660384106186, + 4.589610384656237, + 5.216352204106888, + 4.771264366719914, + 5.850722020498682, + 4.681443297985902, + 5.70326894264873, + 4.9192982431043655, + 5.899568339217481, + 4.973913031211798, + 6.01406685439325, + 5.060869552087093, + 6.131601126341337, + 5.40434781105622, + 6.1126344082176045, + 5.3840579641038095, + 5.97277354648095, + 5.594202888184699 ], "year": [ 1892.0, @@ -4718,12 +4752,12 @@ "swing_enabled": true } }, - "execution_count": 15, + "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], - "execution_count": 15 + "execution_count": 11 }, { "cell_type": "markdown", @@ -4750,15 +4784,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2024-03-25T15:59:12.433313300Z", - "start_time": "2024-03-25T15:59:09.614355Z" + "end_time": "2024-10-10T15:57:40.804246200Z", + "start_time": "2024-10-10T15:57:39.875403200Z" } }, "outputs": [ { "data": { "text/html": [ - " \n", " \n", - "
nameyeargenre
$1,000 Reward1923Western
$10,000 Under a Pillow1921Animation
$10,000 Under a Pillow1921Comedy
$10,000 Under a Pillow1921Short
$100,0001915Drama
$1000 a Touchdown1939Comedy
$20,000 Carat, The1913Crime
$20,000 Carat, The1913Drama
$20,000 Carat, The1913Short
$2500 Bride, The1912Drama
$2500 Bride, The1912Romance
$2500 Bride, The1912Short
$5,000 Reward1918Mystery
$5,000,000 Counterfeiting Plot, The1914Crime
$5,000,000 Counterfeiting Plot, The1914Thriller
$50,000 Jewel Theft, The1915Short
$50,000 Reward1924Western
$500 Reward, The1911Comedy
$500 Reward, The1911Short
$500,000 Reward1911Comedy
\n", + "
nameyeargenre
$1,000 Reward1923Western
$10,000 Under a Pillow1921Animation
$10,000 Under a Pillow1921Comedy
$10,000 Under a Pillow1921Short
$100,0001915Drama
$1000 a Touchdown1939Comedy
$20,000 Carat, The1913Crime
$20,000 Carat, The1913Drama
$20,000 Carat, The1913Short
$2500 Bride, The1912Drama
$2500 Bride, The1912Romance
$2500 Bride, The1912Short
$5,000 Reward1918Mystery
$5,000,000 Counterfeiting Plot, The1914Crime
$5,000,000 Counterfeiting Plot, The1914Thriller
$50,000 Jewel Theft, The1915Short
$50,000 Reward1924Western
$500 Reward, The1911Comedy
$500 Reward, The1911Short
$500,000 Reward1911Comedy
\n", " \n", " \n", " " ], - "application/kotlindataframe+json": "{\"$version\":\"2.0.0\",\"metadata\":{\"columns\":[\"name\",\"year\",\"genre\"],\"nrow\":92266,\"ncol\":3},\"kotlin_dataframe\":[{\"name\":\"$1,000 Reward\",\"year\":1923,\"genre\":\"Western\"},{\"name\":\"$10,000 Under a Pillow\",\"year\":1921,\"genre\":\"Animation\"},{\"name\":\"$10,000 Under a Pillow\",\"year\":1921,\"genre\":\"Comedy\"},{\"name\":\"$10,000 Under a Pillow\",\"year\":1921,\"genre\":\"Short\"},{\"name\":\"$100,000\",\"year\":1915,\"genre\":\"Drama\"},{\"name\":\"$1000 a Touchdown\",\"year\":1939,\"genre\":\"Comedy\"},{\"name\":\"$20,000 Carat, The\",\"year\":1913,\"genre\":\"Crime\"},{\"name\":\"$20,000 Carat, The\",\"year\":1913,\"genre\":\"Drama\"},{\"name\":\"$20,000 Carat, The\",\"year\":1913,\"genre\":\"Short\"},{\"name\":\"$2500 Bride, The\",\"year\":1912,\"genre\":\"Drama\"},{\"name\":\"$2500 Bride, The\",\"year\":1912,\"genre\":\"Romance\"},{\"name\":\"$2500 Bride, The\",\"year\":1912,\"genre\":\"Short\"},{\"name\":\"$5,000 Reward\",\"year\":1918,\"genre\":\"Mystery\"},{\"name\":\"$5,000,000 Counterfeiting Plot, The\",\"year\":1914,\"genre\":\"Crime\"},{\"name\":\"$5,000,000 Counterfeiting Plot, The\",\"year\":1914,\"genre\":\"Thriller\"},{\"name\":\"$50,000 Jewel Theft, The\",\"year\":1915,\"genre\":\"Short\"},{\"name\":\"$50,000 Reward\",\"year\":1924,\"genre\":\"Western\"},{\"name\":\"$500 Reward, The\",\"year\":1911,\"genre\":\"Comedy\"},{\"name\":\"$500 Reward, The\",\"year\":1911,\"genre\":\"Short\"},{\"name\":\"$500,000 Reward\",\"year\":1911,\"genre\":\"Comedy\"}]}" + "application/kotlindataframe+json": "{\"$version\":\"2.1.1\",\"metadata\":{\"columns\":[\"name\",\"year\",\"genre\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"}],\"nrow\":92266,\"ncol\":3},\"kotlin_dataframe\":[{\"name\":\"$1,000 Reward\",\"year\":1923,\"genre\":\"Western\"},{\"name\":\"$10,000 Under a Pillow\",\"year\":1921,\"genre\":\"Animation\"},{\"name\":\"$10,000 Under a Pillow\",\"year\":1921,\"genre\":\"Comedy\"},{\"name\":\"$10,000 Under a Pillow\",\"year\":1921,\"genre\":\"Short\"},{\"name\":\"$100,000\",\"year\":1915,\"genre\":\"Drama\"},{\"name\":\"$1000 a Touchdown\",\"year\":1939,\"genre\":\"Comedy\"},{\"name\":\"$20,000 Carat, The\",\"year\":1913,\"genre\":\"Crime\"},{\"name\":\"$20,000 Carat, The\",\"year\":1913,\"genre\":\"Drama\"},{\"name\":\"$20,000 Carat, The\",\"year\":1913,\"genre\":\"Short\"},{\"name\":\"$2500 Bride, The\",\"year\":1912,\"genre\":\"Drama\"},{\"name\":\"$2500 Bride, The\",\"year\":1912,\"genre\":\"Romance\"},{\"name\":\"$2500 Bride, The\",\"year\":1912,\"genre\":\"Short\"},{\"name\":\"$5,000 Reward\",\"year\":1918,\"genre\":\"Mystery\"},{\"name\":\"$5,000,000 Counterfeiting Plot, The\",\"year\":1914,\"genre\":\"Crime\"},{\"name\":\"$5,000,000 Counterfeiting Plot, The\",\"year\":1914,\"genre\":\"Thriller\"},{\"name\":\"$50,000 Jewel Theft, The\",\"year\":1915,\"genre\":\"Short\"},{\"name\":\"$50,000 Reward\",\"year\":1924,\"genre\":\"Western\"},{\"name\":\"$500 Reward, The\",\"year\":1911,\"genre\":\"Comedy\"},{\"name\":\"$500 Reward, The\",\"year\":1911,\"genre\":\"Short\"},{\"name\":\"$500,000 Reward\",\"year\":1911,\"genre\":\"Comedy\"}]}" }, - "execution_count": 16, + "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], - "execution_count": 16 + "execution_count": 12 }, { "cell_type": "code", @@ -5425,15 +5459,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2024-03-25T15:59:14.095729400Z", - "start_time": "2024-03-25T15:59:12.446142600Z" + "end_time": "2024-10-10T15:57:55.591371400Z", + "start_time": "2024-10-10T15:57:54.617014500Z" } }, "outputs": [ { "data": { "text/html": [ - " \n", " \n", " " ], - "application/kotlindataframe+json": "{\"$version\":\"2.0.0\",\"metadata\":{\"columns\":[\"year\",\"genre\",\"count\"],\"nrow\":752,\"ncol\":3},\"kotlin_dataframe\":[{\"year\":1888,\"genre\":\"Short\",\"count\":2},{\"year\":1890,\"genre\":\"Short\",\"count\":3},{\"year\":1891,\"genre\":\"Short\",\"count\":2},{\"year\":1892,\"genre\":\"Animation\",\"count\":3},{\"year\":1892,\"genre\":\"Comedy\",\"count\":1},{\"year\":1892,\"genre\":\"Documentary\",\"count\":1},{\"year\":1892,\"genre\":\"Romance\",\"count\":1},{\"year\":1892,\"genre\":\"Short\",\"count\":4},{\"year\":1893,\"genre\":\"Short\",\"count\":1},{\"year\":1894,\"genre\":\"Comedy\",\"count\":1},{\"year\":1894,\"genre\":\"Documentary\",\"count\":16},{\"year\":1894,\"genre\":\"Drama\",\"count\":1},{\"year\":1894,\"genre\":\"Short\",\"count\":31},{\"year\":1895,\"genre\":\"Animation\",\"count\":1},{\"year\":1895,\"genre\":\"Comedy\",\"count\":4},{\"year\":1895,\"genre\":\"Documentary\",\"count\":27},{\"year\":1895,\"genre\":\"Drama\",\"count\":1},{\"year\":1895,\"genre\":\"Sci-Fi\",\"count\":1},{\"year\":1895,\"genre\":\"Short\",\"count\":44},{\"year\":1896,\"genre\":\"Comedy\",\"count\":21}]}" + "application/kotlindataframe+json": "{\"$version\":\"2.1.1\",\"metadata\":{\"columns\":[\"year\",\"genre\",\"count\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"}],\"nrow\":752,\"ncol\":3},\"kotlin_dataframe\":[{\"year\":1888,\"genre\":\"Short\",\"count\":2},{\"year\":1890,\"genre\":\"Short\",\"count\":3},{\"year\":1891,\"genre\":\"Short\",\"count\":2},{\"year\":1892,\"genre\":\"Animation\",\"count\":3},{\"year\":1892,\"genre\":\"Comedy\",\"count\":1},{\"year\":1892,\"genre\":\"Documentary\",\"count\":1},{\"year\":1892,\"genre\":\"Romance\",\"count\":1},{\"year\":1892,\"genre\":\"Short\",\"count\":4},{\"year\":1893,\"genre\":\"Short\",\"count\":1},{\"year\":1894,\"genre\":\"Comedy\",\"count\":1},{\"year\":1894,\"genre\":\"Documentary\",\"count\":16},{\"year\":1894,\"genre\":\"Drama\",\"count\":1},{\"year\":1894,\"genre\":\"Short\",\"count\":31},{\"year\":1895,\"genre\":\"Animation\",\"count\":1},{\"year\":1895,\"genre\":\"Comedy\",\"count\":4},{\"year\":1895,\"genre\":\"Documentary\",\"count\":27},{\"year\":1895,\"genre\":\"Drama\",\"count\":1},{\"year\":1895,\"genre\":\"Sci-Fi\",\"count\":1},{\"year\":1895,\"genre\":\"Short\",\"count\":44},{\"year\":1896,\"genre\":\"Comedy\",\"count\":21}]}" }, - "execution_count": 17, + "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], - "execution_count": 17 + "execution_count": 13 }, { "cell_type": "code", @@ -6110,8 +6144,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2024-03-25T15:59:16.840420600Z", - "start_time": "2024-03-25T15:59:14.146594400Z" + "end_time": "2024-10-10T15:57:56.981656300Z", + "start_time": "2024-10-10T15:57:56.414173300Z" } }, "outputs": [ @@ -6122,10 +6156,10 @@ " <head>\n", " <meta charset="UTF-8">\n", " <style> html, body { margin: 0; overflow: hidden; } </style>\n", - " <script type="text/javascript" data-lets-plot-script="library" src="https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.2.0/js-package/distr/lets-plot.min.js"></script>\n", + " <script type="text/javascript" data-lets-plot-script="library" src="https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.3.3/js-package/distr/lets-plot.min.js"></script>\n", " </head>\n", " <body>\n", - " <div id="hdq5Nu"></div>\n", + " <div id="l9bYOC"></div>\n", " <script type="text/javascript" data-lets-plot-script="plot">\n", " var plotSpec={\n", ""mapping":{\n", @@ -6171,11 +6205,11 @@ "}\n", "}]\n", "};\n", - " var plotContainer = document.getElementById("hdq5Nu");\n", + " var plotContainer = document.getElementById("l9bYOC");\n", " LetsPlot.buildPlotFromProcessedSpecs(plotSpec, -1, -1, plotContainer);\n", " </script>\n", " </body>\n", - "</html>\"> \n", + "</html>\"> \n", " \n", - " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " 1,890\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " 1,895\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " 1,900\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " 1,905\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " 1,890\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " 1,910\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " 1,895\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " 1,915\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " 1,900\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " 1,920\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " 1,905\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " 1,925\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " 1,910\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " 1,930\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " 1,915\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " 1,935\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " 1,920\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " 1,940\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " 1,925\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " Short\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " 1,930\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " Animation\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " 1,935\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " Comedy\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " 1,940\n", + " \n", + " \n", " \n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " Documentary\n", - " \n", + " \n", + " \n", + " \n", + " \n", + " Short\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " Romance\n", - " \n", + " \n", + " \n", + " \n", + " Animation\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " Drama\n", - " \n", + " \n", + " \n", + " \n", + " Comedy\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " Sci-Fi\n", - " \n", + " \n", + " \n", + " \n", + " Documentary\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " Crime\n", - " \n", + " \n", + " \n", + " \n", + " Romance\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " Horror\n", - " \n", + " \n", + " \n", + " \n", + " Drama\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " Fantasy\n", - " \n", + " \n", + " \n", + " \n", + " Sci-Fi\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " War\n", - " \n", + " \n", + " \n", + " \n", + " Crime\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " Adventure\n", - " \n", + " \n", + " \n", + " \n", + " Horror\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " Family\n", - " \n", + " \n", + " \n", + " \n", + " Fantasy\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " Western\n", - " \n", + " \n", + " \n", + " \n", + " War\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " Action\n", - " \n", + " \n", + " \n", + " \n", + " Adventure\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " Music\n", - " \n", + " \n", + " \n", + " \n", + " Family\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " Mystery\n", - " \n", + " \n", + " \n", + " \n", + " Western\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " Musical\n", - " \n", + " \n", + " \n", + " \n", + " Action\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " Adult\n", - " \n", + " \n", + " \n", + " \n", + " Music\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " Thriller\n", - " \n", + " \n", + " \n", + " \n", + " Mystery\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " Film-Noir\n", - " \n", + " \n", + " \n", + " \n", + " Musical\n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " Adult\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " Thriller\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " Film-Noir\n", + " \n", + " \n", " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", " genre\n", " \n", " \n", - " \n", + " \n", " \n", " year\n", " \n", @@ -7400,7 +7452,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " count\n", " \n", @@ -7493,7 +7545,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " genre\n", " \n", @@ -7925,10 +7977,10 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", "\n", - " " + " " ], "application/plot+json": { "output_type": "lets_plot_spec", @@ -10252,12 +10304,12 @@ "swing_enabled": true } }, - "execution_count": 18, + "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], - "execution_count": 18 + "execution_count": 14 }, { "cell_type": "code", @@ -10265,23 +10317,23 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2024-03-25T15:59:23.528800Z", - "start_time": "2024-03-25T15:59:16.852382800Z" + "end_time": "2024-10-10T15:58:01.747454700Z", + "start_time": "2024-10-10T15:57:58.260040800Z" } }, "outputs": [ { "data": { "text/plain": [ - "C:\\Users\\zaleslaw\\IdeaProjects\\KotlinDataFrame-SQL-Examples\\notebooks\\lets-plot-images\\ff.png" + "C:\\Users\\zaleslaw\\IdeaProjects\\KotlinDataFrame-SQL-Examples\\notebooks\\lets-plot-images\\exported_plot.png" ] }, - "execution_count": 19, + "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], - "execution_count": 19 + "execution_count": 15 }, { "cell_type": "markdown", @@ -10326,25 +10378,94 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2024-03-25T15:59:26.045756900Z", - "start_time": "2024-03-25T15:59:23.532425100Z" + "end_time": "2024-10-10T15:58:02.154191300Z", + "start_time": "2024-10-10T15:58:01.876108Z" } }, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "name: String?\n", - "year: Int?\n", - "rank: Float?\n", - "genres: String?\r\n" + "ename": "org.jetbrains.kotlinx.jupyter.exceptions.ReplCompilerException", + "evalue": "Line_41.jupyter.kts (20:81 - 91) Type mismatch: inferred type is Connection! but DbType was expected", + "output_type": "error", + "traceback": [ + "org.jetbrains.kotlinx.jupyter.exceptions.ReplCompilerException: Line_41.jupyter.kts (20:81 - 91) Type mismatch: inferred type is Connection! but DbType was expected", + "\tat org.jetbrains.kotlinx.jupyter.repl.impl.JupyterCompilerImpl.compileSync(JupyterCompilerImpl.kt:201)", + "\tat org.jetbrains.kotlinx.jupyter.repl.impl.InternalEvaluatorImpl.eval(InternalEvaluatorImpl.kt:126)", + "\tat org.jetbrains.kotlinx.jupyter.repl.impl.CellExecutorImpl$execute$1$result$1.invoke(CellExecutorImpl.kt:80)", + "\tat org.jetbrains.kotlinx.jupyter.repl.impl.CellExecutorImpl$execute$1$result$1.invoke(CellExecutorImpl.kt:78)", + "\tat org.jetbrains.kotlinx.jupyter.repl.impl.ReplForJupyterImpl.withHost(ReplForJupyterImpl.kt:742)", + "\tat org.jetbrains.kotlinx.jupyter.repl.impl.CellExecutorImpl.execute-L4Nmkdk(CellExecutorImpl.kt:78)", + "\tat org.jetbrains.kotlinx.jupyter.repl.execution.CellExecutor$DefaultImpls.execute-L4Nmkdk$default(CellExecutor.kt:13)", + "\tat org.jetbrains.kotlinx.jupyter.repl.impl.ReplForJupyterImpl.evaluateUserCode-wNURfNM(ReplForJupyterImpl.kt:565)", + "\tat org.jetbrains.kotlinx.jupyter.repl.impl.ReplForJupyterImpl.evalExImpl(ReplForJupyterImpl.kt:423)", + "\tat org.jetbrains.kotlinx.jupyter.repl.impl.ReplForJupyterImpl.access$evalExImpl(ReplForJupyterImpl.kt:139)", + "\tat org.jetbrains.kotlinx.jupyter.repl.impl.ReplForJupyterImpl$evalEx$1.invoke(ReplForJupyterImpl.kt:416)", + "\tat org.jetbrains.kotlinx.jupyter.repl.impl.ReplForJupyterImpl$evalEx$1.invoke(ReplForJupyterImpl.kt:415)", + "\tat org.jetbrains.kotlinx.jupyter.repl.impl.ReplForJupyterImpl.withEvalContext(ReplForJupyterImpl.kt:396)", + "\tat org.jetbrains.kotlinx.jupyter.repl.impl.ReplForJupyterImpl.evalEx(ReplForJupyterImpl.kt:415)", + "\tat org.jetbrains.kotlinx.jupyter.messaging.IdeCompatibleMessageRequestProcessor$processExecuteRequest$1$response$1$1.invoke(IdeCompatibleMessageRequestProcessor.kt:170)", + "\tat org.jetbrains.kotlinx.jupyter.messaging.IdeCompatibleMessageRequestProcessor$processExecuteRequest$1$response$1$1.invoke(IdeCompatibleMessageRequestProcessor.kt:169)", + "\tat org.jetbrains.kotlinx.jupyter.streams.BlockingSubstitutionEngine.withDataSubstitution(SubstitutionEngine.kt:70)", + "\tat org.jetbrains.kotlinx.jupyter.streams.StreamSubstitutionManager.withSubstitutedStreams(StreamSubstitutionManager.kt:118)", + "\tat org.jetbrains.kotlinx.jupyter.messaging.IdeCompatibleMessageRequestProcessor.withForkedIn(IdeCompatibleMessageRequestProcessor.kt:342)", + "\tat org.jetbrains.kotlinx.jupyter.messaging.IdeCompatibleMessageRequestProcessor.access$withForkedIn(IdeCompatibleMessageRequestProcessor.kt:66)", + "\tat org.jetbrains.kotlinx.jupyter.messaging.IdeCompatibleMessageRequestProcessor$evalWithIO$1$1.invoke(IdeCompatibleMessageRequestProcessor.kt:356)", + "\tat org.jetbrains.kotlinx.jupyter.streams.BlockingSubstitutionEngine.withDataSubstitution(SubstitutionEngine.kt:70)", + "\tat org.jetbrains.kotlinx.jupyter.streams.StreamSubstitutionManager.withSubstitutedStreams(StreamSubstitutionManager.kt:118)", + "\tat org.jetbrains.kotlinx.jupyter.messaging.IdeCompatibleMessageRequestProcessor.withForkedErr(IdeCompatibleMessageRequestProcessor.kt:331)", + "\tat org.jetbrains.kotlinx.jupyter.messaging.IdeCompatibleMessageRequestProcessor.access$withForkedErr(IdeCompatibleMessageRequestProcessor.kt:66)", + "\tat org.jetbrains.kotlinx.jupyter.messaging.IdeCompatibleMessageRequestProcessor$evalWithIO$1.invoke(IdeCompatibleMessageRequestProcessor.kt:355)", + "\tat org.jetbrains.kotlinx.jupyter.streams.BlockingSubstitutionEngine.withDataSubstitution(SubstitutionEngine.kt:70)", + "\tat org.jetbrains.kotlinx.jupyter.streams.StreamSubstitutionManager.withSubstitutedStreams(StreamSubstitutionManager.kt:118)", + "\tat org.jetbrains.kotlinx.jupyter.messaging.IdeCompatibleMessageRequestProcessor.withForkedOut(IdeCompatibleMessageRequestProcessor.kt:323)", + "\tat org.jetbrains.kotlinx.jupyter.messaging.IdeCompatibleMessageRequestProcessor.evalWithIO(IdeCompatibleMessageRequestProcessor.kt:354)", + "\tat org.jetbrains.kotlinx.jupyter.messaging.IdeCompatibleMessageRequestProcessor$processExecuteRequest$1$response$1.invoke(IdeCompatibleMessageRequestProcessor.kt:169)", + "\tat org.jetbrains.kotlinx.jupyter.messaging.IdeCompatibleMessageRequestProcessor$processExecuteRequest$1$response$1.invoke(IdeCompatibleMessageRequestProcessor.kt:168)", + "\tat org.jetbrains.kotlinx.jupyter.execution.JupyterExecutorImpl$Task.execute(JupyterExecutorImpl.kt:41)", + "\tat org.jetbrains.kotlinx.jupyter.execution.JupyterExecutorImpl$executorThread$1.invoke(JupyterExecutorImpl.kt:81)", + "\tat org.jetbrains.kotlinx.jupyter.execution.JupyterExecutorImpl$executorThread$1.invoke(JupyterExecutorImpl.kt:79)", + "\tat kotlin.concurrent.ThreadsKt$thread$thread$1.run(Thread.kt:30)", + "" ] - }, + } + ], + "execution_count": 16 + }, + { + "cell_type": "code", + "source": [ + "val df = dfTarantinoFilmsRs\n", + " .fillNA { year }\n", + " .with { 0 }\n", + " .convert { year }.toInt()\n" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2024-10-10T15:58:02.165336600Z", + "start_time": "2024-09-17T17:20:59.543586600Z" + } + }, + "outputs": [], + "execution_count": 20 + }, + { + "cell_type": "code", + "source": [ + "df.filter { year > 2000 }" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2024-10-10T15:58:02.183607300Z", + "start_time": "2024-09-17T17:20:59.908374400Z" + } + }, + "outputs": [ { "data": { "text/html": [ - " \n", " \n", - "
nameyearrankgenres
My Best Friend's Birthday19873,900000Comedy,Drama
Reservoir Dogs19928,300000Crime,Mystery,Action,Thriller
"ER"1994nullnull
Pulp Fiction19948,700000Drama,Crime
Four Rooms19955,900000Drama,Comedy
Jackie Brown19977,500000Crime,Drama,Thriller
"Jimmy Kimmel Live"2003nullnull
Kill Bill: Vol. 120038,400000Thriller,Action,Crime
Kill Bill: Vol. 220048,200000Romance,Action,Thriller,Drama
Inglorious Bastards2006nullDrama,War,Action
\n", + "
nameyearrankgenres
"Jimmy Kimmel Live"2003nullnull
Kill Bill: Vol. 120038,400000Crime,Thriller,Action
Kill Bill: Vol. 220048,200000Thriller,Drama,Romance,Action
Inglorious Bastards2006nullWar,Action,Drama
\n", " \n", " \n", " " ], - "application/kotlindataframe+json": "{\"$version\":\"2.0.0\",\"metadata\":{\"columns\":[\"name\",\"year\",\"rank\",\"genres\"],\"nrow\":10,\"ncol\":4},\"kotlin_dataframe\":[{\"name\":\"My Best Friend's Birthday\",\"year\":1987,\"rank\":3.9000000953674316,\"genres\":\"Comedy,Drama\"},{\"name\":\"Reservoir Dogs\",\"year\":1992,\"rank\":8.300000190734863,\"genres\":\"Crime,Mystery,Action,Thriller\"},{\"name\":\"\\\"ER\\\"\",\"year\":1994,\"rank\":null,\"genres\":null},{\"name\":\"Pulp Fiction\",\"year\":1994,\"rank\":8.699999809265137,\"genres\":\"Drama,Crime\"},{\"name\":\"Four Rooms\",\"year\":1995,\"rank\":5.900000095367432,\"genres\":\"Drama,Comedy\"},{\"name\":\"Jackie Brown\",\"year\":1997,\"rank\":7.5,\"genres\":\"Crime,Drama,Thriller\"},{\"name\":\"\\\"Jimmy Kimmel Live\\\"\",\"year\":2003,\"rank\":null,\"genres\":null},{\"name\":\"Kill Bill: Vol. 1\",\"year\":2003,\"rank\":8.399999618530273,\"genres\":\"Thriller,Action,Crime\"},{\"name\":\"Kill Bill: Vol. 2\",\"year\":2004,\"rank\":8.199999809265137,\"genres\":\"Romance,Action,Thriller,Drama\"},{\"name\":\"Inglorious Bastards\",\"year\":2006,\"rank\":null,\"genres\":\"Drama,War,Action\"}]}" + "application/kotlindataframe+json": "{\"$version\":\"2.1.1\",\"metadata\":{\"columns\":[\"name\",\"year\",\"rank\",\"genres\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Float?\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String?\"}],\"nrow\":4,\"ncol\":4},\"kotlin_dataframe\":[{\"name\":\"\\\"Jimmy Kimmel Live\\\"\",\"year\":2003,\"rank\":null,\"genres\":null},{\"name\":\"Kill Bill: Vol. 1\",\"year\":2003,\"rank\":8.4,\"genres\":\"Crime,Thriller,Action\"},{\"name\":\"Kill Bill: Vol. 2\",\"year\":2004,\"rank\":8.2,\"genres\":\"Thriller,Drama,Romance,Action\"},{\"name\":\"Inglorious Bastards\",\"year\":2006,\"rank\":null,\"genres\":\"War,Action,Drama\"}]}" }, - "execution_count": 20, + "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], - "execution_count": 20 - }, - { - "cell_type": "code", - "source": [ - "val df = dfTarantinoFilmsRs\n", - " .fillNA { year }\n", - " .with { 0 }\n", - " .convert { year }.toInt()\n" - ], - "metadata": { - "collapsed": false, - "ExecuteTime": { - "end_time": "2024-03-25T15:59:27.412102300Z", - "start_time": "2024-03-25T15:59:26.056728100Z" - } - }, - "outputs": [], "execution_count": 21 }, { - "cell_type": "code", - "source": [ - "df.filter { year > 2000 }" - ], "metadata": { - "collapsed": false, "ExecuteTime": { - "end_time": "2024-03-25T15:59:27.887089900Z", - "start_time": "2024-03-25T15:59:27.426065300Z" + "end_time": "2024-10-10T15:58:02.185284100Z", + "start_time": "2024-09-17T17:21:00.066949800Z" } }, - "outputs": [ - { - "data": { - "text/html": [ - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
nameyearrankgenres
"Jimmy Kimmel Live"2003nullnull
Kill Bill: Vol. 120038,400000Thriller,Action,Crime
Kill Bill: Vol. 220048,200000Romance,Action,Thriller,Drama
Inglorious Bastards2006nullDrama,War,Action
\n", - " \n", - " \n", - " " - ], - "application/kotlindataframe+json": "{\"$version\":\"2.0.0\",\"metadata\":{\"columns\":[\"name\",\"year\",\"rank\",\"genres\"],\"nrow\":4,\"ncol\":4},\"kotlin_dataframe\":[{\"name\":\"\\\"Jimmy Kimmel Live\\\"\",\"year\":2003,\"rank\":null,\"genres\":null},{\"name\":\"Kill Bill: Vol. 1\",\"year\":2003,\"rank\":8.399999618530273,\"genres\":\"Thriller,Action,Crime\"},{\"name\":\"Kill Bill: Vol. 2\",\"year\":2004,\"rank\":8.199999809265137,\"genres\":\"Romance,Action,Thriller,Drama\"},{\"name\":\"Inglorious Bastards\",\"year\":2006,\"rank\":null,\"genres\":\"Drama,War,Action\"}]}" - }, - "execution_count": 22, - "metadata": {}, - "output_type": "execute_result" - } - ], - "execution_count": 22 + "cell_type": "code", + "source": "", + "outputs": [], + "execution_count": null } ], "metadata": { diff --git a/settings.gradle.kts b/settings.gradle.kts index 2c75297..350b0ad 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,3 +1,10 @@ +pluginManagement { + repositories { + mavenLocal() + gradlePluginPortal() + } +} + plugins { id("org.gradle.toolchains.foojay-resolver-convention") version "0.5.0" } diff --git a/src/main/kotlin/Example_1_Define_schema_manually.kt b/src/main/kotlin/Example_1_Define_schema_manually.kt index 2329953..583717b 100644 --- a/src/main/kotlin/Example_1_Define_schema_manually.kt +++ b/src/main/kotlin/Example_1_Define_schema_manually.kt @@ -8,20 +8,20 @@ import org.jetbrains.kotlinx.dataframe.api.cast import org.jetbrains.kotlinx.dataframe.api.sortByDesc import org.jetbrains.kotlinx.dataframe.api.print import org.jetbrains.kotlinx.dataframe.api.take +import org.jetbrains.kotlinx.dataframe.io.DbConnectionConfig import org.jetbrains.kotlinx.dataframe.io.readSqlTable -import org.jetbrains.kotlinx.dataframe.io.DatabaseConfiguration @DataSchema interface Movies { val id: Int - val name: String? - val year: Int? + val name: String + val year: Int val rank: Float? } fun main() { // define the database configuration - val dbConfig = DatabaseConfiguration(URL, USER_NAME, PASSWORD) + val dbConfig = DbConnectionConfig(URL, USER_NAME, PASSWORD) // read the table val movies = DataFrame.readSqlTable(dbConfig, TABLE_NAME_MOVIES, 10000).cast(verify=true) diff --git a/src/main/kotlin/Example_2_Import_schema_annotation.kt b/src/main/kotlin/Example_2_Import_schema_annotation.kt index 2a94a52..bfeff26 100644 --- a/src/main/kotlin/Example_2_Import_schema_annotation.kt +++ b/src/main/kotlin/Example_2_Import_schema_annotation.kt @@ -4,6 +4,12 @@ jdbcOptions = JdbcOptions(USER_NAME, PASSWORD, tableName = TABLE_NAME_DIRECTORS) ) +/*@file:ImportDataSchema( + "NewActors", + URL, + jdbcOptions = JdbcOptions("DB_USER", "DB_PASSWORD", extractCredFromEnv = true, sqlQuery = ACTORS_IN_LATEST_MOVIES) +)*/ + @file:ImportDataSchema( "NewActors", URL, @@ -23,16 +29,16 @@ import org.jetbrains.kotlinx.dataframe.api.count import org.jetbrains.kotlinx.dataframe.io.readSqlQuery import org.jetbrains.kotlinx.dataframe.io.readSqlTable import org.jetbrains.kotlinx.dataframe.api.take -import org.jetbrains.kotlinx.dataframe.io.DatabaseConfiguration +import org.jetbrains.kotlinx.dataframe.io.DbConnectionConfig fun main() { // Part 1: Reading the table `directors` // define the database configuration - val dbConfig = DatabaseConfiguration(URL, USER_NAME, PASSWORD) + val dbConfig = DbConnectionConfig(URL, USER_NAME, PASSWORD) // read the table - val directors = DataFrame.readSqlTable(dbConfig, TABLE_NAME_DIRECTORS, 1000).cast(verify=true) + val directors = DataFrame.readSqlTable(dbConfig, TABLE_NAME_DIRECTORS, 1000).cast() // manipulate and print directors.filter { firstName != null && firstName!!.contains("A") } @@ -42,7 +48,7 @@ fun main() { // Part 2: Handle the table results of an SQL query // read the data - val newActors = DataFrame.readSqlQuery(dbConfig, ACTORS_IN_LATEST_MOVIES).cast(verify=true) + val newActors = DataFrame.readSqlQuery(dbConfig, ACTORS_IN_LATEST_MOVIES).cast() newActors.print() // build a report of different roles' popularity diff --git a/src/main/kotlin/Example_3_Import_schema_via_Gradle.kt b/src/main/kotlin/Example_3_Import_schema_via_Gradle.kt index d4c09a1..dc20144 100644 --- a/src/main/kotlin/Example_3_Import_schema_via_Gradle.kt +++ b/src/main/kotlin/Example_3_Import_schema_via_Gradle.kt @@ -7,6 +7,8 @@ import org.jetbrains.kotlinx.dataframe.api.cast import org.jetbrains.kotlinx.dataframe.api.describe import org.jetbrains.kotlinx.dataframe.api.filter import org.jetbrains.kotlinx.dataframe.api.print +import org.jetbrains.kotlinx.dataframe.io.db.DbType +import org.jetbrains.kotlinx.dataframe.io.db.MySql import org.jetbrains.kotlinx.dataframe.io.getSchemaForResultSet import org.jetbrains.kotlinx.dataframe.io.getSchemaForSqlQuery import org.jetbrains.kotlinx.dataframe.io.getSchemaForSqlTable @@ -40,14 +42,16 @@ fun main() { println("---------------------------- Part 1: SQL Table ------------------------------------") DriverManager.getConnection(URL, props).use { connection -> // read the data from the SQL table - val actors = DataFrame.readSqlTable(connection, TABLE_NAME_ACTORS, 100).cast(verify=true) + val actors = DataFrame.readSqlTable(connection, TABLE_NAME_ACTORS, 100).cast() + + // TODO: .cast(verify=true) actors.print() // filter and print the data actors.filter { firstName!=null && firstName!!.contains("J") }.print() // extract the schema of the SQL table - val actorSchema = DataFrame.getSchemaForSqlTable(connection, TABLE_NAME_ACTORS) + val actorSchema = DataFrame.getSchemaForSqlTable(connection, TABLE_NAME_ACTORS) actorSchema.print() } @@ -55,7 +59,8 @@ fun main() { println("---------------------------- Part 2: SQL Query ------------------------------------") DriverManager.getConnection(URL, props).use { connection -> // read the data from as a result of an executed SQL query - val tarantinoFilms = DataFrame.readSqlQuery(connection, TARANTINO_FILMS_SQL_QUERY, 100).cast(verify=true) + val tarantinoFilms = DataFrame.readSqlQuery(connection, TARANTINO_FILMS_SQL_QUERY, 100).cast() + //TODO: .cast(verify=true) tarantinoFilms.print() // transform and print the data @@ -72,14 +77,14 @@ fun main() { connection.createStatement().use { st -> st.executeQuery(TARANTINO_FILMS_SQL_QUERY).use { rs -> // read the data from as a result of an executed SQL query - val tarantinoFilms = DataFrame.readResultSet(rs, connection, 100).cast(verify=true) + val tarantinoFilms = DataFrame.readResultSet(rs, dbType = MySql, 100).cast() + // TODO: .cast(verify=true) tarantinoFilms.print() - // transform and print the data tarantinoFilms.filter { year!= null && year!! > 2000 }.print() // extract the schema of the SQL table - val tarantinoFilmsSchema = DataFrame.getSchemaForResultSet(rs, connection) + val tarantinoFilmsSchema = DataFrame.getSchemaForResultSet(rs, dbType = MySql) tarantinoFilmsSchema.print() } } @@ -89,7 +94,7 @@ fun main() { // with an explicit announcement of the Connection object from the JDBC driver. println("---------------------------- Part 4: readAllSqlTables ------------------------------------") DriverManager.getConnection(URL, props).use { connection -> - val dataFrames = DataFrame.readAllSqlTables(connection, limit = 100) + val dataFrames = DataFrame.readAllSqlTables(connection, limit = 100).values dataFrames.forEach { it.print() it.describe() diff --git a/src/main/kotlin/customdb/Example_1_Define_schema_manually.kt b/src/main/kotlin/customdb/Example_1_Define_schema_manually.kt new file mode 100644 index 0000000..b80acbd --- /dev/null +++ b/src/main/kotlin/customdb/Example_1_Define_schema_manually.kt @@ -0,0 +1,35 @@ +package org.jetbrains.kotlinx.dataframe.examples.jdbc.customdb + +import customdb.HSQLDB +import org.jetbrains.kotlinx.dataframe.annotations.DataSchema +import org.jetbrains.kotlinx.dataframe.api.* +import org.jetbrains.kotlinx.dataframe.impl.DELIMITERS_REGEX +import org.jetbrains.kotlinx.dataframe.impl.toCamelCaseByDelimiters +import org.jetbrains.kotlinx.dataframe.io.readDataFrame +import java.sql.DriverManager +import java.util.* + +@DataSchema +interface Orders { + val id: Int + val item: String + val price: Double + val orderDate: java.util.Date +} + +//https://www.tutorialspoint.com/hsqldb/hsqldb_quick_guide.htm +// CMD> java -classpath lib/hsqldb.jar org.hsqldb.server.Server --database.0 file:hsqldb/demodb --dbname.0 testdb +fun main() { + DriverManager.getConnection(URL, USER_NAME, PASSWORD).use { con -> + createAndPopulateTable(con) + + val df = con.readDataFrame("SELECT * FROM orders", dbType = HSQLDB).rename { + all() + }.into { it.name.lowercase(Locale.getDefault()).toCamelCaseByDelimiters(DELIMITERS_REGEX)} + .cast(verify=true) + + df.filter { it.price > 800 }.print() + + removeTable(con) + } +} diff --git a/src/main/kotlin/customdb/HSQLDB.kt b/src/main/kotlin/customdb/HSQLDB.kt new file mode 100644 index 0000000..f1809ec --- /dev/null +++ b/src/main/kotlin/customdb/HSQLDB.kt @@ -0,0 +1,45 @@ +package customdb + +import org.jetbrains.kotlinx.dataframe.io.TableColumnMetadata +import org.jetbrains.kotlinx.dataframe.io.TableMetadata +import org.jetbrains.kotlinx.dataframe.io.db.DbType +import org.jetbrains.kotlinx.dataframe.schema.ColumnSchema +import java.sql.ResultSet +import java.util.Locale +import kotlin.reflect.KType + +/** + * Represents the HSQLDB database type. + * + * This class provides methods to convert data from a ResultSet to the appropriate type for HSQLDB, + * and to generate the corresponding column schema. + */ +public object HSQLDB : DbType("hsqldb") { + override val driverClassName: String + get() = "org.hsqldb.jdbcDriver" + + override fun convertSqlTypeToColumnSchemaValue(tableColumnMetadata: TableColumnMetadata): ColumnSchema? { + return null + } + + override fun isSystemTable(tableMetadata: TableMetadata): Boolean { + val locale = Locale.getDefault() + fun String?.containsWithLowercase(substr: String) = this?.lowercase(locale)?.contains(substr) == true + val schemaName = tableMetadata.schemaName + val name = tableMetadata.name + return schemaName.containsWithLowercase("information_schema") || + schemaName.containsWithLowercase("system") || + name.containsWithLowercase("system_") + } + + override fun buildTableMetadata(tables: ResultSet): TableMetadata = + TableMetadata( + tables.getString("TABLE_NAME"), + tables.getString("TABLE_SCHEM"), + tables.getString("TABLE_CAT"), + ) + + override fun convertSqlTypeToKType(tableColumnMetadata: TableColumnMetadata): KType? { + return null + } +} diff --git a/src/main/kotlin/customdb/hsqldbUtils.kt b/src/main/kotlin/customdb/hsqldbUtils.kt new file mode 100644 index 0000000..4e1e663 --- /dev/null +++ b/src/main/kotlin/customdb/hsqldbUtils.kt @@ -0,0 +1,36 @@ +package org.jetbrains.kotlinx.dataframe.examples.jdbc.customdb + +import java.sql.Connection + +const val URL = "jdbc:hsqldb:hsql://localhost/testdb" +const val USER_NAME = "SA" +const val PASSWORD = "" + + +fun removeTable(con: Connection): Int { + val stmt = con.createStatement() + return stmt.executeUpdate("""DROP TABLE orders""") +} + +fun createAndPopulateTable(con: Connection) { + var stmt = con.createStatement() + stmt.executeUpdate( + """CREATE TABLE IF NOT EXISTS orders ( + id INT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, + item VARCHAR(50) NOT NULL, + price DOUBLE NOT NULL, + order_date DATE + ); + """.trimIndent() + ) + + stmt.executeUpdate( + """INSERT INTO orders (item, price, order_date) + VALUES ('Laptop', 1500.00, NOW())""".trimIndent() + ) + + stmt.executeUpdate( + """INSERT INTO orders (item, price, order_date) + VALUES ('Smartphone', 700.00, NOW())""".trimIndent() + ) +} \ No newline at end of file