Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

The function of adding columns and rows to the numpy array

Shulou Source: shulou.com Published: 2022-06-02 05:06:26 10月16日 Update

This article mainly talks about "the function of adding columns and rows to the numpy array". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn the function of adding columns and rows to the numpy array.

Def fun_ndarray (): a = np.array (a) b = np.array (a) b = np.array (b) a_b_column = np.column_stack ((a) B)) # concatenate a_b_row = np.row_stack ((AMagneb)) according to column # splice print ('axib column') print (a_b_column) print (a_b_row) up and down according to row

Results:

The argument to the note:column_stack,row_stack function is a tuple

Np.delete (): delete rows or columns

Data = np.delete (data,3,axis=1) # delete the fourth column here, I believe you have a better understanding of "the function of adding columns and rows to the numpy array", you might as well do it in practice! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Function array content learning practical deeper upper and lower interest parameter practicality practice simple operation method more friends results website channel query Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker macOS NVidia OPPO Reno Microsoft