简体   繁体   English

使用 python pandas 从原始 github 文件访问 CSV 数据

[英]Accessing CSV data from raw github file using python pandas

Why does the following code give the error?:为什么下面的代码会报错?:

urllib.error.URLError: <urlopen error [Errno 11001] getaddrinfo failed>

Using the following code:使用以下代码:

import pandas as pd

url= 'https://raw.githubusercontent.com/justmarkham/pandas-videos/master/data/drinks.csv'
df=pd.read_csv(url)

Make sure you are not connected through a proxy or VPN.确保您没有通过代理或 VPN 连接。

I had this same issue while working from home while connected to my company's VPN.我在连接到我公司的 VPN 时在家工作时遇到了同样的问题。 As soon as I disconnected from VPN the error went away.一旦我与 VPN 断开连接,错误就消失了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Python中从CSV文件访问列数据 - Accessing column data from a CSV file in Python 在Python中使用Pandas从CSV文件读取特定数据 - Using Pandas to read specific data from a CSV file in Python 如何使用 Pandas 从 GitHub 读取 CSV 文件 - How to read CSV file from GitHub using pandas 从.csv文件使用Pandas访问JSON子属性 - Accessing JSON sub attributes using Pandas from .csv file 使用熊猫在python中刷新csv中的数据 - Refreshing data from csv in python using pandas Python pandas 从 GitHub 读取压缩 csv - Python pandas read gzipped csv from GitHub 在Debian OS上使用熊猫从github存储库读取csv文件时出现奇怪的csv输出 - Strange csv output when csv file is read from a github repo using pandas on Debian OS 从 github python 下载和访问数据 - Downloading and accessing data from github python 有没有办法使用 Python 中的 matplotlib/pandas 模块根据 csv 文件提供的数据更改条形图的颜色? - Is there a way to change the color of a bar graph based on the data provided from a csv file, using the matplotlib/pandas module in Python? <class ‘decimal.conversionsyntax’>使用 Python 从 CSV 文件导入数据时出错(尝试使用 CSV 和 Pandas)</class> - <class ‘decimal.ConversionSyntax’> errors when importing data from a CSV file using Python (tried using CSV and Pandas)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM