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