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.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ce827a066399a05fbc20d02657c93d53c29972861fc54eaf81009a052aa0247 |
|
MD5 | d18dd338848d00eca0d6303ecf63f6e5 |
|
BLAKE2b-256 | 336190c590e8bafc6fd5b1e0be74a8032bf359c7cbdcde2638fb221d9a697fdf |
Close
Hashes for spark_dataframe_tools-0.6.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19f5d508e3c5e0f4dad2efc87e36515b1c184c6e0d736d7266c5eb20494c3329 |
|
MD5 | 3ff4ac7ee8be9282dce426bf9f4852d8 |
|
BLAKE2b-256 | cdd3a59988193ad4b4530717073dff8cf5f27766d86f2ab1bbc0566b5bbca0d8 |