Reading a Text file#
For parsing general delimited text files, as with CSV files, the right separator must be used if it is anything other than a whitespace or a tab.
Importing libraries and packages#
1# Mathematical operations and data manipulation
2import pandas as pd
Set paths#
1# Path to datasets directory
2data_path = "./datasets"
3# Path to assets directory (for saving results to)
4assets_path = "./assets"
Loading dataset#
1dataset_13 = pd.read_csv(f"{data_path}/example_1.txt")
2dataset_13
Column 1 | Column 2 | Column 3 | Column 4 | |
---|---|---|---|---|
0 | 2 | 1500 | Good | 300000 |
1 | 3 | 1300 | Fair | 240000 |
2 | 3 | 1900 | Very good | 450000 |
3 | 3 | 1850 | Bad | 280000 |
4 | 2 | 1640 | Good | 310000 |