Example #1
0
    'Age': [29, 30, 27, 19, 31],
    'Country': ['USA', 'England', 'Japan', 'France', 'Japan']
}

countryDF = {
    'Ccode': [1, 2, 3, 4],
    'Country': ['USA', 'England', 'Japan', 'France']
}

pdf1 = pd.DataFrame(peopleDF)
pdf2 = pd.DataFrame(countryDF)
fdf1 = FrovedisDataframe(pdf1)
fdf2 = FrovedisDataframe(pdf2)

# displaying created frovedis dataframes
fdf1.show()
fdf2.show()

# select demo
fdf1["Ename"].show()  # single column
fdf1[["Ename", "Age"]].show()  # multiple column

# filter demo
fdf1[fdf1.Age > 19].show()
fdf1[fdf1.Age > 19 and fdf1.Country == 'Japan'].show()

# sort demo
fdf1.sort("Age", ascending=False).show()  # single column
fdf1.sort(["Age", "Country"]).show()  # multiple column

# groupby demo
Example #2
0
    'Age': [29, 30, 27, 19, 31],
    'Country': ['USA', 'England', 'Japan', 'France', 'Japan']
}

countryDF = {
    'Ccode': [1, 2, 3, 4],
    'Country': ['USA', 'England', 'Japan', 'France']
}

pdf1 = pd.DataFrame(peopleDF)
pdf2 = pd.DataFrame(countryDF)
fdf1 = FrovedisDataframe(pdf1)
fdf2 = FrovedisDataframe(pdf2)

# displaying created frovedis dataframes
fdf1.show()
fdf2.show()

# select demo
fdf1["Ename"].show()  # single column
fdf1[["Ename", "Age"]].show()  # multiple column

# filter demo
fdf1[fdf1.Age > 19].show()
fdf1[fdf1.Age > 19 and fdf1.Country == 'Japan'].show()

# sort demo
fdf1.sort("Age", ascending=False).show()  # single column
fdf1.sort(["Age", "Country"]).show()  # multiple column

# groupby demo