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 | 1736+ Python FAQs | Share
file-handling | recursion | dictionaries | python_version | max-min | list-operation | binary-operation | methods | join | access-modifier | design-principle | postfix | list-indexing | comprehension | control-flow | gil | threading | zip | matrix-list-comprehension | operator | iterator | generators | list-vs-tuple | round-function | application | global-keyword | tuple | math-copysign | objects | sum() | bitwise | numpy | data-type | installation | sys | destructor | yield | virtual-environment | sorting | exception | regex | collection | inherit | global-variable | numeric | collections | matrix | operators | integer | with-statement | boolean-and-non-boolean | mysql | list-comprehension | classes | raise | fabs-function | loops | slice | heap-memory | sum-function | python | oops | dicts | lists | function-argument | built-in | functions | complex-number | encoding | pseudocode | type_conversion | python-history | function-and-scope | function | higher-order-function | invalid-list | assert | arithmetic-operation | comparison | class-and-object | multiple-inheritance | error-handling | head-and-tail | list-mutation | mathematics | while-and-for-loop | __all__-attribute | memory-management | min-function | polymorphism | string-formatting | decorator | library | version | counter | oop | string-method | logical-operator | typeerror | conversion | class | counter-function | indentation | module | mapping-function | scientific-notation | overflow | zfill-function | print-statement | bitwise-operator | assignment-operator | implementation | frozenset | turtle | else-statement | indexing | mathematical-function | conditional-statement | exponentiation | map-function | filter | datatype | class-and-instance-variable | enumerate() | print | loop | input | list-comprehension | string-manipulation | center | operator-overloading | escape-operator | functional-programming | for | identity-operator | error | statement | array | exception-handling | identifier | return-statement | call | sorted | append | benefit | deep-copy | asyncio | goto-function | staticmethod | filter-function | string-method | operations | swapping | matplotlib | odd-number | control-flow | string | list | default-mutable-argument | set-operation | string-concatenation | rollback | dictionary | control-statement | format | type-conversion | descriptors | data-structure | loop-control | datetime | debugging | factorial-function | lambda-function | async | immutable-data-type | namedtuple | floating-point-precision | generators-in-python | context-manager | input-function | asyncio-module | command-line-parsing | inheritance | attribute | match | regular-expression | comment | data_structure | touples | object-attribute | syntax-error | file_handling | id-function | docstring | import-method | parameter | nested-loop | multiprocessing | python-django | recurssion | list-slicing | decimal | bitwise-operator | built-in-function | precedence-and-associativity | data-structures | string-iteration | pickling-&-unpickling | data-type | binary | multithreading | math | immutability | keyword | lambda | tuple-unpacking | variable | operator-and | stack | iterable | random | virtual-environment | lambdas | python-repl | min-max-function | python-module | string-slicing | logical-operator | range | basic | logical-operation | split | encapsulation | copy | thread | interpreter | built-in-function | string-slicing | sys-module | type-conversion | conditional-statement | memory | boolean | condition | __init_subclass__ | random-function | pandas | syntaxerror | class-and-inheritance | round | name-mangling | syntax-error | expression | method | identity-operator | formal-and-actual-parameter | set | choice | mutable | file | version-check | arithmetic-expression | package-management | global-variable | list-method | generator | update | feature | expand-tab | complex | precedence | compute | operand | file-handling | pep | constructor | init | while-loop | static-method | magic-method | operator-or | list-join | while-else-loop | int | string-formatting | global | def | slicing | input-function | namespace | shallow-copy | syntax | exception-handling | software-design | zip-function | data-structure | __future__ ...