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.13.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a3ca218f3070d2cba836a3f088b822c5eeff0f7f19feacc6206a28dbf6ad0ca |
|
MD5 | 8574002e7eef4cf72cc1a0d3fad3c3f5 |
|
BLAKE2b-256 | 0799bfa416b6be62bf299d537e5d87b914b34fd027b0e94479a377981c76b23f |
Close
Hashes for spark_dataframe_tools-0.6.13-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a167e5d7bc95b499bafe534d5e4572e6af829ccbfa7d324a8c61ba9283f4fafd |
|
MD5 | b59bb8c656354da77b46e5d86227228d |
|
BLAKE2b-256 | 351fc091f752ee0c9e36170f14aba179ed01d6f41e2dec0e0b69efffc38be7e2 |