Easy Spreadsheet Data Analysis Methods – Python Pandas Tutorial




[ad_1]

Hey Everyone! In this one I just wanted to show you a few built in methods of the pandas package that we can use for quick data analysis on our spreadsheets.

Kite helps fund the channel, thanks for checking them out and supporting me —
⭐ Kite is a free AI-powered coding assistant that will help you code faster and smarter. The Kite plugin integrates with all the top editors and IDEs to give you smart completions and documentation while you’re typing. https://www.kite.com/get-kite/?utm_medium=referral&utm_source=youtube&utm_campaign=derricksherrill&utm_content=description-only

Here’s the spreadsheet I used in this tutorial:
https://www.kaggle.com/wkirgsn/electric-motor-temperature

Support the Channel on Patreon —
https://www.patreon.com/join/derricksherrill
Join The Socials —
Reddit – https://www.reddit.com/r/CodeWithDerrick/
FB – https://www.facebook.com/CodeWithDerrick/
Insta – https://www.instagram.com/codewithderrick/
Twitter – https://twitter.com/codewithderrick
LinkedIn – https://www.linkedin.com/in/derricksherrill/
GitHub – https://github.com/Derrick-Sherrill
*****************************************************************
Full code from the video:
import pandas as pd

excel_file_path = ‘electric_motor_data.csv’

df = pd.read_csv(excel_file_path)
print(df.columns)

df_info = df.info()
print(df_info)

print(df.describe()[‘i_d’])

grouped_df = df.groupby([‘profile_id’]).max()
print(grouped_df[‘torque’])

profile_id_4_df = df[df[‘profile_id’] == 4]
profile_id_4_df.to_excel(‘output.xlsx’)

https://github.com/Derrick-Sherrill/DerrickSherrill.com/blob/master/builtin-pandas-data-analysis.py

Packages (& Versions) used in this video:
Python 3.8
Pandas 0.25
Atom 1.41

*****************************************************************
Code from this tutorial and all my others can be found on my GitHub:
https://github.com/Derrick-Sherrill/DerrickSherrill.com

Check out my website:
https://www.derricksherrill.com/

If you liked the video – please hit the like button. It means more than you know. Thanks for watching and thank you for all your support!!

— Channel FAQ —

What text editor do you use?
Atom – https://atom.io/

What Equipment do you use to film videos?
Blue Yeti Microphone – https://amzn.to/2PcNj5d
Mic sound shield – https://amzn.to/3bVNkEt
Soundfoam – https://amzn.to/37NV9ci
Camera desk stand – https://amzn.to/3bX8xhm
Box Lights – https://amzn.to/2PanL95
Side Lights – https://amzn.to/37KSNut
Green Screen – https://amzn.to/37SFFnc

What computer do you use/desk setup?
Film on imac (4k screen) – https://amzn.to/37SEu7g
Work on Macbook Pro – https://amzn.to/2HJ5b3G
Video Storage – https://amzn.to/2Pey8sw
Mouse – https://amzn.to/2PhCtv3
Desk – https://amzn.to/37O1Mv1
Chair – https://amzn.to/2uqHE4E

What editing software do you use?
Adobe CC – https://www.adobe.com/creativecloud.html
Premiere Pro for video editing
Photoshop for images
After Effects for animations

Do I have any courses available?
Yes & always working on more!
https://www.udemy.com/user/derrick-sherrill-2/

Where do I get my music?
I get all my music from the copyright free Youtube audio library
https://www.youtube.com/audiolibrary/music?nv=1

Let me know if there’s anything else you want answered!

————————-

Always looking for suggestions on what video to make next — leave me a comment with your project! Happy Coding!

Source


[ad_2]

Comment List

  • Derrick Sherrill
    November 27, 2020

    this is more data prep. would love to see random forest, regression, etc.

  • Derrick Sherrill
    November 27, 2020

    I know this is a dumb question, but what are the advantages of analyzing a spreadsheet in python? I mean, why of the same can be done within excel? I'm sure there are advantages but I would like to know why they are

  • Derrick Sherrill
    November 27, 2020

    Gr8 videos
    Print('Thank you very much !!')

  • Derrick Sherrill
    November 27, 2020

    .nunique() and .unique() are my favs for data analysis

  • Derrick Sherrill
    November 27, 2020

    Awesome easy to follow tutorial. Thank you!

  • Derrick Sherrill
    November 27, 2020

    Derrick your videos are cool, right to the point and clear

  • Derrick Sherrill
    November 27, 2020

    Hello for newbies like me, you need to install the openpyxl library to extract the excel file.

  • Derrick Sherrill
    November 27, 2020

    Hi Derick Girish here from India. I been watching ur videos from last month. It's more information n I learnt few methods. But been given a project of making a pick to light using Raspberypi. I'm learning python a biginer. Please help me.
    The project details. We store windows in the 8 Racks each having 9 shelf. Each type window frame has a unique ID. We have 64 models of vehicles. Each model is fitted with a set of windows. I have make system to light at the locations of the window frame. The type of window frame to model is stored in excel sheet. I need your help in getting the Rack number & shelf number as output when I type the vehicle model as input. Please share your mail id.
    My mail is girishchenna@gmail.com.
    Please guid me. Thanks in advance.

  • Derrick Sherrill
    November 27, 2020

    I have group af data files that I most organize them in an exel file.every excel file most be about a same row ib every file and datas that are related to especial row.
    Could you help or let me know which videos are more useful for me?

  • Derrick Sherrill
    November 27, 2020

    Excelent methods! Good explanation….I learn to much with you.

  • Derrick Sherrill
    November 27, 2020

    Your Voice is so perfect for YT. I'm sure you'll grow big…

  • Derrick Sherrill
    November 27, 2020

    Hi, great video, How would you filter more than 1 id, e.g 4 and 5 and 6

  • Derrick Sherrill
    November 27, 2020

    You could talk about handling utf-8 characters. The problem can be when you pull a CSV into excel and it converts to the Microsoft character set. When you pull that up in pandas it can sometimes be a mess. Fix can be to load with encoding=’utf-8’. Thanks for the great videos.

  • Derrick Sherrill
    November 27, 2020

    Hello Derrick ! Great stuff. Just a small query – Why was the complete file path not assigned to the variable excel_file_path but just the file name ?

  • Derrick Sherrill
    November 27, 2020

    Useful video! Thank you!

  • Derrick Sherrill
    November 27, 2020

    Thank you very much brother. Love from India ❤️ ❤️❤️

  • Derrick Sherrill
    November 27, 2020

    Excellent! Thank you!

  • Derrick Sherrill
    November 27, 2020

    very useful. Thanks from Viet Nam

  • Derrick Sherrill
    November 27, 2020

    Thanks Derrick! Your teaching method is great but could you please slowdown a little bit and also explain why you are doing this?

  • Derrick Sherrill
    November 27, 2020

    Which is the best free text editor we can use for Windows?

  • Derrick Sherrill
    November 27, 2020

    Nice Video. Could you please make a video on how to format the columns and rows in an excel file using Python. Example: applying borders, changing cell interior color, font and etc.

  • Derrick Sherrill
    November 27, 2020

    Very good 👍

  • Derrick Sherrill
    November 27, 2020

    Hello Derrick Thank you for making useful videos on Python, Expecting more from you. Could you group all your videos in order to go through one after the another in sequence. Once again Kudos for your work.

  • Derrick Sherrill
    November 27, 2020

    hello brother i have a column name Total Traded Quantity which has values like 1.01M, 1.11k,….
    1) what does this M & K mens in this data set?
    2) And how can i make this column simple float

  • Derrick Sherrill
    November 27, 2020

    Dude i am getting error occurred , whatever your code written , i am using windows7 , tried so much yah

  • Derrick Sherrill
    November 27, 2020

    Is it possible to import an Excel column by its number? I'm working on reading differents columns (from about 300) inside a loop but I only find the way to select a column by its name, not by its number!

  • Derrick Sherrill
    November 27, 2020

    Hi Derrick, enjoy your videos a lot. Can you tell me three main things that Python can do where Excel can not (assuming advanced excel user)

  • Derrick Sherrill
    November 27, 2020

    Hi, i have a doubt that all the above operations we can perform it in excel…then why to use python to do this operations.

  • Derrick Sherrill
    November 27, 2020

    Love it very useful ! Looking forward for more content like this 🙂

  • Derrick Sherrill
    November 27, 2020

    I'm trying to do this in vscode on a chromebook, but am unable to work out the file path structure. Any ideas?

  • Derrick Sherrill
    November 27, 2020

    Pretty enjoy watching your awesome video…Inspire me a lot…Cheers mate.

  • Derrick Sherrill
    November 27, 2020

    I have been struggling with aggregating demand history by month. Parts A, B, C demanded on multiple different days in a month for different quantities month over month. I would like to know how to show month, part, quantity. Can you help?

  • Derrick Sherrill
    November 27, 2020

    hello, i got problem, at first, im starting to learn python , and i stuck on one stupid problem, i have data sheet with example, date,time, name,phone,email, and i will merge date and time to one column, any useful tips ? i think i googled all i can, butstill no luck, i tried, merge them in openoffice, but it just make one line at a time , my sheep is over 65000 lines… and as it does, it merge the datata one behid other not on separate line as i expect… but i like to have it in script cuz then i can automate outpu from sheet and analyze the data, but im stuck, please help me thank you

  • Derrick Sherrill
    November 27, 2020

    hello sir pandas can make the value in 1 excel column be like this [2,1,3,1], thank you

  • Derrick Sherrill
    November 27, 2020

    One of my favorite things to do with pandas is normalize data, it so happens that your data was already normalized. However, in pandas it's so easy to take a spreadsheet of arbitrary values and call (stats =pandas.DataFrame.describe( )) then stats.transpose( ) and then take the original frame and simply say (normalized = ((pandas.DataFrame – stats['mean']) / stats['std'])) I believe this is one of the hottest quick tips. I'm sorry if you've already covered this, but this is your first video I've ever seen.

  • Derrick Sherrill
    November 27, 2020

    Thank you Derrick. U make Python so easy for us👋👋👋🙏😃

  • Derrick Sherrill
    November 27, 2020

    Good video. FYI you look like a young Tom Brady

  • Derrick Sherrill
    November 27, 2020

    Derrick you make learning python easy!

  • Derrick Sherrill
    November 27, 2020

    Nice video!! but this all can be done easily in Excel also.Can you make a video that really showcase the power of python (pandas).
    Thank you

  • Derrick Sherrill
    November 27, 2020

    Make it look EZ

  • Derrick Sherrill
    November 27, 2020

    Great and very useful video, thank you Derrick, there are a lot of people appreciating your work!

  • Derrick Sherrill
    November 27, 2020

    more of that please – especially pandas methods 👍

  • Derrick Sherrill
    November 27, 2020

    👍

  • Derrick Sherrill
    November 27, 2020

    I'm really enjoying your videos, and am learning a lot! Have you done a tutorial on cleansing data of certain characters? Like if I had a spreadsheet with 8 columns, and 1000+ rows, and wanted to scan and remove all special characters like $%^&#, etc… and then write everything back to a new spreadsheet. Any advice on the best way to handle that?

Write a comment