Pandas Dataframe sütünları farklı veri tiplerinde olabilir. Değerlendirme yada topluca işlem yapmak için aynı veri tipi sütünlarını seçmek isteyebiliriz.
import pandas as pd import numpy as np url = "https://raw.githubusercontent.com/TrainingByPackt/Big-Data-Analysis-with-Python/master/Lesson01/RadNet_Laboratory_Analysis.csv" df = pd.read_csv(url, sep=',') filtered_dict = {key for key, value in dict(df.dtypes).items() if value == 'object'} #int64,int32,float vb. print(df[list(filtered_dict)].head())
Çıktı:
Sample Type Unit Date Collected State Location Date Posted 0 Air Filter pCi/m3 03/23/2011 ID Boise 03/30/2011 1 Air Filter pCi/m3 03/23/2011 ID Boise 03/30/2011 2 Air Filter pCi/m3 03/23/2011 AK Juneau 03/30/2011 3 Air Filter pCi/m3 03/22/2011 AK Nome 03/30/2011 4 Air Filter pCi/m3 03/23/2011 AK Nome 03/30/2011
0 Comments
Recommended Comments
There are no comments to display.