spark_dataframe_tools
Project description
spark_dataframe_tools
spark_dataframe_tools is a Python library that implements styles in the Dataframe
Installation
The code is packaged for PyPI, so that the installation consists in running:
pip install spark-dataframe-tools --user --upgrade
Usage
import spark_dataframe_tools
from pyspark.sql.types import StructType,StructField, StringType, IntegerType
data2 = [("James","","Smith","36636","M",3000),
("Michael","Rose","","40288","M",4000),
("Robert","","Williams","42114","M",4000),
("Maria","Anne","Jones","39192","F",4000),
("Jen","Mary","Brown","","F",-1)
]
schema = StructType([ \
StructField("firstname",StringType(),True), \
StructField("middlename",StringType(),True), \
StructField("lastname",StringType(),True), \
StructField("id", StringType(), True), \
StructField("gender", StringType(), True), \
StructField("salary", IntegerType(), True) \
])
df = spark.createDataFrame(data=data2, schema=schema)
Pandas
df_pandas = df.toPandas()
df_pandas.show2()
Spark
# Dataframe template table
df.show2()
# Dataframe memory usage
df.size()
License
New features v1.0
BugFix
- choco install visualcpp-build-tools
Reference
- Jonathan Quiza github.
- Jonathan Quiza RumiMLSpark.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for spark_dataframe_tools-0.5.9.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7cbdbea3b7435107c334f3af6641efa81dadd473fa8fd6a6e8a2a1450fff3209 |
|
MD5 | f36155950a7e8bfd1ce014e83c869810 |
|
BLAKE2b-256 | a24ad8b84ba249ff2b9759237a010bfc63302b5d16ddc26768f3d10c301beb05 |
Close
Hashes for spark_dataframe_tools-0.5.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 428094134a36963f49da09934969fa9d8b6f1c5f7ec7b34e32ad60f1d863ae35 |
|
MD5 | 9178b831b1d2ba9d0074a3150dd16dc3 |
|
BLAKE2b-256 | e105e9af286ac3fc60a867c50617a1fef2776a56dd3d7eaa6c30b11d12cffbd2 |