কম্পিউটার

Python Pandas - RangeIndex এর স্টপ প্যারামিটারের মান প্রদর্শন করে


RangeIndex এর স্টপ প্যারামিটারের মান প্রদর্শন করতে, index.stop ব্যবহার করুন পান্ডাসে সম্পত্তি।

প্রথমে, প্রয়োজনীয় লাইব্রেরিগুলি আমদানি করুন -

import pandas as pd

RangeIndex হল Int64Index-এর একটি মেমরি-সেভিং বিশেষ কেস যা একঘেয়ে রেঞ্জের প্রতিনিধিত্ব করার জন্য সীমাবদ্ধ। স্টার্ট, স্টপ এবং স্টেপ সহ একটি রেঞ্জ সূচক তৈরি করুন। নামটি সূচকে সংরক্ষিত নাম।

index = pd.RangeIndex(start=5, stop=20, step=2, name="data")

রেঞ্জ ইনডেক্স −

প্রদর্শন করুন
print("RangeIndex...\n",index)

স্টপ প্যারামিটার মান −

প্রদর্শন করুন
print("\nRangeIndex stop value...\n",index.stop)

উদাহরণ

নিম্নলিখিত কোড -

import pandas as pd

# RangeIndex is a memory-saving special case of Int64Index limited to representing monotonic ranges.
# Using RangeIndex may in some instances improve computing speed.
# Create a range index with start, stop and step
# The name is the name to be stored in the index.
index = pd.RangeIndex(start=10, stop=30, step=2, name="data")

# Display the RangeIndex
print("RangeIndex...\n",index)

# Display the stop parameter value
print("\nRangeIndex stop value...\n",index.stop)

আউটপুট

এটি নিম্নলিখিত আউটপুট −

তৈরি করবে
RangeIndex...
RangeIndex(start=10, stop=30, step=2,name='data')

RangeIndex stop value...
30

  1. ডাউনট্রেন্ড - পাইথন পান্ডাস প্রদর্শনের জন্য ডেটাসেট প্লট করুন

  2. Uptrend – Python Pandas প্রদর্শন করতে ডেটাসেট প্লট করুন

  3. Python Pandas - মাল্টি-ইনডেক্স আকারে ডেটাফ্রেমের সূচক প্রদর্শন করুন

  4. পাইথন - একটি ডেটাফ্রেমের মান পান্ডাসে অন্য ডেটাফ্রেমের মান দিয়ে প্রতিস্থাপন করুন