Answers for "how to set pandas dataframe as global"

0

how to set pandas dataframe as global

import pandas as pd

data = pd.DataFrame({'A' : [1, 2, 3, 4],
                     'B' : [1,2,3,4]})
def test():
    global data
    data =  data + 1

test()
Posted by: Guest on November-13-2020
-1

how to set pandas dataframe as global

import pandas as pd

data = pd.DataFrame({'A' : [1, 2, 3, 4],
                     'B' : [1,2,3,4]})

def test(data):
   data =  data + 1
   return data

data = test(data)
Posted by: Guest on November-13-2020

Code answers related to "how to set pandas dataframe as global"

Python Answers by Framework

Browse Popular Code Answers by Language