Переглянути джерело

Ignore # comments in csv, read everything as string.

George Jones 1 рік тому
батько
коміт
b03a02e993
1 змінених файлів з 2 додано та 2 видалено
  1. 2 2
      home/public/snippits/pandas/read_csv.py

+ 2 - 2
home/public/snippits/pandas/read_csv.py

@@ -1,7 +1,7 @@
 #! /usr/bin/env python3
-# Read a CSV file and ignore comments
+# Read a CSV file and ignore comments,  read everything as a string
 
 import pandas as pd
 
-df = pd.read_csv("foo.csv",comment='#')
+df = pd.read_csv("foo.csv",comment='#',dtype=str)
 print(df)