python中出现的不懂的知识点汇总

2020/01/13

关于数据转换的问题

import numpy as np

List转numpy.array:

temp = np.array(list) 

numpy.array转List:

arr = temp.tolist() 

1. memory error

unable to allacate 

https://blog.csdn.net/xovee/article/details/101077022

2.virtualenv

https://www.cnblogs.com/simplelovecs/p/5149982.html

3. 关于 import tensorflow的时候出现的future warning的解决方法

https://blog.csdn.net/LKCNFV/article/details/100176691

4.python的正则表达式

https://blog.csdn.net/qq_34776336/article/details/81416232

20200210 Monday 12:25 CA

5. python 的逻辑运算符

Python Bitwise Operator
a. Binary AND(&)
011(3) and 100(4) results in 000(0)
3&4: 0

b. Binary OR(|)
10(2) and 11(3) results in 11(3)
2|3: 3

c. Binary XOR(^)
10(2) and 11(3) results in 01(1).
2^3: 1

d. Binary One’s Complement(~)
Binary for 2 is 00000010. Its one’s complement is 11111101. This is binary for -3. 
So, this results in -3. Similarly, ~1 results in -2.
~-3: 2

e. Binary Left-Shift(<<)
2<<2 shifts it two places to the left. This results in 1000, which is binary for 8.
2<<2: 8

f. Binary Right-Shift(>>)
3>>2 shifts it two places to the right. This results in 00, which is binary for 0.
3>>1: 1

bin(num) operation: convert integer into binary number!!!!!

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值