“EDA Playground” — это онлайн-платформа, предоставляющая среду совместной работы для исследовательского анализа данных (EDA) с использованием различных языков программирования. Вот некоторые популярные методы, обычно используемые в EDA, а также примеры кода:
-
Загрузка данных:
- Python (Pandas):
import pandas as pd df = pd.read_csv('data.csv')
- Python (Pandas):
-
Исследование основных данных:
- Python (Pandas):
# Display the first few rows of the DataFrame df.head() # Get summary statistics of the numerical columns df.describe() # Count the number of missing values in each column df.isnull().sum()
- Python (Pandas):
-
Визуализация:
- Python (Matplotlib):
import matplotlib.pyplot as plt # Create a histogram plt.hist(df['column_name'], bins=10) plt.xlabel('Values') plt.ylabel('Frequency') plt.title('Histogram of column_name') plt.show() # Create a scatter plot plt.scatter(df['column1'], df['column2']) plt.xlabel('Column 1') plt.ylabel('Column 2') plt.title('Scatter Plot') plt.show()
- Python (Matplotlib):
-
Очистка данных:
- Python (Pandas):
# Remove duplicate rows df = df.drop_duplicates() # Fill missing values with the mean df['column_name'].fillna(df['column_name'].mean(), inplace=True) # Remove rows with missing values df.dropna(inplace=True)
- Python (Pandas):
-
Разработка функций:
- Python (Pandas):
# Create a new column based on existing columns df['new_column'] = df['column1'] + df['column2'] # Apply a function to transform a column df['transformed_column'] = df['column'].apply(lambda x: x2)
- Python (Pandas):
-
Корреляционный анализ:
- Python (Pandas):
# Compute the correlation matrix correlation_matrix = df.corr() # Plot a correlation heatmap import seaborn as sns sns.heatmap(correlation_matrix, annot=True, cmap='coolwarm') plt.title('Correlation Heatmap') plt.show()
- Python (Pandas):
-
Обнаружение выбросов:
- Python (Pandas):
# Calculate z-scores for a column from scipy.stats import zscore df['z_scores'] = zscore(df['column']) # Identify outliers using a threshold threshold = 3 outliers = df[df['z_scores'] > threshold]
- Python (Pandas):