Informatics Practices 12 Q&A
- Home
- / Python Handay
- / Informatics Practices 12 Q&A
- What is Pandas in Python?
Pandas is a powerful data manipulation and analysis library for Python, primarily used for working with structured data.
- How do you create a DataFrame in Pandas?
Use the pd.DataFrame() function. Example: df = pd.DataFrame(data).
- How can you read a CSV file using Pandas?
Use the pd.read_csv(‘filename.csv’) function.
- What is the purpose of the head() method in Pandas?
The head() method returns the first n rows of a DataFrame. Example: df.head(5).
- How do you select a specific column from a DataFrame?
Use the column name as a key. Example: df[‘column_name’].
- How can you filter rows in a DataFrame?
Use boolean indexing. Example: df[df[‘age’] > 18].
- How do you handle missing values in a DataFrame?
Use methods like dropna() to remove or fillna(value) to fill missing values.
- What is Matplotlib in Python?
Matplotlib is a plotting library for Python used to create static, interactive, and animated visualizations.
- How do you create a simple line plot in Matplotlib?
Use plt.plot(x, y) followed by plt.show().
- What is the purpose of plt.xlabel() and plt.ylabel()?
These functions are used to set the labels for the x-axis and y-axis, respectively.
- How do you create a bar chart in Matplotlib?
Use plt.bar(x, height) to create a bar chart.
- How can you save a plot as an image file in Matplotlib?
Use the savefig(‘filename.png’) function.
- What function is used to create a histogram in Matplotlib?
The plt.hist() function is used to create histograms.
- What is the purpose of plt.legend() in Matplotlib?
plt.legend() is used to display a legend on the plot, indicating different data series.
- How do you retrieve all records from a MySQL table?
Use the SELECT * FROM table_name; statement.
- What is the COUNT() function in MySQL?
The COUNT() function returns the number of rows that match a specified criterion.
- How do you use the AVG() function in MySQL?
The AVG() function calculates the average value of a numeric column.
- How do you update a record in MySQL?
Use of UPDATE command.
- What is the DISTINCT keyword in MySQL?
The DISTINCT keyword is used to return only unique values in a query.
- How do you sort results in MySQL?
Use the ORDER BY clause..
- What is the CONCAT() function in MySQL?
The CONCAT() function is used to concatenate two or more strings.
- How do you find the length of a string in MySQL?
Use the LENGTH() function.
- What does the UPPER() function do in MySQL?
The UPPER() function converts a string to uppercase.
- How can you extract a substring in MySQL?
Use the SUBSTRING() function.
- How do you round a number in MySQL?
Use the ROUND() function.
- What is the NOW() function in MySQL?
The NOW() function returns the current date and time.
- What is the societal impact of computer technology?
Computer technology impacts society by improving communication, enhancing productivity, and enabling access to information.
- What are the ethical concerns related to artificial intelligence?
Ethical concerns include privacy issues, job displacement, and decision-making transparency.
- What is cyberbullying, and how does it impact individuals?
Cyberbullying is harassment through digital means, which can lead to emotional distress and mental health issues.
- What is a computer network?
A computer network is a collection of interconnected devices that can communicate and share resources.
- What is the purpose of a router?
A router directs data packets between different networks, managing traffic and connections.
- What is the difference between LAN and WAN?
LAN (Local Area Network) covers a small geographic area, while WAN (Wide Area Network) covers a larger area, such as multiple cities.
- What does the term ‘bandwidth’ refer to in networking?
Bandwidth refers to the maximum rate of data transfer across a network path.