pandas ile Kolaylaştırılmış Veri Alımı
Amany Mahfouz
Instructor
pandas içinde özel bir yükleme işlevine sahiptir: read_excel()import pandas as pd # Excel dosyasını oku survey_data = pd.read_excel("fcc_survey.xlsx")# İlk 5 satırı görüntüle print(survey_data.head())
Age AttendedBootcamp ... SchoolMajor StudentDebtOwe
0 28.0 0.0 ... NaN 20000
1 22.0 0.0 ... NaN NaN
2 19.0 0.0 ... NaN NaN
3 26.0 0.0 ... Cinematography And Film 7000
4 20.0 0.0 ... NaN NaN
[5 rows x 98 columns]
read_excel(), read_csv() ile ortak birçok argümana sahiptirnrows: yüklenecek satır sayısını sınırlaskiprows: atlanacak satır sayısını veya satır numaralarını belirtusecols: sütunları ada, konum numarasına veya harfe göre seç (ör. "A:P")
# Metaveri başlığını atlayarak dosyanın W-AB ve AR sütunlarını oku survey_data = pd.read_excel("fcc_survey_with_headers.xlsx", skiprows=2, usecols="W:AB, AR")# Veriyi görüntüle print(survey_data.head())
CommuteTime CountryCitizen ... EmploymentFieldOther EmploymentStatus Income
0 35.0 United States of America ... NaN Employed for wages 32000.0
1 90.0 United States of America ... NaN Employed for wages 15000.0
2 45.0 United States of America ... NaN Employed for wages 48000.0
3 45.0 United States of America ... NaN Employed for wages 43000.0
4 10.0 United States of America ... NaN Employed for wages 6000.0
[5 rows x 7 columns]
pandas ile Kolaylaştırılmış Veri Alımı