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.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99dd29ed28c4efb4edb9243516440a222d8c6af2f41840ef11f74f55b5465769 |
|
MD5 | ab771d39b592f89a42adf96c2623d337 |
|
BLAKE2b-256 | 7107619680bb86db87442881c51d3502c3f70d0ec5d2cdf472be33ca906c8d18 |
Close
Hashes for spark_dataframe_tools-0.6.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42b5c3b5233c79137c9ea28bcd41b05ed78fa04c4a93817b8381a839aae90ed8 |
|
MD5 | dc6ae1b1283ee0b2898c0cae67396f86 |
|
BLAKE2b-256 | 30695e3d13103bbbf2221e7e8f516df91efd1fc9842e48bc35599ceb328b163c |