CSE 6040 - 7.2 - Tibbles(Tidy Tables) & Bits - Code Flashcards
1
Q
What code do you use to canonicalize the columns of a tibble? Say the Tibble is X.
A
**var\_names = sorted(X.columns) Y = X[var\_names].copy()**
2
Q
How would you canonicalize the row values within a tibble if the tibble is Y?
A
Y.sort_values (by=var_names, inplace=True)
3
Q
How would you canonicalize the index value within a tibble if the tibble is Y?
A
Y.set_index([list(range(0, len(Y)))], inplace=True)
4
Q
A