Python Code Runner

With pandas and numpy support

Python Tutorial

Pandas Library

Pandas is a fast, powerful, flexible and easy to use open source data analysis and manipulation tool, built on top of the Python programming language.
Pandas হলো একটি দ্রুতগতির, শক্তিশালী, নমনীয় এবং সহজে ব্যবহারযোগ্য ওপেন সোর্স ডেটা বিশ্লেষণ ও রূপান্তরের টুল, যা পাইথন প্রোগ্রামিং ভাষার ওপর ভিত্তি করে তৈরি।

DataFrame Basics

A DataFrame is a 2-dimensional labeled data structure with columns of potentially different types. You can think of it like a spreadsheet or SQL table.
একটি DataFrame হলো দ্বিমাত্রিক (2-dimensional) লেবেলযুক্ত ডেটা স্ট্রাকচার, যেখানে কলামগুলো ভিন্ন ভিন্ন ধরনের ডেটা ধারণ করতে পারে। একে সহজভাবে বলা যায়—এটি একটি স্প্রেডশিট (spreadsheet) বা একটি SQL টেবিলের মতো।

Example Code Explanation

The code in the editor creates a simple DataFrame:

import pandas as pd
data = {'x': [3]}   # value is a list
df = pd.DataFrame(data)
print(df)

This creates a DataFrame with one column named 'x' containing a single value 3.

Common DataFrame Operations

Some common operations you can perform with DataFrames:

  • df.head() - View first few rows
  • df.describe() - Summary statistics
  • df['column_name'] - Access a specific column
  • df.shape - Get dimensions of DataFrame
  • df.info() - Get information about data types

Numpy Integration

Pandas works well with NumPy. You can convert DataFrame columns to NumPy arrays for mathematical operations:

import numpy as np
values = df['x'].values  # Convert to NumPy array
result = np.mean(values) # Calculate mean

Data Selection

You can select data from a DataFrame in multiple ways:

# Select a single column
ages = df['Age']

# Select multiple columns
subset = df[['Name', 'Age']]

# Filter rows based on condition
adults = df[df['Age'] >= 18]

Tips for Effective Data Analysis

1. Always check for missing values using df.isnull().sum()

2. Use df.info() to get information about data types

3. Explore your data with df.describe() before analysis

4. Use df.columns to see all column names

Code Editor

Available packages: pandas, numpy, and more

Packages will be loaded automatically when needed

Output

Output will be displayed here...

Code Examples