Level 10 : What will be the output of the following code?


import numpy as np

a = np.array([1, 2, 3, 4, 5])
print(a[a > 3])

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