Plotting Salary vs. Names

Learn how to read data from a file and plot it in Python.

Reading data from a file

We have two following files:

  • names.txt that contains names.

  • salaries.txt that contains salaries.

Let’s look at the files. We’re using the Linux cat command, which prints the file contents on the screen.

Lets run the following commands on the terminal below and see what happens.

cat names.txt
cat salaries.txt

Get hands-on with 1400+ tech skills courses.