Please enable JavaScript.
Coggle requires JavaScript to display documents.
Khoa học dữ liệu - Coggle Diagram
Khoa học dữ liệu
Python
Nhập xuất
print(" ")
comment
sử dụng dấu#
khối lệnh
Thụt lệ ít nhất 1 khoảng trắng
function
def
list[kiểu khác nhau]
thêm vào list
insert
append
extend
Xóa
remove
tên phần tử
pop
pop(chỉ số)
pop(): lấy cuổi ra
del
del list[chỉ mục]
del list: xóa cả
clear
làm rỗng thôi
sửa
[a:b]
Duyệt
for x in list
for i in range(len(list))
while i in len(list):i=i+1
sắp xếp
Tăng dần
sort
Giảm dân
sort(reverse=True)
copy
list.copy()
Gộp
+
append
extend
có duplicate
Kiểu dữ liệu trong python
tuple(kiểu dữ liệu khác nhau)
Được sắp xếp
Không thể thay đổi
không thêm, sửa, xóa...
có thể duplicate
Tạo một item trong tuple: tuple = ("apple",)
set{}
dictionary: như kiểu object
class
thừa kế class con(cha)
matplotlib: trực quan hóa dữ liệu
biểu đồ đường
plot
plt.plot(x,y,marker='o', mfc='red',mec='green',ms=20,color='red',linestyle=':',linewidth='20'
plt.xlabel("trục hoành");plt.ylabel("trục tung");plt.title("tên biểu đồ")
plt.grid(aixis='x')
plt.show(): hiển thị biểu đồ
Biểu đồ điểm
scatter(s='20',alpha='0.5')
plt.colorbar()
Biểu đồ cột
plt.bar()
plt.barh()
Biểu đồ tròn
plt.pie()
numpy: xử lý số học
pandas: phân tích dữ liệu