Last Updated on 2022-03-10 by Kassandra
When it comes to analyzing data, there are many tools (like python pandas) with which to do so.
You might code in R, which is a programming language for statistical computing & graphics.
You might leverage things like the aforementioned pandas and matplotlib to wrangle your data & display in impactful data plots.
Whatever your data storytelling choice, one thing is clear – you have to read in data to start.
Before we get started, I wanted to let you know that the doors to my python basics bootcamp will be closing at the end of this month. But if you want to take advantage of the super early bird discount & special bonus offer, you only have 2 days left!
So be sure to learn more here & see if my python basics boot camp is right for you.
Python Pandas For File Reading
In this section you will learn how to read in a CSV file with a python package called pandas. (The process is similar for XLSX, it just depends on how you make the call.)
In 2022, I started a monthly mentorship program to better support my students. As a part of that program, I am learning more about what they are looking to accomplish in their current job role and their passion projects.
This has lead me to realize that a good portion of my students are involved in data analytics – which is great! Because I did a bit of that when I worked at Cisco.
Because I fashion my classes after what best suits my students, I have begun recreating projects I’ve worked on prior.
Why does this matter to you?
Because as I am preparing training materials for them, you reap the benefit of seeing some of the pieces used to complete those projects.
As such … in the below video, I will be importing a CSV file (with option for XLSX) into a very simple python program.
Let me show you what I mean …
Read In Data From CSV or XLSX
And … I couldn’t just leave that end. So I had to fix the code and do a redo. So here you go!
Read In And Export To/From CSV or XLSX
Since I redid the code and totally forgot to upload BEFORE …
I only have the updated code for the below video here.
And that’s it! As you will be able to see in documentation, you can read in multiple types of data – including XLSX format. So be sure to read the documentation and experiment! See how it all works.
Thank you for sharing your time and energy with me today.
If you would like occasional mobile notifications for when this post is updated, be sure to subscribe by tapping the pink bell in the bottom left corner of any page on my blog.
I am passionate about empowering people just like you for greater success. And over on my different social media platforms, I share information like python programming, digital marketing, human design, and anything else that has brought me success in my own life.
I hope to hear from you soon. In the mean time, if you are looking to:
- gain a solid foundation in python programming
- create clarity on how to get started coding
- build confidence in this new skillset
… Be sure to grab a super early bird spot in my upcoming python basics bootcamp. The investment for your seat is going up soon, so be sure to head over to https://prosperousheart.com/python-bootcamp to learn more about this 3 month program.
Thank you again, and have a prosperous rest of your day!