Last active
June 10, 2019 07:26
-
-
Save AntiKnot/0861cabb7071f144f7ec971e49b5bfa9 to your computer and use it in GitHub Desktop.
python read xlsx or csv by row
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import numpy as np | |
| import pandas as pd | |
| if __name__ == '__main__': | |
| csv_data = pd.read_csv('../resources/areadata/data.csv') | |
| dict_data = csv_data.to_dict(orient='row') | |
| for elem in dict_data: | |
| do_something(elem) | |
| print(dict_data[3]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import numpy as np | |
| import pandas as pd | |
| if __name__ == '__main__': | |
| excel_data = pd.read_excel('../resources/recorddata/data.xlsx') | |
| dict_data = excel_data.to_dict(orient='row') | |
| for elem in dict_data: | |
| do_something(elem) | |
| print(dict_data[3]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment