I m importing a csv file into python dataframe using pandas. PFA my code below:
import pandas as pd
df=pd.read_csv('C:/Users/Administrator/Desktop/NSE_Normalize.csv')
When I import using the code above no error is given but there is a warning as shown:
Columns (0,1,3) have mixed types.Specify dtype option on import or set low_memory=False.
By referring the answer Pandas read_csv low_memory and dtype options I came to know why this happens and that my file had ambiguous dtypes.
I was able to solve this by using:
df = pd.read_csv("C:/Users/Administrator/Desktop/NSE_Normalize.csv",sep=',', error_bad_lines=False, index_col=False, dtype='unicode') as mentioned on [Specify dtype option on import or set low_memory=False][2]
But when I import the same file as an excel workbook(.xlsx file). This error does not happen. Sure takes a larger time to get imported as compared to its csv counterpart but the error is not shown.
Hence from the above discussion may I know why the time to load an .xlsx file in python is larger than its .csv counterpart? Also when to use a .csv import and a .xlsx import?
Here is the file I import:


