0

I have a csv file which is 63 MB and blood tests of patients. I can't get a DataFrame. It says:

DtypeWarning: Columns (5,12,20,21,22,23,24,25,26,30,32,35,36,37,38,39,40,41,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,121,123,167,169,171,173,175,181,183,189,191,193,195,207,209,211,213,215,217,219,221,223,225,227,229,231,233,235) have mixed types. Specify dtype option on import or set low_memory=False. hmg1 = pd.read_csv("/home/fatih/İndirilenler/sample1-1.csv")

Henry Ecker
  • 34,399
  • 18
  • 41
  • 57
Fatih
  • 21
  • 2
  • Don't let Pandas infers the datatype of your column: use `hmg1 = pd.read_csv("/home/fatih/İndirilenler/sample1-1.csv", dtype=str)` – Corralien Mar 11 '22 at 13:39

1 Answers1

0

Just force the type of your data :

pd.read_csv(path_to_file, dtype=str)
Tomo
  • 71
  • 1
  • 7