November 2018
Beginner to intermediate
354 pages
6h 59m
English
Now, items jan_price and mar_price have four elements, whereas june_price has three elements. So, we can't use a data frame in this case to store all of these values in a single variable. Instead, we can use lists. Using lists, we can get almost all the advantages of a data frame in addition to its capacity for storing different sets of elements (columns in the case of data frames) with different lengths:
all_prices_list2 = list(items, jan_price, mar_price, june_price)all_prices_list2
We can now see that all_prices_list2 has a different structure than that of a data frame:

Accessing list elements can be done by either using [] or [[]] ...
Read now
Unlock full access