【发布时间】:2019-09-27 18:36:55
【问题描述】:
我有使用 pandas.read_excel 的 excel 表,我在数据框中得到了输出,但我想在阅读完 pandas 后添加计算,我需要在每个 x 和 y 列中进行以下计算。
ratiox = (73.77481944859028 - 73.7709567323327) / 720
ratioy = (18.567453940477293 - 18.56167674097576) / 1184
mapLongitudeStart = 73.7709567323327
mapLatitudeStart = 18.567453940477293
longitude = 0, latitude = 0
longitude = (mapLongitudeStart + x1 * ratiox)) #I have take for the single column x1 value
latitude = (mapLatitudeStart - (-y1 *ratioy )) # taken column y1 value
如何将此计算应用于 x 和 y a 的每一列和每一行,其中的值不应为空值。我想要通过在列中进行计算来创建新的数据框
【问题讨论】:
-
您能否以文本形式提供来自
pandas Dataframe的一些示例行? -
Pune पुणे हवेली बाणेर 3 ROAD WHITE #FFFFFF 11803.84 -3546.78 11808.36 -3531.79 11812.89 -3523.84 11830.37 -3523.84 11854.1 -3545.22 11854.1 -3548.58 11890.25 -3566.37 11942.91 -3577.78 11970.66 -3587.68 12005.36 -3587.68 12018.9 -3582.07 12033.11 -3582.07 12074.74 -3569.53 12066.81 -3603.85 12050.64 -3689.78 12046.44 -3712.12 12038.74 -3725.88 12034.46 -3769.25 12027.85 -3791.69 12005.81 -3791.68 12045.49 -3625.73 12039.1 -3609.91 12009.37 -3621.93 11971.88 -3621.93 11942.31 -3608.22 11888.45 -3596.61 11850.94 -3583.88跨度>
-
以上是文本形式的单行数据
-
你应该edit这个问题包含数据,而不是在评论中添加它
-
您也应该添加列标题,也许您可以使用更少的列来解释问题。