79481579

Date: 2025-03-03 16:42:27
Score: 0.5
Natty:
Report link

You can simply use the following syntax

import pandas as pd
df = pd.DataFrame(columns=['A', 'B', 'C'])
df[['D', 'E', 'F']] = None
print(df)

This creates an empty dataframe with columns from 'A' to 'F' with below result

 >>Empty DataFrame
 >>Columns: [A, B, C, D, E, F]
 >>Index: []
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Pramod B R