File size: 404 Bytes
34cffe9
63ae9cd
34cffe9
 
 
 
 
 
 
 
 
 
 
 
 
 
88a78a4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import numpy as np
import pandas as pd

rand_between = lambda a, b, size: np.random.rand(*size) * (b - a) + a

X = pd.DataFrame(
    {
        "T": rand_between(273, 373, (100,)),  # Kelvin
        "P": rand_between(100, 200, (100,)) * 1e3,  # Pa
        "n": rand_between(0, 10, (100,)),  # mole
    }
)

R = 8.3144598  # J/mol/K
X["y"] = X["n"] * R * X["T"] / X["P"]

X.to_csv("data.csv", index=False)