๐๐ฆ๐ฉ๐จ๐ซ๐ญ๐ข๐ง๐ ๐๐๐๐๐ฌ๐ฌ๐๐ซ๐ฒ ๐๐ข๐๐ซ๐๐ซ๐ข๐๐ฌ:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
๐๐จ๐๐๐ข๐ง๐ ๐ญ๐ก๐ ๐๐๐ญ๐๐ฌ๐๐ญ:
df = pd.read_csv('your_dataset.csv')
๐๐ง๐ข๐ญ๐ข๐๐ฅ ๐๐๐ญ๐ ๐๐ง๐ฌ๐ฉ๐๐๐ญ๐ข๐จ๐ง:
1- View the first few rows:
df.head()
2- Summary of the dataset:
df.info()
3- Statistical summary:
df.describe()
๐๐๐ง๐๐ฅ๐ข๐ง๐ ๐๐ข๐ฌ๐ฌ๐ข๐ง๐ ๐๐๐ฅ๐ฎ๐๐ฌ:
1- Identify missing values:
df.isnull().sum()
2- Visualize missing values:
sns.heatmap(df.isnull(), cbar=False, cmap='viridis')
plt.show()
๐๐๐ญ๐ ๐๐ข๐ฌ๐ฎ๐๐ฅ๐ข๐ณ๐๐ญ๐ข๐จ๐ง:
1- Histograms:
df.hist(bins=30, figsize=(20, 15))
plt.show()
2 - Box plots:
plt.figure(figsize=(10, 6))
sns.boxplot(data=df)
plt.xticks(rotation=90)
plt.show()
3- Pair plots:
sns.pairplot(df)
plt.show()
4- Correlation matrix and heatmap:
correlation_matrix = df.corr()
plt.figure(figsize=(12, 8))
sns.heatmap(correlation_matrix, annot=True, cmap='coolwarm')
plt.show()
๐๐๐ญ๐๐ ๐จ๐ซ๐ข๐๐๐ฅ ๐๐๐ญ๐ ๐๐ง๐๐ฅ๐ฒ๐ฌ๐ข๐ฌ:
Count plots for categorical features:
plt.figure(figsize=(10, 6))
sns.countplot(x='categorical_column', data=df)
plt.show()
Python Interview Q&A: https://topmate.io/coding/898340
Like for more โค๏ธ
ENJOY LEARNING ๐๐
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
๐๐จ๐๐๐ข๐ง๐ ๐ญ๐ก๐ ๐๐๐ญ๐๐ฌ๐๐ญ:
df = pd.read_csv('your_dataset.csv')
๐๐ง๐ข๐ญ๐ข๐๐ฅ ๐๐๐ญ๐ ๐๐ง๐ฌ๐ฉ๐๐๐ญ๐ข๐จ๐ง:
1- View the first few rows:
df.head()
2- Summary of the dataset:
df.info()
3- Statistical summary:
df.describe()
๐๐๐ง๐๐ฅ๐ข๐ง๐ ๐๐ข๐ฌ๐ฌ๐ข๐ง๐ ๐๐๐ฅ๐ฎ๐๐ฌ:
1- Identify missing values:
df.isnull().sum()
2- Visualize missing values:
sns.heatmap(df.isnull(), cbar=False, cmap='viridis')
plt.show()
๐๐๐ญ๐ ๐๐ข๐ฌ๐ฎ๐๐ฅ๐ข๐ณ๐๐ญ๐ข๐จ๐ง:
1- Histograms:
df.hist(bins=30, figsize=(20, 15))
plt.show()
2 - Box plots:
plt.figure(figsize=(10, 6))
sns.boxplot(data=df)
plt.xticks(rotation=90)
plt.show()
3- Pair plots:
sns.pairplot(df)
plt.show()
4- Correlation matrix and heatmap:
correlation_matrix = df.corr()
plt.figure(figsize=(12, 8))
sns.heatmap(correlation_matrix, annot=True, cmap='coolwarm')
plt.show()
๐๐๐ญ๐๐ ๐จ๐ซ๐ข๐๐๐ฅ ๐๐๐ญ๐ ๐๐ง๐๐ฅ๐ฒ๐ฌ๐ข๐ฌ:
Count plots for categorical features:
plt.figure(figsize=(10, 6))
sns.countplot(x='categorical_column', data=df)
plt.show()
Python Interview Q&A: https://topmate.io/coding/898340
Like for more โค๏ธ
ENJOY LEARNING ๐๐
๐46โค18
These 6 videos will help you to get the product knowledge and case study solving skill
๐๐
https://t.iss.one/caseinterviewscracked/18
๐๐
https://t.iss.one/caseinterviewscracked/18
๐4
Frequently asked Python practice questions and answers in Data Analyst Interview:
1.Temperature Conversion: Write a program that converts a given temperature from Celsius to Fahrenheit or from Fahrenheit to Celsius based on user input.
temp = float(input('Enter the temperature: '))
unit = input('Enter the unit (C/F): ').upper()
if unit == 'C':
converted = (temp * 9/5) + 32
print(f'Temperature in Fahrenheit: {converted}')
elif unit == 'F':
converted = (temp - 32) * 5/9
print(f'Temperature in Celsius: {converted}')
else:
print('Invalid unit')
2.Multiplication Table: Write a program that prints the multiplication table of a given number using a while loop.
num = int(input('Enter a number: '))
i = 1
while i <= 10:
print(f'{num} x {i} = {num * i}')
i += 1
3.Greatest of Three Numbers: Write a program that takes three numbers as input and prints the greatest of the three.
num1 = float(input('Enter first number: '))
num2 = float(input('Enter second number: '))
num3 = float(input('Enter third number: '))
if num1 >= num2 and num1 >= num3:
print(f'The greatest number is {num1}')
elif num2 >= num1 and num2 >= num3:
print(f'The greatest number is {num2}')
else:
print(f'The greatest number is {num3}')
4.Sum of Even Numbers: Write a program that calculates the sum of all even numbers between 1 and a given number using a while loop.
num = int(input('Enter a number: '))
total = 0
i = 2
while i <= num:
total += i
i += 2
print(f'The sum of even numbers up to {num} is {total}')
5.Check Armstrong Number: Write a program that checks if a given number is an Armstrong number.
num = int(input('Enter a number: '))
sum_of_digits = 0
original_num = num
while num > 0:
digit = num % 10
sum_of_digits += digit ** 3
num //= 10
if sum_of_digits == original_num:
print(f'{original_num} is an Armstrong number')
else:
print(f'{original_num} is not an Armstrong number')
6.Reverse a Number: Write a program that reverses the digits of a given number using a while loop.
num = int(input('Enter a number: '))
reversed_num = 0
while num > 0:
digit = num % 10
reversed_num = reversed_num * 10 + digit
num //= 10
print(f'The reversed number is {reversed_num}')
7.Count Vowels and Consonants: Write a program that counts the number of vowels and consonants in a given string.
string = input('Enter a string: ').lower()
vowels = 'aeiou'
vowel_count = 0
consonant_count = 0
for char in string:
if char.isalpha():
if char in vowels:
vowel_count += 1
else:
consonant_count += 1
print(f'Number of vowels: {vowel_count}')
print(f'Number of consonants: {consonant_count}')
Python Interview Q&A: https://topmate.io/coding/898340
Like for more โค๏ธ
ENJOY LEARNING ๐๐
1.Temperature Conversion: Write a program that converts a given temperature from Celsius to Fahrenheit or from Fahrenheit to Celsius based on user input.
temp = float(input('Enter the temperature: '))
unit = input('Enter the unit (C/F): ').upper()
if unit == 'C':
converted = (temp * 9/5) + 32
print(f'Temperature in Fahrenheit: {converted}')
elif unit == 'F':
converted = (temp - 32) * 5/9
print(f'Temperature in Celsius: {converted}')
else:
print('Invalid unit')
2.Multiplication Table: Write a program that prints the multiplication table of a given number using a while loop.
num = int(input('Enter a number: '))
i = 1
while i <= 10:
print(f'{num} x {i} = {num * i}')
i += 1
3.Greatest of Three Numbers: Write a program that takes three numbers as input and prints the greatest of the three.
num1 = float(input('Enter first number: '))
num2 = float(input('Enter second number: '))
num3 = float(input('Enter third number: '))
if num1 >= num2 and num1 >= num3:
print(f'The greatest number is {num1}')
elif num2 >= num1 and num2 >= num3:
print(f'The greatest number is {num2}')
else:
print(f'The greatest number is {num3}')
4.Sum of Even Numbers: Write a program that calculates the sum of all even numbers between 1 and a given number using a while loop.
num = int(input('Enter a number: '))
total = 0
i = 2
while i <= num:
total += i
i += 2
print(f'The sum of even numbers up to {num} is {total}')
5.Check Armstrong Number: Write a program that checks if a given number is an Armstrong number.
num = int(input('Enter a number: '))
sum_of_digits = 0
original_num = num
while num > 0:
digit = num % 10
sum_of_digits += digit ** 3
num //= 10
if sum_of_digits == original_num:
print(f'{original_num} is an Armstrong number')
else:
print(f'{original_num} is not an Armstrong number')
6.Reverse a Number: Write a program that reverses the digits of a given number using a while loop.
num = int(input('Enter a number: '))
reversed_num = 0
while num > 0:
digit = num % 10
reversed_num = reversed_num * 10 + digit
num //= 10
print(f'The reversed number is {reversed_num}')
7.Count Vowels and Consonants: Write a program that counts the number of vowels and consonants in a given string.
string = input('Enter a string: ').lower()
vowels = 'aeiou'
vowel_count = 0
consonant_count = 0
for char in string:
if char.isalpha():
if char in vowels:
vowel_count += 1
else:
consonant_count += 1
print(f'Number of vowels: {vowel_count}')
print(f'Number of consonants: {consonant_count}')
Python Interview Q&A: https://topmate.io/coding/898340
Like for more โค๏ธ
ENJOY LEARNING ๐๐
๐22โค12
Lists ๐ Tuples ๐ Dictionaries
What's the difference?
Lists are mutable.
Tuples are immutable.
Dictionaries are associative.
When should you use each?
Lists:
โถ When you want to add or remove elements
โถ When you want to sort elements
โถ When you want to slice elements
Tuples:
โถ When you want a constant object
โถ When you want to send multiple in a function
โถ When you want to return multiple from a function
Dictionaries:
โถ When you want to map keys to values
โถ When you want to loop over the keys
โถ When you want to validate if key exists
Now, pick your weapon of mass data analysis and become a Python pro!
Python Interview Q&A: https://topmate.io/coding/898340
Like for more โค๏ธ
ENJOY LEARNING ๐๐
What's the difference?
Lists are mutable.
Tuples are immutable.
Dictionaries are associative.
When should you use each?
Lists:
โถ When you want to add or remove elements
โถ When you want to sort elements
โถ When you want to slice elements
Tuples:
โถ When you want a constant object
โถ When you want to send multiple in a function
โถ When you want to return multiple from a function
Dictionaries:
โถ When you want to map keys to values
โถ When you want to loop over the keys
โถ When you want to validate if key exists
Now, pick your weapon of mass data analysis and become a Python pro!
Python Interview Q&A: https://topmate.io/coding/898340
Like for more โค๏ธ
ENJOY LEARNING ๐๐
๐13โค9
Here are 5 key Python libraries/ concepts that are particularly important for data analysts:
1. Pandas: Pandas is a powerful library for data manipulation and analysis in Python. It provides data structures like DataFrames and Series that make it easy to work with structured data. Pandas offers functions for reading and writing data, cleaning and transforming data, and performing data analysis tasks like filtering, grouping, and aggregating.
2. NumPy: NumPy is a fundamental package for scientific computing in Python. It provides support for large, multi-dimensional arrays and matrices, along with a collection of mathematical functions to operate on these arrays efficiently. NumPy is often used in conjunction with Pandas for numerical computations and data manipulation.
3. Matplotlib and Seaborn: Matplotlib is a popular plotting library in Python that allows you to create a wide variety of static, interactive, and animated visualizations. Seaborn is built on top of Matplotlib and provides a higher-level interface for creating attractive and informative statistical graphics. These libraries are essential for data visualization in data analysis projects.
4. Scikit-learn: Scikit-learn is a machine learning library in Python that provides simple and efficient tools for data mining and data analysis tasks. It includes a wide range of algorithms for classification, regression, clustering, dimensionality reduction, and more. Scikit-learn also offers tools for model evaluation, hyperparameter tuning, and model selection.
5. Data Cleaning and Preprocessing: Data cleaning and preprocessing are crucial steps in any data analysis project. Python offers libraries like Pandas and NumPy for handling missing values, removing duplicates, standardizing data types, scaling numerical features, encoding categorical variables, and more. Understanding how to clean and preprocess data effectively is essential for accurate analysis and modeling.
By mastering these Python concepts and libraries, data analysts can efficiently manipulate and analyze data, create insightful visualizations, apply machine learning techniques, and derive valuable insights from their datasets.
Credits: https://t.iss.one/free4unow_backup
Python Interview Q&A: https://topmate.io/coding/898340
Like for more โค๏ธ
ENJOY LEARNING ๐๐
1. Pandas: Pandas is a powerful library for data manipulation and analysis in Python. It provides data structures like DataFrames and Series that make it easy to work with structured data. Pandas offers functions for reading and writing data, cleaning and transforming data, and performing data analysis tasks like filtering, grouping, and aggregating.
2. NumPy: NumPy is a fundamental package for scientific computing in Python. It provides support for large, multi-dimensional arrays and matrices, along with a collection of mathematical functions to operate on these arrays efficiently. NumPy is often used in conjunction with Pandas for numerical computations and data manipulation.
3. Matplotlib and Seaborn: Matplotlib is a popular plotting library in Python that allows you to create a wide variety of static, interactive, and animated visualizations. Seaborn is built on top of Matplotlib and provides a higher-level interface for creating attractive and informative statistical graphics. These libraries are essential for data visualization in data analysis projects.
4. Scikit-learn: Scikit-learn is a machine learning library in Python that provides simple and efficient tools for data mining and data analysis tasks. It includes a wide range of algorithms for classification, regression, clustering, dimensionality reduction, and more. Scikit-learn also offers tools for model evaluation, hyperparameter tuning, and model selection.
5. Data Cleaning and Preprocessing: Data cleaning and preprocessing are crucial steps in any data analysis project. Python offers libraries like Pandas and NumPy for handling missing values, removing duplicates, standardizing data types, scaling numerical features, encoding categorical variables, and more. Understanding how to clean and preprocess data effectively is essential for accurate analysis and modeling.
By mastering these Python concepts and libraries, data analysts can efficiently manipulate and analyze data, create insightful visualizations, apply machine learning techniques, and derive valuable insights from their datasets.
Credits: https://t.iss.one/free4unow_backup
Python Interview Q&A: https://topmate.io/coding/898340
Like for more โค๏ธ
ENJOY LEARNING ๐๐
๐20โค7
How to get job as python fresher?
1. Get Your Python Fundamentals Strong
You should have a clear understanding of Python syntax, statements, variables & operators, control structures, functions & modules, OOP concepts, exception handling, and various other concepts before going out for a Python interview.
2. Learn Python Frameworks
As a beginner, youโre recommended to start with Django as it is considered the standard framework for Python by many developers. An adequate amount of experience with frameworks will not only help you to dive deeper into the Python world but will also help you to stand out among other Python freshers.
3. Build Some Relevant Projects
You can start it by building several minor projects such as Number guessing game, Hangman Game, Website Blocker, and many others. Also, you can opt to build few advanced-level projects once youโll learn several Python web frameworks and other trending technologies.
@crackingthecodinginterview
4. Get Exposure to Trending Technologies Using Python.
Python is being used with almost every latest tech trend whether it be Artificial Intelligence, Internet of Things (IOT), Cloud Computing, or any other. And getting exposure to these upcoming technologies using Python will not only make you industry-ready but will also give you an edge over others during a career opportunity.
5. Do an Internship & Grow Your Network.
You need to connect with those professionals who are already working in the same industry in which you are aspiring to get into such as Data Science, Machine learning, Web Development, etc.
Python Interview Q&A: https://topmate.io/coding/898340
Like for more โค๏ธ
ENJOY LEARNING ๐๐
1. Get Your Python Fundamentals Strong
You should have a clear understanding of Python syntax, statements, variables & operators, control structures, functions & modules, OOP concepts, exception handling, and various other concepts before going out for a Python interview.
2. Learn Python Frameworks
As a beginner, youโre recommended to start with Django as it is considered the standard framework for Python by many developers. An adequate amount of experience with frameworks will not only help you to dive deeper into the Python world but will also help you to stand out among other Python freshers.
3. Build Some Relevant Projects
You can start it by building several minor projects such as Number guessing game, Hangman Game, Website Blocker, and many others. Also, you can opt to build few advanced-level projects once youโll learn several Python web frameworks and other trending technologies.
@crackingthecodinginterview
4. Get Exposure to Trending Technologies Using Python.
Python is being used with almost every latest tech trend whether it be Artificial Intelligence, Internet of Things (IOT), Cloud Computing, or any other. And getting exposure to these upcoming technologies using Python will not only make you industry-ready but will also give you an edge over others during a career opportunity.
5. Do an Internship & Grow Your Network.
You need to connect with those professionals who are already working in the same industry in which you are aspiring to get into such as Data Science, Machine learning, Web Development, etc.
Python Interview Q&A: https://topmate.io/coding/898340
Like for more โค๏ธ
ENJOY LEARNING ๐๐
๐26โค7
Python for everything
๐๐
https://www.linkedin.com/posts/sql-analysts_how-to-get-job-as-python-fresher-1-get-activity-7209174333351485440-5FQT
๐๐
https://www.linkedin.com/posts/sql-analysts_how-to-get-job-as-python-fresher-1-get-activity-7209174333351485440-5FQT
๐11โค2
Python Interview Questions for Data/Business Analysts in MNC:
Question 1:
Given a dataset in a CSV file, how would you read it into a Pandas DataFrame? And how would you handle missing values?
Question 2:
Describe the difference between a list, a tuple, and a dictionary in Python. Provide an example for each.
Question 3:
Imagine you are provided with two datasets, 'sales_data' and 'product_data', both in the form of Pandas DataFrames. How would you merge these datasets on a common column named 'ProductID'?
Question 4:
How would you handle duplicate rows in a Pandas DataFrame? Write a Python code snippet to demonstrate.
Question 5:
Describe the difference between '.iloc[] and '.loc[]' in the context of Pandas.
Question 6:
In Python's Matplotlib library, how would you plot a line chart to visualize monthly sales? Assume you have a list of months and a list of corresponding sales numbers.
Question 7:
How would you use Python to connect to a SQL database and fetch data into a Pandas DataFrame?
Question 8:
Explain the concept of list comprehensions in Python. Can you provide an example where it's useful for data analysis?
Question 9:
How would you reshape a long-format DataFrame to a wide format using Pandas? Explain with an example.
Question 10:
What are lambda functions in Python? How are they beneficial in data wrangling tasks?
Question 11:
Describe a scenario where you would use the 'groupby()' method in Pandas. How would you aggregate data after grouping?
Question 12:
You are provided with a Pandas DataFrame that contains a column with date strings. How would you convert this column to a datetime format? Additionally, how would you extract the month and year from these datetime objects?
Question 13:
Explain the purpose of the 'pivot_table' method in Pandas and describe a business scenario where it might be useful.
Question 14:
How would you handle large datasets that don't fit into memory? Are you familiar with Dask or any similar libraries?
Question 15:
In a dataset, you observe that some numerical columns are highly skewed. How can you normalize or transform these columns using Python?
Python Interview Q&A: https://topmate.io/coding/898340
Like for more โค๏ธ
Question 1:
Given a dataset in a CSV file, how would you read it into a Pandas DataFrame? And how would you handle missing values?
Question 2:
Describe the difference between a list, a tuple, and a dictionary in Python. Provide an example for each.
Question 3:
Imagine you are provided with two datasets, 'sales_data' and 'product_data', both in the form of Pandas DataFrames. How would you merge these datasets on a common column named 'ProductID'?
Question 4:
How would you handle duplicate rows in a Pandas DataFrame? Write a Python code snippet to demonstrate.
Question 5:
Describe the difference between '.iloc[] and '.loc[]' in the context of Pandas.
Question 6:
In Python's Matplotlib library, how would you plot a line chart to visualize monthly sales? Assume you have a list of months and a list of corresponding sales numbers.
Question 7:
How would you use Python to connect to a SQL database and fetch data into a Pandas DataFrame?
Question 8:
Explain the concept of list comprehensions in Python. Can you provide an example where it's useful for data analysis?
Question 9:
How would you reshape a long-format DataFrame to a wide format using Pandas? Explain with an example.
Question 10:
What are lambda functions in Python? How are they beneficial in data wrangling tasks?
Question 11:
Describe a scenario where you would use the 'groupby()' method in Pandas. How would you aggregate data after grouping?
Question 12:
You are provided with a Pandas DataFrame that contains a column with date strings. How would you convert this column to a datetime format? Additionally, how would you extract the month and year from these datetime objects?
Question 13:
Explain the purpose of the 'pivot_table' method in Pandas and describe a business scenario where it might be useful.
Question 14:
How would you handle large datasets that don't fit into memory? Are you familiar with Dask or any similar libraries?
Question 15:
In a dataset, you observe that some numerical columns are highly skewed. How can you normalize or transform these columns using Python?
Python Interview Q&A: https://topmate.io/coding/898340
Like for more โค๏ธ
๐25โค7
Complete Python topics required for the Data Engineer role: https://t.iss.one/sql_engineer/70
Telegram
Data Engineers
Complete Python topics required for the Data Engineer role:
โค ๐๐ฎ๐๐ถ๐ฐ๐ ๐ผ๐ณ ๐ฃ๐๐๐ต๐ผ๐ป:
- Python Syntax
- Data Types
- Lists
- Tuples
- Dictionaries
- Sets
- Variables
- Operators
- Control Structures:
- if-elif-else
- Loops
- Break & Continue try-except blockโฆ
โค ๐๐ฎ๐๐ถ๐ฐ๐ ๐ผ๐ณ ๐ฃ๐๐๐ต๐ผ๐ป:
- Python Syntax
- Data Types
- Lists
- Tuples
- Dictionaries
- Sets
- Variables
- Operators
- Control Structures:
- if-elif-else
- Loops
- Break & Continue try-except blockโฆ
๐4
SQL Query Execution Order
๐๐
https://www.linkedin.com/posts/sql-analysts_guys-this-sql-question-is-asked-in-many-activity-7213904258629267456-PfZf
๐๐
https://www.linkedin.com/posts/sql-analysts_guys-this-sql-question-is-asked-in-many-activity-7213904258629267456-PfZf
๐7
Python road map
๐๐
https://www.linkedin.com/posts/sql-analysts_complete-roadmap-to-learn-python-for-beginners-activity-7214847272734363648-hSKY?
Like for more
๐๐
https://www.linkedin.com/posts/sql-analysts_complete-roadmap-to-learn-python-for-beginners-activity-7214847272734363648-hSKY?
Like for more
๐7