Created
September 13, 2020 20:55
-
-
Save SaraM92/3ba6cac1801b20f6de1ef3cc4a18c843 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
#Import needed library | |
import pandas as pd | |
#Dataset | |
csv = "https://raw.githubusercontent.com/nytimes/covid-19-data/master/us-counties.csv" | |
#Load entire dataset | |
data = pd.read_csv(csv) | |
data.info(verbose=False, memory_usage="deep") | |
#Create sub dataset | |
df = data[["county", "cases"]] | |
df.info(verbose=False, memory_usage="deep") | |
#Load only two columns | |
df_2col = pd.read_csv(csv , usecols=["county", "cases"]) | |
df_2col.info(verbose=False, memory_usage="deep") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment