“Python | PANDAS MULTIINDEX.IS_LEXSORTED ()” Kode Jawaban

Python | PANDAS MULTIINDEX.IS_LEXSORTED ()

"""Now let’s check if the labels in the MultiIndex are lexicographically sorted or not."""
# check if labels are sorted or not
midx.is_lexsorted()
Shy Skunk

Python | PANDAS MULTIINDEX.IS_LEXSORTED ()

""" Example #1: Use MultiIndex.is_lexsorted() function to check if the MultiIndex labels 
are lexicographically sorted or not.""""
# importing pandas as pd
import pandas as pd
  
# Create the MultiIndex
midx = pd.MultiIndex.from_arrays([['Networking', 'Cryptography',
                                     'Anthropology', 'Science'], 
                                             [88, 84, 98, 95]])
  
# Print the MultiIndex
print(midx)
Shy Skunk

Jawaban yang mirip dengan “Python | PANDAS MULTIINDEX.IS_LEXSORTED ()”

Pertanyaan yang mirip dengan “Python | PANDAS MULTIINDEX.IS_LEXSORTED ()”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya