# 7 summary for your reference heres a table of all the

• Lab Report
• 27
• 97% (92) 89 out of 92 people found this document helpful

This preview shows page 26 - 27 out of 27 pages.

7. Summary For your reference, here's a table of all the functions and methods we saw in this lab. Name Example Purpose Table Table() Create an empty table, usually to extend with data Table.read_table Table.read_table("my_data.csv") Create a table from a data file with_columns tbl = Table().with_columns("N", np.arange(5), "2*N", np.arange(0, 10, 2)) Create a copy of a table with more columns column tbl.column("N") Create an array containing the elements of a column sort tbl.sort("N") Create a copy of a table sorted by the values in a column where tbl.where("N", are.above(2)) Create a copy of a table with only the rows that match some predicate num_rows tbl.num_rows Compute the number of rows in a table num_columns tbl.num_columns Compute the number of columns in a table select tbl.select("N") Create a copy of a table with only some of the columns drop tbl.drop("2*N") Create a copy of a table without some of the columns take tbl.take(np.arange(0, 6, 2)) Create a copy of the table with only the rows whose indices are in the given array Alright! You're finished with lab 3! Be sure to... run all the tests (the next cell has a shortcut for that), Save and Checkpoint from the File menu, run the last cell to submit your work , and ask one of the staff members to check you off.
In [ ]: # For your convenience, you can run this cell to run all the tes ts at once! import os _ = [ok.grade(q[:‐3]) for q in os.listdir("tests") if q.startswi th('q')] In [ ]: _ = ok.submit()
• • • 