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(7929)
Hadoop in Practice by Alex Holmes(5707)
Jquery UI in Action : Master the concepts Of Jquery UI: A Step By Step Approach by ANMOL GOYAL(5569)
Life 3.0: Being Human in the Age of Artificial Intelligence by Tegmark Max(4605)
Functional Programming in JavaScript by Mantyla Dan(3783)
Big Data Analysis with Python by Ivan Marin(3562)
The Age of Surveillance Capitalism by Shoshana Zuboff(3512)
Test-Driven Development with Java by Alan Mellor(3424)
Data Augmentation with Python by Duc Haba(3267)
Principles of Data Fabric by Sonia Mezzetta(3075)
Blockchain Basics by Daniel Drescher(2964)
Microservices with Spring Boot 3 and Spring Cloud by Magnus Larsson(2861)
Learn Blender Simulations the Right Way by Stephen Pearson(2824)
The Rosie Effect by Graeme Simsion(2792)
WordPress Plugin Development Cookbook by Yannick Lefebvre(2764)
The Infinite Retina by Robert Scoble Irena Cronin(2703)
Hands-On Machine Learning for Algorithmic Trading by Stefan Jansen(2677)
Machine Learning on Kubernetes by Faisal Masood Ross Brigoli(2660)
Applied Predictive Modeling by Max Kuhn & Kjell Johnson(2562)
![](/ebook_detail_files/space.gif)