WorksheetsPlay with Python Lib
Total questions: 25
Worksheet time: 13mins
What is a correct syntax to create a Pandas Series from a Python list?
pd.Series(mylist)
pd.createSeries(mylist)
pd.getSeries(mylist)
What is a correct syntax to return the first value of a Pandas Series?
myseries.get(0)
myseries[0]
get(myseries, 0)
What is a correct syntax to add the lables "x", "y", and "z" to a Pandas Series?
pd.Series(mylist, index = ["x", "y", "z"])
pd.Series(mylist, lables = ["x", "y", "z"])
pd.Series(mylist, names = ["x", "y", "z"])
What is a correct syntax to create a Pandas DataFrame?
pd.DataFrame(data)
pd.df(data)
pd.dataframe(data)
What is a correct syntax to return the first row in a Pandas DataFrame?
df[0]
df.loc[0]
df.get(0)
What is a correct syntax to return both the first row and the second row in a Pandas DataFrame?
df.loc[[0, 1]]
df.[[0, 1]]
df.[[0-1]]
df.loc[[0-1]]
What is the correct Pandas function for loading CSV files into a DataFrame?
read_csv()
read_file()
ReadCSV()
ReadFile()
When you print a DataFrame, by default you will get the headers and how many rows?
the first 10 and the last 10
the first 10
the first 5
the first 5 and the last 5
What is a correct syntax to return the entire DataFrame
df.to_string()
df.Full()
df.print_full()
df.dump()
What is the correct Pandas function for loading JSON files into a DataFrame?
read_file()
read_json()
ReadFile()
ReadJSON()
What is a correct syntax to load a Python Dictionary called "data" into a Pandas DataFrame?
pd.DataFrame(data)
pd.load_json(data)
pd.ReadJSON(data)
What does the Pandas head() method do?
Returns the headers
Returns the headers and the specified number of rows, starting from the top
Returns the specified number of rows, starting from the top
For the Pandas head() method, how many rows are returned by default, if you do not specify it?
All
10
5
What is a correct Pandas method for returning the last rows?
last()
tail()
back()
foot()
What is a correct Pandas method for removing rows that contains empty cells?
delete_null
dropna()
remove_null()
True or false: by default, the Pandas dropna() method returns a new DataFrame, and will not change the original.
True
False
What is a correct method to fill empty cells with a new value?
value_null()
fillna()
insertna()
replacena()
When using the Pandas dropna() method, what argument allowes you to change the original DataFrame instead of returning a new one?
dropna(inplace = True)
dropna(original = True)
dropna(keep = True)
Mean, Median, Mode. Which one returns the value in the middle?
median()
mode()
mean()
Mean, Median, Mode. Which one returns the value that appears most frequently?
mode()
median()
mean()
Mean, Median, Mode. Which one returns the average value?
mode()
mean()
median()
What is a correct method to remove duplicates from a Pandas DataFrame?
df.drop_duplicates()
df.remove_duplicates()
df.duplicates()
df.delete_duplicates()
What is a correct method to discover if a row is a duplicate?
df.duplicate()
df.dup()
df.duplicated()
What is a correct method to find relationships between column in a DataFrame?
df.corr()
df.correlation()
df.rel()
df.relation()
What is a correct method to plot (draw) diagrams from the data in a DataFrame?
df.draw()
df.print()
df.plot()
