1. What do all elements of a NumPy array share?
- A Python object type per element
- A single value
- A single dtype
- Nothing in particular
जवाब देखें
जवाब: A single dtype
One dtype enables fast, compact storage.
NumPy / Pandas / scikit-learn कोर्स के 25 सवाल, हर सवाल के सही जवाब और explanation के साथ। जवाब देखने से पहले ख़ुद सोचें।
जवाब: A single dtype
One dtype enables fast, compact storage.
जवाब: Yes, the (3,) array is broadcast across each row
Trailing dimensions match.
जवाब: A basic slice such as a[1:4]
Slices are views; masks and lists copy.
जवाब: The mean of each exam (column)
axis=0 collapses rows.
जवाब: nan
NaN spreads; use np.nanmean to ignore it.
जवाब: They add the numbers in a different order, and floating-point addition is not exactly associative
Compare floats with a tolerance.
जवाब: Its own dtype
Columns are typed Series.
जवाब: iloc
i for integer position.
जवाब: NaN
Missing values become NaN.
जवाब: Drops every row that has any missing value
Often too aggressive; use subset.
जवाब: Turns unparseable values into NaN
Bad values become missing.
जवाब: df.loc[df["a"] > 1, "b"] = 0
One loc call on the original.
जवाब: transform
Same length as the input.
जवाब: A left join from orders
Left keeps all left rows.
जवाब: They are combined with the aggregation function
pivot_table aggregates; pivot would fail.
जवाब: Aggregates into weeks ending on Sunday
Weekly bins, W-SUN.
जवाब: To keep class proportions the same in train and test sets
Stratification preserves class balance.
पाठ: The Estimator API
जवाब: Recall
Recall = found positives / all positives.
जवाब: The model is no better than predicting the mean
R² compares to the mean baseline.
जवाब: Encodes unseen categories as all zeros instead of raising an error
Robust to new categories.
जवाब: TimeSeriesSplit
Never train on the future.
पाठ: Cross-Validation
जवाब: svc__C
step__parameter.
जवाब: Put them in a Pipeline so they are fitted only on training folds
Fit preprocessing on training data only.
पाठ: Data Leakage
जवाब: Unpickling can execute arbitrary code
Pickle is not a safe format for untrusted input.
जवाब: Compare the model to a dummy baseline
A baseline shows whether the model adds value.