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.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32823160d9f9bbf8136fcd2ea1441429169f0d9ea5e1e2976cc5108e723acd0d |
|
MD5 | 90e935416c2b0e00c19d81bfa3370a14 |
|
BLAKE2b-256 | 60ec9377115fcc66470a9dc3df54c0e67633f0e822a5cc552f64fc53c09ceaeb |
Close
Hashes for spark_dataframe_tools-0.6.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2fa8673c894cf929e33d5e07ea3fe4984b21e55cabb27c5f8c2f24dd47fb7e0 |
|
MD5 | 96ac3957cfea38748d97ab0db803a1ca |
|
BLAKE2b-256 | fcc0e7b1866e8de3bc8cb8a888fe21a1238d996a674f0507a04e80b14d9cca43 |