#Create empty DataFrame with specific column names & types
df = pd.DataFrame({'Courses': pd.Series(dtype='str'),
'Fee': pd.Series(dtype='int'),
'Duration': pd.Series(dtype='str'),
'Discount': pd.Series(dtype='float')})
# Using NumPy
dtypes = np.dtype(
[
("Courses", str),
("Fee", int),
("Duration", str),
("Discount", float),
('date',np.datetime64)
]
)
df = pd.DataFrame(np.empty(0, dtype=dtypes))