匿名函数python_基于python内置函数与匿名函数详解

内置函数

Built-in Functions

abs()

dict()

help()

min()

setattr()

all()

dir()

hex()

next()

slice()

any()

divmod()

id()

object()

sorted()

ascii()

enumerate()

input()

oct()

staticmethod()

bin()

eval()

int()

open()

str()

bool()

exec()

isinstance()

pow()

super()

bytes()

float()

iter()

print()

tuple()

callable()

format()

len()

property()

type()

chr()

frozenset()

list()

range()

vars()

classmethod()

getattr()

locals()

repr()

zip()

compile()

globals()

map()

reversed()

__import__()

complex()

hasattr()

max()

round()

bytearray()

filter()

issubclass()

pow()

super()

delattr()

hash()

memoryview()

set

截止到python版本3.6.2,现在python一共为我们提供了68个内置函数。它们就是python提供给你直接可以拿来使用的所有函数。

内置函数分类

2018010909503011.png

作用域相关

2018010909503012.png

基于字典的形式获取局部变量和全局变量

globals()——获取全局变量的字典

locals()——获取执行本方法所在命名空间内的局部变量的字典

其他

2018010909503013.png

输入输出相关

input()输入

s = input("请输入内容 : ") #输入的内容赋值给s变量

print(s) #输入什么打印什么。数据类型是str

print输出

def print(self, *args, sep=' ', end='\n', file=None): # known special case of print

"""

print(value, ..., sep=' ', end='\n', file=sys.stdout, flush=False)

file: 默认是输出到屏幕,如果设置为文件句柄,输出到文件

sep: 打印多个值之间的分隔符,默认为空格

end: 每一次打印的结尾,默认为换行符

flush: 立即把内容输出到流文件,不作缓存

"""

f = open('tmp_file','w')

print(123,456,sep=',',file = f,flush=True)

from time import sleep

for i in range(0,101,2):

sleep(0.1)

str="*"*(i//2)

print('\r%s%%:%s'%(i,str),end="",flush=True)

数据类型相关

type(s)返回s的数据类型

s="abc"

print(type(s))#

内存相关

id(s) s是参数,返回一个变量的内存地址

hash(s) s是参数,返回一个可hash变量的哈希值,不可hash的变量被hash之后会报错。

l1=[1,2,3]

l2=(1,2,3)

print(hash(l2))#2528502973977326415

print(hash(l1))#TypeError: unhashable type: 'list'

hash函数会根据一个内部的算法对当前可hash变量进行处理,返回一个int数字。

*每一次执行程序,内容相同的变量hash值在这一次执行过程中不会发生改变。

hash函数会根据一个内部的算法对当前可hash变量进行处理,返回一个int数字。

*每一次执行程序,内容相同的变量hash值在这一次执行过程中不会发生改变。

文件操作相关

open() 打开一个文件,返回一个文件操作符(文件句柄)

操作文件的模式有r,w,a,r+,w+,a+ 共6种,每一种方式都可以用二进制的形式操作(rb,wb,ab,rb+,wb+,ab+)

可以用encoding指定编码.

模块操作相关

__import__导入一个模块

os = __import__('os')

print(os.path.abspath('.'))

帮助方法

help(s) s为函数名

help(str)

#输出

class str(object)

| str(object='') -> str

| str(bytes_or_buffer[, encoding[, errors]]) -> str

|

| Create a new string object from the given object. If encoding or

| errors is specified, then the object must expose a data buffer

| that will be decoded using the given encoding and error handler.

| Otherwise, returns the result of object.__str__() (if defined)

| or repr(object).

| encoding defaults to sys.getdefaultencoding().

| errors defaults to 'strict'.

|

| Methods defined here:

|

| __add__(self, value, /)

| Return self+value.

|

| __contains__(self, key, /)

| Return key in self.

|

| __eq__(self, value, /)

| Return self==value.

|

| __format__(...)

| S.__format__(format_spec) -> str

|

| Return a formatted version of S as described by format_spec.

|

| __ge__(self, value, /)

| Return self>=value.

|

| __getattribute__(self, name, /)

| Return getattr(self, name).

|

| __getitem__(self, key, /)

| Return self[key].

|

| __getnewargs__(...)

|

| __gt__(self, value, /)

| Return self>value.

|

| __hash__(self, /)

| Return hash(self).

|

| __iter__(self, /)

| Implement iter(self).

|

| __le__(self, value, /)

| Return self<=value.

|

| __len__(self, /)

| Return len(self).

|

| __lt__(self, value, /)

| Return self

|

| __mod__(self, value, /)

| Return self%value.

|

| __mul__(self, value, /)

| Return self*value.n

|

| __ne__(self, value, /)

| Return self!=value.

|

| __new__(*args, **kwargs) from builtins.type

| Create and return a new object. See help(type) for accurate signature.

|

| __repr__(self, /)

| Return repr(self).

|

| __rmod__(self, value, /)

| Return value%self.

|

| __rmul__(self, value, /)

| Return self*value.

|

| __sizeof__(...)

| S.__sizeof__() -> size of S in memory, in bytes

|

| __str__(self, /)

| Return str(self).

|

| capitalize(...)

| S.capitalize() -> str

|

| Return a capitalized version of S, i.e. make the first character

| have upper case and the rest lower case.

|

| casefold(...)

| S.casefold() -> str

|

| Return a version of S suitable for caseless comparisons.

|

| center(...)

| S.center(width[, fillchar]) -> str

|

| Return S centered in a string of length width. Padding is

| done using the specified fill character (default is a space)

|

| count(...)

| S.count(sub[, start[, end]]) -> int

|

| Return the number of non-overlapping occurrences of substring sub in

| string S[start:end]. Optional arguments start and end are

| interpreted as in slice notation.

|

| encode(...)

| S.encode(encoding='utf-8', errors='strict') -> bytes

|

| Encode S using the codec registered for encoding. Default encoding

| is 'utf-8'. errors may be given to set a different error

| handling scheme. Default is 'strict' meaning that encoding errors raise

| a UnicodeEncodeError. Other possible values are 'ignore', 'replace' and

| 'xmlcharrefreplace' as well as any other name registered with

| codecs.register_error that can handle UnicodeEncodeErrors.

|

| endswith(...)

| S.endswith(suffix[, start[, end]]) -> bool

|

| Return True if S ends with the specified suffix, False otherwise.

| With optional start, test S beginning at that position.

| With optional end, stop comparing S at that position.

| suffix can also be a tuple of strings to try.

|

| expandtabs(...)

| S.expandtabs(tabsize=8) -> str

|

| Return a copy of S where all tab characters are expanded using spaces.

| If tabsize is not given, a tab size of 8 characters is assumed.

|

| find(...)

| S.find(sub[, start[, end]]) -> int

|

| Return the lowest index in S where substring sub is found,

| such that sub is contained within S[start:end]. Optional

| arguments start and end are interpreted as in slice notation.

|

| Return -1 on failure.

|

| format(...)

| S.format(*args, **kwargs) -> str

|

| Return a formatted version of S, using substitutions from args and kwargs.

| The substitutions are identified by braces ('{' and '}').

|

| format_map(...)

| S.format_map(mapping) -> str

|

| Return a formatted version of S, using substitutions from mapping.

| The substitutions are identified by braces ('{' and '}').

|

| index(...)

| S.index(sub[, start[, end]]) -> int

|

| Return the lowest index in S where substring sub is found,

| such that sub is contained within S[start:end]. Optional

| arguments start and end are interpreted as in slice notation.

|

| Raises ValueError when the substring is not found.

|

| isalnum(...)

| S.isalnum() -> bool

|

| Return True if all characters in S are alphanumeric

| and there is at least one character in S, False otherwise.

|

| isalpha(...)

| S.isalpha() -> bool

|

| Return True if all characters in S are alphabetic

| and there is at least one character in S, False otherwise.

|

| isdecimal(...)

| S.isdecimal() -> bool

|

| Return True if there are only decimal characters in S,

| False otherwise.

|

| isdigit(...)

| S.isdigit() -> bool

|

| Return True if all characters in S are digits

| and there is at least one character in S, False otherwise.

|

| isidentifier(...)

| S.isidentifier() -> bool

|

| Return True if S is a valid identifier according

| to the language definition.

|

| Use keyword.iskeyword() to test for reserved identifiers

| such as "def" and "class".

|

| islower(...)

| S.islower() -> bool

|

| Return True if all cased characters in S are lowercase and there is

| at least one cased character in S, False otherwise.

|

| isnumeric(...)

| S.isnumeric() -> bool

|

| Return True if there are only numeric characters in S,

| False otherwise.

|

| isprintable(...)

| S.isprintable() -> bool

|

| Return True if all characters in S are considered

| printable in repr() or S is empty, False otherwise.

|

| isspace(...)

| S.isspace() -> bool

|

| Return True if all characters in S are whitespace

| and there is at least one character in S, False otherwise.

|

| istitle(...)

| S.istitle() -> bool

|

| Return True if S is a titlecased string and there is at least one

| character in S, i.e. upper- and titlecase characters may only

| follow uncased characters and lowercase characters only cased ones.

| Return False otherwise.

|

| isupper(...)

| S.isupper() -> bool

|

| Return True if all cased characters in S are uppercase and there is

| at least one cased character in S, False otherwise.

|

| join(...)

| S.join(iterable) -> str

|

| Return a string which is the concatenation of the strings in the

| iterable. The separator between elements is S.

|

| ljust(...)

| S.ljust(width[, fillchar]) -> str

|

| Return S left-justified in a Unicode string of length width. Padding is

| done using the specified fill character (default is a space).

|

| lower(...)

| S.lower() -> str

|

| Return a copy of the string S converted to lowercase.

|

| lstrip(...)

| S.lstrip([chars]) -> str

|

| Return a copy of the string S with leading whitespace removed.

| If chars is given and not None, remove characters in chars instead.

|

| partition(...)

| S.partition(sep) -> (head, sep, tail)

|

| Search for the separator sep in S, and return the part before it,

| the separator itself, and the part after it. If the separator is not

| found, return S and two empty strings.

|

| replace(...)

| S.replace(old, new[, count]) -> str

|

| Return a copy of S with all occurrences of substring

| old replaced by new. If the optional argument count is

| given, only the first count occurrences are replaced.

|

| rfind(...)

| S.rfind(sub[, start[, end]]) -> int

|

| Return the highest index in S where substring sub is found,

| such that sub is contained within S[start:end]. Optional

| arguments start and end are interpreted as in slice notation.

|

| Return -1 on failure.

|

| rindex(...)

| S.rindex(sub[, start[, end]]) -> int

|

| Return the highest index in S where substring sub is found,

| such that sub is contained within S[start:end]. Optional

| arguments start and end are interpreted as in slice notation.

|

| Raises ValueError when the substring is not found.

|

| rjust(...)

| S.rjust(width[, fillchar]) -> str

|

| Return S right-justified in a string of length width. Padding is

| done using the specified fill character (default is a space).

|

| rpartition(...)

| S.rpartition(sep) -> (head, sep, tail)

|

| Search for the separator sep in S, starting at the end of S, and return

| the part before it, the separator itself, and the part after it. If the

| separator is not found, return two empty strings and S.

|

| rsplit(...)

| S.rsplit(sep=None, maxsplit=-1) -> list of strings

|

| Return a list of the words in S, using sep as the

| delimiter string, starting at the end of the string and

| working to the front. If maxsplit is given, at most maxsplit

| splits are done. If sep is not specified, any whitespace string

| is a separator.

|

| rstrip(...)

| S.rstrip([chars]) -> str

|

| Return a copy of the string S with trailing whitespace removed.

| If chars is given and not None, remove characters in chars instead.

|

| split(...)

| S.split(sep=None, maxsplit=-1) -> list of strings

|

| Return a list of the words in S, using sep as the

| delimiter string. If maxsplit is given, at most maxsplit

| splits are done. If sep is not specified or is None, any

| whitespace string is a separator and empty strings are

| removed from the result.

|

| splitlines(...)

| S.splitlines([keepends]) -> list of strings

|

| Return a list of the lines in S, breaking at line boundaries.

| Line breaks are not included in the resulting list unless keepends

| is given and true.

|

| startswith(...)

| S.startswith(prefix[, start[, end]]) -> bool

|

| Return True if S starts with the specified prefix, False otherwise.

| With optional start, test S beginning at that position.

| With optional end, stop comparing S at that position.

| prefix can also be a tuple of strings to try.

|

| strip(...)

| S.strip([chars]) -> str

|

| Return a copy of the string S with leading and trailing

| whitespace removed.

| If chars is given and not None, remove characters in chars instead.

|

| swapcase(...)

| S.swapcase() -> str

|

| Return a copy of S with uppercase characters converted to lowercase

| and vice versa.

|

| title(...)

| S.title() -> str

|

| Return a titlecased version of S, i.e. words start with title case

| characters, all remaining cased characters have lower case.

|

| translate(...)

| S.translate(table) -> str

|

| Return a copy of the string S in which each character has been mapped

| through the given translation table. The table must implement

| lookup/indexing via __getitem__, for instance a dictionary or list,

| mapping Unicode ordinals to Unicode ordinals, strings, or None. If

| this operation raises LookupError, the character is left untouched.

| Characters mapped to None are deleted.

|

| upper(...)

| S.upper() -> str

|

| Return a copy of S converted to uppercase.

|

| zfill(...)

| S.zfill(width) -> str

|

| Pad a numeric string S with zeros on the left, to fill a field

| of the specified width. The string S is never truncated.

|

| ----------------------------------------------------------------------

| Static methods defined here:

|

| maketrans(x, y=None, z=None, /)

| Return a translation table usable for str.translate().

|

| If there is only one argument, it must be a dictionary mapping Unicode

| ordinals (integers) or characters to Unicode ordinals, strings or None.

| Character keys will be then converted to ordinals.

| If there are two arguments, they must be strings of equal length, and

| in the resulting dictionary, each character in x will be mapped to the

| character at the same position in y. If there is a third argument, it

| must be a string, whose characters will be mapped to None in the result.

在控制台执行help()进入帮助模式。可以随意输入变量或者变量的类型。输入q退出

或者直接执行help(o),o是参数,查看和变量o有关的操作。。。

和调用相关

callable(s),s是参数,看这个变量是不是可调用。

如果s是一个函数名,就会返回True

def func():pass

print(callable(func))#True

print(callable(123))#Flase

查看参数所属类型的所有内置方法

dir() 默认查看全局空间内的属性,也接受一个参数,查看这个参数内的方法或变量

dir(list)

['__add__', '__class__', '__contains__', '__delattr__', '__delitem__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__gt__', '__hash__', '__iadd__', '__imul__', '__init__', '__init_subclass__', '__iter__', '__le__', '__len__', '__lt__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__reversed__', '__rmul__', '__setattr__', '__setitem__', '__sizeof__', '__str__', '__subclasshook__', 'append', 'clear', 'copy', 'count', 'extend', 'index', 'insert', 'pop', 'remove', 'reverse', 'sort']

和数字相关

2018010909503016.png

数字——数据类型相关:bool,int,float,complex

数字——进制转换相关:bin,oct,hex

数字——数学运算:abs,divmod,min,max,sum,round,pow

和数据结构相关

2018010909503017.png

序列——列表和元组相关的:list和tuple

序列——字符串相关的:str,format,bytes,bytearry,memoryview,ord,chr,ascii,repr

ret=bytearray('xiaozhangmen',encoding='utf-8')

print(ret)#bytearray(b'xiaozhangmen')

ret = memoryview(bytes('你好',encoding='utf-8'))

print(len(ret))

print(bytes(ret[:3]).decode('utf-8'))

print(bytes(ret[3:]).decode('utf-8'))

序列:reversed,slice

l=[1,2,3,4,5,6]

l.reverse()

print(l)#[6, 5, 4, 3, 2, 1]

l=[1,2,3,4,5,6]

sli=slice(1,4,2)#slice看起来返回的是一个规则,拿到这个规则后再对列表进行操作

print(l[sli])#[2, 4]

数据集合——字典和集合:dict,set,frozenset

数据集合:len,sorted,enumerate,all,any,zip,filter,map

filter:使用指定方法过滤可迭代对象的元素

def is_odd(x):

return x % 2 == 1

print(filter(is_odd,[1,2,3,4,5,6]))#

print(list(filter(is_odd,[1,2,3,4,5,6])))#[1, 3, 5]

map:python中的map函数应用于每一个可迭代的项,返回的是一个结果list。如果有其他的可迭代参数传进来,map函数则会把每一个参数都以相应的处理函数进行迭代处理。map()函数接收两个参数,一个是函数,一个是序列,map将传入的函数依次作用到序列的每个元素,并把结果作为新的list返回。

def pow(x):

return x**2

print(map(pow,[0,1,2,3]))#

print(list(map(pow,[0,1,2,3])))#[0, 1, 4, 9]

匿名函数

匿名函数:为了解决那些功能很简单的需求而设计的一句话函数

匿名函数格式:

函数名 = lambda 参数 :返回值

#参数可以有多个,用逗号隔开

#匿名函数不管逻辑多复杂,只能写一行,且逻辑执行结束后的内容就是返回值

#返回值和正常的函数一样可以是任意数据类型

匿名函数实例

#如把下面函数改为匿名函数

def add(x,y):

return x+y

add1=lambda x,y:x+y

print(add(1,2))

print(add1(1,2))

面试题笔记:

现有两个元组(('a'),('b')),(('c'),('d')),请使用python中匿名函数生成列表[{'a':'c'},{'b':'d'}]

#答案一

test = lambda t1,t2 :[{i:j} for i,j in zip(t1,t2)]

print(test(t1,t2))

#答案二

print(list(map(lambda t:{t[0]:t[1]},zip(t1,t2))))

#还可以这样写

print([{i:j} for i,j in zip(t1,t2)])

1.下面程序的输出结果是:

d = lambda p:p*2

t = lambda p:p*3

x = 2

x = d(x)

x = t(x)

x = d(x)

print x

2.现有两元组(('a'),('b')),(('c'),('d')),请使用python中匿名函数生成列表[{'a':'c'},{'b':'d'}]

3.以下代码的输出是什么?请给出答案并解释。

def multipliers():

return [lambda x:i*x for i in range(4)]

print([m(2) for m in multipliers()])

请修改multipliers的定义来产生期望的结果。

以上这篇基于python内置函数与匿名函数详解就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持脚本之家。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/266567.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

ASP.NET AJAX(服务器回调)

如果只用纯粹的 js &#xff0c;你必须弥补 ASP.NET 服务器端抽象和有限的 HTML DOM 之间的鸿沟&#xff0c;这不简单&#xff0c;没有 VS 的智能提示和调试工具&#xff0c;编写无错的代码和诊断错误都非常困难。由于各种突发事件及实现的差异&#xff0c;编写能够在所有现代浏…

git版本回退命令_Git学习版本回退和管理文件的修改及删除操作

版本回退前面我们成功的提交了一次mygit.txt&#xff0c;下面咱对它进行修改&#xff0c;内容如下&#xff1a;Hello GitGit is so easy.然后用git status来跟踪该文件的状态&#xff1a;可以看到hellogit.txt已经被修改过了&#xff0c;到底这次修改的内容与上次的内容有什么不…

node 版本升级_Node-RED: 自动化事件触发工具的安装与介绍

Node-RED 介绍Node-RED 是一种基于流程的编程工具由 IBM 的新兴技术服务团队原创开发Node-RED 是一种事件触发工具&#xff0c;和 StackStorm 类似, 可以归类为上层的自动化工具&#xff0c;可以用来触发与之相对应的下层自动化工具&#xff0c;比如 ansible&#xff0c;来更加…

python处理mysql数据结构_python环境下使用mysql数据及数据结构和二叉树算法(图)...

python环境下使用mysql数据及数据结构和二叉树算法(图)&#xff1a;1 python环境下使用mysql2使用的是 pymysql库3 开始-->创建connection-->获取cursor-->操作-->关闭cursor->关闭connection->结束45 代码框架6 import pymysql.cursors7 ###连接数据库8 con…

大数据工作流_大数据和人工智能时代下的数字化工作流

点击上方“Bentley软件”可以订阅哦本文作者Bentley 软件公司高级技术经理赵顺耐大数据、人工智能以及与之相伴相生的物联网已经成为现代社会的运行方式&#xff0c;信息技术的急速发展&#xff0c;和数据量爆炸式增长&#xff0c;改变了整个社会传统的运行方式。人类与信息技术…

多租户系统技术实现mysql_SaaS “可配置”和“多租户”架构的几种技术实现方式...

1、数据存储方式的选择多租户(Multi-Tenant )&#xff0c;即多个租户共用一个实例&#xff0c;租户的数据既有隔离又有共享&#xff0c;说到底是要解决数据存储的问题。常用的数据存储方式有三种。方案一&#xff1a;独立数据库一个Tenant&#xff0c;一个Database“的数据存储…

全国计算机等级考试题库二级C操作题100套(第15套)

更多干货推荐可以去牛客网看看&#xff0c;他们现在的IT题库内容很丰富&#xff0c;属于国内做的很好的了&#xff0c;而且是课程刷题面经求职讨论区分享&#xff0c;一站式求职学习网站&#xff0c;最最最重要的里面的资源全部免费&#xff01;&#xff01;&#xff01;点击进…

iOS如何判断当前网络的运营商

2019独角兽企业重金招聘Python工程师标准>>> 在IOS上存在retain屏&#xff0c;经常需要在一些时刻用到高清图&#xff0c;有些时候也要到普通图。 在网络条件很爽的情况下&#xff0c;这当然不在话下。如果咱是iphone用户&#xff0c;又正好用的是移动卡。 如果还用…

Py函数直接传入root是啥意思_Python内部函数——用处何在?

这是一篇译文&#xff0c;原文地址&#xff1a;https://realpython.com/inner-functions-what-are-they-good-for/1. 封装内部函数可以免受函数之外的情况的影响&#xff0c;也就是说&#xff0c;对于全局命名空间而言&#xff0c;它们是隐藏的。下面是一个简单的例子&#xff…

Linux 和 Windows 平台不同的 UCS-2 编码

2019独角兽企业重金招聘Python工程师标准>>> 以下是有关两个平台 UCS-2 编码的潜规则&#xff1a; 1, UCS-2 不等于 UTF-16。 UTF-16 每个字节使用 ASCII 字符范围编码&#xff0c;而 UCS-2 对每个字节的编码可以超出 ASCII 字符范围。UCS-2 和 UTF-16 对每个字符至…

vld检测不输出_输出轴热处理形变超差,找找原因

这里有最实用的技术&#xff0c;点击↑↑关注作者&#xff1a;阚亚威单位&#xff1a;镇江液压股份有限公司来源&#xff1a;《金属加工(热加工)》杂志我公司摆线液压马达输出轴材料主要为20CrMnTi&#xff0c;热处理工艺为渗碳直接淬火低温回火&#xff0c;工艺如图1所示。近期…

java 独占锁_锁分类(独占锁、分拆锁、分离锁、分布式锁)

一、java内存模型提到同步、锁&#xff0c;就必须提到Java的内存模型&#xff0c;为了提高程序的执行效率&#xff0c;java也吸收了传统应用程序的多级缓存体系。在共享内存的多处理器体系架构中&#xff0c;每个处理器都拥有自己的缓存&#xff0c;并且定期地与主内存进行协调…

url模糊匹配优化_企业必备的网站SEO优化解决方案

一、网站优化与调整倡议一个好网站不只要满足阅读者&#xff0c;还要契合搜索引擎规则、满足搜索引擎快照抓取、赋予评级、提升关键词排序等。我们站在用户角度和搜索引擎规则根底上为您提供一套完好的SEO处理计划SEO处理计划SEO倡议大纲&#xff1a;1、目的客户剖析与定位&…

中文能用rsa加密吗_外文文献数据库能用中文词进行检索吗?

大家使用外文文献数据库进行检索的时候可能想过一个问题&#xff1a;我们可以使用中文关键词进行检索吗&#xff1f;上文献检索课的老师可能会这样回答&#xff1a;在一般情况下&#xff0c;是不可以的。那么实际情况是怎样的呢&#xff1f;我们找几个外文文献数据库来验证一下…

【maven3学习之三】maven构建一个简单的Hello World

2019独角兽企业重金招聘Python工程师标准>>> 在写之前我先需要配置一下setting.xml。 首先是localRepository&#xff0c;默认情况下是【你的用户目录】/.m2/repository作为本地库的目录&#xff0c;但是我希望将其放在D:\maven_localRepository的目录下面。 如果…

python营销骗局_python案例:金融营销活动中欺诈用户行为分析

首先&#xff0c;数据导入 1 importnumpy as np2 importpandas as pd3 from collections importCounter4 importmatplotlib.pyplot as plt5 from pymining importitemmining,assocrules,perftesting,seqmining6 importpyecharts as pe7 rtpd.read_csv(r"E:\transaction_tr…

你真的会数钱吗?

本文已迁移至&#xff1a;http://thinkinside.tk/2013/01/01/money.html 快年底了&#xff0c;假如你们公司的美国总部给每个人发了一笔201212.21美元的特别奖金&#xff0c;作为程序员的你&#xff0c; 该如何把这笔钱收入囊中&#xff1f; Table of Contents 1 美元&#xff…

Maven 系统环境变量配置

Download http://maven.apache.org/download.cgi http://mirrors.shu.edu.cn/apache/maven/maven-3/3.5.4/binaries/apache-maven-3.5.4-bin.zip 环境变量 1.添加 MAVEN_HOME&#xff1a; 变量名&#xff1a;MAVEN_HOME  变量值&#xff1a;C:\Program\apache-maven-3.5.4 注…

eclipse中文乱码解决_解决git status显示中文文件名乱码问题

使用 git status 查看本地有改动但未提交的中文文件名时&#xff0c;发现会显示为一串数字&#xff0c;没有显示中文的文件名。具体如下所示&#xff1a;$ git status# 位于分支 master# 尚未暂存以备提交的变更:# (使用 "git add ..." 更新要提交的内容)# (使用 &qu…

MongoDB 3.X 用户权限控制

摘要&#xff1a; MongoDB 3.0 安全权限访问控制&#xff0c;在添加用户上面3.0版本和之前的版本有很大的区别&#xff0c;这里就说明下3.0的添加用户的方法。 环境、测试&#xff1a; 在安装MongoDB之后&#xff0c;先关闭auth认证&#xff0c;进入查看数据库&#xff0c;只有…