NEW
Font size
WorksheetsPython Basics, Strings & Pandas Worksheet
Total questions: 70
Worksheet time: 35mins
What symbol is used to create a comment in Python?
//
#
;;
Which of the following is a valid Python variable name?
2var
_data
for
var-name
Which operator is used for assignment in Python?
==
:=
=>
=
What does the print() function do?
Saves a file
Returns a value
Outputs text to screen
Pauses execution
What is the file extension for Python scripts?
.pt
.script
.python
.py
Loops and Functions — What keyword starts a while loop?
do
repeat
while
loop
Which function is used to get user input in Python?
input()
scan()
read()
prompt()
What keyword exits a loop prematurely?
skip
exit
break
stop
What does continue do in a loop?
Ends the loop
Skips the current iteration
Prints an error
Starts a new loop
Which of these is a valid function definition in Python?
def add(x, y):
function add(x, y)
define add(x, y):
func add(x, y)
Strings & Data Types — What data type is "123" in Python?
Integer
Float
String
Boolean
What is the result of "2" + "2" in Python?
4
"22"
Error
None
Which method converts all string characters to uppercase?
toUpper()
upper()
uppercase()
makeUpper()
Which method is used to remove whitespace from both sides of a string?
clean()
strip()
trim()
remove()
Which function gives the length of a string?
size()
count()
len()
length()
Pandas — What does df.head() display?
Last 5 rows
Summary
First 5 rows
Column names only
What data structure is used in Pandas for 2D data?
Array
Table
DataFrame
Tuple
How do you select a single column called 'Age' from a DataFrame df?
df.select('Age')
df['Age']
df.get('Age')
df.Age()
What function is used to merge two DataFrames?
join()
append()
bind()
merge()
What does fillna() do in Pandas?
Removes all rows
Fills missing values
Deletes duplicates
Adds new rows
What does np.array([1,2,3]) create?
DataFrame
List
Series
NumPy array
How do you calculate the mean of a NumPy array arr?
arr.mean()
mean(arr)
np.mean(arr)
average(arr)
What will arr[1:3] return?
1st to 3rd element
2nd and 3rd element
1st to 2nd element
2nd to 4th element
What does np.arange(0, 10) return?
Array from 0 to 9
Array from 0 to 10
Error
List from 1 to 10
Which of the following is not a NumPy statistical function?
np.mean
np.std
np.count
np.median
What is plt.plot() used for?
Tables
Line graphs
Histograms
Labels
Which function adds a title to a plot?
title()
plt.title()
plot.title()
graph.title()
Which library is used with Matplotlib to plot Pandas data?
SciPy
Seaborn
Pandas
NumPy
What function displays the plot?
plot()
draw()
show()
plt.display()
What does plt.hist() plot?
Bar chart
Scatter plot
Histogram
Pie chart
Which function is used to access the current ArcGIS Pro project?
arcpy.project()
arcpy.loadProject()
arcpy.mp.ArcGISProject()
arcpy.mp.open()
What does map.listLayers() return?
Layout elements
Map names
Feature classes
Layers in a map
Which ArcPy method adds symbology from another layer?
ApplyStyle()
ApplyLayer()
ApplySymbologyFromLayer()
StyleLayer()
What is the file extension for ArcGIS layer files?
.lyrx
.shx
.csv
.gdb
Which command saves changes to a project in ArcPy?
aprx.save()
aprx.commit()
arcpy.saveProject()
aprx.write()
What does GIS stand for?
Global Information Structure
Geographical Information System
General Info Statistics
Geospatial Internet Services
Which of the following is a component of GIS?
SQL
Cloud computing
People
Blockchain
What are the two main GIS data models?
Linear and Circular
Spatial and Temporal
Raster and Vector
2D and 3D
What does vector data represent?
Elevation
Pixels
Points, lines, polygons
Images
What is the smallest unit of raster data?
Cell
Pixel
Node
Vertex
Who is known as the "Father of GIS"?
Jack Dangermond
Dr. Roger Tomlinson
Ian McHarg
John Snow
What does topology ensure in vector data?
Data encryption
Projection
Spatial relationships
Table sorting
Which GIS type is used via browsers?
Desktop GIS
Enterprise GIS
Web GIS
Cloud GIS
Which data model is better for surface analysis?
Vector
Raster
SQL
Feature
What does attribute data describe?
Location
Coordinates
Features
Descriptive characteristics of features
Which ArcPy command removes a layer from a map?
map.remove()
removeLayer()
map.deleteLayer()
remove(layer)
Which is NOT a type of GIS listed in GIS-503?
Desktop GIS
Mobile GIS
Cloud GIS
Terminal GIS
What is the format of a GIS raster file pixel value?
Vector
Binary
Single value
Multi-value array
What is the purpose of listLayouts() in ArcPy?
Lists maps
Lists tables
Lists layout elements
Lists map legends
What is the advantage of vector data over raster?
More colorful
Simpler structure
Better for surface modeling
More compact and accurate geometry
What is the primary data structure used by GeoPandas?
DataGrid
GeoSeries
GeoFrame
GeoDict
What file format does Fiona primarily work with?
NetCDF
.csv
.shp
.tif
Which function in GeoPandas is used to read a shapefile?
gpd.load()
gpd.read_file()
gpd.open_shapefile()
shapefile.read()
What is the purpose of the Shapely library?
Plot satellite images
Read raster data
Manipulate geometric shapes
Connect to APIs
Which of the following is a valid Shapely geometry?
GeoPoint
Polygon
Raster
Layer
What does folium.Map() create?
A point geometry
A coordinate list
An interactive leaflet map
A shapefile
What function in Folium adds markers to a map?
add_layer()
Marker()
add_point()
Drop()
What file format does Rasterio commonly work with?
.json
.shp
.tif
.xlsx
Which module is commonly used with Rasterio to read metadata?
rasterio.meta.read()
rasterio.open().meta
rasterio.read()
rasterio.open().info()
What function is used to read raster data in Rasterio?
read_image()
rasterio.load()
dataset.read()
open_raster()
In Network Analyst, what is the purpose of arcpy.na.MakeRouteLayer()?
To edit routes
To convert to shapefile
To create a route analysis layer
To export a network dataset
Which method adds locations to a network analysis layer?
arcpy.na.AssignPoints()
arcpy.na.AddLocations()
arcpy.na.Attach()
arcpy.na.Insert()
What unit is commonly used for impedance in ArcPy network analysis?
Inches
Minutes
Meters
Degrees
What is the result of arcpy.na.Solve()?
A raster file
An edited feature
A solved route or network
A spatial join
In Folium, how do you save a map to an HTML file?
map.save()
map.export()
map.to_file()
map.write_html()
Which of the following can be used to validate geometries in Shapely?
.validate()
.check()
.is_valid
.test()
What does GeoDataFrame.plot() do in GeoPandas?
Creates an HTML map
Plots geometries on a static map
Converts raster to vector
Writes to a shapefile
Which of these libraries is best suited for reading and writing shapefiles?
Shapely
Rasterio
Fiona
NumPy
In a routing analysis, what are "Stops"?
Raster layers
Metadata points
Locations to include in a route
Temporary buffers
What function in Fiona is used to open a shapefile?
fiona.open()
fiona.read_file()
fiona.load()
fiona.shapefile()
