TGTGInsighttelegram intelligenceLIVE / telegram public index
← Data Analytics
Data Analytics avatar

TGINSIGHT POST

Post #2685

@sqlspecialist

Data Analytics

Views7,360Post view count
PostedMar 2603/26/2026, 07:23 PM
Post content

Post content

Here's a concise cheat sheet to help you get started with Python for Data Analytics. This guide covers essential libraries and functions that you'll frequently use. 1. Python Basics - Variables: x = 10 y = "Hello" - Data Types: - Integers: x = 10 - Floats: y = 3.14 - Strings: name = "Alice" - Lists: my_list = [1, 2, 3] - Dictionaries: my_dict = {"key": "value"} - Tuples: my_tuple = (1, 2, 3) - Control Structures: - if, elif, else statements - Loops: for i in range(5): print(i) - While loop: while x < 5: print(x) x += 1 2. Importing Libraries - NumPy: import numpy as np - Pandas: import pandas as pd - Matplotlib: import matplotlib.pyplot as plt - Seaborn: import seaborn as sns 3. NumPy for Numerical Data - Creating Arrays: arr = np.array([1, 2, 3, 4]) - Array Operations: arr.sum() arr.mean() - Reshaping Arrays: arr.reshape((2, 2)) - Indexing and Slicing: arr[0:2] # First two elements 4. Pandas for Data Manipulation - Creating DataFrames: df = pd.DataFrame({ 'col1': [1, 2, 3], 'col2': ['A', 'B', 'C'] }) - Reading Data: df = pd.read_csv('file.csv') - Basic Operations: df.head() # First 5 rows df.describe() # Summary statistics df.info() # DataFrame info - Selecting Columns: df['col1'] df[['col1', 'col2']] - Filtering Data: df[df['col1'] > 2] - Handling Missing Data: df.dropna() # Drop missing values df.fillna(0) # Replace missing values - GroupBy: df.groupby('col2').mean() 5. Data Visualization - Matplotlib: plt.plot(df['col1'], df['col2']) plt.xlabel('X-axis') plt.ylabel('Y-axis') plt.title('Title') plt.show() - Seaborn: sns.histplot(df['col1']) sns.boxplot(x='col1', y='col2', data=df) 6. Common Data Operations - Merging DataFrames: pd.merge(df1, df2, on='key') - Pivot Table: df.pivot_table(index='col1', columns='col2', values='col3') - Applying Functions: df['col1'].apply(lambda x: x*2) 7. Basic Statistics - Descriptive Stats: df['col1'].mean() df['col1'].median() df['col1'].std() - Correlation: df.corr() This cheat sheet should give you a solid foundation in Python for data analytics. As you get more comfortable, you can delve deeper into each library's documentation for more advanced features. I have curated the best resources to learn Python 👇👇 https://whatsapp.com/channel/0029VaiM08SDuMRaGKd9Wv0L Hope you'll like it Like this post if you need more resources like this 👍❤️