df.loc[df.shape[0]] = dict(zip(df.columns, List)) 一行代码搞定
df.loc[df.shape[0]] = dict(zip(df.columns, List)) 一行代码搞定
网上各种介绍文章,都没提及如果存放的时间是毫秒而不是秒,那么就需要在转换前,先除以1000 所以重要的是两步: 1、cast 转 int; 2、毫秒转为秒; from_unixtime(cast(BEGIN_TIME/1000 as int),'yyyy-MM-dd HH:mm:ss')
https://zhuanlan.zhihu.com/p/143502208
一、参考日期为当前日期 以当前系统日期作为参考日期,将其转换为统一的天维度yyyyMMdd数据格式。 例如当前日期为2021-01-29 昨天 方式一:date_format(date_sub(current_date(),1), 'yyyyMMdd') select date_format(date_sub(current_date(),1), 'yyyyMMdd') 20210128 方式二:date_format(date_sub(from_unixtime(unix_timestamp(), 'yyyy-M…
df.groupby(['YN','date'],as_index=False).agg('count').sort_values(by ='msisdn',ascending=False).head(3)
报错 : sqlalchemy.exc.ArgumentError: Mapper mapped class DataSet->DataSet could not assemble any primary key columns for mapped table 'DataSet' 解决办法: 在字段定义的下面增加一行:(各字段都放入list) __mapper_args__ = { 'primary_key':[dataSetName, FileName, FileNa…
import pandas as pd import numpy as np file1 = 'all.csv' file2 = 'sa.csv' df1 = pd.read_csv(file1) df2 = pd.read_csv(file2) df3 = pd.concat([df1,df2,df2]).drop_duplicates(keep=False) df3.to_csv('result.csv',index=0)
编辑ssh_config文件: Host 157 HostName 157.x.x.x Port 22 User root ProxyCommand C:\Program Files (x86)\Nmap\ncat --proxy-type socks4 --proxy 127.0.0.1:1080 %h %p # 需要安装nmap软件