This formula dynamically adjusts when copied, but a dollar sign ($) prevents part of it from changing—this is called:
Absolute referencing
What is the difference between lists and dictionaries?
Lists are a list of items, wheras disc
To prevent data loss or resource leaks, you should always call this method on a file object once you are finished with it.
.close()
True or False: The plt.show() function must be called after every plotting command to display the graph.
False!
This pandas function displays the first 5 rows of a DataFrame.
.head()
What is the primary difference between an IF statement and an IFS statement?
IF handles one condition, while IFS can handle multiple ordered conditions in a single function.
This method adds an element to the end of a list.
append()
To make a parameter optional, you can assign it one of these in the function header, allowing the function to run even if that argument is omitted.
Default value
What is the output of this code?
import numpy as np
a = np.array([1, 2, 3])
print(a * 2)
[2, 4, 6]
What is the difference between data.loc[] and data.iloc[]?
data.loc[] is label-based, you can select rows and columns by their named index. data.iloc[] is integer-based, selecting data on its numerical position, regardless of the label.
The WEEKDAY function in Excel returns:
Returns a number representing the day of the week for a given date. (1-7)
What will this print
for i in range(3):
print(i)
0,1,2
In the function header
def make_pizza(pepperoni, pineapple, olives)
these three toppings are called what in the syntax of a function?
Parameters.
This NumPy function creates an array of evenly spaced values between two numbers.
np.linspace()
True or false: While the Pandas library allows you to read an Excel file into a dataframe, you need to use the xlsxwriter library to write dataframes to Excel.
False! While Pandas requires an engine like xlsxwriter to be installed to handle the file construction, you actually execute the write operation using the native Pandas .to_excel() method.
What is the main difference between Goal Seek and Solver
Solver can change multiple cells and handle constraints, while Goal Seek changes one cell for one target.
What is the output of the following code?
x = [10, 20, 30, 40, 50]
print(x[1:4])
[20, 30, 40]
What is the difference between an attribute and a method in a class?
An attribute is a variable that belongs to an instance, a method is a function that belongs to a class
What does this code do?
with pd.ExcelWriter("file.xlsx") as writer:
df.to_excel(writer, sheet_name="Sheet1")
It writes a DataFrame to an Excel file using a specified sheet name
If an Excel workbook contains multiple tabs, you use this parameter within pd.read_excel() to specify which one to import.
Sheet_name =
You want to maximize profit by adjusting multiple decision variables with constraints; this Excel tool is used.
Solver
What is the output of the following code?
count = 0
while count < 3:
print(count)
count += 1
0 1 2
Write a Python class called Car that:
class Car:
def __init__(self, make, year):
self.make = make
self.year = year
def get_info(self):
return f"Make: {self.make}, Year: {self.year}"
Whoever can draw this on the board first wins:
import matplotlib.pyplot as plt
plt.plot([1,2,3], [4,5,6])
plt.show()
A line graph connecting the points (1,4), (2,5), (3,6)
What is the purpose of this code?
with pd.ExcelWriter("file.xlsx") as writer:
df.to_excel(writer, sheet_name="Sheet1")
It writes a DataFrame to an Excel file using a specified sheet name.