सूचना: जिन गैर-व्यावसायिक प्रोजेक्ट के लिए Earth Engine को
15 अप्रैल, 2025 से पहले रजिस्टर किया गया है उन्हें ऐक्सेस बनाए रखने के लिए,
गैर-व्यावसायिक इस्तेमाल से जुड़ी ज़रूरी शर्तों की पुष्टि करनी होगी. अगर आपने 26 सितंबर, 2025 तक पुष्टि नहीं की, तो आपके ऐक्सेस को होल्ड पर रखा जा सकता है.
ee.FeatureCollection.randomColumn
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
किसी कलेक्शन में, डेटरमिनिस्टिक स्यूडोरैंडम नंबर का कॉलम जोड़ता है. आउटपुट, डबल-प्रिसिशन फ़्लोटिंग पॉइंट नंबर होते हैं. 'यूनिफ़ॉर्म' डिस्ट्रिब्यूशन (डिफ़ॉल्ट) का इस्तेमाल करने पर, आउटपुट [0, 1] की रेंज में होते हैं. 'सामान्य' डिस्ट्रिब्यूशन का इस्तेमाल करने पर, आउटपुट में μ=0, σ=1 होता है. हालांकि, इनकी कोई तय सीमा नहीं होती.
| इस्तेमाल | रिटर्न |
|---|
FeatureCollection.randomColumn(columnName, seed, distribution, rowKeys) | FeatureCollection |
| आर्ग्यूमेंट | टाइप | विवरण |
|---|
यह: collection | FeatureCollection | वह इनपुट कलेक्शन जिसमें कोई रैंडम कॉलम जोड़ना है. |
columnName | स्ट्रिंग, डिफ़ॉल्ट: "random" | जोड़ने के लिए कॉलम का नाम. |
seed | लंबी, डिफ़ॉल्ट: 0 | रैंडम नंबर जनरेट करते समय इस्तेमाल किया जाने वाला सीड. |
distribution | स्ट्रिंग, डिफ़ॉल्ट: "uniform" | रैंडम नंबर जनरेट करने के लिए, डिस्ट्रिब्यूशन का टाइप; 'यूनिफ़ॉर्म' या 'नॉर्मल' में से कोई एक. |
rowKeys | सूची, ज़रूरी नहीं | ऐसी प्रॉपर्टी की सूची जो कलेक्शन के किसी एलिमेंट की पहचान, यूनीक और बार-बार करने में सक्षम होनी चाहिए. इसका इस्तेमाल, रैंडम नंबर जनरेट करने के लिए किया जाता है. डिफ़ॉल्ट रूप से, [system:index] पर सेट होता है. |
उदाहरण
कोड एडिटर (JavaScript)
// FeatureCollection of power plants in Belgium.
var fc = ee.FeatureCollection('WRI/GPPD/power_plants')
.filter('country_lg == "Belgium"');
print('N features in collection', fc.size());
// Add a uniform distribution random value column to the FeatureCollection.
fc = fc.randomColumn();
// Randomly split the collection into two sets, 30% and 70% of the total.
var randomSample30 = fc.filter('random < 0.3');
print('N features in 30% sample', randomSample30.size());
var randomSample70 = fc.filter('random >= 0.3');
print('N features in 70% sample', randomSample70.size());
Python सेटअप
Python API के बारे में जानकारी पाने और इंटरैक्टिव डेवलपमेंट के लिए geemap का इस्तेमाल करने के लिए,
Python एनवायरमेंट पेज देखें.
import ee
import geemap.core as geemap
Colab (Python)
# FeatureCollection of power plants in Belgium.
fc = ee.FeatureCollection('WRI/GPPD/power_plants').filter(
'country_lg == "Belgium"')
display('N features in collection:', fc.size())
# Add a uniform distribution random value column to the FeatureCollection.
fc = fc.randomColumn()
# Randomly split the collection into two sets, 30% and 70% of the total.
random_sample_30 = fc.filter('random < 0.3')
display('N features in 30% sample:', random_sample_30.size())
random_sample_70 = fc.filter('random >= 0.3')
display('N features in 70% sample:', random_sample_70.size())
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-10-30 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-10-30 (UTC) को अपडेट किया गया."],[],["This tool adds a column of pseudorandom numbers to a FeatureCollection. Users can specify the `columnName`, `seed`, and `distribution`. The default distribution, 'uniform', generates numbers between 0 and 1; 'normal' produces numbers with a mean of 0 and a standard deviation of 1. The `randomColumn` method returns the modified FeatureCollection. This is exemplified by creating random splits into subsets. The outputs are double-precision floating point numbers.\n"]]