Python: Uploading Files Directly From Your PC into Google Colab, and Creating Charts.
Python Notebook: https://colab.research.google.com/drive/1cyrpCWUU5KmixQf6lBjTjdzQgXDA078e?usp=sharing
CSV file: https://drive.google.com/file/d/1wKHLmXVQG_0nV7gImV-KfcgfW7QoepkB/view?usp=sharing
By Me A Coffe: https://www.buymeacoffee.com/ViSIT
In this tutorial, we will guide you through the process of uploading files directly from your computer to your Google Colab notebook and then creating charts using the data with PyPlot.
We begin with a CSV file containing salary data categorized by employees, gender, and department. Our first step is to upload this dataset to Google Colab.
To achieve this, Open your Google Drive folder, Create a new Google Colab notebook, Load the necessary libraries, such as pandas for reading CSV files and PyPlot for creating charts, Use the "files.upload" command to upload files from your local drive to the notebook, Once the upload is complete, you can access the uploaded file in your Python code.
By organizing the code into separate blocks, you can make changes without running the entire code each time. This saves time and effort. Remember, the uploaded file remains accessible after execution, so there's no need to upload it repeatedly.
Next, we employ the pandas "read_csv" command to read the uploaded CSV file. Using the "head" command, we load the headers and a few initial rows of the data frame to ensure it was loaded correctly.
Moving on to chart creation, we use the PyPlot "subplots" command to define the figure and axis of our horizontal bar chart. We customize the chart by setting titles and labels for the X and Y axes, as well as displaying a legend. By using the "show" command, we finalize and display the chart.
We then duplicate the chart creation code to generate another chart displaying salaries by department. To improve accuracy, we group data by departments and modify the data frame to show total salaries for each department.
Additionally, we create a pie chart to depict salaries by gender. In this case, we adjust the chart type to "pie," move the "Gender" column to the legend, and run the code to display the pie chart.
We conclude the tutorial by thanking you for watching and encourage you to like and subscribe for more tutorials and updates. We hope you found this guide helpful in uploading files and creating insightful charts using Google Colab and PyPlot.
#GoogleColab #DataAnalysis #DataVisualization #PythonProgramming #PyPlot #CSVFiles #Charts #Tutorial #Coding #ProgrammingTips #DataScience #LearnCoding #TechTutorial