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.6.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11ad55a770403981418f70b812bbfb8ae45c24a124a5cfce396ce3e68c576fb0 |
|
MD5 | 0a8c7de89520f3f81053a6a143986cf8 |
|
BLAKE2b-256 | 501e1dc2e4994ad321b7ca4bab78bebb8a64c15b9b8f4f5de2b8adaf4ec05c06 |
Close
Hashes for spark_dataframe_tools-0.6.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3fb1849182ba6c6a68460c10d235a79ad2512822ee227311c6911e01201405b |
|
MD5 | c7312bc1d4150354e66cd8ae7dc9c6e8 |
|
BLAKE2b-256 | 6b070c2fa052329bf79d71ad95aa8c645ef688d9490830862e01a3d30c1dbc03 |