{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[[0 0 0]\n", " [0 0 0]]\n" ] } ], "source": [ "import numpy as np\n", "\n", "l = [[0, 0, 0], [0, 0, 0]]\n", "arr = np.array(l)\n", "print(arr)" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "int64 (2, 3) 2\n" ] } ], "source": [ "print(arr.dtype, arr.shape, arr.ndim)" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[[0, 0, 0] [0, 0]]\n" ] } ], "source": [ "l2 = [[0, 0, 0], [0, 0]]\n", "arr2 = np.array(l2)\n", "print(arr2)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "object (2,) 1\n" ] } ], "source": [ "print(arr2.dtype, arr2.shape, arr2.ndim)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.2" } }, "nbformat": 4, "nbformat_minor": 2 }