This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
# read image | |
img = cv2.imread('Lenna.png') | |
# convert to grayscale | |
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Append | |
""" Add single element to end of List""" | |
fruits = ["Apple", "Orange", "Banana"] | |
fruits.append("Mango") | |
# Clear | |
""" Remove all Items from List""" | |
fruits = ["Apple", "Orange", "Banana"] | |
fruits.clear() |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def readTable(tableName: String): DataFrame = { | |
val df = spark | |
.read | |
.format("delta") | |
.load("/opt/partitioned_lake/" + tableName) | |
df | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.spark.sql.delta.DeltaLog | |
import io.delta.tables._ | |
import org.apache.spark.sql.functions._ | |
import org.apache.spark.sql.{SaveMode, SparkSession, DataFrame} | |
def createPartitionedTable(data: DataFrame, tableName: String, Keys: String): Unit = { | |
data | |
.write | |
.partitionBy(Keys) | |
.format("delta") |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder