Kaynağa Gözat

Added example to read csv in pandas and ignore comments

George Jones 1 yıl önce
ebeveyn
işleme
6948a57d93

+ 4 - 0
home/public/snippits/pandas/foo.csv

@@ -0,0 +1,4 @@
+foo,bar,baz
+# This is a comment, ignore it.
+1,2,3
+4,5,6

+ 7 - 0
home/public/snippits/pandas/read_csv.py

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