Book Image

Data Analysis Foundations with Python

By : Cuantum Technologies LLC
Book Image

Data Analysis Foundations with Python

By: Cuantum Technologies LLC

Overview of this book

Embark on a comprehensive journey through data analysis with Python. Begin with an introduction to data analysis and Python, setting a strong foundation before delving into Python programming basics. Learn to set up your data analysis environment, ensuring you have the necessary tools and libraries at your fingertips. As you progress, gain proficiency in NumPy for numerical operations and Pandas for data manipulation, mastering the skills to handle and transform data efficiently. Proceed to data visualization with Matplotlib and Seaborn, where you'll create insightful visualizations to uncover patterns and trends. Understand the core principles of exploratory data analysis (EDA) and data preprocessing, preparing your data for robust analysis. Explore probability theory and hypothesis testing to make data-driven conclusions and get introduced to the fundamentals of machine learning. Delve into supervised and unsupervised learning techniques, laying the groundwork for predictive modeling. To solidify your knowledge, engage with two practical case studies: sales data analysis and social media sentiment analysis. These real-world applications will demonstrate best practices and provide valuable tips for your data analysis projects.
Table of Contents (37 chapters)
Free Chapter
1
Code Blocks Resource
2
Premium Customer Support
4
Introduction
7
Acknowledgments
9
Quiz for Part I: Introduction to Data Analysis and Python
13
Quiz for Part II: Python Basics for Data Analysis
17
Quiz for Part III: Core Libraries for Data Analysis
21
Quiz for Part IV: Exploratory Data Analysis (EDA)
25
Quiz for Part V: Statistical Foundations
29
Quiz Part VI: Machine Learning Basics
33
Quiz Part VII: Case Studies
36
Conclusion
37
Know more about us

Practical Exercises Chapter 12

Exercise 1: Conducting a t-test

Question: You have been given the exam scores of a small class of 8 students before and after a coaching program. Conduct a paired t-test to find out if the coaching program made a significant impact on the scores.

Before Coaching: [55, 45, 67, 78, 49, 59, 61, 64]

After Coaching: [67, 53, 71, 85, 61, 66, 70, 80]

Solution:

from scipy import stats

 

before_coaching = [55, 45, 67, 78, 49, 59, 61, 64]

after_coaching = [67, 53, 71, 85, 61, 66, 70, 80]

 

# Conducting paired t-test

t_stat, p_value = stats.ttest_rel(before_coaching, after_coaching)

print(f't-statistic: {t_stat}, p-value: {p_value}')

 

Exercise 2: Performing One-Way ANOVA

Question: Three algorithms have been tested for their accuracy in classifying images, yielding the following results. Conduct a one-way ANOVA test to find out if the algorithms have different accuracies.

Algorithm A: [0.92, 0.88, 0.91, 0.87, 0.95]

Algorithm B: [0.77, 0.80...