import pyupbit market_price = pyupbit.get_ohlcv("KRW-ETH", interval="minute1") print(market_price.resample('2T')) ------------------------------------------------------------------------------------- DatetimeIndexResampler [freq=<2 * Minutes>, axis=0, closed=left, label=left, convention=start, origin=start_day] 에러가 나서, 찾아보니까 Starting from 0.18.0, resample itself is a deferred operation, meaning that you first have to call a method (in this case mean()) to perform the actual resampling: 판다스 버전이 높아서 난 에러인것 같습니다. import pandas as pd print( pd. __version__ ) ------------------------------------ 1.1.3 market_price.resample('2T').mean() 로 수정하니까 정상 출력이 됩니다. 참고하세요~ https://stackoverflow.com/questions/37723906/pandas-resample-does-not-work-properly
It's a rudimentary question, but I used the parent parameter in MyWidgetSet, which inherited QWidget, when do I use it? I wonder why it's like that to hand over the parent when resetting. When do I use the parent parameter and hand it over to initialization??
Let me think of it as QPushButton. When simply creating and outputting widgets, you can simply create them and print them out on the screen as shown below. app = QApplication([]) w = QPushButton() w.show() app.exec_() Complex programs require multiple widgets to be placed in the main window. When the widget was printed out on top of Windows instead of alone, it had to be used as follows in the initializer, right? class MyWindow(QMainWindow): def __init__(self): w = QPushButton(self) self specifies where to output the widget. The current initializer is in the state of being called while creating MyWindow. At this point, self means the instance/object/object that is created. The QPushButton class allows you to specify where to output a single parameter by making it possible to receive input. When calling only the top widget, it should work without entering any values.
Now let's look at the custom widget. The class I created should also be able to be printed out on the main window or used alone. The following code is set to None if no parent is entered and output alone; if a value is entered, output is made to the specified location. class MyWidgetSet(QWidget): def __init__(self, parent=None): # Omit It can be used alone without any parameters like this way. app = QApplication([]) m = MyWidgetSet() m.show() app.exec_() It can also be used within the main window in complex cases. At this time, you must specify where to print it. class MyWindow(QMainWindow): def __init__(self): super().__init__() w = MyWidgetSet(self)