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