Guest User

Untitled

a guest
Dec 16th, 2017
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. myList = []
  2. Status = "A"
  3. myFile = open("Payments.txt")
  4. record = myFile.readlines()
  5. for line in record:
  6. myList.append(line.strip().split(','))
  7. myFile.close()
  8. for z in record:
  9. details = [x for x in myList if len(x) == 5 and x[3] == Status and x[2]>x[4]]
  10. if details:
  11. print(details)
  12. break
  13.  
  14. ImportError: No module named 'tabulate'
  15.  
  16. pip install pandas
  17.  
  18. import pandas as pd
  19. table = pd.read_csv('filename.txt')
  20. table
  21.  
  22. # output should be the entire table
  23. # if you don't want to see the whole table use:
  24.  
  25. table.head()
  26. # or
  27.  
  28. table.tail()
Add Comment
Please, Sign In to add comment