Get your own Python server Result Size: 625 x 565
x
 
import pandas as pd
data = {
  "age": ["fifty", 40, 30],
  "qualified": ["No", True, False]
}
df = pd.DataFrame(data)
print("Original DataFrame:")
print(df)
print("Original dtypes:")
print(df.dtypes)
#Remove the first row in both colums:
df = df.iloc[1:]
print("New DataFrame:")
print(df)
newdf = df.infer_objects()
print("New dtypes:")
print(newdf.dtypes)
  Original DataFrame:
       age qualified
  0  fifty        No
  1     40      True
  2     30     False
  Original dtypes:
  age          object
  qualified    object
  dtype: object
  New DataFrame:
    age qualified
  1  40      True
  2  30     False
  New dtypes:
  age          int64
  qualified     bool
  dtype: object