Overview functions for data analysis – Python

After several data analyzes, the same operations were repeated. I once read something that said « if you repeat yourself more than 3 times, write a function« .

New datasets can take several hours to get used to, especially if we are not experts in the field. And when we are finally ok with the data, we have to optimize the data, and keep only the variables with « potential ». Depending on the information given, we also have to decode the names of columns and variables. This sometimes requires more in-depth research on the subject.

To facilitate this work, I needed two functions:

  • one allowing me to study, to measure the relations, if existing, between the variables of my dataset and my target variable (the one to predict). A data visualization would be perfect for that!
  • the other allowing me to familiarize myself quickly with all the values of the table. What are the different values for this and that column? How many times does it appear? A table will do the trick.

Two hours later, I coded something satisfying. For the example, I use the dataset provided on Kaggle, compiled by Dean De Cock, Boston House Prices.

The code of these two functions is published on GitHub and on Kaggle. Feel free to use it, upvote if you like it, and share yours ! 🙂

Function 1 : Overview plot

This first function displays the correlation of the dataset variables with your target variable. In my example, my target variable is SalePrice of houses, from Kaggle dataset House Pricing.

Function 2 : Overview table

This second function displays the different values existing in each of the columns. For exemple third row first column, RL [1151 = 78,84%], where RL is one of the value of MSZoning column, 1151 its occurence and 78,84% its percentage.

Thank you for reading this article. Perhaps it has been helpful for you, that these functions can help you in your data analysis. If you also have tools like those presented in this article, do not hesitate to share it in comment. I will be delighted to discover your portofolio! 🙂

Florent

47 comments

  1. footlights

    footlights xyandanxvurulmus.oBqEZKczYQWp

  2. sexx

    anal siteleri 250tldenemebonusuxx.fDjpJ5GkHV06

  3. Registrácia na binance

    I don’t think the title of your article matches the content lol. Just kidding, mainly because I had some doubts after reading the article.

  4. Crear cuenta personal

    Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.

  5. Registrace

    Thanks for sharing. I read many of your blog posts, cool, your blog is very good.

  6. binance referencní kód

    I don’t think the title of your article matches the content lol. Just kidding, mainly because I had some doubts after reading the article.

  7. can you drink while on shrooms

    Hi! Do you know if they make any plugins to
    protect against hackers? I’m kinda paranoid about losing everything I’ve worked
    hard on. Any tips?

  8. Inscreva-se na binance

    Your point of view caught my eye and was very interesting. Thanks. I have a question for you.

  9. goodhere Hairy porn

    goodhere Black and White porn vurucutewet.neUd7DXOof9

  10. binance register

    Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.

  11. binance

    Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me?

  12. bwerpipes in halabjah

    Bwer Pipes: The Ultimate Destination for Irrigation Excellence in Iraq: Elevate your farm’s irrigation capabilities with Bwer Pipes’ premium-quality products. Our innovative sprinkler systems and robust pipes are engineered for durability and efficiency, making them the ideal choice for Iraqi farmers striving for success. Learn More

  13. smortergiremal

    It’s onerous to seek out knowledgeable people on this matter, however you sound like you realize what you’re speaking about! Thanks

  14. Mendaftar di Binance

    Your article helped me a lot, is there any more related content? Thanks!

  15. akne_sbPa

    Какие причины вызывают акне? – Основные причины акне включают избыточное производство кожного сала, закупорку волосяных фолликулов, бактерии и воспаление.
    What causes acne? – The main causes of acne include excess oil production, clogged hair follicles, bacteria, and inflammation.
    средства от акне и прыщей https://www.almedinfo.ru/ .

  16. OfeliaB

    You have observed very interesting details! ps decent site.Leadership

  17. Mag-sign up sa Binance

    I don’t think the title of your article matches the content lol. Just kidding, mainly because I had some doubts after reading the article.

  18. Anonyme

    Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée.