xxxxxxxxxx
import pandas as pd # pip install pandas
df = pd.read_csv("Demo.csv") # Enter your file name
df = df.dropna(inplace=True)
xxxxxxxxxx
import csv
with open(in_fnam, newline='') as in_file:
with open(out_fnam, 'w', newline='') as out_file:
writer = csv.writer(out_file)
for row in csv.reader(in_file):
if row:
writer.writerow(row)