Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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)
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #Python #Pandas
ADD COMMENT
Topic
Name
3+4 =