Level 10 : Given the following DataFrame df, what will df.loc[df['A'] > 2, 'B'] return?


import pandas as pd

df = pd.DataFrame({
    'A': [1, 2, 3, 4],
    'B': ['a', 'b', 'c', 'd']
})

Author: KaivalyaG | Tags: pandas | 1859+ Python FAQs | Share
data-structure | input-function | assignment-operators | implementation | built-in | assignment-operator | interpreter | booleans | built-in-modules | lambda-function | global-keyword | command-line-parsing | binary-operation | pseudocode | multiple-inheritance | list-indexing | list-mutation | list-operation | asyncio-module | import-method | statement | logical-operators | escape-operator | operator-and | access-modifier | exponentiation | python-django | aggregating-data-with-functools.reduce() | name-mangling | random | numeric | list-methods-and-slicing | goto-function | error-handling | boolean | math | function-argument | postfix | nested-loop | precedence-and-associativity | descriptors | max-min | package-management | mathematics | odd-number | pandas | parameter | python | numpy | overriding-methods | functional-programming | class-and-inheritance | file_handling | error-handling | intering | dictionary | enumerate() | compute | heap-memory | immutable-data-type | init | methods | complex-number | dictionary-methods | key-value-pairs | global | matplotlib | quantifiers-(*,-+,-?,-{}) | global-variable | __init_subclass__ | thread | identity-operators-(is,-is-not) | min-max-function | dataframe-and-series-objects | stack | working-with-binary-files-(rb,-wb) | dictionaries | regular-expressions | file | frozenset | datetime.date,-datetime.time,-datetime.datetime | opening-files-(open()) | reading-and-writing-large-files-efficiently | format | recurssion | difference-between-threads-and-processes | append | namedtuple | raise | string-method | data-structures-in-python | iterable | staticmethod | call | classes | operator | oops | head-and-tail | round | encoding | application | filter-function | python-syntax-and-structure | multithreading | pass | collection | namespace | lambdas | global-variable | collections | object-attribute | print | operand | control-flow | creating-and-starting-threads | input | else | random-function | data-type | identity-operator | def | data-types | mutable | tuple | python-module | loop-control | lists | data_structure | regex | operators | class-and-object | exception-handling | choice | loop | scientific-notation | string-slicing | lambda | comparison | introduction-to-multiprocessing | python_version | class-decorators | __future__ | input-function | sys | python-history | installation | class | datetime | thread-synchronization | identifier | counter | destructor | introduction-to-python | slicing | floats | string-concatenation | functions | async | floating-point-precision | copy | identity-operator | while-else-loop | filtering-and-indexing | arbitrary-arguments-(*args,-**kwargs) | multiple-except-blocks | version | version-check | exception-handling | constructor | binary | literal-characters-and-special-characters | using-lists-as-stacks | string-formatting | gil | bitwise-operator | complex | type-conversion | module | id-function | while-loops | indexing:-loc-vs-iloc | condition | min-function | attribute | overflow | comment | deep-copy | matrix | arithmetic-operation | file-handling | advanced-file-operations | memory | list-comprehensions | else-statement | list-slicing | method | arithmetic-expression | control-flow | counter-function | strings | operator-overloading | regular-expression | bitwise | magic-method | raise-statement | match | string | feature | unit-testing | oop | swapping | print-statement | default-arguments | docstring | immutability | function-and-scope | using-assertions-(assertequal,-assertraises) | logical-operation | string-formatting | formal-and-actual-parameter | sorted | type-conversion | integers | formatting-with-strftime | syntaxerror | dictionary-comprehensions | polymorphism | managing-directories-with-os-and-shutil | error | __all__-attribute | basic | logical-operator | pickling--unpickling | range | comprehension | python-repl | sum() | thread-safe-data-structures-(queue.queue) | conditional-statement | expression | library | decorator | python-operators | working-with-file-paths | matrix-list-comprehension | list-comprehension | decimal | tuples | boolean-and-non-boolean | data-structures | operations | sys-module | filter | list-method | expand-tab | pep | default-mutable-argument | data-structure | test-discovery | string-slicing | mysql | debugging | update | control-statement | anchors-(^,-$) | set-operation | loop-control-statements | type-conversion-and-casting | recursion | working-with-dates-and-times | center | tuple-methods | array | mathematical-function | sum-function | threading | string-iteration | benefit | yield | list,-set,-and-dictionary-comprehensions | boolean-masking | using-else-and-finally | method-overloading | indentation | built-in-function | higher-order-function | precedence | data-type | while-loop | loops | math-copysign | membership-operators-(in,-not-in) | bitwise-operator | context-manager | using-map()-for-transformations | working-with-temporary-files-using-tempfile | handling-missing-values-(fillna,-dropna) | built-in-function | class-and-instance-variable | using-yield-in-functions | iterators | variable | conditional-statements | sorting-and-ranking | logical-operator | functional-programming | reading-and-writing-files | return-statement | virtual-environment | memory-management | function | rollback | map-function | file-handling | datatype | directory-operations | list-vs-tuple | multiple-inheritance | using-the-threading-module | conditional-statement | mapping-function | joining-and-merging-dataframes | assert | parsing-with-strptime | why-use-multiprocessing-over-threading?-(gil) | asyncio | round-function | multiprocessing | writing:-write(),-writelines() | integer | introduction-to-threads | data-type-conversions | generators-in-python | virtual-environment | creating-custom-modules | operator-or | objects | design-principle | tuple-unpacking | static-method | conversion | syntax | string-manipulation | iterator | with-statement | zip | split | defining-functions | encapsulation | using-os-and-pathlib-modules | for | time-series-with-pandas | typeerror | exception | sorting | factorial-function | string-methods | fabs-function | while-and-for-loop | turtle | string-method | slice | reading:-read(),-readline(),-readlines() | list-comprehension | zfill-function | set | indexing | touples | sets | type_conversion | walking-through-directories-using-os.walk() | generators | syntax-error | generator | inheritance | shallow-copy | single-inheritance | lambda-functions | using-join()-and-is_alive()-methods | zip-function | list | software-design | inherit | invalid-list | list-join | syntax-error | keyword | join | dicts | int ...