我有一个数据框,其列的值为毫秒时间戳.(df['Millisecond'])
我想要做的是将该列的所有值转换为正常日期.防爆.2017-04-27 04:55:00
x = [1, 3, 2, 5, 7]
Run Code Online (Sandbox Code Playgroud)
从列表的第一个值开始:
如果下一个值更大,则打印 "\nthe value x is greater than y"
如果下一个值相等,则打印 "\nthe value x is equal to y"
如果下一个值较小,则打印 "\nthe value x is smaller than y"
如何将其转换为精确的Python代码?我实际上正在使用pandas数据框,我只是通过使用列表作为示例来简化它.
x = [1, 3, 2, 5, 7]
Run Code Online (Sandbox Code Playgroud)
根据上面给出的,输出应该是这样的:
the value 3 is greater than 1
the value 2 is smaller than 3
the value 5 is greater than 2
the value 7 is greater than 5
Run Code Online (Sandbox Code Playgroud)