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.8.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9b8a9d96ad94e1af095e4fe94cec20e4a9ba62300843b4b4b070ec04e6f407a |
|
MD5 | 02f25c3f0cf0029090f54f1456edfaa6 |
|
BLAKE2b-256 | 9009ab63ad6a32416de8713a54b476b362a38e9b3b9b68e5001329de9b07090e |
Close
Hashes for spark_dataframe_tools-0.6.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | adf8250dad982d7e0d8d50170a0a0bebb85d318badec2a730938ee3654a212d5 |
|
MD5 | 252a872f2813425d95bef2a2ca634a5d |
|
BLAKE2b-256 | a93df3d86fa2d7cfeb8161ce05f53f06f24c4f8c7cb033b3e1ca4958c2eccf83 |