pandas 3

Reference: https://mp.weixin.qq.com/s?__biz=MzU5Mjg2OTQ1MA==&mid=2247484097&idx=1&sn=ad8fabbd84bf67655996026fc0ac5688&chksm=fe1863e4c96feaf200e9398bb7c824e99d3fc01ec965666497ce584466dc93f83dd5d127a46d&scene=21#wechat_redirect

1 engine analysis engine is used to read csv file generally designated python avoid an error caused by encoding and Chinese.

 

 2 df.info () to help us find out each step of the column data types , as well as missing cases:

 

 3 Pandas used, to avoid thinking treated with the data line, to gradually develop a column to thinking, each column is the same root, the process is fast up whizzing

41) increase in a, with DF [ 'new column name'] = new column value of the form

2) to develop a corresponding drop function to delete columns, axis = 1 denotes the column for the operation, with a plurality of rows deleted [col1, col2, col3]

 

 3) Select a column: df [ 'Column Name'] to select multiple columns: df [[ 'first row', 'second row', 'the third column' ..]]

 

 

 

4 simple changes: df [ 'old column name'] = a value or a column value, to complete the modification of the original column values.

Modified multi-column: df2 [[ 'aa', 'cc']] = 90

 5 

Guess you like

Origin www.cnblogs.com/testzcy/p/11578193.html