【Python基礎】101道Numpy、Pandas練習題,提升你的Python水平
無論是數(shù)據(jù)分析還是機器學習,數(shù)據(jù)的預處理必不可少。其中最常用、最基礎的Python庫非numpy和pandas莫屬,很多初學者可能看了很多教程,但是很快就把用法忘光了。
光看不練假把式,今天向大家推薦三套感覺不錯的練習題,感興趣的同學可以練練手,挑戰(zhàn)一下。
每套題都分四個Level的難度
Difficulty?Level:?L1
Q.?Extract?all?odd?numbers?from?arr
Input:
arr?=?np.array([0,?1,?2,?3,?4,?5,?6,?7,?8,?9])
Desired?output:
#>?array([1,?3,?5,?7,?9])
答案是隱藏的,點開Solution即可查看
#?Input
arr?=?np.array([0,?1,?2,?3,?4,?5,?6,?7,?8,?9])
#?Solution
arr[arr?%?2?==?1]
#>?array([1,?3,?5,?7,?9])
Numpy 練習題
https://www.machinelearningplus.com/python/101-numpy-exercises-python/
Pandas 練習題
https://www.machinelearningplus.com/python/101-pandas-exercises-python/
datatable 練習題
工具包 datatable 的功能特征與 Pandas 非常類似,但更側(cè)重于速度以及對大數(shù)據(jù)的支持。
https://www.machinelearningplus.com/data-manipulation/101-python-datatable-exercises-pydatatable/
往期精彩回顧
本站qq群704220115,加入微信群請掃碼:
評論
圖片
表情

