Skip to content

PM1_prediction.ipynb Jupyter Book Cannot Load .RData #1

@Eli-m93

Description

@Eli-m93

The current code links to github's wage data which is only an RData dataset, then the code reads:

Data Analysis
Set the following file_directory to a place where you downloaded https://github.com/CausalAIBook/MetricsMLNotebooks/blob/main/PM1/wage2015_subsample_inference.rdata

file_dir = None
df = pd.read_csv(file_dir)

I found two solutions:

  1. Import RData to Pandas ready package (taken from my collab code):
!pip install pyreadr
import pyreadr
import numpy as np
import pandas as pd
temp = pyreadr.read_r('/content/wage2015_subsample_inference.Rdata')
df = temp['data']
  1. Upload a CSV

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions