I want to print a table on my console. From now am using pandas how to print using tabulate
Here is my Source code:
from numpy import average
import pandas as pd
z = 10119011
a = 17
c = 43
m = 499
for i in range(0, 21):
LCG = ((a*z)+c) % m
z = LCG
u = z/m
hasil = 700 + u * (1500-700+1)
d = {
'Random Number Integer': [z],
'Uniform Random Number': [u],
'Penggunaan Pertamax/hari': [hasil]
}
df = pd.DataFrame(data=d)
print(df)
If you use tabulate, you need to pass your dataframe
dfas main argument and specify its keys:Output: