G3. Defining a tabular view of a data collection Flashcards

1
Q

What is a DataFrame?

A

Tabular data structure, with rows and columns. Rows have a specific index to access them, which can be any name or value. In Pandas, the columns are called Series, a special type of data, which consists of a list of several values, where each value has an index.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Define a DataFrame that shows the readings of home appliances energy consumption when they are used according to the following schema:
<applianceName, initialdate, initialhour, finaldate, finalhour, consumedWatts>

A

import pandas as pd
data = {
‘applianceName’:[‘Refrigerator’, ‘Washing Machine’, ‘Air Conditioner’]
‘initialdate’:[,]
‘initialhour’:[,]
‘finaldate’:[,]
‘finalhour’:[,]
‘consumedWatts (kWh)’:[1.5, 2.0, 3.5]
}
df=pd.DataFrame(data)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly