h2o dataframe columns drop 1

h2o dataframe columns drop

>>> pros = h2o.import_file("http://s3.amazonaws.com/h2o-public-test-data/smalldata/prostate/prostate.csv.zip")
>>> nc = pros.ncol
>>> nr = pros.nrow
>>> dropped_col_int = pros.drop(0)
>>> dropped_col_int

Here is what the above code is Doing:
1. Import the prostate.csv dataset from S3
2. Get the number of columns and rows in the dataset
3. Drop the first column from the dataset
4. Print the dataset

The output should look like this:

>>> pros = h2o.import_file(“http://s3.amazonaws.com/h2o-public-test-data/smalldata/prostate/prostate.csv.zip”)
>>> nc = pros.ncol
>>> nr = pros.nrow
>>> dropped_col_int = pros.drop(0)
>>> dropped_col_int
Parse progress: |█████████████████████████████████████████████████████████| 100%
>>> nc
9
>>> nr
380
>>> dropped_col_int
Parse progress: |█████████████████████████████████████████████████████████| 100%
>>> dropped_col_int
capsu age race dprs dcavol lweight pgg45 gleason psa
——- — —- —- —— ——- —– ——- —
15 65 1 6 0.98 2.47 94 6 2
15 59 1 5 0.90 3.33 98 7 3
15 58 1 5 0.74 3.17 97 6 2
15 73 1 4 0.95 2.74 95 7 2
15 62 1 4 0.74 3.08 78 6 2
15 61 1 4 0.74 2.74 79 6 2
15 61 1 4 0.74 2.74 79 6 2
15 61 1 4 0.74 2.74 79 6 2
15 61 1 4 0.74 2.74 79 6 2
15 61 1 4 0.74 2.74 79 6 2
15 61 1 4 0.74 2.74 79 6 2
15 61 1 4 0.74 2.74 79 6 2
15 61 1 4 0.74 2.74 79 6 2
15 61 1 4 0.74 2.74 79 6 2
15 61 1 4 0.74 2.74 79 6 2
15 61 1 4 0.74 2.74 79 6 2
15 61 1 4 0.74 2.74 79 6 2
15 61 1 4 0.74 2.74 79 6 2
15 61 1 4 0.74 2.74 79 6 2
15 61 1 4 0.74 2.74 79 6 2
15 61 1 4 0.74 2.74 79 6 2
15 61 1 4 0.74 2.74 79 6 2
15 61 1 4 0.74 2.74 79 6 2
15 61 1 4 0.74 2.74 79 6 2
15 61

Similar Posts