[Python] 练习代码

news/2024/7/2 23:23:24
# from random import randrange
# num = int(input('摇几次骰子: '))
# sides=int(input('筛子有几个面: '))
# sum=0
# for i in range(num):
#     sum+= randrange(sides)+1
# print('最终的点数和是 ',sum,'平均点数是:',sum/num)# from random import shuffle
# from pprint import pprint
# values=list(range(1,11))+'Jack Queen King'.split()  #并入列表中
# card_suits='diamonds clubs hearts spades'.split()
# value_suit=['{} of {}'.format(v,c) for v in values for c in card_suits]
# shuffle(value_suit)  #打乱顺序
# pprint(value_suit[:12])
# while value_suit:
#     input(value_suit.pop())
f=open('a123.txt','a')
f.write('hello aaaaaaaaaaaaadddddddddddddddddd')
f.close()f=open('a123.txt','r')
for i in range(10):print(f.readline(),end='')f = open('a123.txt','a')
f.write('This\nis no\nhaikou')
f.close()def process(string):print('处理中...',string)# with open('a123.txt','r') as f:
#     while True:
#         line=f.readline()
#         if not line:
#             break
#         process(line)
with open('a123.txt','r') as f:for line in f:process(line)with open('a123.txt','r') as f:for line in f.readlines():process(line)def triangles():row = [1]while True:yield(row)row = [1] + [row[k] + row[k + 1] for k in range(len(row) - 1)] + [1]
n = 0
results = []
for t in triangles():print(t)results.append(t)n = n + 1if n == 10:break
if results == [[1],[1, 1],[1, 2, 1],[1, 3, 3, 1],[1, 4, 6, 4, 1],[1, 5, 10, 10, 5, 1],[1, 6, 15, 20, 15, 6, 1],[1, 7, 21, 35, 35, 21, 7, 1],[1, 8, 28, 56, 70, 56, 28, 8, 1],[1, 9, 36, 84, 126, 126, 84, 36, 9, 1]
]:print('测试通过!')
else:print('测试失败!')' a test module '__author__ = 'Michael Liao'import sysdef test():args = sys.argvif len(args)==1:print('Hello, world!')elif len(args)==2:print('Hello, %s!' % args[1])else:print('Too many arguments!')if __name__=='__main__':test()class Student(object):pass
bart = Student()
bart.name='jojo'
bart.nameclass Student(object):def __init__(self, name, score):self.name = nameself.score = scoredef get_grade(self):if self.score >= 90:return 'A'elif self.score >= 60:return 'B'else:return 'C'gg=Student('aaa',100)
gg.get_grade()for c in "python":if c=='t':continueprint(c,end=' ')s='python'
while s !='':for c in s:print(c,end='')s=s[:-1]import random
from pprint import pprint
pprint(random.seed(10))
random.random()from random import random
from time import perf_counter
DARTS=1000*10000
hits=0.0
start=perf_counter()
for i in range(1,DARTS+1):x,y=random(),random()dist=pow(x**2+y**2,0.5)if dist <= 1:hits=hits+1
pi = 4*(hits/DARTS)
print("圆周率值是:{}".format(pi))
print('运行时间是:{:.20f}s'.format(perf_counter()-start))import requests
r=requests.get('http://www.shipxy.com/')
r.status_code
r.textfor i in range(1,5):for j in range(1,5):for k in range(1,5):if (i!=j)and(j!=k)and(k!=i):print(i,j,k)profit = int(input('输入发放的利润值(万元): '))
if 0 <= profit <10:print('提成为:',profit*0.1,'万元')
if 10 <= profit < 20:print('提成为:',(profit-10)*0.075+10*0.1,'万元')
if 20 <= profit < 40:print('提成为:',(profit-20)*0.05+10*0.075+10*0.1,'万元')
if 40 <= profit < 60:print('提成为:',(profit-40)*0.03+20*0.05+10*0.075+10*0.1,'万元')
if 60 <= profit < 100:print('提成为:',(profit-60)*0.015+20*0.03+20*0.05+10*0.075+10*0.1,'万元')
if profit >= 100:print('提成为:',(profit-100)*0.01+40*0.015+20*0.03+20*0.05+10*0.075+10*0.1,'万元')profit = int(input('输入企业的利润值(万元): '))
gap = [100,60,40,20,10,0]
ratio =[0.01,0.015,0.03,0.05,0.075,0.1]
bonus=0
for idx in range(0,6):if profit >= gap[idx]:bonus += (profit-gap[idx])*ratio[idx]profit=gap[idx]
print('提成为:',bonus,'万元')profit = int(input('输入企业的利润值(万元): '))
def get_bonus(profit):bonus = 0if 0 <= profit <= 10:bonus = 0.1*profitelif (profit > 10) and (profit <= 20):bonus = (profit-10)*0.075 + get_bonus(10)elif (profit > 20) and (profit <= 40):bonus = (profit-20)*0.05 + get_bonus(20)elif (profit > 40) and (profit <= 60):bonus = (profit-40)*0.03 + get_bonus(40)elif (profit > 60) and (profit <= 100):bonus = (profit-60)*0.015 + get_bonus(60)elif (profit >100):bonus = (profit-100)*0.01 + get_bonus(100)else:print("利润输入值不能为负")return bonusif __name__ == '__main__':print('提成为:',get_bonus(profit),'万元')'''
分析:
x + 100 = m^2
x + 100 + 168 = n^2
n^2 - m^2 = 168
(n + m) * (n - m) = 168
n > m >= 0
n - m 最小值为 1
n + m 最大为 168
n 最大值为 168
m 最大值为 167
'''def _test():for m in range(0, 168):for n in range(m + 1, 169):#print('n=%s,m=%s' % (n, m))if (n + m) * (n - m) == 168:print("该数为:" + str(n * n - 168 - 100))print("该数为:" + str(m * m - 100))print('n为%s,m为%s' % (n, m))
if __name__ == '__main__':_test()def test1():for n in range(0,168):for m in range(n,169):if (m+n)*(m-n) == 168:print("这个整数是: ",str(n*n-100))
if __name__ =='__main__':test1()import pandas as pd
df = pd.read_csv(r'c:\Users\clemente\Desktop\all\train.csv',index_col='Id')
df.head()for i in range(0,7):for j in range(0,7):for k in range(0,7):for g in range(0,7):for h in range(0,7):while (i!=j) and(i!=g) and(g!=h)and(h!=k)and(k!=i):if (i+j+k+g+h)==15:print (i,j,k,g,h)import random
def gen5num():alldigit=[0,1,2,3,4,5,6,0]first=random.randint(0,6)  #randint包含两端,0和6
    alldigit.remove(first)second=random.choice(alldigit)alldigit.remove(second)third=random.choice(alldigit)alldigit.remove(third)forth=random.choice(alldigit)alldigit.remove(forth)fiveth=random.choice(alldigit)alldigit.remove(fiveth)if (first+second+third+forth+fiveth)==15:return first,second,third,forth,fiveth
if __name__=='__main__':for i in range(100):print(gen5num())#!/usr/bin/env python3
#coding=utf-8from itertools import permutations
t = 0
for i in permutations('0123456',5):print(''.join(i))t += 1print("不重复的数量有:%s"%t)def sum_1():"""aaaddd"""for i in '01234567':p += int(i)print(sum(p))
sum_1()np.*load*?#题目:数组中找出两个元素之和 等于给定的整数# 思路:
# 1、将数组元素排序;
# 2、array[i]与a[j](j的取值:i+1到len_array-1) 相加;
# 3、如两两相加<整数继续,如=整数则输出元素值;
# 4、如>则直接退出,i+1 开始下一轮相加比较def addData(array, sumdata):"""aaaadddd"""temp_array = arraytemp_sumdata = sumdataprint ("sumdata: {}".format(temp_sumdata))sorted(temp_array)len_temp_array = len(temp_array)# 计数符合条件的组数num = 0for i in range(0, len_temp_array-1):for j in range(i+1, len_temp_array):for k in range(j+1,len_temp_array):if temp_array[i] + temp_array[j] + temp_array[k] < temp_sumdata:continueelif temp_array[i] + temp_array[j] + temp_array[k] == temp_sumdata:num += 1print("Group {} :".format(num))print("下标:{}, 元素值: {}".format(i, temp_array[i]))else:breakif __name__=="__main__":test_array = [0,1,2,3,4,5,6,0]test_sumdata = 4addData(test_array, test_sumdata)#题目:数组中找出两个元素之和 等于给定的整数# 思路:
# 1、将数组元素排序;
# 2、array[i]与a[j](j的取值:i+1到len_array-1) 相加;
# 3、如两两相加<整数继续,如=整数则输出元素值;
# 4、如>则直接退出,i+1 开始下一轮相加比较import numpy as np
names=np.array(['Bob','Joe','Will','Bob','Will','Joe','Joe'])
data=np.random.randn(7,4)
names
data
names == 'Bob'
data[names=='Bob']arr[[4,3,0,6]]import matplotlib.pyplot as plt
points = np.arange(-5,5,0.01)
xs,ys=np.meshgrid(points,points)
z=np.sqrt(xs**2+ys**2)plt.imshow(z,cmap=plt.cm.gray)
plt.colorbar()
plt.title("图像  $\sqrt{x^2+y^2}$")import pandas as pd
obj=pd.Series(range(3),index=["a","b","c"])
index=obj.index
index[1]='d'
import numpy as np
import pandas as pd
data=pd.DataFrame(np.arange(16).reshape(4,4),index=[1,2,3,4],columns=["one","two","three","forth"])
data<3df1=pd.DataFrame({"A":[1,2]})
df1obj=pd.Series(["a","a","b","c"]*4)
obj
obj.describe()import json 
result = json.loads(obj)
resultimport pandas as pd
ages=[12,34,23,45,67,30,20,55,98,30,43]
bins=[1,20,30,40,50,100]
cats=pd.cut(ages,bins)
cats
cats.codes
pd.value_counts(cats)DataF=pd.DataFrame(np.arange(5*4).reshape((5,4)))
DataF
sample_1=np.random.permutation(5*4)
sample_1.reshape(5,4)df=pd.DataFrame({'key':['b','b','a','c','a','b'],'data1':range(6)})
df
df[["data1"]]import pandas as pd
left=pd.DataFrame({'key1':['foo','foo','bar'],'key2':['one','two','one'],'lval':[1,2,3]})
right=pd.DataFrame({'key1':['foo','foo','bar','bar'],'key2':['one','one','one','two'],'rval':[4,5,6,7]})
pd.merge(left,right,on=['key1'])import matplotlib.pyplot as plt
import numpy as np
data=np.arange(10000)
plt.plot(data)fig=plt.figure()
ax1=fig.add_subplot(2,2,1)
ax2=fig.add_subplot(2,2,2)
ax3=fig.add_subplot(2,2,3)ax1.hist(np.random.randn(100),bins=20,color='k',alpha=0.5)
ax2.scatter(np.arange(30),np.arange(30)+3*np.random.randn(30))
ax3.plot(np.random.randn(50).cumsum(),drawstyle='steps-post')fig=plt.figure()
ax=fig.add_subplot(1,1,1)
rect=plt.Rectangle((0.5,0.8),0.4,0.4,color='g',alpha=0.4)
ax.add_patch(rect)plt.savefig("真的.svg",bbox_inches='tight')s=pd.Series(np.random.randn(10).cumsum())
s.plot()s=pd.Series(np.random.randn(10).cumsum(),index=np.arange(0,100,10))
s.plot()df=pd.DataFrame(np.random.randn(10,4).cumsum(0),columns=['A','B','C','D'],index=np.arange(0,100,10))
df.plot()fig,axes=plt.subplots(2,1)
data=pd.Series(np.random.rand(16),index=list("abcdefghijklmnop"))
data.plot.bar(ax=axes[0],color='k',alpha=0.7)
data.plot.barh(ax=axes[1],color='g',alpha=0.7)
plt.show()df=pd.DataFrame(np.random.rand(6,4),index=['one','two','three','four','five','six'],columns=pd.Index(['A','B','C','D'],name='Genus'))
df
df.plot.bar()
df.plot.barh(stacked=True,alpha=0.5)tips=pd.read_csv('tips.csv')
party_counts = pd.crosstab(tips['day'],tips['size'])
party_counts
party_counts=party_counts.loc[:,2:5]
party_countsparty_counts.sum(1)party_pcts= party_counts.div(party_counts.sum(1),axis=0)
party_pcts.plot.bar()import seaborn as sns
tips=pd.read_csv('tips.csv')
tips['tip_pct']=tips['tip']/(tips['total_bill']-tips['tip'])
tips.head()
sns.barplot(x='tip_pct',y='day',data=tips,orient='h')
sns.barplot(x='tip_pct',y='day',hue='time',data=tips,orient='h')
sns.set(style='whitegrid')tips['tip_pct'].plot.hist(bins=50)
tips['total_bill'].plot.hist(bins=50)tips['tip_pct'].plot.density()
tips['total_bill'].plot.density()comp1=np.random.normal(0,1,size=200)
comp2=np.random.normal(10,2,size=200)
values=pd.Series(np.concatenate([comp1,comp2]))
sns.distplot(values,bins=101,color='k')macro=pd.read_csv('macrodata.csv')
data=macro[['cpi','m1','tbilrate','unemp']]
trans_data=np.log(data).diff().dropna()
trans_data.head()
trans_data[-5:]sns.regplot("m1","unemp",data=trans_data)
plt.title('Changes in log {} versus log {}'.format('m1','unemp'))
sns.set(style="ticks", color_codes=True)
sns.pairplot(trans_data,diag_kind='kde',kind='reg')
sns.pairplot(trans_data,diag_kind='hist',kind='reg')sns.factorplot(x='day',y='tip_pct',row='time',hue='smoker',kind='box',data=tips[tips.tip_pct<0.5])tips.describe()import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
df=pd.DataFrame({'key1':['a','a','b','b','a'],'key2':['one','two','one','two','one'],'data1':np.random.randn(5),'data2':np.random.randn(5)})
dfgroup_1=df['data1'].groupby(df['key1'])
group_1.describe()
group_2=df['data1'].groupby([df['key1'],df['key2']]).mean()
group_2states=np.array(['Ohio','California','California','Ohio','Ohio'])
years=np.array([2005,2005,2006,2005,2006])
df['data1'].groupby([states,years]).mean()dict(list(df.groupby('key1')))try:year=input("输入年份:")month=input("输入月份: ")day=input("输入日期号: ")
finally:print("正在计算")months2days=[0,31,59,90,120,151,181,212,243,273,304,334]
# 闰年
if int(year) % 4 ==0:for i in range(2,12,1):months2days[i] +=1month_index=[]
for j in range(12):month_index.append(i+1)
dict_md=dict(zip(month_index,months2days))
whichday=dict_md[int(month)]+int(day)
print('结果是: 第{}天'.format(whichday))def unsortedSearch(list, i, u):found = Falsepos = 0pos2 = 0while pos < len(list) and not found:if int(list[pos]) < int(u) :if int(list[pos2]) > int(i):found = Truepos2 = pos2 + 1pos = pos + 1return foundunsortedList = ['1', '3', '4', '2', '6', '9', '2', '1', '3', '7']
num1 = '3'
num2 = '5'isItThere = unsortedSearch(unsortedList, num1, num2)if isItThere:print ("There is a number between those values")
else:print ("There isn't a number between those values")def get_nums():nums=[]n=int(input("一共有几个整数?"))for i in range(n):x=int(input('请按次随机输入第{}个整数(剩余{}次输入):'.format(i+1,n-i)))nums.append(x)return nums
if __name__=='__main__':list_nums=get_nums()def BubbleSort(nums):  #冒泡法print('初始整数集合为:{}'.format(nums))for i in range(len(nums)-1):for j in range(len(nums)-i-1):if nums[j]>nums[j+1]:nums[j],nums[j+1]=nums[j+1],nums[j] #调换位置,相互赋值print("第{}次迭代排序结果:{}".format((len(nums)-j-1),nums))return nums
if __name__=='__main__':print('经过冒泡法排序最终得到:{}'.format(BubbleSort(list_nums)))def get_nums():nums=[]n=int(input("一共有几个整数?"))for i in range(n):x=int(input('请按次随机输入第{}个整数(剩余{}次输入):'.format(i+1,n-i)))nums.append(x)return nums
if __name__=='__main__':myList=get_nums()def selectedSort(myList):#获取list的长度length = len(myList)#一共进行多少轮比较for i in range(0,length-1):#默认设置最小值得index为当前值smallest = i#用当先最小index的值分别与后面的值进行比较,以便获取最小indexfor j in range(i+1,length):#如果找到比当前值小的index,则进行两值交换if myList[j]<myList[smallest]:tmp = myList[j]myList[j] = myList[smallest]myList[smallest]=tmp#打印每一轮比较好的列表print("Round ",i,": ",myList) #根据第一个i循环进行打印,而不是选j循环print("选择排序法:迭代过程 ")
selectedSort(myList)def merge_sort(LIST):start = []end = []while len(LIST) > 1:a = min(LIST)b = max(LIST)start.append(a)end.append(b)LIST.remove(a)LIST.remove(b)if LIST: start.append(LIST[0])end.reverse()return (start + end)if __name__=='__main__':nums=[]n=int(input('一共几位数: '))for i in range(n):x=int(input("请依次输入整数:"))nums.append(x)print(merge_sort(nums))# =============================================================================
#10.1.2
# =============================================================================
import pandas as pd
df=pd.DataFrame({'key1':['a','a','b','b','a'],'key2':['one','two','one','two','one'],'data1':np.random.randn(5),'data2':np.random.randn(5)})
df
df.groupby(['key1','key2'])['data1'].mean()people=pd.DataFrame(np.random.randn(5,5),columns=['a','b','c','d','e'],index=['joe','steve','wes','jim','travis'])
people
mapping={'a':'red','b':'red','c':'blue','d':'blue','e':'red','f':'orange'}
by_column=people.groupby(mapping,axis=1)
by_column.mean()
map_series=pd.Series(mapping)people.groupby(len).sum()# =============================================================================
# 分组加权
# =============================================================================import pandas as pd
df=pd.DataFrame({'目录':['a','a','a','a','b','b','b','b'],'data':np.random.randn(8),'weights':np.random.randn(8)})
df
grouped=df.groupby('目录')
get_weighpoint=lambda x: np.average(x['data'],weights=x['weights'])
grouped.apply(get_weighpoint)# =============================================================================
# 
# =============================================================================

spx=pd.read_csv('stock_px_2.csv',index_col=0,parse_dates=True)
spx
spx.info()from datetime import datetimedatestrs=['7/6/2011','8/6/2011']
[datetime.strptime(x,'%m/%d/%Y')for x in datestrs]dates=pd.date_range('1/1/2018',periods=1000)
dates
long_df=pd.DataFrame(np.random.randn(1000,4),index=dates,columns=['Colorado','Texas','New York','Ohio'])
long_dfpd.date_range('2018-10-1',periods=30,freq='1h')# =============================================================================
# 
# =============================================================================
close_px_all=pd.read_csv("stock_px_2.csv",parse_dates=True,index_col=0)
close_px=close_px_all[['AAPL','MSFT','XOM']]
close_px=close_px.resample("B").ffill()
close_px.AAPL.plot()
close_px.AAPL.rolling(250).mean().plot()import pandas as pd
import numpy as np
values=pd.Series(['apple','orange','apple','apple']*2)
values
pd.unique(values)
pd.value_counts(values)import pandas as pd
import matplotlib.pyplot as plt
from sklearn.linear_model import RANSACRegressor, LinearRegression, TheilSenRegressor
from sklearn.metrics import explained_variance_score, mean_absolute_error, mean_squared_error, median_absolute_error, r2_score
from sklearn.svm import SVR
from sklearn.linear_model import Ridge,Lasso,ElasticNet,BayesianRidge
from sklearn.ensemble import GradientBoostingRegressor
from sklearn.cross_validation import train_test_splitdata = pd.read_csv('../cement_data.csv')
# 查看数据记录的长度,共1030行
print(len(data))
# 查看前五行数据
data.head()import pandas
titanic=pandas.read_csv('train.csv')
titanic.head()
titanic.describe()
titanic['Age']=titanic['Age'].fillna(titanic['Age'].median())
print(titanic['Sex'].unique()) #找Sex特征里的分类字符名,只有两种可能性
titanic.loc[titanic['Sex']=='female','Sex']=1#把分类字符名转换成整数1,0形式,进行标记
titanic.loc[titanic['Sex']=='male','Sex']=0
#对embarked 登船地 进行填充(按最多标记)
print(titanic['Embarked'].unique())
titanic['Embarked']=titanic['Embarked'].fillna('S')
titanic.loc[titanic['Embarked']=='S']=0
titanic.loc[titanic['Embarked']=='C']=1
titanic.loc[titanic['Embarked']=='Q']=2# =============================================================================
# 引进模型,线性回归
# =============================================================================
from sklearn.linear_model import LinearRegression
from sklearn.cross_validation import KFold
#cross_validation 交叉验证,进行调参,训练数据集分成三份,三份做交叉验证

predictors=['Pclass','Sex','Age','SibSp','Parch','Fare','Embarked'] #需要输入并做预测的特征列
alg=LinearRegression()
kf=KFold(titanic.shape[0],n_folds=3,random_state=1) #shape[0]一共有多少行,random_state=1 随机种子开启,n_fold=3把训练集分为三份

predictions=[]
for train,test in kf:train_predictors=titanic[predictors].iloc[train,:]  #交叉验证中,除开训练的部分train_target=titanic['Survived'].iloc[train]#获取目标训练集alg.fit(train_predictors,train_target) #依据模型,训练
    test_predictions=alg.predict(titanic[predictors].iloc[test,:]) #测试集
    predictions.append(test_predictions)import numpy as np
predictions=np.concatenate(predictions,axis=0)
# 整理输出值,按照可能性分类到0,1
predictions[predictions>=0.5]=0
predictions[predictions<0.5]=1
accuracy=sum(predictions[predictions==titanic['Survived']])/len(predictions)
print(accuracy)# =============================================================================
# 逻辑回归
# =============================================================================
from sklearn import cross_validation
from sklearn.linear_model import LogisticRegression
alg=LogisticRegression(random_state=1)
scores=cross_validation.cross_val_score(alg,titanic[predictors],titanic['Survived'],cv=3)
print(scores.mean())# =============================================================================
# 随机森林
# =============================================================================
from sklearn import cross_validation
from sklearn.ensemble import RandomForestClassifier
predictors=['Pclass','Sex','Age','SibSp','Parch','Fare','Embarked']
alg=RandomForestClassifier(random_state=1,n_estimators=10,min_samples_split=2,min_samples_leaf=1)
kf=cross_validation.KFold(titanic.shape[0],n_folds=3,random_state=1)
scores=scores=cross_validation.cross_val_score(alg,titanic[predictors],titanic['Survived'],cv=kf)
print(scores.mean())

 

转载于:https://www.cnblogs.com/clemente/p/9951189.html


http://lihuaxi.xjx100.cn/news/270021.html

相关文章

java开发人员技术提升_Java开发初学者如何快速提升编程能力

原标题&#xff1a;Java开发初学者如何快速提升编程能力2019年如何才能学好Java开发?初学者需要注意哪些问题&#xff1f;技术的学习很多人都会有一个共同的问题&#xff0c;那就是该如何选择一门技术学习&#xff0c;或者说如何选择一门编程语言学习&#xff0c;部分人之所以…

周鸿祎在360新员工入职培训上的讲话

我想给新入职的同事讲一讲我的期望&#xff0c;再提几个建议。我这个人喜欢说真话&#xff0c;不喜欢说漂亮话&#xff0c;因为漂亮话没用。但说真话&#xff0c;大家可能不爱听。 首先&#xff0c;大家一定要明白&#xff0c;你自己来360到底想获得什么。 我觉得&#xff0c;第…

[亲测]在Mac下配置php开发环境:Apache+php+MySql

公司给我们配上了高大上的Apple Mac Pro本本&#xff0c;这两天自己正在习惯中。通过虚拟机PD&#xff0c;确实解决了一些因为工作习惯无法在iOS上很好完成的事情&#xff0c;但是我想&#xff0c;既然用起了iOS就尽量将一些事务在iOS环境下处理&#xff0c;免得好似关羽耍着大…

轻松学Pytorch–环境搭建与基本语法

点击上方“小白学视觉”&#xff0c;选择加"星标"或“置顶”重磅干货&#xff0c;第一时间送达基本思路选择以前我用过Caffe&#xff0c;用过tensorflow&#xff0c;最近一直在用pytorch感觉特别好用。所以打算写点我学习的过程跟经验&#xff0c;如果你是一个pytorc…

一份 Spring Boot 项目搭建模板

点击上方蓝色“方志朋”&#xff0c;选择“设为星标”回复“666”获取独家整理的学习资料&#xff01;前言建立一个全新的项目&#xff0c;或者把旧的庞大的项目&#xff0c;进行拆分成多个项目。在建立新的项目中&#xff0c;经常需要做一些重复的工作&#xff0c;比如说拷贝一…

终于有人把计算机视觉讲明白了

在人工智能机器学习的领域中&#xff0c;目前最火的莫过于计算机视觉了&#xff0c;这项技术一直广受关注&#xff0c;而其中的目标检测是计算机视觉领域中最常见的问题之一。从去年的 YOLOv4 发布后&#xff0c;目标检测框架被问的最多的问题就是&#xff1a;“有没有同学复现…

深度学习概述:NLP vs CNN

作者 | Manish Kuwar译者 | 苏本如&#xff0c;责编 | 郭芮头图 | CSDN 下载自视觉中国出品 | CSDN&#xff08;ID&#xff1a;CSDNnews&#xff09;以下为译文&#xff1a;当今&#xff0c;人工智能已经不仅仅是一个技术术语了。这项技术在过去十年的时间内几乎将其影响扩展到…

java linkedlist二维,如何在Java中制作二维LinkedList?

for example:public static LinkedList ll new LinkedList;解决方案from your question, I think (not 100% sure) you are looking forjava.util.LinkedHashMapin your case, it would be LinkedHashMapfrom java doc:Hash table and linked list implementation of the Map …