Пример #1
0
#col_mat = df.to_frovedis_colmajor_matrix(['A', 'B'], dtype=np.float64)
#print (col_mat.to_numpy_matrix())

crs_mat, info = df.to_frovedis_crs_matrix(['A', 'B', 'C'], ['C'],
                                          need_info=True)
crs_mat.debug_print()
print

data2 = {
    'A': [12, 13],
    'B': [34.56, 78.9],
    'C': ['male', 'male'],
}
pdf2 = pd.DataFrame(data2)
df2 = FrovedisDataframe(pdf2)
print(pdf2)
print

crs_mat2 = df2.to_frovedis_crs_matrix_using_info(info)
crs_mat2.debug_print()

df.release()
row_mat.release()
#col_mat.release()
crs_mat.release()
crs_mat2.release()
info.save("info")
info.release()

FrovedisServer.shut_down()
Пример #2
0
print
print "sum(age): ", fdf1.sum("Age")
print
print "avg(age): ", fdf1.avg("Age")
print
print "std(age): ", fdf1.std("Age")
print
print "count(age): ", fdf1.count("Age")
print
print(fdf1.describe())
print

# describe demo
data = {
    'one': [10, 12, 13, 15],
    'two': [10.23, 12.20, 34.90, 100.12],
    'three': ['F', 'F', 'D', 'A'],
    'four': [1, 2, 3, 4]
}
pdf = pd.DataFrame(data)
print(pdf.describe())
print
df = FrovedisDataframe(pdf)
print(df.describe())
print  # prints count, mean, std, sum, min, max
df.release()

fdf1.release()
fdf2.release()
FrovedisServer.shut_down()