Код: Выделить всё
dtype = {'material_id': object, 'location_id' : object, 'time_period_id' : int, 'demand' : int, 'sales_branch' : object, 'demand_type' : object }
df = pd.read_csv('./demand.csv', dtype = dtype)
Код: Выделить всё
df=pd.read_csv('demand.csv')
df=df.dropna()
Изменить: Код —
Код: Выделить всё
import pandas as pd
dtype1 = {'material_id': object, 'location_id' : object, 'time_period_id' : int, 'demand' : int, 'sales_branch' : object, 'demand_type' : object }
df = pd.read_csv('./demand.csv', dtype = dtype1)
df
Снимок моего CSV-файла —

Подробнее здесь: https://stackoverflow.com/questions/521 ... blank-rows
Мобильная версия