0

what's up?

In excel i could transform an entire column of dates or string in number using number_value formula. Can I do something like this in Python with pandas at on my dataFrames?

Tks

1
  • 1
    yes, see pd.to_numeric or df[col].astype(int) or (float) Commented Jun 26, 2020 at 22:12

1 Answer 1

0

The code below should transform string values to a numeric value. The first line is only needed if you are transforming dates from a string to a number.

df['col'] = pd.to_datetime(df['col'])
df['col'] = pd.to_numeric(df['col'])
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.