<jupyter_start><jupyter_text>Introduction to Google Colab  Install Spark<jupyter_code>!apt-get update
!apt-get install openjdk-8-jdk-headless -qq > /dev/null
!wget -q http://archive.apache.org/dist/spark/spark-2.3.1/spark-2.3.1-bin-hadoop2.7.tgz
!tar xf spark-2.3.1-bin-hadoop2.7.tgz
!pip install -q findspark
import os
os.environ["JAVA_HOME"] = "/usr/lib/jvm/java-8-openjdk-amd64"
os.environ["SPARK_HOME"] = "/content/spark-2.3.1-bin-hadoop2.7"
!ls
import findspark
findspark.init()
from pyspark import SparkContext

sc = SparkContext.getOrCreate()
sc
import pyspark
from pyspark.sql import SparkSession
spark = SparkSession.builder.getOrCreate() 
spark<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14181286549707603, 'fraction_numerical': 0.03216374269005848, 'mean_word_length': 5.061946902654867, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '125395', 'license': 'MIT', 'n_tokens_mistral': 289, 'n_tokens_neox': 271, 'n_words': 48, 'path': 'Spark - Apache PySpark by Example/01.GoogleColab - Lab Setup and Download Data/Lab_environment.ipynb', 'repo_name': 'ptyadana/probability-and-statistics-for-business-and-data-science', 'size': '684'}