Get the App
SLTechnology News&Howtos  ›  Development  › 

How python uses the Map command

Shulou Source: shulou.com Published: 2022-06-01 04:51:09 09月10日 Update

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!

Tags: Commands content more articles good practical examples dictionaries data articles levels users look knowledge coding lexicology this is reference help related Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Shulou Information Shulou Tech Info Redmi NVidia