Given below is python pandas program using mad()function :
import pandas as pd import numpy as np diSales= { 2016:{'qtr1':34500,'qtr2':56000,'qtr3':47000,'qtr4':49000}, 2017:{'qtr1':44900,'qtr2':46100,'qtr3':57000,'qtr4':59000}, 2018:{'qtr1':54500,'qtr2':51000,'qtr3':57000,'qtr4':58500}, 2019:{'qtr1':61000} } df = pd.DataFrame(diSales) ks = df.mad(axis = 1) print(ks)My question is how can i change dtype of this pandas dataframe , by default it is showing float64 but i want to change it to int32 ? When i am trying command
ks = df.mad(axis = 1, dtype = int32)then it is showing error Plz help