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.14.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9a080273102cd49f9f73a5d6c1d82feb2eb8b596de92d8c2c9edd2a1a491af8 |
|
MD5 | b469ba7f34f229b097e0b01888d55f93 |
|
BLAKE2b-256 | 4580d687eacfd54aff08bfbc7a749413039a5389c9da69ae7be6a6b3e55302bf |
Close
Hashes for spark_dataframe_tools-0.6.14-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a8c12e55b2770df5a567e0696294131131db8f934ead8e33910bb782bb30611 |
|
MD5 | 976d3df3fb3cf941aad596f78133cb75 |
|
BLAKE2b-256 | 39788a079059a7d4de277895ff76d7ac3ac3eccb339cf0079f30f54acac90aa3 |