Skip to content
Search

Select / Drop

Back
Table of Contents

Select

Keep only the listed columns with DataFrame::select():

<?php 

data_frame()
    ->read(from_array([['id' => 1, 'name' => 'Norbert', 'email' => 'norbert@example.com']]))
    ->select("id", "name")
    ->write(to_output())
    ->run();

Drop

Remove the listed columns with DataFrame::drop():

<?php 

data_frame()
    ->read(from_array([['id' => 1, 'name' => 'Norbert', '_tags' => 'internal']]))
    ->drop("_tags")
    ->write(to_output())
    ->run();

Found a typo or an outdated section? Edit this page on GitHub


Contributors

Built in the open.

Join us on GitHub
scroll back to top