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