-
Notifications
You must be signed in to change notification settings - Fork 399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
获取数据异常 #17
Comments
php是通过什么方式调用python的呢?命令行的输入输出吗?能否贴一下代码呢? |
1 similar comment
php是通过什么方式调用python的呢?命令行的输入输出吗?能否贴一下代码呢? |
谢谢您的回复
代码就是通过
$outPut = exec('python3 mypy.py 思明区望海路67号')
print_r($outPut);
mypy.py 是我直接写的通过调用你的代码来的,我通过命令行来运行是正常输出的
…------------------ 原始邮件 ------------------
发件人: "DQYuan"<[email protected]>;
发送时间: 2018年11月5日(星期一) 晚上7:37
收件人: "DQinYuan/chinese_province_city_area_mapper"<[email protected]>;
抄送: "ㄗs綯氣ぃ!"<[email protected]>; "Author"<[email protected]>;
主题: Re: [DQinYuan/chinese_province_city_area_mapper] 获取数据异常 (#17)
php是通过什么方式调用python的呢?命令行的输入输出吗?能否贴一下代码呢?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
mypy.py里的内容能贴出来吗? |
这个我的代码
…------------------ 原始邮件 ------------------
发件人: "DQYuan"<[email protected]>;
发送时间: 2018年11月5日(星期一) 晚上9:56
收件人: "DQinYuan/chinese_province_city_area_mapper"<[email protected]>;
抄送: "ㄗs綯氣ぃ!"<[email protected]>; "Author"<[email protected]>;
主题: Re: [DQinYuan/chinese_province_city_area_mapper] 获取数据异常 (#17)
谢谢您的回复 代码就是通过 $outPut = exec('python3 mypy.py 思明区望海路67号') print_r($outPut); mypy.py 是我直接写的通过调用你的代码来的,我通过命令行来运行是正常输出的
…
------------------ 原始邮件 ------------------ 发件人: "DQYuan"[email protected]; 发送时间: 2018年11月5日(星期一) 晚上7:37 收件人: "DQinYuan/chinese_province_city_area_mapper"[email protected]; 抄送: "ㄗs綯氣ぃ!"[email protected]; "Author"[email protected]; 主题: Re: [DQinYuan/chinese_province_city_area_mapper] 获取数据异常 (#17) php是通过什么方式调用python的呢?命令行的输入输出吗?能否贴一下代码呢? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
mypy.py里的内容能贴出来吗?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
我说的是mypy.py中的python代码,能贴出来看看吗?你在mypy.py中输出的是字符串吗?如果你直接输出的是dateframe可能会出错的吧,因为我没看到mypy.py,只能猜测一下了 |
mypy.py代码就是截图上的,我是输出字符串,我自己对数据格式作了转换
…------------------ 原始邮件 ------------------
发件人: "DQYuan"<[email protected]>;
发送时间: 2018年11月7日(星期三) 中午11:11
收件人: "DQinYuan/chinese_province_city_area_mapper"<[email protected]>;
抄送: "ㄗs綯氣ぃ!"<[email protected]>; "Author"<[email protected]>;
主题: Re: [DQinYuan/chinese_province_city_area_mapper] 获取数据异常 (#17)
我说的是mypy.py中的python代码,能贴出来看看吗?你在mypy.py中输出的是字符串吗?如果你直接输出的是dateframe可能会出错的吧,因为我没看到mypy.py,只能猜测一下了
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
# -*- coding: utf-8 -*-
import sys
import urllib.parse
import pandas as pd
import numpy as np
data = urllib.parse.unquote(sys.argv[1])
location_str = [data]
from cpca import *
df = transform(location_str)
arr = np.array(df)
str1 = ','.join(arr[0])
print(str1);这是我的代码
…------------------ 原始邮件 ------------------
发件人: "DQYuan"<[email protected]>;
发送时间: 2018年11月7日(星期三) 中午11:11
收件人: "DQinYuan/chinese_province_city_area_mapper"<[email protected]>;
抄送: "ㄗs綯氣ぃ!"<[email protected]>; "Author"<[email protected]>;
主题: Re: [DQinYuan/chinese_province_city_area_mapper] 获取数据异常 (#17)
我说的是mypy.py中的python代码,能贴出来看看吗?你在mypy.py中输出的是字符串吗?如果你直接输出的是dateframe可能会出错的吧,因为我没看到mypy.py,只能猜测一下了
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
php那面是报错还是显示的数据不对?如果是报错的话是什么错呢? |
思明区,厦门市,福建省,望海路 正常输出
,,,思明区望海路 php输出
…------------------ 原始邮件 ------------------
发件人: "DQYuan"<[email protected]>;
发送时间: 2018年11月7日(星期三) 中午11:31
收件人: "DQinYuan/chinese_province_city_area_mapper"<[email protected]>;
抄送: "ㄗs綯氣ぃ!"<[email protected]>; "Author"<[email protected]>;
主题: Re: [DQinYuan/chinese_province_city_area_mapper] 获取数据异常 (#17)
php那面是报错还是显示的数据不对?如果是报错的话是什么错呢?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
我使用了php调用python来处理地址,输出返回值时数据异常,也就是无法显示正确的省市区,但是我用python直接运行又是正常的,这是为什么
The text was updated successfully, but these errors were encountered: