fork download
  1. import pandas as pd
  2.  
  3. # Sample DataFrame
  4. data = {
  5. 'Day': [1, 2, 3, 4, 5],
  6. 'Month': ['Jan', 'Feb', 'Mar', 'Apr', 'May']
  7. }
  8.  
  9. df = pd.DataFrame(data)
  10.  
  11. # Convert the 'Day' column to string
  12. df['Day'] = df['Day'].astype(str)
  13.  
  14. # Display the DataFrame
  15. print(df)
Success #stdin #stdout 0.39s 57964KB
stdin
Standard input is empty
stdout
  Day Month
0   1   Jan
1   2   Feb
2   3   Mar
3   4   Apr
4   5   May