Created
September 10, 2018 22:03
-
-
Save afonsoaugusto/d170a8dbe12c6bbbcbd908ee245ba841 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How to unzip gz file using Python | |
https://stackoverflow.com/questions/31028815/how-to-unzip-gz-file-using-python | |
import pandas as pd | |
import os | |
fn = '../data/file_to_load.json.gz' | |
print(os.path.isfile(fn)) | |
df = pd.read_json(fn, lines=True, compression='gzip') | |
df.tail() | |
Loading web data file to pandas dataframe | |
https://stackoverflow.com/questions/43422692/loading-web-data-file-to-pandas-dataframe | |
df = pd.read_csv( | |
'https://vincentarelbundock.github.io/Rdatasets/' | |
'csv/datasets/OrchardSprays.csv') | |
print(df) | |
Selecting multiple columns in a pandas dataframe | |
https://stackoverflow.com/questions/11285613/selecting-multiple-columns-in-a-pandas-dataframe | |
df1 = df[['a','b']] | |
df1 = df.iloc[:,0:2] # Re | |
Enconding file unix: | |
file -i <file_name> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment