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.11.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fce6ff97b73819f280bd1389495c39152524178302c40eacdf07dc4ccfb0230e |
|
MD5 | b2ad22e07a0de8b245631e9aa2920a0c |
|
BLAKE2b-256 | 48b074885ddbbf1b22fb8b2745a094587b083c1062f63f09ed560dd5c7af8cf4 |
Close
Hashes for spark_dataframe_tools-0.6.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36ebe7daa156b55a3a413f8c2b5b2ebafd9bf9605dafc389ba2124299f877da6 |
|
MD5 | 22b086ef63ddb25498e5e78f002bf0d9 |
|
BLAKE2b-256 | c2a8149e8e1385d9a0132f76922ba3f85fc690a33ff17ca438e39c55494af529 |