Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

delta lake with spark

# Import Delta Table
from deltalake import DeltaTable

# Read the Delta Table using the Rust API
dt = DeltaTable("../rust/tests/data/simple_table")

# Create a Pandas Dataframe by initially converting the Delta Lake
# table into a PyArrow table
df = dt.to_pyarrow_table().to_pandas()
# Query the Pandas table
Df

# Example output
0	5
1	7
2	9

You can also use Time Travel and load a previous version of the Delta table by specifying the version number by using the load_version method.

# Load version 2 of the table
dt.load_version(2)
Comment

PREVIOUS NEXT
Code Example
Python :: Tree : Top View 
Python :: turtle screen close error fix 
Python :: how to install opencv for python 3.7.3 
Python :: vectorized function 
Python :: Basic 13 Algorithm 
Python :: map column dataframe python 
Python :: Horizontal concatication 
Python :: python matrices access row 
Python :: How to Use the abs() Function with a Complex Number Argument 
Python :: python get favicon from url 
Python :: unpack list 
Python :: how to choose a random key from a dictionary in python 
Python :: index is datetime and i want the row number 
Python :: how to resize image with pillow in django 
Python :: passport parsing python 
Python :: iptc text classification example 
Python :: houghlinesp python stackoverflow 
Python :: shorten all floats in a list 
Python :: print fps in while loop python 
Python :: python tqdm seet width 
Python :: how to wirte something 100 times with python 
Python :: scrapy itemloader example 
Python :: Perform a right outer join of self and other. 
Python :: Applies the f function to all Row 
Python :: assigning a value to a character in string or text file in python 
Python :: specify dtype when creating array 
Python :: comment a lot of lines python vscode 
Python :: fill misssing values using sklrean 
Python :: Recursive Folder scan 
Python :: introduction to sets python3 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =