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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 353e1f17b84cdfdaf0de3e7411acc1ee8e752f687134e113028809088bb99701 |
|
MD5 | 74342ae5f2c344013414d1da14d90f1c |
|
BLAKE2b-256 | ec2a88c2ec73233d7a316a421bd6c844153c808af2f516c54af787827a91425f |
Close
Hashes for spark_dataframe_tools-0.6.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5391337a68924f55097a6366cf1c7feb7e53e69a5f5979666e30efcbdb1adc0b |
|
MD5 | 4b0b15ae2a45ae42a1680bd9fad71f5b |
|
BLAKE2b-256 | d255739a64adf127c398834a1b7269215feb2aaacad0e33f7c25c8de1873d8ba |