PySpark DataFrame में डेटा का निरीक्षण
प्लॉटिंग, मॉडलिंग, ट्रेनिंग आदि जैसे विश्लेषण से पहले डेटा का निरीक्षण करना बहुत महत्वपूर्ण है. इस सरल अभ्यास में, आप बेसिक DataFrame ऑपरेटर का उपयोग करके पिछले अभ्यास में बनाए गए people_df DataFrame के डेटा का निरीक्षण करेंगे.
ध्यान रखें, आपके वर्कस्पेस में SparkSession spark और DataFrame people_df पहले से उपलब्ध हैं.
यह अभ्यास पाठ्यक्रम का हिस्सा है
PySpark के साथ Big Data Fundamentals
अभ्यास निर्देश
people_dfDataFrame में पहली 10 observations प्रिंट करें.people_dfDataFrame में पंक्तियों की संख्या गिनें.people_dfDataFrame में कितने कॉलम हैं और उनके नाम क्या हैं?
इंटरैक्टिव व्यावहारिक अभ्यास
इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।
# Print the first 10 observations
people_df.____(10)
# Count the number of rows
print("There are {} rows in the people_df DataFrame.".format(people_df.____()))
# Count the number of columns and print their names
print("There are {} columns in the people_df DataFrame and their names are {}".format(len(people_df.____), people_df.____))