Python Interview Questions for data analyst interview
Question 1: Find the top 5 dates when the percentage change in Company A's stock price was the highest.
Question 2: Calculate the annualized volatility of Company B's stock price. (Hint: Annualized volatility is the standard deviation of daily returns multiplied by the square root of the number of trading days in a year.)
Question 3: Identify the longest streaks of consecutive days when the stock price of Company A was either increasing or decreasing continuously.
Question 4: Create a new column that represents the cumulative returns of Company A's stock price over the year.
Question 5: Calculate the 7-day rolling average of both Company A's and Company B's stock prices and find the date when the two rolling averages were closest to each other.
Question 6: Create a new DataFrame that contains only the dates when Company A's stock price was above its 50-day moving average, and Company B's stock price was below its 50-day moving average
Question 1: Find the top 5 dates when the percentage change in Company A's stock price was the highest.
Question 2: Calculate the annualized volatility of Company B's stock price. (Hint: Annualized volatility is the standard deviation of daily returns multiplied by the square root of the number of trading days in a year.)
Question 3: Identify the longest streaks of consecutive days when the stock price of Company A was either increasing or decreasing continuously.
Question 4: Create a new column that represents the cumulative returns of Company A's stock price over the year.
Question 5: Calculate the 7-day rolling average of both Company A's and Company B's stock prices and find the date when the two rolling averages were closest to each other.
Question 6: Create a new DataFrame that contains only the dates when Company A's stock price was above its 50-day moving average, and Company B's stock price was below its 50-day moving average
👍15❤5
👍6❤3
Python Most Important Interview Questions
Question 1: Calculate the average stock price for Company X over the last 6 months.
Question 2: Identify the month with the highest total sales for Company Y using their monthly sales data.
Question 3: Find the maximum and minimum stock price for Company Z on any given day in the last year.
Question 4: Create a column in the DataFrame showing the percentage change in stock price from the previous day for Company X.
Question 5: Determine the number of days when the stock price of Company Y was above its 30-day moving average. Question
6: Compare the average stock price of Companies X and Z in the first quarter of the year.
#Data#
----------------------------------------------
import pandas as pd
data = { 'Date': pd.date_range(start='2023-01-01', periods=180, freq='D'), 'CompanyX_StockPrice': pd.np.random.randint(50, 150, 180), 'CompanyY_Sales': pd.np.random.randint(20000, 50000, 180), 'CompanyZ_StockPrice': pd.np.random.randint(70, 200, 180) }
df = pd.DataFrame(data)
Question 1: Calculate the average stock price for Company X over the last 6 months.
Question 2: Identify the month with the highest total sales for Company Y using their monthly sales data.
Question 3: Find the maximum and minimum stock price for Company Z on any given day in the last year.
Question 4: Create a column in the DataFrame showing the percentage change in stock price from the previous day for Company X.
Question 5: Determine the number of days when the stock price of Company Y was above its 30-day moving average. Question
6: Compare the average stock price of Companies X and Z in the first quarter of the year.
#Data#
----------------------------------------------
import pandas as pd
data = { 'Date': pd.date_range(start='2023-01-01', periods=180, freq='D'), 'CompanyX_StockPrice': pd.np.random.randint(50, 150, 180), 'CompanyY_Sales': pd.np.random.randint(20000, 50000, 180), 'CompanyZ_StockPrice': pd.np.random.randint(70, 200, 180) }
df = pd.DataFrame(data)
👍19❤6👏4
Complete Python Course with Building 10 Real-world Applications
👇👇
https://www.linkedin.com/posts/sql-analysts_python-viral-pythonprogramming-activity-7141826568485605376-tf7V
👇👇
https://www.linkedin.com/posts/sql-analysts_python-viral-pythonprogramming-activity-7141826568485605376-tf7V
👍21👏6
👍12👏5
Python for Data Analysts
Complete Python Course with Building 10 Real-world Applications 👇👇 https://www.linkedin.com/posts/sql-analysts_python-viral-pythonprogramming-activity-7141826568485605376-tf7V
Sent to all who liked and commented on the post 😄
❤8👍6
Master Python with this Free Guide
👇👇
https://www.linkedin.com/posts/sql-analysts_master-python-with-this-free-guide-tips-activity-7142572820852641793-l0UX?utm_source=share&utm_medium=member_android
👇👇
https://www.linkedin.com/posts/sql-analysts_master-python-with-this-free-guide-tips-activity-7142572820852641793-l0UX?utm_source=share&utm_medium=member_android
👍10
Forwarded from Python Projects & Resources
Master Python Programming with this Free Notion Guide
👇👇
https://www.linkedin.com/posts/sql-analysts_python-pythonprojects-freecourses-activity-7143810292228026368-wnhL?utm_source=share&utm_medium=member_android
👇👇
https://www.linkedin.com/posts/sql-analysts_python-pythonprojects-freecourses-activity-7143810292228026368-wnhL?utm_source=share&utm_medium=member_android
👍11
Python Libraries every Data Scientist should know
Join for more -> https://t.iss.one/addlist/KBNT2WWRIEs0NzIx
All the best 👍👍
Join for more -> https://t.iss.one/addlist/KBNT2WWRIEs0NzIx
All the best 👍👍
👍25❤10🥰1
👍10❤4
Python is a popular programming language in the field of data analysis due to its versatility, ease of use, and extensive libraries for data manipulation, visualization, and analysis. Here are some key Python skills that are important for data analysts:
1. Basic Python Programming: Understanding basic Python syntax, data types, control structures, functions, and object-oriented programming concepts is essential for data analysis in Python.
2. NumPy: NumPy is a fundamental package for scientific computing in Python. It provides support for large multidimensional arrays and matrices, along with a collection of mathematical functions to operate on these arrays.
3. 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 and perform tasks such as filtering, grouping, joining, and reshaping data.
4. Matplotlib and Seaborn: Matplotlib is a versatile library for creating static, interactive, and animated visualizations in Python. Seaborn is built on top of Matplotlib and provides a higher-level interface for creating attractive statistical graphics.
5. Scikit-learn: Scikit-learn is a popular machine learning library in Python that provides tools for building predictive models, performing clustering and classification tasks, and evaluating model performance.
6. Jupyter Notebooks: Jupyter Notebooks are an interactive computing environment that allows you to create and share documents containing live code, equations, visualizations, and narrative text. They are commonly used by data analysts for exploratory data analysis and sharing insights.
7. SQLAlchemy: SQLAlchemy is a Python SQL toolkit and Object-Relational Mapping (ORM) library that provides a high-level interface for interacting with relational databases using Python.
8. Regular Expressions: Regular expressions (regex) are powerful tools for pattern matching and text processing in Python. They are useful for extracting specific information from text data or performing data cleaning tasks.
9. Data Visualization Libraries: In addition to Matplotlib and Seaborn, data analysts may also use other visualization libraries like Plotly, Bokeh, or Altair to create interactive visualizations in Python.
10. Web Scraping: Knowledge of web scraping techniques using libraries like BeautifulSoup or Scrapy can be useful for collecting data from websites for analysis.
By mastering these Python skills and applying them to real-world data analysis projects, you can enhance your proficiency as a data analyst and unlock new opportunities in the field.
1. Basic Python Programming: Understanding basic Python syntax, data types, control structures, functions, and object-oriented programming concepts is essential for data analysis in Python.
2. NumPy: NumPy is a fundamental package for scientific computing in Python. It provides support for large multidimensional arrays and matrices, along with a collection of mathematical functions to operate on these arrays.
3. 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 and perform tasks such as filtering, grouping, joining, and reshaping data.
4. Matplotlib and Seaborn: Matplotlib is a versatile library for creating static, interactive, and animated visualizations in Python. Seaborn is built on top of Matplotlib and provides a higher-level interface for creating attractive statistical graphics.
5. Scikit-learn: Scikit-learn is a popular machine learning library in Python that provides tools for building predictive models, performing clustering and classification tasks, and evaluating model performance.
6. Jupyter Notebooks: Jupyter Notebooks are an interactive computing environment that allows you to create and share documents containing live code, equations, visualizations, and narrative text. They are commonly used by data analysts for exploratory data analysis and sharing insights.
7. SQLAlchemy: SQLAlchemy is a Python SQL toolkit and Object-Relational Mapping (ORM) library that provides a high-level interface for interacting with relational databases using Python.
8. Regular Expressions: Regular expressions (regex) are powerful tools for pattern matching and text processing in Python. They are useful for extracting specific information from text data or performing data cleaning tasks.
9. Data Visualization Libraries: In addition to Matplotlib and Seaborn, data analysts may also use other visualization libraries like Plotly, Bokeh, or Altair to create interactive visualizations in Python.
10. Web Scraping: Knowledge of web scraping techniques using libraries like BeautifulSoup or Scrapy can be useful for collecting data from websites for analysis.
By mastering these Python skills and applying them to real-world data analysis projects, you can enhance your proficiency as a data analyst and unlock new opportunities in the field.
👍48❤13🥰1
7 must know SQL concepts with resources to learn 👇👇
https://www.instagram.com/reel/C3szNi4NLh3/?igsh=enpicm5wN2swNTBv
https://www.instagram.com/reel/C3szNi4NLh3/?igsh=enpicm5wN2swNTBv
👍7❤2