Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- myList = []
- Status = "A"
- myFile = open("Payments.txt")
- record = myFile.readlines()
- for line in record:
- myList.append(line.strip().split(','))
- myFile.close()
- for z in record:
- details = [x for x in myList if len(x) == 5 and x[3] == Status and x[2]>x[4]]
- if details:
- print(details)
- break
- ImportError: No module named 'tabulate'
- pip install pandas
- import pandas as pd
- table = pd.read_csv('filename.txt')
- table
- # output should be the entire table
- # if you don't want to see the whole table use:
- table.head()
- # or
- table.tail()
Add Comment
Please, Sign In to add comment