@ChatGPT 编写python,对Excel文件中某一列数据(含有HTML格式数据)抽取(可以使用re模块)出文本信息,并将结果写入最后一列空列中
-
本社区终于可以向 @ChatGPT 提问了! -
本社区终于可以向 @ChatGPT 提问了! -
本社区终于可以向 @ChatGPT 提问了!编写python,对Excel文件中某一列数据(含有HTML格式数据)抽取出文本信息,并将结果写入最后一列空列中
-
本社区终于可以向 @ChatGPT 提问了!@ChatGPT 下面代码有什么错误:import pandas as pd
String containing JSON-formatted data
json_string = '[{"name": "Alice", "age": 25}, {"name": "Bob", "age": 22}, {"name": "Carol", "age": 27}]'
json_string="[{'lab': 'A', 'index': 22, 'isshow': 'Y', 'name': 'AH股比价', 'link': 'http://quote.eastmoney.com/center/list.html#ah_1', 'newClass': 'false', 'isstrong': 'false', 'character': 'A'}, {'lab': 'B', 'index': 4, 'isshow': 'Y', 'name': '板块资金', 'link': 'http://data.eastmoney.com/bkzj/', 'newClass': 'false', 'isstrong': 'false', 'character': 'B'}, {'lab': 'B', 'index': 14, 'isshow': 'Y', 'name': '并购重组', 'link': 'http://data.eastmoney.com/bgcz/', 'newClass': 'false', 'isstrong': 'false', 'character': ''}]"
Convert the JSON string to a DataFrame
df=eval(json_string)
print(df)df = pd.read_json(df)
print(type(df))
print(df)
-
本社区终于可以向 @ChatGPT 提问了!@ChatGPT 有如下字符串,如何转换为DataFrame:json_string="[{'lab': 'A', 'index': 22, 'isshow': 'Y', 'name': 'AH股比价', 'link': 'http://quote.eastmoney.com/center/list.html#ah_1', 'newClass': 'false', 'isstrong': 'false', 'character': 'A'}, {'lab': 'B', 'index': 4, 'isshow': 'Y', 'name': '板块资金', 'link': 'http://data.eastmoney.com/bkzj/', 'newClass': 'false', 'isstrong': 'false', 'character': 'B'}, {'lab': 'B', 'index': 14, 'isshow': 'Y', 'name': '并购重组', 'link': 'http://data.eastmoney.com/bgcz/', 'newClass': 'false', 'isstrong': 'false', 'character': ''}]"
-
本社区终于可以向 @ChatGPT 提问了! -
本社区终于可以向 @ChatGPT 提问了! -
本社区终于可以向 @ChatGPT 提问了! -
本社区终于可以向 @ChatGPT 提问了! -
本社区终于可以向 @ChatGPT 提问了! -
本社区终于可以向 @ChatGPT 提问了! -
本社区终于可以向 @ChatGPT 提问了! -
本社区终于可以向 @ChatGPT 提问了! -
本社区终于可以向 @ChatGPT 提问了! -
本社区终于可以向 @ChatGPT 提问了! -
本社区终于可以向 @ChatGPT 提问了! -
本社区终于可以向 @ChatGPT 提问了! -
本社区终于可以向 @ChatGPT 提问了! -
本社区终于可以向 @ChatGPT 提问了! -
本社区终于可以向 @ChatGPT 提问了!