Big Data Analysis with Python by Ivan Marin
Author:Ivan Marin
Language: eng
Format: epub
Publisher: Packt Publishing
Published: 2019-04-07T16:00:00+00:00
In this exercise, we will add a new column in the dataset using the withColumn method, and later, using the drop function, will remove it. Now, let's perform the following steps:
Add a new column in a Spark DataFrame using the withColumn method:df = df.withColumn('Half_sepal_width', df['Sepalwidth']/2.0)
Use the following command to show the dataset with the newly added column:df.show(4)
Figure 4.10: Introducing new column, Half_sepal_width
Now, to remove a column in a Spark DataFrame, use the drop method illustrated here:df = df.drop('Half_sepal_width')
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Computer Vision & Pattern Recognition | Expert Systems |
Intelligence & Semantics | Machine Theory |
Natural Language Processing | Neural Networks |
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8091)
Hadoop in Practice by Alex Holmes(5803)
Jquery UI in Action : Master the concepts Of Jquery UI: A Step By Step Approach by ANMOL GOYAL(5650)
Test-Driven Development with Java by Alan Mellor(5247)
Data Augmentation with Python by Duc Haba(5094)
Life 3.0: Being Human in the Age of Artificial Intelligence by Tegmark Max(4916)
Principles of Data Fabric by Sonia Mezzetta(4903)
Learn Blender Simulations the Right Way by Stephen Pearson(4689)
Microservices with Spring Boot 3 and Spring Cloud by Magnus Larsson(4658)
Big Data Analysis with Python by Ivan Marin(4532)
RPA Solution Architect's Handbook by Sachin Sahgal(4059)
Functional Programming in JavaScript by Mantyla Dan(3887)
The Infinite Retina by Robert Scoble Irena Cronin(3785)
The Age of Surveillance Capitalism by Shoshana Zuboff(3685)
Pretrain Vision and Large Language Models in Python by Emily Webber(3505)
Infrastructure as Code for Beginners by Russ McKendrick(3303)
Deep Learning with PyTorch Lightning by Kunal Sawarkar(3155)
Blockchain Basics by Daniel Drescher(3108)
WordPress Plugin Development Cookbook by Yannick Lefebvre(2968)
