Skip to content

Instantly share code, notes, and snippets.

@cgoliver
Created November 27, 2017 18:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cgoliver/f864a791bb9115b334fa0bfb63902cc2 to your computer and use it in GitHub Desktop.
Save cgoliver/f864a791bb9115b334fa0bfb63902cc2 to your computer and use it in GitHub Desktop.
from mycsv import *
if __name__ == "__main__":
#creating parser object
#these are default values anyway
#passing them explicitly just to show funcionatity
parser = MyCSV(delimiter=",", header=True)
#parsing test file
data = parser.parse("test.csv")
print(f"Columns: {data.columns}")
print("-"*20)
print(f"Attributes: {data.__dict__}")
#get gpa column
print(f"GPA column: {data.gpa}")
print("-"*20)
for row in data.iterrows():
print(row)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment