ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Hilfe
  • Sign Out
ArcGIS Desktop

ArcGIS Online

Die Mapping-Plattform für Ihre Organisation

ArcGIS Desktop

Ein vollständiges professionelles GIS

ArcGIS Enterprise

GIS in Ihrem Unternehmen

ArcGIS Developers

Werkzeuge zum Erstellen standortbezogener Apps

ArcGIS Solutions

Kostenlose Karten- und App-Vorlagen für Ihre Branche

ArcGIS Marketplace

Rufen Sie Apps und Daten für Ihre Organisation ab.

  • Dokumentation
  • Support
Esri
  • Anmelden
user
  • Eigenes Profil
  • Abmelden

ArcMap

  • Startseite
  • Erste Schritte
  • Karte
  • Analysieren
  • Verwalten von Daten
  • Werkzeuge
  • Erweiterungen

NumPyArrayToTable

  • Zusammenfassung
  • Auswertung
  • Syntax
  • Codebeispiel

Zusammenfassung

Konvertiert ein strukturiertes NumPy-Array in eine Tabelle.

Auswertung

Wenn ein Feldname aus dem Eingabe-Array für das Ausgabeformat ungültig ist, wird er validiert. Alle ungültigen Zeichen im Namen des Eingabefeldes werden im Namen des Ausgabefeldes durch einen Unterstrich (_) ersetzt. Beschränkungen für Feldnamen sind abhängig von der verwendeten Datenbank.

NumPyArrayToTable überschreibt eine vorhandene Tabelle nicht, auch wenn der Umgebungsparameter overwriteOutput auf "true" festgelegt ist.

NumPyArrayToTable akzeptiert nur strukturierte Arrays. Liegt ein reguläres NumPy-ndarray vor, muss es zunächst in ein strukturiertes Array konvertiert werden. Im Folgenden wird das ursprüngliche Array umgruppiert und das neue strukturierte Array mit der Methode numpy.core.records.fromarrays erstellt.

import numpy
import arcpy
import os

a = numpy.array([(0.2, 1.0), (0.5, 2.5)])
struct_array = numpy.core.records.fromarrays(
    a.transpose(), numpy.dtype([('Value1', 'f8'), ('Value2', 'f8')]))

arcpy.da.NumPyArrayToTable(struct_array, 'c:/data/f.gdb/array_output')

NumPy is a fundamental package for scientific computing in Python, including support for a powerful N-dimensional array object. For more information, see Working with NumPy in ArcGIS.

Syntax

NumPyArrayToTable (in_array, out_table)
ParameterErklärungDatentyp
in_array

Ein strukturiertes NumPy-Array.

Das Array muss Feldnamen und NumPy-dtypes enthalten.

NumPyArray
out_table

The table to which the records from the NumPy array will be written.

String

Codebeispiel

import arcpy
import numpy

# Create a simple array from scratch
#
inarray = numpy.array([('a', 1, 1111.0), ('b', 2, 2222.22)],
                      numpy.dtype([('textfield', '|S256'),
                                   ('intfield',numpy.int32),
                                   ('doublefield','<f8')]))

# Convert array to a geodatabase table
#
arcpy.da.NumPyArrayToTable(inarray, "c:/data/gdb.gdb/out_table")

import arcpy
import numpy

# Create a simple array from scratch using a list of values
#
recs = [['M', 64, 75.0],['F', 25, 60.0]]
dts = {'names': ('gender','age','weight'),
       'formats':('S1', numpy.uint8, numpy.float32)}
array = numpy.rec.fromrecords(recs, dtype=dts)

# Convert array to a geodatabase table
#
arcpy.da.NumPyArrayToTable(array, "c:/data/gdb.gdb/out_table")

Verwandte Themen

  • NumPyArrayToFeatureClass
  • FeatureClassToNumPyArray
  • TableToNumPyArray
  • Arbeiten mit NumPy in ArcGIS
  • ExtendTable

ArcGIS Desktop

  • Startseite
  • Dokumentation
  • Support

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

Über Esri

  • Über uns
  • Karriere
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Wir sind an Ihrer Meinung interessiert.
Copyright © 2021 Esri. | Datenschutz | Rechtliches