How python uses the Map command
This article is about how python uses the Map command. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Map
This is a command that can perform simple data conversion. First define a dictionary where 'keys' is the old value and' values' is the new value.
Level_map = {1: 'high', 2:' medium', 3: 'low'} df [' centering level'] = df ['c'] .map (level_map)
To give a few examples: True,False is 1J 0 (for modeling); definition level; user-defined lexical coding.
Thank you for reading! This is the end of this article on "how to use Map commands in python". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!