1. Setting Up the Modern Data Analysis Environment
To write production-grade data analysis scripts, data analysts use either Jupyter Notebooks (for interactive exploratory data analysis, plotting, and experimentation) or VS Code / PyCharm (for end-to-end data pipeline scripts and web APIs).
In this lesson, we will set up our local Python data environment using modern package managers (pip or conda).
2. Installing Pandas & Essential Dependencies
Option A: Standard Pip Installation
In your terminal, command prompt, or virtual environment:
1# Upgrade pip to latest version
2python -m pip install--upgrade pip
3
4# Install Pandas along with core scientific companion libraries
If you are using the Anaconda distribution, Pandas is pre-installed. To update it:
1conda install pandas
3. Verifying Installation & Checking Versions
Always verify that your Python environment is importing the correct binary build of Pandas:
1import pandas as pd
2import numpy as np
3
4print(f"Pandas Version: {pd.__version__}")
5print(f"NumPy Version: {np.__version__}")
6
7# Check system build dependencies
8pd.show_versions()
Sample Output:
1Pandas Version: 2.2.2
2NumPy Version: 1.26.4
The pd.show_versions() function prints detailed diagnostic information, including versions of optional acceleration libraries like pyarrow, bottleneck, and numba.
4. Setting Display Options for Clean Terminal Output
By default, Pandas truncates large DataFrames to avoid flooding your screen. You can customize these formatting parameters:
1# Show up to 20 columns instead of hiding them
2pd.set_option('display.max_columns',20)
3
4# Show up to 100 rows
5pd.set_option('display.max_rows',100)
6
7# Format floats to 2 decimal places with comma separation
Test your understanding of this lesson with 5 questions. Each question has one correct answer.
12-Month Data Analysis Mastery Program
Master Full-Stack Data Analytics (Excel, SQL, Python, Power BI & Tableau)
Combine 15 complete courses, 150 chapters, 541 topics, live SQL/Power BI/Tableau dashboards, and Scikit-Learn capstones at MSK Institute Shikohabad or Live Online.