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